# KVM/Qcow2 snapshots questions

**URL:** <https://forum.opennebula.io/t/kvm-qcow2-snapshots-questions/5882>\
**Category:** Product Support\
**Created:** [April 4, 2018, 9:44am UTC](https://forum.opennebula.io/t/kvm-qcow2-snapshots-questions/5882 "2018-04-04T09:44:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mptek](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@mptek](https://forum.opennebula.io/u/mptek)\
**Post date:** [April 4, 2018, 9:44am UTC](https://forum.opennebula.io/t/kvm-qcow2-snapshots-questions/5882/1 "2018-04-04T09:44:41Z")

</div>

Hi to all.  
I’m new to opennebula…  
Thank you in advance for any response (if any).

When i make a snapshot (from sunstone) on any VM opennebula pause the VM and take long time to make snapshot. Say 3 to 7 minutes for 25GB qcow2 files (on NFS filesystem).

When i have changed some datastore parameter i don’t remembre i have received this error:  
“Error creating new disk snapshot: Cannot perform a live DISKSNAPSHOTCREATE operation”.

I’m not able to make live snapshot. And i’m asking why i t took too much time for a “paused” snapshot.  
I have followed info in another thread: [How to make a live disk snapshot](https://forum.opennebula.io/t/how-to-make-a-live-disk-snapshot/3836)

All seems fine to me (kvm/qcow2).  
Where i’m wrong?

Thank you to all… for patience and for this incredible piece of software.  
Best regards  
Mirko

* * *

Opennebula 5.4.6 on all debian 9 (nodes, shared storage and sunstone (ha)). KVM + Qcow2 on NFS share.

---

<div class="post-metadata">

**Author:** ![mptek](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@mptek](https://forum.opennebula.io/u/mptek)\
**Post date:** [April 8, 2018, 9:46am UTC](https://forum.opennebula.io/t/kvm-qcow2-snapshots-questions/5882/2 "2018-04-08T09:46:46Z")

</div>

Hi to all.

I have tried many times and this what i’ve found: it’s KVM “problem”.

Live VM snapshot (Disk+RAM+Status) work correctly. I’ve tried on my desktop simulating KVM subsystem (with virt-manager GUI). VM is paused while RAM is copied. If i configure cache=none writing RAM to disk is very very slow. With cache=writeback it’s much faster. For security i’ve tried live migration while inseide VM dd to disk and work well (with writeback). My problem is KVM related. Live VM snapshot work correctly now… VM is paused for 6 seconds for 8GB RAM (300M used).

But i have others questions…

1. In my setup when i try to take a disk live snapshot (only disk from the sunstone storage TAB) i have this error:  
Sun Apr 8 11:13:11 2018 [Z0][VM][I]: New state is ACTIVE  
Sun Apr 8 11:13:11 2018 [Z0][VM][I]: New LCM state is DISK\_SNAPSHOT  
Sun Apr 8 11:13:11 2018 [Z0][VMM][E]: Error creating new disk snapshot: Cannot perform a live DISKSNAPSHOTCREATE operation  
Sun Apr 8 11:13:11 2018 [Z0][VM][I]: New LCM state is RUNNING  
Sun Apr 8 11:13:11 2018 [Z0][LCM][E]: Could not take disk snapshot.  
Why this error?

2. When i take a live vm snapshot (disk+RAM+status) and migrate my vm snapshot disappear. But in “qemu-img info dsik.0” i see it. I’ve read that this is normal on documentation but it seems not intuitive. Why this limitation? Why snapshot not persist after a VM migration?

3. If i take 2 live VM snapshot i see 2 snapshot on qcow file: snap-0 and snap-1. If i migrate VM these snapshot remain on qcow2 fdisk.0 file. Sunstone show no snapshot. When (on new node) take one snapshot only snap-0 is remove and recreated. snap-1 stay here. It’s normal? It seems a bug…

Thank you for reading and thank you in advance for any response…  
Regards  
Mirko

---

<div class="post-metadata">

**Author:** ![mptek](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@mptek](https://forum.opennebula.io/u/mptek)\
**Post date:** [April 10, 2018, 5:05pm UTC](https://forum.opennebula.io/t/kvm-qcow2-snapshots-questions/5882/3 "2018-04-10T17:05:41Z")

</div>

Hi to all.  
I’m responding to myself hoping that my experience is useful for someone…

I’ve found a solution to point 2.  
In oned.conf on the VM\_MAD kvm i set KEEP\_SNAPSHOTS = “yes” from “no”.  
For the default file it’s on line 506.  
I don’t know why the default is “no”. But it seems to work.

The others problem remain 😃

Regards.  
Mirko.

---

<div class="post-metadata">

**Author:** ![Githopp192](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/githopp192/32/7488_2.png) [@Githopp192](https://forum.opennebula.io/u/Githopp192)\
**Post date:** [October 9, 2021, 12:33pm UTC](https://forum.opennebula.io/t/kvm-qcow2-snapshots-questions/5882/4 "2021-10-09T12:33:22Z")

</div>

Hi Mirko

i’ve got the same issue with OpenNebula 5.12.

That’s a good hint - i changed the cache mode from writetrough to none, increased the memory from 8GB to 16GB on the vm and doubled the size of the swap file.

Before these actions the vm live snapshot (HOTPLUG\_SNAPSHOT) took about 3-5 minutes. Now (on NVME SSD Storage !) it takes abut 55 minutes to complete.

In this scenario it makes not much sense to do a live snapshot … i could also just make an offline backup of vm Disk, which takes - more or less - the same time to complete.

About the behave of OpenNebula and the KEEP\_SNAPSHOT option … that’s a goot hint, too.  
I think OpenNebula will NOT handles the qemu-img snaps best, because - although when (default) option KEEP\_SNAPSHOTS is off, OpenNebula should cleanup also the “pyhsical” qemu-img snapshot stuff - if not doing so - old qemu-img snapshot keeping old space, which then is unvisible from OpenNebula. The unexperienced OpenNebula admin would never be aware of that issue, that the image does occupy “unused” space.
