GithubHelp home page GithubHelp logo

gobindadas / cockpit-machines-ovirt-provider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ovirt/cockpit-machines-ovirt-provider

0.0 3.0 0.0 223 KB

License: Apache License 2.0

Makefile 1.77% Shell 4.45% JavaScript 90.75% M4 1.18% HTML 0.85% CSS 0.99%

cockpit-machines-ovirt-provider's Introduction

Build Status

oVirt External Provider for Cockpit-machines

With this external provider, the machines plugin in Cockpit can redirect actions to oVirt REST API instead of default Libvirt.

Please refer to cockpit-machines README.md for external plugin description and API which is implemented by this project.

The entry point for the provider API implementation is src/provider.js. It's fine to implement the API using VanillaJS, as far as the simple API contract is met.

For more complex scenarios ES6, Babel, Webpack and React can be leveraged as shown in this project.

Installation

Actual installation is as simple as copying 2 files.

Anyway, the project requires oVirt and Cockpit running.

General Prerequisites

No matter you are going to build from sources or install from RPM, following must be met:

  • the oVirt is installed (means engine with at least one host)

  • the Cockpit is installed in version 133 or higher on the oVirt host

     yum install cockpit cockpit-machines
    

    or check http://cockpit-project.org/running.html for more details

  • Please note, latest project features might be available only with latest Cockpit:

    https://copr.fedorainfracloud.org/coprs/g/cockpit/cockpit-preview/

  • When logged as the root user on the oVirt engine machine:

     engine-config -s CORSSupport=true # To turn on the CORS support for the REST API     
     engine-config -s CORSAllowDefaultOrigins=true  # To allow CORS for all configured hosts
     systemct restart ovirt-engine
    

RPM Installation

The RPM builds are released on Copr repository. To enable it, use:

dnf copr enable mlibra/cockpit-machines-ovirt-provider  

To install:

dnf install cockpit-machines-ovirt-provider

Development Build

If RPM installation is not enough and you are willing to build from sources, this section is for you.

Dev Build Prerequisites

All JavaScript dependencies can be installed via npm i (see package.json file).

Anyway, it is recommended to use yarn and offline cache maintained by the ovirt-engine-nodejs-modules project since the project is tested against such "fixed" versions of 3rd party libraries.

To do so, enable the tested repository from

http://resources.ovirt.org/repos/ovirt/tested/master/rpm

Until BZ 1427045 is finished, this step has to be done manually.

To install all dependencies:

git clone https://github.com/oVirt/cockpit-machines-ovirt-provider.git
cd cockpit-machines-ovirt-provider
./autogen.sh
yum-builddep cockpit-machines-ovirt-provider.spec  # to install ovirt-engine-yarn and other dependencies of correct versions
source /usr/share/ovirt-engine-nodejs-modules/setup-env.sh  # to create ./node_modules dir from yarn offline cache

Build

make [rpm]

The result can be found under dist or tmp.repos directories.

Development Build Installation

If the project is built from sources, it's enough to just copy dist/ content under [COCKPIT_INSTALL_DIR]/machines/provider.

On an oVirt host machine:

cd [COCKPIT_INSTALL_DIR]/machines
mkdir -p ./provider
cp [PROVIDER_SRC @ BUILD_MACHINE]/dist/* ./provider/
# and just refresh the cockpit:machines page (press F5) to take effect

The COCKPIT_INSTALL_DIR usually refers to /usr/share/cockpit.

The PROVIDER_SRC refers to directory where you built the project (probably remote machine).

Post install

Once either the RPM or from sources installation is finished, the plugin needs to do some additional configuration, like setting the URL of your oVirt engine.

To do so:

  • login into Cockpit as root user
  • enter the machines plugin, installation dialog pops-up
  • submit URL of your running oVirt engine
    • Example: https://my.domain.com/ovirt-engine
    • following config files will be updated:
      • cockpit/machines/override.json
      • cockpit/machines/provider/machines-ovirt.config
    • in case of failure, please follow instructions by the install.sh
  • as instructed on the screen, re-login into Cockpit

Cockpit does not need to be restarted to take effect, just log out/log in is enough.

Invocation

If installed and configured properly, the oVirt will be used as datasource after next reload of the machines plugin page in Cockpit (re-login to Cockpit).

The provider supports oVirt SSO (see [2]), it means the user will be optionally redirected to oVirt login page and back to the Cockpit.

Actions

Data retrieval (means list of VMs and their properties) is intentionally handled still via Libvirt leading to host-local view on the system.

Active operations (start, shutdown, restart) are redirected to oVirt REST API to be performed.

Links

To Be Done

  • [1] ovirt-engine/web-ui/authorizedRedirect.jsp (part of ovirt-engine 4.1 from ovirt-web-ui.0.1.1-2.rpm) is used to handle SSO redirect. Recently considering moving this JSP under enginesso.war

Author(s)

Please send author(s) any feedback on the project.

cockpit-machines-ovirt-provider's People

Contributors

devyanikota avatar mareklibra avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.