Patch for using drbd block devices and pygrub.
I ran into this problem when I installed CentOS using the HowTo:
http://wiki.centos.org/HowTos/Xen/InstallingCentOSDomU
After installation, you are urged to use bootloader="/usr/bin/pygrub"
However, trying to start the domU results in the error "Error: Disk isn't accessible". A google search turns up speculation that this is somehow pygrub's fault, however, if one runs pygrub /dev/drbd0, it works as expected.
The problem is in the xm utility, it attempts to resolve the disk name (drbd0) into a device name (/dev/drbd0) by using the disk type (drbd). However, it does not recognize the type drbd, so it fails to do so. Attached is a patch that simply treats a drbd disk like phy and returns "/dev/%s" % "drbd0".
I realize that a resource (drbd0) may actually use a different device node that /dev/drbd0, however, resolving this would require parsing the drbd.conf file and also using the current host name to locate the correct "on" section. I figure this patch is good enough to work for most folks.
tools/python/xen/util/blkif.py +1 -1
@@ -75,7 +75,7 @@ def _parse_uname(uname): fn = taptype = None if uname.find(":") != -1: (typ, fn) = uname.split(":", 1) - if typ == "phy" and not fn.startswith("/"): + if typ in ("phy", "drbd") and not fn.startswith("/"): fn = "/dev/%s" %(fn,) if typ == "tap": (taptype, fn) = fn.split(":", 1)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel