Qiu Yu
2013-Jun-01 05:28 UTC
Re: [Libguestfs] How to use libguestfs access LVM as non-root user?
On Fri, May 31, 2013 at 7:25 PM, Richard W.M. Jones <rjones@redhat.com>wrote:> On Fri, May 31, 2013 at 06:39:53PM +0800, Qiu Yu wrote: > > [00098ms] /usr/libexec/qemu-kvm \ > > -global virtio-blk-pci.scsi=off \ > > -drive file=/dev/xenvg/123,cache=off,format=qcow2,if=virtio \ > > -nodefconfig \ > > -enable-kvm \ > > -nodefaults \ > > -nographic \ > > -m 500 \ > > -no-reboot \ > > -device virtio-serial \ > > -serial stdio \ > > -chardev socket,path=/tmp/libguestfssaaw6T/guestfsd.sock,id=channel0 > \ > > -device > virtserialport,chardev=channel0,name=org.libguestfs.channel.0 \ > > -kernel /var/tmp/.guestfs-501/kernel.30285 \ > > -initrd /var/tmp/.guestfs-501/initrd.30285 \ > > -append 'panic=1 console=ttyS0 udevtimeout=300 no_timer_check > acpi=off > > printk.time=1 cgroup_disable=memory selinux=0 guestfs_verbose=1 > > TERM=screen-bce ' \ > > -drive > > > file=/var/tmp/.guestfs-501/root.30285,snapshot=on,if=virtio,cache=unsafeqemu-kvm: > > -drive file=/dev/xenvg/123,cache=off,format=qcow2,if=virtio: could not > open > > disk image /dev/xenvg/123: Invalid argument > > I'm assuming it's because the format is wrong (ie. not qcow2 but raw). > > The error message is a little bit obscure and could be better, but we > do rely on qemu printing something sensible instead of just "Invalid > argument". > >Oh, yes. It's indeed the wrong 'format' argument causing the issue. Sorry I'm not familiar with libguestfs, 'invalid argument' should be an obvious hint for me to follow on. For others who might interests, if you use qcow2 image with OpenStack and choose LVM as image backend, nova libvirt driver will convert it raw when creating a new instance. However, data injection using libguestfs will still assuming the it is qcow2 format, hence hit the above issue. Not sure it is a bug or not, probably one should specify "use_cow_images = False" to avoid the problem in this case. -- Qiu Yu
Richard W.M. Jones
2013-Jun-01 08:57 UTC
Re: [Libguestfs] How to use libguestfs access LVM as non-root user?
On Sat, Jun 01, 2013 at 01:28:20PM +0800, Qiu Yu wrote:> For others who might interests, if you use qcow2 image with OpenStack and > choose LVM as image backend, nova libvirt driver will convert it raw when > creating a new instance. However, data injection using libguestfs will > still assuming the it is qcow2 format, hence hit the above issue. Not sure > it is a bug or not, probably one should specify "use_cow_images = False" to > avoid the problem in this case.Yes, this sounds like a Nova bug. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Kashyap Chamarthy
2013-Jun-01 09:05 UTC
Re: [Libguestfs] How to use libguestfs access LVM as non-root user?
On 06/01/2013 02:27 PM, Richard W.M. Jones wrote:> On Sat, Jun 01, 2013 at 01:28:20PM +0800, Qiu Yu wrote: >> For others who might interests, if you use qcow2 image with OpenStack and >> choose LVM as image backend, nova libvirt driver will convert it raw when >> creating a new instance.IIUC, that's the reason, why it converts to raw -- https://github.com/openstack/nova/commit/ff9d353b ------------------------- "This uses 'qemu-img' to convert images that are not 'raw' to be 'raw'. By doing so, it a.) refuses to run uploaded images that have a backing image reference (LP: #853330, CVE-2011-3147) b.) ensures that when FLAGS.use_cow_images is False, and the libvirt xml written specifies 'driver_type="raw"' that the disk referenced is also raw format. (LP: #837102) c.) removes compression that might be present to avoid cpu bottlenecks (LP: #837100) It does have the negative side affect of using more space in the case where the user uploaded a qcow2 (or other advanced image format) that could have been used directly by the hypervisor. That could, later, be remedied by another 'qemu-img convert' being done to the "preferred" format of the hypervisor." ------------------------- It also does it during nova-image-create. A small write-up on how/why -- http://kashyapc.wordpress.com/2013/03/11/openstack-nova-image-create-under-the-hood/ However, data injection using libguestfs will>> still assuming the it is qcow2 format, hence hit the above issue. Not sure >> it is a bug or not, probably one should specify "use_cow_images = False" to >> avoid the problem in this case. > > Yes, this sounds like a Nova bug. > > Rich. >-- /kashyap
Apparently Analagous Threads
- Re: How to use libguestfs access LVM as non-root user?
- Re: How to use libguestfs access LVM as non-root user?
- Re: How to use libguestfs access LVM as non-root user?
- Re: How to use libguestfs access LVM as non-root user?
- Re: How to use libguestfs access LVM as non-root user?