[DRBD-user] trying to use the block-drbd script for xen backend

Florian Haas florian.haas at linbit.com
Wed Nov 7 19:15:58 CET 2007

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


Tom,

On Wednesday 07 November 2007 14:07:10 Tom Georgoulias wrote:
> Florian Haas wrote:
> > The fact that the device becomes Secondary after shutting down your domU
> > is by design. Since a domU installation process normally shuts down your
> > freshly-installed domU before firing it up again immediately afterwards,
> > it is normal to see a couple of DRBD state transitions in the process.
>
> Ah, OK.  Makes sense.

Glad you approve. :-)

> [root at radm012d ~]# cat /etc/xen/rusr007d
> name = "rusr007d"
> memory = "512"
> disk = [ 'drbd:r0,xvda,w', ]
> vif = [ 'bridge=xenbr0','bridge=xenbr1' ]
> bootloader="/usr/bin/pygrub"
> vcpus=2
> on_reboot   = 'restart'
> on_crash    = 'restart'
>
> I only have one drbd resource, r0.  The hosts are configured like this:
>
> on radm012d {
> 	device     /dev/drbd0;
> 	disk       /dev/md2;
> 	address    <IPaddr>:7788;
> 	flexible-meta-disk  internal;
> 	}
>
> I install the domU with this command (with kickstart server URL removed)
>
> xm create rusr007d on_reboot=restart kernel=/var/lib/xen/vmlinuz
> ramdisk=/var/lib/xen/initrd.img extra="ks=http://<ksserver>/ks.cfg
> ksdevice=eth0 noipv6" bootloader="" -c

OK, note you invoked your Xen domU in two very different ways during and after 
installation.

On installation, you explicitly told Xen to use a specific kernel and initrd. 
When you do that, the block-drbd script is invoked correctly and the DRBD 
resource is properly added to the domU.

However, after installation, you are attempting to boot with the pygrub 
bootloader. Aye, there's the rub: pygrub appears to only support block 
devices and file-backed VBDs. It appears quite ugly that way (I don't use any 
RHEL/CentOS dom0's, so I can't tell for sure, but that's what I've heard from 
people that do).

So, copy your kernel and initrd from inside your domU VBD to somewhere where 
the dom0 can access them. Change your domU config by removing 
the "bootloader" entry and adding a correct "kernel", "initrd", and "extra" 
entry. For one of my CentOS 5 domU's, this looks like this:

kernel = '/boot/xen/vmlinuz-2.6.18-8.1.8.el5xen'
ramdisk = '/boot/xen/initrd-2.6.18-8.1.8.el5xen.img'
root    = '/dev/xvda2 ro'
disk    = [ 'drbd:pinot-disk,xvda,w', ]

Adjust as necessary.

Your alternative course of action is to wait for the Xen people to fix pygrub. 
Or submit a patch; I'm sure they'll be grateful for one. :-)

Hope this helps,
Florian

-- 
: Florian G. Haas 
: LINBIT Information Technologies GmbH
: Vivenotgasse 48, A-1120 Vienna, Austria



More information about the drbd-user mailing list