VM Snapshot shown in Sunstone but it can't be deleted

I have a KVM vm which is running just fine. If I check the Opennebula’s web interface, in the snapshot list for that VM I can see one snapshot. The issue is when trying to delete it since I’m getting this message:

Tue Dec 17 16:14:55 2019 [Z0][VMM][I]: Command execution failed (exit code: 1): 'if [ -x "/var/tmp/one/vmm/kvm/snapshot_delete" ]; then /var/tmp/one/vmm/kvm/snapshot_delete one-0 snap-0 0 virt.acasa; else                              exit 42; fi'
Tue Dec 17 16:14:55 2019 [Z0][VMM][E]: snapshot_delete: Command "virsh --connect qemu:///system snapshot-delete one-0 snap-0" failed: error: Domain snapshot not found: no domain snapshot with matching name 'snap-0'

Even if I manually connect with virsh from the console, it says there are no snapshots for that VM.

How do I get rid of that snapshot shown in the web interface?

try running in CLI

onevm disk-snapshot-delete {ID_VM} {ID_DISK_WITH_SNAPSHOT} {ID_SNAPSHOT}

Not working…

onevm disk-snapshot-delete 0 0 0
[one.vm.disksnapshotdelete] Snapshot does not exist

onevm snapshot-delete 0 snap-0
snap-0 not found or duplicated

I had the issue from 5.2 to 5.8, and this is finally fixed in 5.10.1
If you are not in this version yet, this is what I used to do

  • Connect to opennebula database (you will have to see what type of DB you used, and look for login and password)
  • Edit the table “vm_pool”
  • Find the machine ID you are having issues with
  • Edit the XML and remove the damaged snapshot (use a json formatter like https://jsonformatter.org/xml-formatter )

After that, the snapshot won’t show anymore.
I would highly recommend to upgrade to 5.10.1 where this is fixed.

When your issue happens you will also have a bug where you actually can’t restore snapshots. If you need to, I have a solution too for that (also fixed in 5.10.1)

1 Like

Thank you! I’ll give it a try. As for 5.10.2 do I have to manually build the packages? I don’t see that version in their official repo yet

My apologies, 5.10.1 - I edited my post to correct this.
I personally use the pre-compiled repo version so there is nothing to build.
If you have IRC, I’m there if you want to talk live

I’m already using 5.10.1 version from their official repo. I’ll do it the manual way. I assume this happens since I kept upgrading it since 5.0 or something.

I’m mobile right now and I have no IRC app on my phone. Maybe some other time.

Thanks!

Hi ,
No worries. So best way is to actually hit the opennebula database as I wrote above.
Good luck!

It worked like a charm. I’ve saved the one.db file locally to my computer then I’ve edited it with DB Browser Lite for MacOS. I’ve also used that XML formatter for an easier understanding.

Thank you! I’ve been struggling with this for over 6 months!

Glade I was able to help!