From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 618D41FF16B for ; Thu, 31 Oct 2024 18:27:43 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5184FE3DA; Thu, 31 Oct 2024 18:27:47 +0100 (CET) Message-ID: <0c3fcb3d-6367-403b-968a-d73042853c33@proxmox.com> Date: Thu, 31 Oct 2024 18:27:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Severen Redwood , pve-devel@lists.proxmox.com References: <20241004050957.441759-1-severen.redwood@sitehost.co.nz> <20241004050957.441759-4-severen.redwood@sitehost.co.nz> From: Aaron Lauterer In-Reply-To: <20241004050957.441759-4-severen.redwood@sitehost.co.nz> X-SPAM-LEVEL: Spam detection results: 0 AWL -0.037 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [lxc.pm] Subject: Re: [pve-devel] [PATCH container v2] api: record CT ID as used after a container is destroyed X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Cc: Thomas Lamprecht Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" This is missing a use PVE::UsedVmidList; at the top of the file. Otherwise running pct destroy {vmid} will result in the following error: Undefined subroutine &PVE::UsedVmidList::add_vmid called at /usr/share/perl5/PVE/API2/LXC.pm line 799. This doesn't seem to be necessary in the qemu-server repo, but I did not investigate further how pulling in dependencies works there. On 2024-10-04 07:07, Severen Redwood wrote: > 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 > Signed-off-by: Severen Redwood > --- > src/PVE/API2/LXC.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm > index 918e719..ee0e3e9 100644 > --- a/src/PVE/API2/LXC.pm > +++ b/src/PVE/API2/LXC.pm > @@ -794,7 +794,9 @@ __PACKAGE__->register_method({ > } > } > > - # only now remove the zombie config, else we can have reuse race > + # only now mark the CT ID as previously used and remove the zombie > + # config, else we can have reuse race > + PVE::UsedVmidList::add_vmid($vmid); > PVE::LXC::Config->destroy_config($vmid); > }; > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel