[Openstack-operators] Reducing ext4/qcow2 snapshot size

Shake Chen shake.chen at gmail.com
Tue Aug 21 02:11:46 UTC 2012


On Tue, Aug 21, 2012 at 9:04 AM, Lorin Hochstein
<lorin at nimbisservices.com>wrote:

>
> On Aug 20, 2012, at 12:47 PM, Samuel Winchenbach <swinchen at gmail.com>
> wrote:
>
> Hi all,
>
> I launched a large (100 GB) VM and made the changes I wanted
> (installed software, created users, etc...)  and made a snapshot.
> Now I would like to launch VMs from that snapshot with a smaller disk
> size, but no mater what flavor I select it always creates a 100GB
> image.
>
> Is there a way to reduce the ext4 partition size inside the qcow2 disk
> image?   It might involve creating a new image file and cloning over
> the original image?  If so what tools do you use for the cloning?
>
> Sam:
>
> You can mount the qcow2 image in your file system using qemu-nbd (see
> http://en.wikibooks.org/wiki/QEMU/Images#Mounting_an_image_on_the_host) and
> then resize the partition using the e2fsprogs tools (e.g., see
> http://en.positon.org/post/Resize-an-ext3-ext4-partition).
>
>
> I believe you can also use libguestfs <http://libguestfs.org/> as an
> alternative to qemu-nbd, but I've never tried it.
>
>
>
whether is possible done it auto when create snapshot?




>
> Take care,
>
> Lorin
> --
> Lorin Hochstein
> Lead Architect - Cloud Services
> Nimbis Services, Inc.
> www.nimbisservices.com
>
>
>
>
>
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>
>


-- 
Shake Chen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-operators/attachments/20120821/128c09f2/attachment-0001.html>


More information about the OpenStack-operators mailing list