[DRBD-user] DRBD and KVM for a HA-Cluster ?

netz-haut - stephan seitz s.seitz at netz-haut.de
Sat Jan 15 17:09:52 CET 2011

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


> > Two questions:
> > 1. Are you sure that kpartx is able to read the raw data written by
> KVM into the lv's, that it is able to recognize the partitions ?
> 
> It's what it does. Try it, I can't hand out guarantees ;p

kpartx recognizes all partition tables known by the kernel. If you run some very exotic OS virtualized, you should check if your kernel supports it.
Same counts for the filesystems...

> 
> > 2. What is if my guest OS contains lv's, not only physical
> partitions ?
> 
> You mean, your guest created PVs atop its own partitions inside your
> dedicated guest LV?
> 
> Good question, you will have to vgscan or pvscan for them or something
> along those lines. I'm not sure how well that will work.

In theory this works. At least with manual intervention. You have to temporarily enable these dm devices (lvm.conf), rescan and mount.
If you plan file-based backups on a regular base, forget about it. Even if you're doing any step double-checked, your dm or udev will
get confused about it sooner or later. It's somewhat fragile and offers the risk of loosing your "real" devicemappings.

> The bottom line is that you get /dev/mapper/vg_snapshot-part* as
> ordinary block devices that you can treat like any other plain old
> partition. If one or more of them are PVs, treat them like they are.
> Whatever that implies in this use case.
> 
> But I can conceivably see that being somewhat problematic, yes. If in
> doubt, just avoid LVM inside your guests ;)

AFAIK this is the default layout on CentOS / RHEL.

I'ld propose to setup another virtual machine with some kind of rescue or backup system. Scenario would be:
- create a snapshot
- attach the snapshot to the rescue/backup VM
- do the backup stuff (and even fsck, remember it's a snapshot) inside the rescue/backup VM
- detach the snapshot
- lvremove the snapshot (if wished)
Some script voodoo has to be done outside and inside the rescue/backup VM to synchronise these tasks.

Anyway, I'ld first ask some "backup solutions consultants" to offer suggestions...

Cheers,

Stephan








More information about the drbd-user mailing list