From 04a34c5688d4fd813023a57c24c43498bc606093 Mon Sep 17 00:00:00 2001 From: Oguz Bektas Date: Wed, 13 Oct 2021 14:31:53 +0200 Subject: [PATCH] api: clone_vm: don't include snapshot properties apparently this caused a weird[0] bug... when a container with a snapshot was cloned, it would take 'parent: foo' from the original container. if you add a new snapshot 'bar', and then another one 'foo', this causes the snapshots to become parents of each other (thus not parsed correctly in the tree view of GUI nor with 'pct listsnapshot CTID') we also drop these properties for VMs, so it makes sense to do the same here as well. [0]: https://forum.proxmox.com/threads/snapshots-of-one-lxc-disappeared.97711/ Signed-off-by: Oguz Bektas --- src/PVE/API2/LXC.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm index 1f2f1f0..05cfbad 100644 --- a/src/PVE/API2/LXC.pm +++ b/src/PVE/API2/LXC.pm @@ -1512,7 +1512,12 @@ __PACKAGE__->register_method({ # Replace the 'disk' lock with a 'create' lock. $newconf->{lock} = 'create'; + # delete all snapshot related config options delete $newconf->{snapshots}; + delete $newconf->{parent}; + delete $newconf->{snaptime}; + delete $newconf->{snapstate}; + delete $newconf->{pending}; delete $newconf->{template}; if ($param->{hostname}) { -- 2.39.5