Build Instructions

This Page Is Deprecated!

For build instructions, please see this page.

This document is intended for developers who want to build the oVirt components from scratch. If you just want to see how it works, just follow the install instructions.

The steps below assume a familiarity with Linux development tools. Throughout this document, we give commands to type at a shell prompt. By convention, if a command is meant to be run by a non-privileged user, we will preface it with sudo.

Source Repositories

Source code is contained in the following source repositories:

  1. ovirt-server: The oVirt Server Suite that provides ability to manage vms via a web interface
  2. ovirt-node: The oVirt Node that runs vms managed by the server
  3. ovirt-node-image: RPMs that contain LiveCD ISO image and PXE images of the oVirt Node which uses the ovirt-node RPM
  4. ovirt-release: RPM that contains yum repo configuration file for ovirt.org repositories and developer convenience scripts
  5. ovirt-docs: Documentation for the oVirt project
  6. ovirt-client: Command line client to the oVirt API
  7. ovirt-viewer: A VNC client intended to be used with oVirt managed VMs

All of these source repositories are available via git web interface. It is not necessary to manually clone each of these repositories. Please follow the instructions below for using the ovirt.mk Makefile provided in the ovirt-build RPM for retrieving the repositories.

Prerequisites

There are a few prerequisites to building the oVirt components:

  1. Fedora 11: installed with latest updates.
  2. Passwordless Sudo: The user running the build does not need to be root, however it does need to have passwordless sudo as root access to build various components, such as ovirt-node-image that depends on livecd-creator which presently requires root.
  3. Hardware Virtualization Support: The oVirt Node requires hardware assisted virtualization. A processor with either Intel VT or AMD AMD-V is required to run oVirt. The build process does not require hardware virtualization.
  4. rpmmacros: The user must have valid ~/.rpmmacros set up. A minimal rpmmacro file should contain:

    %_topdir      %(echo $HOME)/rpmbuild
    This will put your rpmbuild directory in ~/rpmbuild. Adjust the destination to your liking.

  5. SELinux: The Node is built with SELinux enabled by default. This requires build host to also have SELinux enabled in Permissive mode. If SELinux is not enabled, the build will fail. If it is enabled but in Enforcing mode the build will temporarily put the host into Permissive mode and then toggle back to Enforcing

    NOTE: The Node does not require SELinux to be enabled, though it is by default. This behavior can be toggled in the Node kickstart file in the ovirt-node-image repository.

  6. Additional Computers: These computers should be cabled to a private LAN that will be bridged to the oVirt server. These computers will run the oVirt Node and will be managed by the oVirt Server.

Getting Started

In order to build oVirt you will need several RPMs from the ovirt.org repositories. To get these, install the ovirt-release RPM which provides a yum configuration file. Because this process updates libvirt and you'll need to restart libvirt at the end, shut down any existing virtual machines before proceeding.

  1. Install the ovirt-release RPM to get yum configured 1
  2. :
    sudo rpm -ivh http://ovirt.org/repos/ovirt/ovirt-release-LATEST.noarch.rpm
  3. Update any existing RPMs with newer RPMs available in the oVirt repository:
    sudo yum update --enablerepo=ovirt
  4. Install additional RPMs necessary for building the components.
  5. sudo yum install --enablerepo=ovirt ovirt-build

1 - NOTE: if you are running an older version of Fedora, then the latest ovirt-release RPM may not be right for you. If so, you can check the oVirt yum repos and download the correct version for your Fedora version. Generally, all build instructions are for the latest release of Fedora.

Using the oVirt Makefile

the ovirt-build RPM provides a Makefile to assist developers with building from source.

This makefile provides a convenient way for a developer to clone/update all of the git repositories and to do an end-to-end build. In addition, it can be used to just build specific components rather than the entire system.

The makefile also uses several environment variables to alter its behavior:

  1. OVIRT_BRANCH - This specifies which branch to use in git. Default is 'next', which is for the latest development code. Stable releases are in the 'master' branch.
  2. FEDORA_URL - This provides a local mirror to use for Fedora repositories. Default is to use the remote mirrorlist. An example FEDORA_URL would be:
    http://download.fedora.redhat.com/pub/fedora/linux
  3. OVIRT_CACHE_DIR - The build of ovirt-node-image requires RPMs from Fedora repositories. This is the location of a cache directory for storing files used in those builds. Default is to use ~/ovirt-cache
  4. SUBDIRS - The list of repositories to build. This can be overridden if you only want to work with a subset of the repositories available. The default set is defined in the ovirt.mk file in the ovirt-release repository.

To build the entire system

To build oVirt un the following commands:

  1. If you want to build the latest stable oVirt release, and NOT use the current rawhide / development branch, set the OVIRT_BRANCH environment variable to work with the 'master' branch:
    export OVIRT_BRANCH=master

    Note, if you want to build against the latest development head, skip this step, and leave OVIRT_BRANCH as is

  2. Prepare your development directory and check out the git repositories:
    mkdir $HOME/ovirt
    cd $HOME/ovirt
    make -f /usr/share/ovirt-build/ovirt.mk update
  3. Create a symlink to the release/ovirt.mk makefile to use in the top level build directory:
    ln -s release/ovirt.mk Makefile
  4. Run a build of all components:
    make build
    This step will take a quite a while to complete the first time you run it. Subsequent runs should take much less time, since the downloaded packages are stored in a cache directory.

The following are some of the top level make targets in ovirt.mk that are useful for developers:

  1. update - This target refreshes all of the repository checkouts with git pull and switches to the branch specified in OVIRT_BRANCH
  2. build - Does a build of all repositories
  3. status, diff, branch, show-branch - Runs the corresponding git command on each of the repository directories

Following a successful build the generated RPMs for each of the git repositories will be placed into $OVIRT_CACHE_DIR/ovirt. A symlink is created in the build directory (for example: ~/ovirt/rpms).

Installing the oVirt RPMS

See the install instructions for how to install the rpms just built.

Finally, you can bring up the main oVirt web user-interface by running firefox on the host machine.

Browse to http://<server-hostname>/ovirt

The default username/password is ovirtadmin/ovirt

The root password for the default server is ovirt

Managing oVirt Nodes

If you have real physical hardware cabled up, you can boot up any physical hardware you have cabled to your private LAN. Make sure that your hardware is set to PXE boot first, otherwise it will boot to the normal operating system.

sudo ovirt-install-node stateful

Boot the server as described in the above section and bring up the oVirt web user interface in a Firefox. Navigate to the Hosts tab in the Default hardware pool and verify that a host is added with the hostname physical.priv.ovirt.org. It should be marked as unavailable. This is normal.

Restart the libvirt daemon:

sudo service libvirtd restart

Again, navigate to the Hosts tab of the Default hardware pool. This time the physical.priv.ovirt.org host should show up as available. You can now use this host to create and manage virtual machines.