Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: OpenStack: Operators

Reducing ext4/qcow2 snapshot size

 

 

OpenStack operators RSS feed   Index | Next | Previous | View Threaded


swinchen at gmail

Aug 20, 2012, 9:47 AM

Post #1 of 8 (491 views)
Permalink
Reducing ext4/qcow2 snapshot size

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?

Thanks,
Sam

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


shake.chen at gmail

Aug 20, 2012, 5:47 PM

Post #2 of 8 (475 views)
Permalink
Re: Reducing ext4/qcow2 snapshot size [In reply to]

I have the same problem.



On Tue, Aug 21, 2012 at 12:47 AM, Samuel Winchenbach <swinchen [at] gmail>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?
>
> Thanks,
> Sam
>
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>



--
Shake Chen


lorin at nimbisservices

Aug 20, 2012, 6:04 PM

Post #3 of 8 (488 views)
Permalink
Re: Reducing ext4/qcow2 snapshot size [In reply to]

On Aug 20, 2012, at 12:47 PM, Samuel Winchenbach <swinchen [at] gmail> 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.



Take care,

Lorin
--
Lorin Hochstein
Lead Architect - Cloud Services
Nimbis Services, Inc.
www.nimbisservices.com


shake.chen at gmail

Aug 20, 2012, 7:11 PM

Post #4 of 8 (479 views)
Permalink
Re: Reducing ext4/qcow2 snapshot size [In reply to]

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

>
> On Aug 20, 2012, at 12:47 PM, Samuel Winchenbach <swinchen [at] gmail>
> 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
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>
>


--
Shake Chen


lorin at nimbisservices

Aug 20, 2012, 7:18 PM

Post #5 of 8 (484 views)
Permalink
Re: Reducing ext4/qcow2 snapshot size [In reply to]

On Aug 20, 2012, at 10:11 PM, Shake Chen <shake.chen [at] gmail> wrote:

>
>
> On Tue, Aug 21, 2012 at 9:04 AM, Lorin Hochstein <lorin [at] nimbisservices> wrote:
>
> On Aug 20, 2012, at 12:47 PM, Samuel Winchenbach <swinchen [at] gmail> 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?


Whoops, I didn't read the original post closely enough. I'm not sure how to manipulate a qcow2 image that was created as a snapshot.

Take care,

Lorin
--
Lorin Hochstein
Lead Architect - Cloud Services
Nimbis Services, Inc.
www.nimbisservices.com


sorhanse at cisco

Aug 21, 2012, 6:50 AM

Post #6 of 8 (474 views)
Permalink
Re: Reducing ext4/qcow2 snapshot size [In reply to]

Den 20-08-2012 18:47, Samuel Winchenbach skrev:
> 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.

Yes, this is expected. The disk you have is 100 GB. There's no safe,
generic way to reduce its size. Any tool that does so makes assumptions
about filesystems, partition tables, etc. Those assumptions may be fine
in your case (and even in most cases), but not always, so it's unlikely
to be supported by Nova.

--
Soren Hansen
Senior Software Engineer
Office of the cloud CTO
Cisco Systems, Inc.

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


lloydostack at gmail

Aug 21, 2012, 9:47 AM

Post #7 of 8 (477 views)
Permalink
Re: Reducing ext4/qcow2 snapshot size [In reply to]

On Mon, Aug 20, 2012 at 6:04 PM, Lorin Hochstein
<lorin [at] nimbisservices> wrote:
>
> On Aug 20, 2012, at 12:47 PM, Samuel Winchenbach <swinchen [at] gmail> 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.

When last I looked qcow2 images could be shrunk, so although you can
shrink the filesystems you won't fully benefit from the smaller size
as the first instance will be raw'd to the full size.

Cheers,
--
@lloyddewolf
http://www.pistoncloud.com/

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


lloydostack at gmail

Aug 21, 2012, 9:48 AM

Post #8 of 8 (477 views)
Permalink
Re: Reducing ext4/qcow2 snapshot size [In reply to]

On Tue, Aug 21, 2012 at 9:47 AM, Lloyd Dewolf <lloydostack [at] gmail> wrote:
> On Mon, Aug 20, 2012 at 6:04 PM, Lorin Hochstein
> <lorin [at] nimbisservices> wrote:
>>
>> On Aug 20, 2012, at 12:47 PM, Samuel Winchenbach <swinchen [at] gmail> 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.
>
> When last I looked qcow2 images could be shrunk, so although you can
> shrink the filesystems you won't fully benefit from the smaller size
> as the first instance will be raw'd to the full size.

Sorry, could NOT be shrunk.

--
@lloyddewolf
http://www.pistoncloud.com/

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators

OpenStack operators RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.