We've recently discovered that libguestfs can't handle guests which use md. There are (at least) 2 reasons for this: Firstly, the appliance doesn't include mdadm. Without this, md devices aren't detected during the boot process. Simply adding mdadm to the appliance package list fixes this. Secondly, md devices referenced in fstab as, e.g. /dev/md0, aren't handled correctly by inspection. This looks a bit more complicated. In my test guest, the guestfs appliance automatically creates the 2 md devices as: * /dev/md/localhost:localdomain:0 * /dev/md/localhost:localdomain:1 These are symlinks to ../md126 and ../md127 respectively. I haven't yet worked out why they aren't created as md0 and md1 as in the guest. I think here we need to either work out how to make the appliance detect and use their names (if this is even possible), or to map the names appropriately using information from /dev/md/md-device-map in the appliance's root, and /etc/mdadm.conf in the guest's root. I don't currently think we'll need any new apis for this. I'm not convinced we need apis for creating and managing md devices, for example. We could do with a test for inspection of a guest which uses md devices, which would obviously require creating that guest. However, we can frig that for the test using debug sh "mdadm ...". Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
On Mon, Oct 31, 2011 at 02:45:23PM +0000, Matthew Booth wrote:> We've recently discovered that libguestfs can't handle guests which > use md. There are (at least) 2 reasons for this: Firstly, the > appliance doesn't include mdadm. Without this, md devices aren't > detected during the boot process. Simply adding mdadm to the > appliance package list fixes this.I've added the mdadm package since it sounds useful to have: http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=6f84ef6768e9c625d67f7eb015277b0ec1b2c2af> Secondly, md devices referenced in fstab as, e.g. /dev/md0, aren't > handled correctly by inspection. This looks a bit more complicated. > In my test guest, the guestfs appliance automatically creates the 2 > md devices as: > > * /dev/md/localhost:localdomain:0 > * /dev/md/localhost:localdomain:1That's a very strange name. udev going crazy?> These are symlinks to ../md126 and ../md127 respectively. I haven't > yet worked out why they aren't created as md0 and md1 as in the > guest. I think here we need to either work out how to make the > appliance detect and use their names (if this is even possible), or > to map the names appropriately using information from > /dev/md/md-device-map in the appliance's root, and /etc/mdadm.conf > in the guest's root. > > I don't currently think we'll need any new apis for this. I'm not > convinced we need apis for creating and managing md devices, for > example. We could do with a test for inspection of a guest which > uses md devices, which would obviously require creating that guest. > However, we can frig that for the test using debug sh "mdadm ...".New APIs are cheap ... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
On Mon, Oct 31, 2011 at 04:45:43PM +0000, Richard W.M. Jones wrote:> On Mon, Oct 31, 2011 at 02:45:23PM +0000, Matthew Booth wrote: > > * /dev/md/localhost:localdomain:0 > > * /dev/md/localhost:localdomain:1 > > That's a very strange name. udev going crazy?Apparently not a bug ... https://bugzilla.redhat.com/show_bug.cgi?id=606481#c1 It appears the name can be stored in one of two places, either in /etc/mdadm.conf or in metadata stored in the disk superblock. Go Linux! Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw