XAPI toolstack on a Debian-based distribution

From Xen
Revision as of 13:40, 16 December 2011 by MikeCamel (talk | contribs) (What's the best environment?)


This is part of Project Kronos. Follow these instructions to get XCP toolstack (including xapi, the XenAPI server daemon) installed on an Ubuntu Oneiric or Debian Squeeze box, using the upstream Linux kernel. This will effectively allow you to turn an existing Ubuntu or Debian machine into an XCP host. Note that this is *very much* a work-in-progress. Some features will be broken, and there will be a bit of manual configuration required. We appreciate any testing you do for this project, but please don't consider this production ready yet! Please visit the Kronos Supported Features page for a list of XCP features that are known to work on Kronos.

What's the best environment?

The best environment is a clean installed modern system with significant amounts of RAM in it and several cores. However, this guide is written in the knowledge that not everyone will be in the lucky position of having such a box to play with. In fact, many of us will be installing it on a moderately-sized box with an existing (upgraded) version of Ubuntu or Debian running. One of the authors of this guide (MikeCamel) is in exactly that position, so you are not alone. Hopefully this guide will be relevant to you, and will provide working instructions. If you have a problem, let us know.

A note about kernels Kronos is really aimed at distributions (such as Ubuntu Precise Pangolin) which use the 3.2 kernel. There is a nasty bug in the 3.0 series (and probably before) which means that, between them, a couple of the components of Xen are going to reduce the size of Dom0 (and therefore your main operating environment) to something under 1 GiB, which may cause you significant problems. There are work-arounds, but this is a real issue if you're planning to run the XCP toolstack on Oneiric, for instance. There is a work-around available.

Prepare your system

Action Debian Squeeze Ubuntu Oneiric
Install OS Install Debian Squeeze.

Convert to Unstable:

  • Edit /etc/apt/sources.list and replace 'squeeze' with 'unstable'
perl -pi -e 's/squeeze/unstable/g' /etc/apt/sources.list
apt-get update
apt-get dist-upgrade
Install Ubuntu Oneiric.

Kronos will work with either Ubuntu Oneiric Server or Desktop, with the default kernel. If you want to use local storage, you will have to reserve an unformatted partition on your hard disk for xapi. In a later step, you will use this partition to create a local storage repository.

Install any required firmware Install firmware (only if necessary - http://wiki.debian.org/Firmware)
Set up repositories Add the following to /etc/apt/sources.list
deb http://ftp.uk.debian.org/debian/ experimental main
deb-src http://ftp.uk.debian.org/debian/ experimental main
Add the following to /etc/apt/sources.list
deb http://ppa.launchpad.net/ubuntu-xen-org/xcp-unstable/ubuntu oneiric main
deb-src http://ppa.launchpad.net/ubuntu-xen-org/xcp-unstable/ubuntu oneiric main

Install xapi

This step installs XCP's xapi and all its dependencies, including the Xen hypervisor.

apt-get update
apt-get install xcp-xapi
apt-get install xcp-xe

Once you've installed these packages, you can just do an `apt-get update && apt-get upgrade` to keep up with the latest builds.

Post-install setup

a) Optional: Make xen the default grub entry.

sed -i 's/GRUB_DEFAULT=""/GRUB_DEFAULT="Xen 4.1-amd64"/' /etc/default/grub

Note: given the default set up for Ubuntu's grub (in /etc/default/grub), you don't get to see the splashscreen with kernel boot options. If you do want to see the list of options, you may need to change some of the settings in this file.

b. Setup the network/interfaces file:

This is likely to be /etc/network interfaces - ensure that you don't remove any existing settings. Note that if you are running a DHCP server on this machine, then you may need to change the xenbr0 interface to a static or manual IP address, as DHCP may not come up in time to provide an address otherwise.

auto lo xenbr0

iface xenbr0 inet dhcp
        bridge_ports eth0 

c. Setup the xensource-inventory file:

Note: this assumes that the root partition is on /dev/sda1 - change if required. Note: this assumes that your management interface will be xenbr0 - change if required.


cat > /etc/xcp/xensource-inventory << EOF