qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-discuss] qemu-img convert to thin LV


From: Edoardo Comar
Subject: [Qemu-discuss] qemu-img convert to thin LV
Date: Fri, 28 Jun 2013 10:25:51 +0100

Hi,
Is there a way to convert an image to an LV without having to allocate the 
full disk capacity ? 

Is qemu-img convert compatible with thin-provisioned LVs as targets ?

I wanted to convert a file-based image to a LV image.
The file-based image has a capacity much larger than the actual data it 
contains
so it has a small footprint on disk (either a qcow2 or a sparse file raw 
image).

If I use qemu-img convert -O raw ... with a target LV *sized to the full 
capacity of the file-image* all is fine.

However, if I try use an LV whose virtual size equals the capacity, but 
its size is smaller (although more than enough for the data) 
using the capability as described in the lvcreate manpage :

  "lvcreate --virtualsize 1T --size 100M --snapshot --name sparse vg1"
        creates  a  sparse  device named /dev/vg1/sparse of size 1TB with 
space
        for just under 100MB of actual data on it.

then after the qemu-img convert passes without errors, the resulting LV is 
invariably corrupt (unmountable).

If alternatively, I try use a thin-provisioned LV pool, and a LV backed by 
that pool,
as described in 
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/thinly_provisioned_volume_creation.html
 

the LV resulting from qemu-img convert is not corrupt, but it uses as much 
space as the capacity of file-image it came from. 

This on both RHEL64 and Fedora18.

Is there a way to convert an image to an LV without having to allocate the 
full disk capacity ? 

The rationale is that if the LV is then only accessed via snapshots, the 
backing LV can remain small while the snapshot can grow,
and overall I can save disk space (rather than using 2x image capacity).

regards,
Edoardo Comar
WebSphere Application Service Platform for Networks (ASPN)

Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU




reply via email to

[Prev in Thread] Current Thread [Next in Thread]