[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Re: [DRBD-user] Re: DRBD VBD's with Xen status



[Resending with correct source address.]

On 2008-08-19 02:58, Jerry Amundson wrote:
On Mon, Aug 18, 2008 at 1:19 PM, Jan Kellermann|werk21
<jan.kellermann@xxxxxxxxx> wrote:
using PVM and drbd:... on centos 5.2 works fine.

In some cases, but not all. The natural case is to install CentOS 5.2,
with the Virtualization group, and run virt-manager, which sets pygrub
in the resulting config. Editing a xen config created by virt-manager,
and setting it to use the drbd backend as documented, results in a big
fat error.
http://www.drbd.org/users-guide-emb/ch-xen.html

Robert Dunkley (the mail on xen-users you quoted) did an error:
he took the device-name and not the ressource-name of the drbd-drive.

No. The error is "Error: Disk isn't accessible" either way.
The problem, as Florian points out, is with pygrub.
http://lists.linbit.com/pipermail/drbd-user/2007-November/007794.html

The point I'm trying to make is that the DRBD chapter on Xen can
potentially waste the time of a new CentOS admin using it. Yes, I
agree that pygrub (and virt-manger) code needs fixing, and enhancing
(respectively), but that's a development issue. This is a simple
documentation fix.

Meanwhile, I've tweaked my qemu-dm wrapper script to also act as a
wrapper for pygrub, so it now supports both HVMs and PVMs. This wrapper
takes care of making any needed drbd devices primary before pygrub or
qemu-dm is started, and making them secondary after the VM has been shut
down or migrated.

The installation has changed; since xend ignores the device_model
parameter when starting PVMs, it's necessary to place the wrapper in the
normal qemu-dm path, and move the real qemu-dm out of the way. The
install procedure is then:

1. Move qemu-dm, wherever it is, to qemu-dm.real.
2. Put a copy of, or link to, the wrapper script called qemu-dm where
qemu-dm used to be.
3. Move pygrub, wherever it is, to pygrub.real.
4. Put a copy of, or link to, the wrapper script called pygrub, where
pygrub used to be.
5. In xen configurations, use the normal bootloader option, now pointing
to the wrapper, for PVMs, and the normal device_model option, now
pointing to the wrapper, for HVMs. Use a phy:/dev/drbd0 format for the
VM's block devices; the wrapper script checks each device to see if it
is a drbd resource. You don't need the block-drbd script that comes with
drbd.

The wrapper script is polymorphic and behaves like pygrub if invoked as
pygrub, and qemu-dm if invoked as qemu-dm. In either case, it ends up
execing the real pygrub or qemu-dm (by tacking .real onto its own path)
after making the drbd resources primary, and makes the drbd resources
secondary after the real pygrub or qemu-dm exits. There is some
file-based locking and inspection of drbd resource state employed to
prevent split brain. See the wrapper script comments for details.

Note that with PVMs, primary/primary mode for drbd resources is required
for live migrations, but primary/primary is never needed for HVMs.
There's some kind of timing difference between these cases that causes
block devices to end up detaching from PVMs if primary/primary is not
allowed.

The wrapper script is here:

http://www.antibozo.net/xen/qemu-dm.drbd

--
Jefferson Ogata : Internetworker, Antibozo

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.