Devel Quickstart
Ovirt-Server and Node install and setup quickstart
Describes how to set up one ovirt server in a VM, and a few ovirt-nodes to play with.
Prerequisites
- One VM or bare metal host for ovirt server, running a fully updated F11 (I used amd64). No virt support required. VMs are easier to deal with since the install process changes a lot of configuration files. You will *need* Fedora 11 since some updates to 10 change some APIs used by ovirt.
- One or more physical hosts to act as nodes, configured to PXE boot off the the admin network. Requires Intel VT or AMD-V instruction set.
- Two networks: One for the guest, one for the admin network. All hosts, and the server, must be reachable in both networks.
- Storage: in this guide, NFS accessible in the guest network
Initial Base
1. First get a fully updated F11 install going. Minimal is fine since we will get all the needed packages for building later.
2. Next step: passwordless sudo. A quick way to set this up (though nasty) is:
su -c 'visudo -f /etc/sudoers'
And add the following line:
<your_username> ALL=(ALL) NOPASSWD: ALL
Save and quit visudo.
3. Set up a minimal rpmmacros file.
echo "%_topdir %(echo \$HOME)/rpmbuild" > ~/.rpmmacros
4. Ensure SELinux is not disabled. It doesn't matter what mode it is in; if enforcing, the build process will temporarily toggle to Permissive.
Getting Repo Data and Source
1. Get the repo data for ovirt using rpm.
sudo rpm -ivh http://ovirt.org/repos/ovirt/ovirt-release-LATEST.noarch.rpm
2. Update your fedora. This could take a while.
sudo yum update --enablerepo=ovirt
3. If a new kernel or something fundamental like that was installed, you might want to reboot.
4. Install the ovirt build components:
sudo yum install --enablerepo=ovirt ovirt-build
5. Restart libvirtd to pick up the newest version
sudo service libvirtd restart
Building the ovirt tools
1. First we set environment variables so we build the development version.
export OVIRT_BRANCH=next
2. Other environment variables
- 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 - OVIRT_CACHE_DIR - The build of ovirt-node-image and ovirt-appliance 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
- 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.
3. Run the following commands to download the repository into the $HOME/ovirt folder in preparation for build.
mkdir $HOME/ovirt cd $HOME/ovirt make -f /usr/share/ovirt-build/ovirt.mk update
make will download the sources in the git repository and update them as necessary.
4. Create a symlink to the release/ovirt.mk makefile to use in the top level build directory:
ln -s release/ovirt.mk Makefile
5. Run a build of all components:
make build
A couple of gotcha's apply to this step:
- Make sure the nscd service is stopped.
- The java portion will complain about X related problems if you are remotely logged in and X forwarding is not setup. Not entirely sure why.
- If you are deploying the server in the same vm that you are building on (as in this example) then don't bother compiling the appliance. Edit the makefile, and remove "appliance" from the SUBDIRS variable at the top of the file.
This step takes a while the first time.
Installation, Configuration, Deployment
TODO: Step 1 needs to be changed
1. Edit the makefile in $HOME/ovirt and add the following target:
update-local:
@$(write_repo_file)
@sudo yum install -c $(OVIRT_CACHE_DIR)/ovirt-local.repo -y \
--enablerepo=ovirt \
ovirt-server ovirt-server-installer ovirt-node-image ovirt-node-image-pxe
Then run:
make update-local
Installs: ovirt-server ovirt-server-installer ovirt-node-image ovirt-node-image-pxe
which we just built (uses local repository).
2. Edit /etc/hosts so hostname not present on the line for loopback (127.0.0.1) As an example:
127.0.0.1 localhost.localdomain localhost some.domain.name
change this to
127.0.0.1 localhost.localdomain localhost
3. In this example, each host (including the server) has two NICs. One NIC on each is connected via switch to a private admin network. The nodes are currently off and unconfigured, while the VM that will run ovirt-server has network bridges set up as appropriate. We configure the interface on the VM that corresponds with the admin network to have a static IP address, in this case 192.168.50.1. The other interface is set up to access the guest network in this case, the guest network uses another box somewhere for dhcp).
4. Run
ovirt-installer
as root to configure the install Match the guest and admin networks to the appropriate network device. The hostname of the ovirt management server must not be resolvable by the guest network (it's private to the admin network).
Specify 'n' when asked to use the systems existing dns servers. In addition, specify 'n' when asked if the admin network already has dhcp. In this example, the first 3 octets of the dhcp network we are using is 192.168.50 (where .1 is the server).
The dhcp domain in this case will match the domain of the management server as specified above. eg: Management server: ovirt-server.example.com dhcp domain: example.com
The network gateway for the admin network is 192.168.50.1 for this example.
We wish to provide pxe capability, and let the installer set up cobbler for us. When it asks your for realm name for kerberos, pick the same domain as before (example.com).
5. Now that installation parameters are configured, we run the install as root:
sudo ace -d -l <logfile> install ovirt
-d specifies debugging output, while -l specifies a logfile.
Post Install Setup and Configuration
1. We should now be able to log into the web ui from any host on the guest network that can access the ovirt-server vm. Go to http://<ovirt-server-address-in-guest-network>/ovirt from a web browser. Login with the following credentials: username: ovirtadmin password: <freeipa password specified in ovirt-installer>
You should see an admin console with not much going on.
You can also visit http://<ovirt-server-address-in-guest-network>/cobbler/web to check out the running cobbler instance. The username and password are whatever was specified in ovirt-installer earlier. There should be one OS image ready already called ovirt-node.
2. The first thing we want to do is spin up some hosts. We boot the hardware virt capable nodes and instruct them to PXE boot from the NICs attached to the admin network, where it will pick up the ovirt-node image and boot it.
3. Since we are running a development build, the linux image on the nodes will lack a root password. This makes remote administration over ssh difficult. So, access the nodes physically and set a root password so ssh works. In addition, for Kerberos to work the time must be setup correctly on the node. In this example we use UTC (which the nodes use by default).
If the nodes have the hardware clock setup correctly, no further setup is required on that end.
On the server:
sudo ln -sf /usr/share/zoneinfo/UTC /etc/localtime
Edit /etc/sysconfig/clock to contain: ZONE="UTC" UTC="true"
The time should now be correctly set. Time skew is worth paying attention to since kerberos can fail because of it.
4. Configure the interfaces on the node so that all are using dhcp. Restart the network service.
5. At this point, all nodes should be appearing in the web ui with status "Available (enabled)". If not, restart the libvirt-qpid service on each node, and then restart ovirt-db-omatic on the server. After that, all nodes should show up as available unless something is wrong with kerberos or some other configuration.
6. Now we set up some storage for vm's to use. In this example we use an NFS server accessible from the guest network. Set up NFS using your favorite configuration tools, making it accessible to all the nodes and the ovirt-server. Then, go to the web UI and add it, referring to it with the IP address and filesystem export point.
7. Create volumes on the NFS, at least one for each vm.
8. For this example, set up a PXE provider (for example, Cobbler) on the guest network.
9. Create VMs as desired, assigning each at least one storage volume. Set it to boot from PXE.
10. Create a physical network of type guest controlled by dhcp which will be used by the vm's.
11. To boot a vm, use the web interface. To control it, click on open remote desktop which will use either the virt-viewer mozilla plugin or complain that it is not installed. It also provides a link that can be used by vncviewer on the admin network. You can also connect to the underlying node from the guest network and use vncviewer from there.
12. You can then use PXE boot to install an OS and start using your new VM.

