LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 09-16-2017, 08:45 PM   #1
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 948

Rep: Reputation: Disabled
qemu-img compression: how to preserve snapshots?


Hi,

QEMU: 2.10.0.
libvirt: 3.4.0.

I have an image like that:
Code:
$ qemu-img info buildbot.qcow2 
image: buildbot.qcow2
file format: qcow2
virtual size: 128G (137438953472 bytes)
disk size: 25G
cluster_size: 65536
Snapshot list:
ID        TAG                 VM SIZE                DATE       VM CLOCK
2         upgraded                  0 2017-09-17 00:53:38   00:00:00.000
3         fresh install             0 2017-09-17 00:58:10   00:00:00.000
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false
Then I compress it like that:
Code:
qemu-img convert -p -c -f qcow2 -O qcow2 -- buildbot.qcow2 buildbot.new.qcow2
And the resulting image looks like that:
Code:
image: buildbot.new.qcow2
file format: qcow2
virtual size: 128G (137438953472 bytes)
disk size: 6.5G
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false
that is, the snapshots information is lost.

Is it possible to compress the image and preserve snapshots information?

Better yet, is it possible to compress with virsh/libvirt?

--
Best regards,
Andrzej Telszewski
 
Old 12-18-2017, 09:51 AM   #2
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 948

Original Poster
Rep: Reputation: Disabled
Hi,

To blindly answer my own question, what I wanted might not be possible.
Or at least I haven't found anything that could help.

I reverted back to the old way of managing my disk images.
I.e. I use backing file and I discard or commit the changes when I see fit.

This solves also another problem, that is, the hardware configuration is not saved by libvirt, as it is when using snapshots.
This might or might not be a good thing, but in my use case, it is the good one ;-)

--
Best regards,
Andrzej Telszewski
 
Old 12-18-2017, 02:15 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,987

Rep: Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627
Thanks for the update and solution. Maybe someone will add to this if they have some more information.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
qemu-img convert error --> from vmdk to qcow2 oso_togari Linux - Software 16 06-15-2015 03:05 PM
Size of vm created by qemu-img convert Nick_C Linux - Virtualization and Cloud 14 03-30-2012 05:29 AM
After qemu-img, qemu is not capable to detect the C drive (empty) frenchn00b Linux - General 3 10-18-2009 05:39 AM
File Roller: how to set compression ratio? How to preserve all color info in JPEGs? bezdomny Linux - Software 3 03-30-2009 12:53 PM
Qemu.img to hard drive towjamb Debian 3 04-17-2007 05:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 07:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration