VM disk snapshot create and delete

I need some help or explanation - how disk snapshot works in OpenNebula.
I have some virtual machine and i want to make some changes here. I do disk snapshot, do some changes and if i don’t like result - i can revert without any problems and delete latest snapshot. That part is fine. But if i like new state and i want just delete/merge/consolidate snapshot - there is no option. I can’t delete because it is active. And when i want to do next changes - i got same. And i can’t delete previous snapshots because of childrens. But in this case i will have a hudge tree of snapshots which have no sense.
In documentation i found option about flat snapshots - ALLOW_ORPHANS. I did the settings and now i have flat snapshot list without parents-childrens. Now i’m able to delete snapshot in the middle, or just latest snapshot. But VM don’t boot after that. I always got error:

Driver Error
Mon Aug 29 13:11:48 2022: DEPLOY: error: Failed to create domain from /var/lib/one//datastores/101/42/deployment.4 error: Cannot access backing file ‘/var/lib/one//datastores/101/42/disk.0.snap/disk.0.snap/0’ of storage file ‘/var/lib/one//datastores/101/42/disk.0’ (as uid:9869, gid:9869): No such file or directory Could not create domain from /var/lib/one//datastores/101/42/deployment.4 ExitCode: 255

And i don’t found any option to merge/consolidate snaps.
What i’m doing wrong? How i can do disk snapshot, and later delete/consolidate/merge it?

Take a look at this.


ALLOW_ORPHANS is datastore/transfer manager driver specific option. You use qcow2/shared driver, so you can’t change this setting.

If you want to flatten snapshot, you can in image detail, on napshot tab. VM have to be undeployed and it works only with persistent images

I want to create disk snapshot on live, and i want to delete it on live. Without stopping machine. Nor image snapshot, nor system snapshot.

Doesn’t work as i need - i can’t do a ‘Flattern’ with image connected to VM. And, obviously, i can’t undeploy machine every time i want to do changes.

Hi, it doesn’t work, you can not delete intermediate images when you are using qcow2 datastore. There is chain of backing files and you can’t delete intermediate one.