Hi,
I'm trying to get KVM VMs set up right on top of DRBD, with a dedicated DRBD
mirror instance on top of a dedicated pair of LVM LVs per VM - allowing, for
instance, primary-secondary DRBD assignments at the same granularity as the
VMs. In other words, I want to put VMs in raw format directly to the DRBD
block device, just as they are commonly put to an LV block device, with the
DRBD block device stacked on the LV block device.
DRBD is happy to stack on an LV (just as libvirt-KVM-QEMU is happy to). But
when I take an existing KVM LV, set up DRBD for it (DRBD can typically be
placed on a partition with an existing file system, which it inherits), and
then use "virsh edit" to replace the source dev, like so:
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/VolumeGroup/SomeVolume'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
changing the center line to
<source dev='/dev/drbd/by-res/SomeDom'/>
(or /dev/drbdN - to which that's a symlink), then I get
# virsh start sql
error: Failed to start domain SomeDom
error: unable to open disk path /dev/drbd/by-res/SomeDom: Wrong medium type
If this were a normal file system, setting up DRBD with it, then remounting
it through the DRBD device would work. But libvirt doesn't want to "mount"
it. This is with virsh 0.9.12. I don't know what constitutes "Wrong medium
type" here. I had thought it the general case that raw files for KVM can be
written to block devices generally, which is what a DRBD device is, just as
much as an LV device is.
Is this then a case where I have to change something else in the XML? Or a
case where it would work except that libvirt doesn't recognize that this is
a media type that will work, yet is is, so that the answer would be to alter
libvirt's source and recompile? Or would getting this scheme to work require
the trouble of stacking things like
VM
LV
VG
PV
DRBD
LV
VG
PV
DISK
instead of simply like
VM
DRBD
LV
VG
PV
DISK
Since there's a strict 1 VM-1 DRBD-1 LV correspondence, I'm hoping those
extra layers won't be necessary to get DRBD into the stack.
Thanks,
Whit