Ask Your Question
0

why snapshot become so huge considering original image is small

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

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
0

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

NoNoNoo gravatar image

You can use virt-sparsify http://blog.laimbock.com/2013/10/31/h... 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
0

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

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:

http://en.wikibooks.org/wiki/QEMU/Ima...

edit flag offensive delete link more

Comments

thanks, i will look to this suggestion.

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 2,462 times

Last updated: Apr 02 '15