This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

oVirt

From Gentoo Wiki (test)
Jump to:navigation Jump to:search

Resources

oVirt is a complete open sourced virtualization management platform working with KVM. The project is made of:

  • The Engine core, which is the backend server that does the management.
  • The various VDSM agents installed on each host you 'll use as a hypervisor for VMs
  • A client side UI (GWT based) and/or RESTful API to control the engine core.

ovirt-engine

Preparations

PostgreSQL

  • Install PostgreSQL server:
root #emerge --ask dev-db/postgresql
Note
Ensure that the USE flag server is enabled.
  • Configure PostgresSQL server:
root #emerge --config dev-db/postgresql
  • Allow network access:
FILE /etc/postgres-*/pg_hba.conf
host    all             all             127.0.0.1/32            password
host    all             all             ::1/128                 password
  • Start:
root #/etc/init.d/postgres* start

Database

  • Create user and database for engine:
root #su - postgres -c "psql -d template1"
template1=# create user engine password 'engine';
template1=# create database engine owner engine template template0
    encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
  • OPTIONAL: Create user and database for dwh:
root #su - postgres -c "psql -d template1"
template1=# create user ovirt_engine_history password 'ovirt_engine_history';
template1=# create database ovirt_engine_history owner ovirt_engine_history template template0
    encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
  • OPTIONAL: Create user and database for reports:
root #su - postgres -c "psql -d template1"
template1=# create user ovirt_engine_reports password 'ovirt_engine_reports';
template1=# create database ovirt_engine_reports owner ovirt_engine_reports template template0
    encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';

Installation

  • Add oVirt overlay to etc/portage/make.conf

Portage overlay exists here: http://github.com/alonbl/ovirt-overlay

Using a recent Portage version you can add the overlay creating /etc/portage/repos.conf/ovirt-overlay.conf:

FILE /etc/portage/repos.conf/ovirt-overlay.confoVirt overlay
[ovirt-overlay]
location = /usr/local/portage/ovirt-overlay
sync-type = git
sync-uri = https://github.com/alonbl/ovirt-overlay

This can be done automatically with app-eselect/eselect-repository:

root #eselect repository add ovirt-overlay git https://github.com/alonbl/ovirt-overlay.git

If you use an older Portage or prefer to use layman to manage your overlays, you can add the oVirt overlay XML file into /etc/layman/overlays:

FILE /etc/layman/overlays/ovirt.xmloVirt overlay
<?xml version="1.0" ?>
<repositories version="1.0">
        <repo priority="50" quality="experimental" status="unofficial">
                <name>ovirt-overlay</name>
                <description>oVirt Project Overlay</description>
                <homepage>https://github.com/alonbl</homepage>
                <owner>
                        <email>alonbl@redhat.com</email>
                </owner>
                '"`UNIQ--source-00000005-QINU`"'
        </repo>
</repositories>

And then add it using:

root #layman -a ovirt-overlay
  • Install ovirt-engine:
root #emerge --ask app-emulation/ovirt-engine
Note
Before reporting any issue, please try to build with USE="-system-jars".

You may need to add unstable keywords to various packages.

  • OPTIONAL: Emerge ovirt-engine-dwh and/or ovirt-engine-reports:
root #emerge --ask app-emulation/ovirt-engine-dwh app-emulation/ovirt-engine-reports
  • Configure ovirt-engine:
root #emerge --config app-emulation/ovirt-engine

Follow instructions.

Post configuration

Apache

  • Enable mod_proxy, add after APACHE2_OPTS="XXX":
FILE /etc/conf.d/apache2
APACHE2_OPTS="${APACHE2_OPTS} -D PROXY"
  • Restart:
root #/etc/init.d/apache2 restart

Testing

Login into http://localhost/ovirt-engine

Logs are at /var/log/ovirt-engine

Install vdsm

Warning
VDSM for now is mostly Fedora/Redhat oriented, trying to set up VDSM on a non-Fedora node takes more than you think. If you succeed however please update this part of the article and notify upstream. Until then I suggest you use an oVirt-node image for your Hypervisors from here [1]
  • Install dev-python/pyflakes as it is needed by vdsm:
root #emerge --ask dev-python/pyflakes
  • Obtain VDSM source RPM:
  • Convert rpm package to tgz:
user $rpm2tgz vdsm-4.9.0-0.200.g2fc4e63.fc16.src.rpm
  • Unpack the archive:
user $tar zxvf vdsm-4.9.0-0.200.g2fc4e63.fc16.src.tgz
  • Enter the directory and do the configure-make-make install magic (Recommended to use –prefix when compiling from source so you can have all files under one directory per package):
root #cd vdsm-4.9.0-0.200.g2fc4e63.fc16
root #./configure --prefix=/path/to/install/directory && make && make install

How to contribute

  • oVirt project is working with Gerrit code review for code contribution.
  • In order to register and login to oVirt's Gerrit, you'll need an OpenID account.
    • You can use a Google OpenID, or register to some other provider and use it,
  • All other details can be found here: http://www.ovirt.org/wiki/Working_with_oVirt_Gerrit

Advanced features

oVirt Node integration

  • By default development setup works with hosts based on base distro's installations.
  • In order to be able to work with oVirt Node (which is a sub-set of the base OS), you'll need to setup a Public Key environment.
  • More details on Engine and oVirt Node integration can be found here: http://www.ovirt.org/wiki/Engine_Node_Integration.
    • Note that by default Gentoo does not have /etc/pki folder, and you'll need to create it (or write an eBuild which will do that).

Troubleshooting JBoss (obsolete)

If you're being attacked by exceptions, follow this list:

  • Verify jboss folder owner and permissions.
  • If your machine has an SELinux policy installed, make sure it will not block JBoss. Here is a very dirty and insecure jboss.te just to temporarily pass these denials (you'll also need selinux-java)
CODE jboss.te
module jboss 1.0;

require {
        type user_tmp_t;
        type user_home_dir_t;
        type bin_t;
        type usr_t;
        type port_t;
        type node_t;
        type sysfs_t;
        type newrole_t;
        type java_t;
        class tcp_socket { name_bind listen accept node_bind };
        class fd use;
        class capability dac_override;
        class file{ read write getattr open create unlink };
        class dir { getattr read write open search add_name create remove_name };
}

#============= java_t ==============
allow java_t newrole_t:fd use;
allow java_t bin_t:file { getattr read open };
allow java_t self:capability dac_override;
allow java_t sysfs_t:dir { read search open };
allow java_t user_tmp_t:dir { read getattr open search write add_name create remove_name };
allow java_t user_home_dir_t:dir search;
allow java_t user_tmp_t:file { create read write open unlink };
allow java_t usr_t:dir { write add_name create remove_name };
allow java_t usr_t:file { create open write };
allow java_t port_t:tcp_socket name_bind;
allow java_t self:tcp_socket { listen accept };
allow java_t node_t:tcp_socket node_bind;
  • Used TCP ports: 8702/8083/1090/4457
    • Since JBoss binds to the hostname, your hostname should be resolvable, or you may add it to /etc/hosts for local resolution.
127.0.0.1 localhost engine-dev

External resources