One of the benefits of making XenServer fully open-source is that it’s easier to integrate directly with other great open-source projects. A project that I’m particularly interested in is Ceph: a distributed storage system which is particularly suitable for storing VM disk images in the cloud. The Ceph community has already integrated support directly into two other open-source projects:
- qemu: the virtual hardware emulator used by Xen and KVM
- libvirt: an open-source virtualisation toolkit
All that’s needed to make Ceph work with XenServer is therefore:
- to use a newer version of qemu (in Xen jargon this is called “the upstream qemu”)
- to integrate libvirt with the XenServer toolstack (i.e. xapi, xenopsd and friends)
After much coffee-fuelled late-night hacking^Wsoftware development, I’m pleased to announce the availability of a “technology preview” of XenServer integrated with Ceph via libvirt. To give it a go, first install yourself a normal CentOS 6.4 x86_64 system. Second login as root and type:
rpm -ihv http://xenbits.xen.org/djs/xenserver-tech-preview-release-0.3.0-0.x86_64.rpm
This will add the experimental preview software repository based on the Xen code already in CentOS. Next type:
yum install xenserver-core
-- notice how easy it is to install the core packages of XenServer using the normal CentOS distro tools. Now that XenServer is fully open-source, expect to see more like this in future!
It’s now necessary to set up a basic XenServer configuration. The easiest way is to use a simple install “wizard” by typing:
After the wizard has done its magic and you’ve rebooted, you should be able to connect XenCenter like you would with a regular XenServer.
Assuming you have already configured a Ceph cluster, you need to configure your machine to be a Ceph client, as you would with a regular CentOS host. I recommend having a read of the excellent Ceph documentation. Once complete you should be able to list the currently available Ceph storage pools:
ceph osd lspools
Next you should create a XenServer “Storage Repository” to allow VM virtual disks to be stored on Ceph-- this is where libvirt comes in. In dom0, create a libvirt “storage pool” XML file, as if you were going to issue a “virsh pool-create”. I created a file “ceph.xml” which looks like the following:
<pool type='rbd'> <name>ceph</name> <source> <name>rbd</name> <host name='10.80.237.208' port='6789'/> </source> </pool>
xe sr-create type=libvirt name-label=ceph device-config:xml-filename=ceph.xml
You should now have a functioning XenServer Storage Repository which can be managed via the XenAPI and from XenCenter. At this point you should be able to install VMs (both PV and HVM should work) and run them from the Ceph storage.
For more in-depth info about how it all works, known issues and ways you could get involved, have a look at the: