]> git.proxmox.com Git - pve-container.git/commit
fix #2412: ct destroy: only delete config after deleted from pools, fw
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Oct 2019 10:01:49 +0000 (12:01 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Oct 2019 10:49:38 +0000 (12:49 +0200)
commit7fc1d9ebb3b6b3fb29e526d350db65a5c9e94d2b
tree9ceba990d16768917c29d4680193a1ca535b4d5b
parent3ac73b44e79d4c4b1af45f9e1f0c58f3c2ba746e
fix #2412: ct destroy: only delete config after deleted from pools, fw

commit message stolen from:
https://pve.proxmox.com/pipermail/pve-devel/2019-October/039594.html

Between calling destroy_lxc_container and removing the ID from
user.cfg (remove_vm_access) creating a new CT with this ID was
possible. CTs could go missing from pools as a consequence.

unlinking must happen at the very end of the deletion
process to avoid that other nodes use the ID in the meanwhile

Further lock the config after the VM was destroyed with a config lock
named, well, destroyed. This way it's easy to know that the CT was
destroyed but has still the config skelleton and FW, access etc.
stuff possible left over.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/API2/LXC.pm
src/PVE/LXC/Config.pm