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=6f84ef6768e9c625d67f...
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
That'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/