[openstack-dev] [Libguestfs] How to use libguestfs access LVM as non-root user?

Kashyap Chamarthy kchamart at redhat.com
Sat Jun 1 09:05:49 UTC 2013


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



More information about the OpenStack-dev mailing list