[Libguestfs] libguestfs and md devices

Matthew Booth mbooth at redhat.com
Mon Oct 31 14:45:23 UTC 2011


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




More information about the Libguestfs mailing list