Ask Your Question

why snapshot become so huge considering original image is small

asked 2015-04-01 07:27:10 -0500

Maple Wang gravatar image

I need to customize my cloud qcow2 image with new kernel, so I use the openstack to create instance, then replaced the kernel, save the change by creating the snapshot from instance.

the problem is that the original qcow2 image is only 600MB size, but the snapshot is about 4GB size, when I create the instance, i choose the default small flavor(2048MB memory, 20GB disk storage), does it matter for this flavor? but real size doesn't match with flavor size, so what cause it? how can i get small image when i create snapshot? or how do i decrease the size of snapshot?

thanks in advance.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2015-04-02 02:23:45 -0500

NoNoNoo gravatar image

You can use virt-sparsify You have to create the instance snapshot, export it to a qcow2 file, sparsify it and reimport the qcow2 file.

edit flag offensive delete link more

answered 2015-04-01 12:38:18 -0500

A snapshot is the entire disk, so once you launch the image - the snapshot will be much bigger than the original qcow image. How much bigger depends on what flavor you're using and what changes you're making to deploy the new kernel before you take the new snapshot.

You could shrink the disk down after switching out the kernel (look into resize2fs). Alternatively - depending on how you're changing the kernel - you could just mount the original qcow image on the host and make the changes there.

Here's a good doc:

edit flag offensive delete link more


thanks, i will look to this suggestion.

Maple Wang gravatar imageMaple Wang ( 2015-04-01 22:05:41 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-04-01 07:27:10 -0500

Seen: 2,858 times

Last updated: Apr 02 '15