libguestfs mounting solaris 10 ZFS guest
Not sure if this possible, but I have a KVM guest running Solaris 10 with the OS on ZFS and I am trying to use libguestfs/guestfish/guestmount to get to the VM. I am running Red Hat EL 5.4 with EPEL rpms as required. The VM is on a LV and it boots fine, but I can't seem to get the syntax correct to get libguestfs to deal with it. Guestmount seemed like the best option because it supports FUSE modules. I have fuse installed and zfs-fuse and I can create ZFS filesystems on the physical host machine. Just really not sure how to make libguestfs deal with it. I have tried mounting the pool and the underlying virtual disk device with no success. # guestmount -o modules=zfs -a /dev/kvmVG00/sol10u6 -m newpool/ROOT/s10up-08 --ro /mnt libguestfs: error: mount_options: mount_options_stub: newpool/ROOT/s10up-08: expecting a device name # guestmount -o modules=zfs -a /dev/kvmVG00/sol10u6 -m /dev/dsk/c0d0s0 --ro /mnt libguestfs: error: mount_options: mount_options_stub: /dev/dsk/c0d0s0: No such file or directory # guestmount -o modules=zfs -a /dev/kvmVG00/sol10u6 -m /dev/dsk/c0t0d0s0 --ro /mnt libguestfs: error: mount_options: mount_options_stub: /dev/dsk/c0t0d0s0: No such file or directory # rpm -qa | grep fuse zfs-fuse-0.6.0-6.el5 fuse-2.7.4-8.el5 fuse-libs-2.7.4-8.el5 # rpm -qa | grep guest libguestfs-1.0.85-1.el5.9 guestfish-1.0.85-1.el5.9 perl-libguestfs-1.0.85-1.el5.9 libguestfs-tools-1.0.85-1.el5.9 libguestfs-mount-1.0.85-1.el5.9 libguestfs-devel-1.0.85-1.el5.9 Any help MUCH appreciated. John L
On Tue, Apr 20, 2010 at 10:23:07AM -0400, John Larson wrote:
Not sure if this possible, but I have a KVM guest running Solaris 10 with the OS on ZFS and I am trying to use libguestfs/guestfish/guestmount to get to the VM. I am running Red Hat EL 5.4 with EPEL rpms as required.
It has to be said that you are well out on your own on this. We have never tried to access ZFS partitions. In fact, I wasn't even aware that Fedora had support for this, but I notice now it does have support (via a FUSE module). Anyway, we do support FUSE modules to access filesystems. eg. That is exactly how our current NTFS support works (via ntfs-3g). You'd need to rebuild libguestfs, particularly the appliance, adding the ZFS module (zfs-fuse) to appliance/packagelist.in. I don't know if it would just work after that -- mostly likely it would just work. But you might also have to make some small changes to the daemon. If you want to post a small ZFS test filesystem / VM, I'll see if I can get it to work. You'll probably want to look at the architecture diagram, since from the rest of your email it seemed you were a bit confused about how libguestfs works: http://libguestfs.org/guestfs.3.html#architecture And don't bother starting off with guestmount. Use guestfish to try to get a first pass working. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
FWIW I added zfs-fuse to the package list and rebuilt libguestfs. I was then able to run virt-rescue and create pools, copy files on to them and so on:
<rescue> zpool create test /dev/vda1 <rescue> cp -r bin test/ <rescue> ls -l test/ total 4 dr-xr-xr-x 2 root root 92 Apr 20 21:24 bin <rescue> cp -r lib* usr test/ <rescue> ls -l test/ total 14 dr-xr-xr-x 2 root root 92 Apr 20 21:24 bin dr-xr-xr-x 6 root root 6 Apr 20 21:25 lib dr-xr-xr-x 7 root root 187 Apr 20 21:25 lib64 drwxr-xr-x 9 root root 9 Apr 20 21:25 usr <rescue> zpool status pool: test state: ONLINE scrub: none requested config:
NAME STATE READ WRITE CKSUM test ONLINE 0 0 0 vda1 ONLINE 0 0 0 errors: No known data errors
<rescue> zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT test 2.98G 67.9M 2.92G 2% ONLINE - <rescue> sync <rescue> exit
These are just first steps. It looks like to do anything useful with ZFS we would have to bind 'zpool', at least the basic commands. 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/
Neat! What I am hoping to eventually do is the same thing I am doing on my Red Hat KVM guests with my Solaris 10 ZFS KVM guests. Mount it via libguestfs and set up the interfaces, DNS and host name so it will boot up and be usable from a virt-clone of a template. Looks like it will be possible. Just need to mount the ZFS root filesystem. I am working on compiling libguestfs but I'm stuck at the moment with febootstrap giving checksum errors on all the Fedora mirrors. probably something minor...I hope :P Thanks so much for helping out. This is really cool stuff. Richard W.M. Jones wrote:
FWIW I added zfs-fuse to the package list and rebuilt libguestfs. I was then able to run virt-rescue and create pools, copy files on to them and so on:
<rescue> zpool create test /dev/vda1 <rescue> cp -r bin test/ <rescue> ls -l test/ total 4 dr-xr-xr-x 2 root root 92 Apr 20 21:24 bin <rescue> cp -r lib* usr test/ <rescue> ls -l test/ total 14 dr-xr-xr-x 2 root root 92 Apr 20 21:24 bin dr-xr-xr-x 6 root root 6 Apr 20 21:25 lib dr-xr-xr-x 7 root root 187 Apr 20 21:25 lib64 drwxr-xr-x 9 root root 9 Apr 20 21:25 usr <rescue> zpool status pool: test state: ONLINE scrub: none requested config:
NAME STATE READ WRITE CKSUM test ONLINE 0 0 0 vda1 ONLINE 0 0 0
errors: No known data errors
<rescue> zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT test 2.98G 67.9M 2.92G 2% ONLINE - <rescue> sync <rescue> exit
These are just first steps. It looks like to do anything useful with ZFS we would have to bind 'zpool', at least the basic commands.
Rich.
participants (2)
-
John Larson -
Richard W.M. Jones