--- Begin Message ---
After a container is destroyed, record that its ID has been used via the
`PVE::UsedVmidList` module so that the `/cluster/nextids` endpoint can
later optionally avoid suggesting previously used IDs.

Co-authored-by: Daniel Krambrock <krambr...@hrz.uni-marburg.de>
Signed-off-by: Severen Redwood <severen.redw...@sitehost.co.nz>
---
 src/PVE/API2/LXC.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index 918e719..c4cc427 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -800,6 +800,7 @@ __PACKAGE__->register_method({
 
        my $realcmd = sub { PVE::LXC::Config->lock_config($vmid, $code); };
 
+       PVE::UsedVmidList::add_vmid($vmid);
        return $rpcenv->fork_worker('vzdestroy', $vmid, $authuser, $realcmd);
     }});
 
-- 
2.46.2



--- End Message ---
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to