[PATCH container] api: record CT ID as used after a container is destroyed
Severen Redwood
severen.redwood at sitehost.co.nz
Mon Sep 30 02:24:36 CEST 2024
On Fri Sep 27, 2024 at 5:48 AM NZST, Thomas Lamprecht wrote:
> at this point the CT is not yet destroyed, only the worker that tries to destroy
> it is started, destruction can still fail.
>
> It'd be better to place it inside the $realcmd, or even the $code, ideally
> before the actual unlink of the vmid.conf file, as after that happens the
> ID gets free again from the POV of the pmxcfs and thus pve-cluster's VMID
> list that is used by the next-id call.
Thanks for pointing that out! Upon review, that is definitely the wrong
place to add the CT ID to the list. I'll move the call to
`PVE::UsedVmidList::add_vmid` to sit just before the call to
`PVE::LXC::Config->destroy_config` in the `$code` subroutine instead,
which I think is in the vein of your suggestion.
More information about the pve-devel
mailing list