Hi all,
there still seems to be something fundamentally wrong in how OpenNebula handles snapshots in Ceph: I would like to use e.g. daily snapshots as a “lightweight backup”, to be able to revert to them later, should something go wrong with a long-running VM. And keep three or four latest snapshots.
$ onevm disk-snapshot-create 7317 0 testsnap
$ onevm disk-snapshot-delete 7317 0 testsnap
OK, snapshots can be created and deleted. Now let’s test reverting to the previous state:
$ onevm disk-snapshot-create 7317 0 testsnap2
$ ssh root@vm7317 'touch /root/testfile'
$ onevm poweroff 7317
$ onevm disk-snapshot-revert 7317 0 testsnap2
$ onevm resume 7317
$ ssh root@vm7317 'ls -l /root/testfile'
ls: cannot access '/root/testfile': No such file or directory
$ onevm disk-snapshot-delete 7317 0 testsnap2
[one.vm.disksnapshotdelete] Cannot delete the active snapshot
After reverting to a snapshot, it somehow becomes “active”, and cannot be deleted anymore. Nevermind, let’s create another “backup” snapshot:
$ onevm disk-snapshot-create 7317 0 testsnap3
$ onevm poweroff 7317
$ onevm disk-snapshot-revert testsnap3
$ onevm resume 7317
$ onevm disk-snapshot-delete 7317 0 testsnap2
[one.vm.disksnapshotdelete] Cannot delete snapshot with children
It seems that OpenNebula does not use Ceph snapshots at all, but uses RBD image clones instead:
$ rbd snap ls one/one-1920
... no snapshots at all!
$ rbd ls one|grep 1920
one-1920
one-1920-0
one-1920-1
$ rbd snap ls one/one-1920-0
SNAPID NAME SIZE PROTECTED TIMESTAMP
2457 0 4 GiB yes Fri Jun 2 10:31:47 2023
$ rbd snap ls one/one-1920-1
SNAPID NAME SIZE PROTECTED TIMESTAMP
2458 1 4 GiB yes Fri Jun 2 10:39:01 2023
Why is it done this way? I would expect ONe snapshots to use Ceph RBD snapshots directly in a flat structure. But nevermind the implementation, I would definitely not expect reverting to the previous snapshot locking that snapshot forever.
Do you consider this a bug? Other virtualization platforms allow to snapshot a VM disk easily, e.g. before the upgrade, revert to it if something goes wrong, and delete a snapshot whenever it is not needed anymore.
How can I delete testsnap2
and testsnap3
above, without disturbing the state of the running VM #7317 ?
Thanks!
-Yenya