[Libguestfs] --rbd volume access--

Richard W.M. Jones rjones at redhat.com
Fri Mar 14 11:38:40 UTC 2014


On Fri, Mar 14, 2014 at 04:09:23PM +0500, Shumaila Naeem wrote:
> is there any way i can run both inspect-os and get-distro in one line
> 
> something like this
> guestfish -- add /dev/null : config -set
> drive.hd0.file=rbd:ssd-clonetest-rule5/ubuntu-12.04--1.raw.img : run :
>  inspect-get-distro inspect-os

Not like this.  This is why I said before this is "awkward in
guestfish".  TBH you're best off continuing with the Python program.
If you absolutely must use guestfish (which I don't recommend for this
case) then:

----------------------------------------------------------------------
#!/bin/bash -

guestfish <<'EOF'

add /dev/null readonly:true
# RHEL 6 hack for adding Ceph drives:
config -set drive.hd0.file=rbd:ssd-clonetest-rule5/ubuntu-12.04--1.raw.img

run

inspect-os | head -1 > /tmp/root
<! echo inspect-get-distro `cat /tmp/root`

EOF
----------------------------------------------------------------------

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v




More information about the Libguestfs mailing list