Setting up KVM guests with DRBD block device for storage using vmbuilder or virt-manager

Hans Vos hans at laissezfaire.nl
Sun Jun 10 23:41:11 UTC 2012


Hello,

I've been working all weekend on getting this work but I can't find any 
good documentation or tutorials for creating KVM guests using DRBD block 
devices for storage. My setup consists of two identical servers with 
Ubuntu 12.04. I have successfully installed them and configured my 
network bridge and DRBD block device.

Here are some outputs of my configuration:

- ifconfig: http://paste.ubuntu.com/1034662/
- lvdisplay: http://paste.ubuntu.com/1034666/
- brctl show: http://paste.ubuntu.com/1034667/
- cat /proc/drbd: http://paste.ubuntu.com/1034672/

Ideally I would like to be able to create a new KVM guests using 
virt-manager on my Ubuntu desktop machine. This way I can install the 
KVM quest like I would normally install a server. I can setup the 
connection but I have no idea how to configure the storage pool to make 
use of the DRBD device (/dev/drbd0) or how to make use of my network 
bridge. It defaults to NAT networking. But using vmbuilder tool would be 
acceptable also. I have followed several tutorials but none of them 
cover the use of a DRBD block device for storage.

How can I get this to work? Do I maybe have to setup an LVM layer on top 
of my DRBD device and add that to the libvirt storage pool 
configuration? What kind of command should I run to try to get vmbuilder 
to create a KVM guest with my DRBD block device?

Over a year ago I tried setting up a Xen guest under CentOS using a DRBD 
block device by following the DRBD documentation 
(http://www.drbd.org/users-guide/ch-xen.html). I have no idea why this 
is so much harder with KVM. Since both CentOS and Ubuntu have switched 
to KVM and Ubuntu is my distribution of choice I would like to setup 
something similar using Ubuntu.

Any help is greatly appreciated I'm pretty much stuck now.

--
Kind regards,

Hans Vos




More information about the ubuntu-users mailing list