From: Ben Timby Subject: Patch for using drbd block devices and pygrub. Date: Wed, 25 Mar 2009 01:38:44 -0400 Message-ID: <4e55057e0903242238v5c3c749cg3f33c3969f534fc7@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=00221532cba0b8ec170465eae9c3 Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --00221532cba0b8ec170465eae9c3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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. --00221532cba0b8ec170465eae9c3 Content-Type: text/x-diff; charset=US-ASCII; name="drbd_blkif.patch" Content-Disposition: attachment; filename="drbd_blkif.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fspl4jws0 ZGlmZiAtciAwYjEzZDk3ODc2MjIgdG9vbHMvcHl0aG9uL3hlbi91dGlsL2Jsa2lmLnB5Ci0tLSBh L3Rvb2xzL3B5dGhvbi94ZW4vdXRpbC9ibGtpZi5weQlUdWUgTWFyIDI0IDA2OjU1OjI5IDIwMDkg KzAwMDAKKysrIGIvdG9vbHMvcHl0aG9uL3hlbi91dGlsL2Jsa2lmLnB5CVdlZCBNYXIgMjUgMDE6 Mzg6MTMgMjAwOSAtMDQwMApAQCAtNzUsNyArNzUsNyBAQCBkZWYgX3BhcnNlX3VuYW1lKHVuYW1l KToKICAgICBmbiA9IHRhcHR5cGUgPSBOb25lCiAgICAgaWYgdW5hbWUuZmluZCgiOiIpICE9IC0x OgogICAgICAgICAodHlwLCBmbikgPSB1bmFtZS5zcGxpdCgiOiIsIDEpCi0gICAgICAgIGlmIHR5 cCA9PSAicGh5IiBhbmQgbm90IGZuLnN0YXJ0c3dpdGgoIi8iKToKKyAgICAgICAgaWYgdHlwIGlu ICgicGh5IiwgImRyYmQiKSBhbmQgbm90IGZuLnN0YXJ0c3dpdGgoIi8iKToKICAgICAgICAgICAg IGZuID0gIi9kZXYvJXMiICUoZm4sKQogICAgICAgICBpZiB0eXAgPT0gInRhcCI6CiAgICAgICAg ICAgICAodGFwdHlwZSwgZm4pID0gZm4uc3BsaXQoIjoiLCAxKQo= --00221532cba0b8ec170465eae9c3 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --00221532cba0b8ec170465eae9c3--