From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id 976031FF165
	for <inbox@lore.proxmox.com>; Wed, 26 Mar 2025 04:59:33 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 3C3121CA35;
	Wed, 26 Mar 2025 04:59:29 +0100 (CET)
Date: Wed, 26 Mar 2025 16:51:13 +1300
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
References: <mailman.62.1731030290.372.pve-devel@lists.proxmox.com>
 <20241108014620.73352-1-severen.redwood@sitehost.co.nz>
 <mailman.64.1731030431.372.pve-devel@lists.proxmox.com>
 <1494603895.9133.1737980190457@webmail.proxmox.com>
In-Reply-To: <1494603895.9133.1737980190457@webmail.proxmox.com>
MIME-Version: 1.0
Message-ID: <mailman.195.1742961568.359.pve-devel@lists.proxmox.com>
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Post: <mailto:pve-devel@lists.proxmox.com>
From: Severen Redwood via pve-devel <pve-devel@lists.proxmox.com>
Precedence: list
Cc: Severen Redwood <severen.redwood@sitehost.co.nz>
X-Mailman-Version: 2.1.29
X-BeenThere: pve-devel@lists.proxmox.com
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
Subject: Re: [pve-devel] [PATCH container v4] api: record CT ID as used
 after a container is destroyed
Content-Type: multipart/mixed; boundary="===============6313688531353785723=="
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

--===============6313688531353785723==
Content-Type: message/rfc822
Content-Disposition: inline

Return-Path: <severen.redwood@sitehost.co.nz>
X-Original-To: pve-devel@lists.proxmox.com
Delivered-To: pve-devel@lists.proxmox.com
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by lists.proxmox.com (Postfix) with ESMTPS id C9C6ACA7F9
	for <pve-devel@lists.proxmox.com>; Wed, 26 Mar 2025 04:59:27 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id A9CDB1C7F5
	for <pve-devel@lists.proxmox.com>; Wed, 26 Mar 2025 04:58:57 +0100 (CET)
Received: from mx3.ext.sitehost.co.nz (mx3.ext.sitehost.co.nz [120.138.20.239])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by firstgate.proxmox.com (Proxmox) with ESMTPS
	for <pve-devel@lists.proxmox.com>; Wed, 26 Mar 2025 04:58:56 +0100 (CET)
Received: from localhost (extmx1-new.vps.sitehost.co.nz [127.0.0.1])
	by mx3.ext.sitehost.co.nz (Postfix) with ESMTP id 827B3180BC5;
	Wed, 26 Mar 2025 16:51:17 +1300 (NZDT)
X-Virus-Scanned: SiteHost Virus/Spam Prevention on mx3.ext.sitehost.co.nz
X-Spam-Flag: NO
X-Spam-Score: -3.45
X-Spam-Status: No, score=-3.45 tagged_above=-100 required=5
	tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, RP_MATCHES_RCVD=-0.55]
	autolearn=ham autolearn_force=no
Received: from mx3.ext.sitehost.co.nz ([127.0.0.1])
	by localhost (mx3.ext.sitehost.co.nz [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id I_4OIrCocSc9; Wed, 26 Mar 2025 16:51:13 +1300 (NZDT)
Received: from [192.168.99.182] (oep.nct.sitehost.co.nz [120.138.23.30])
	by mx3.ext.sitehost.co.nz (Postfix) with ESMTPSA id C3F8A18075B;
	Wed, 26 Mar 2025 16:51:13 +1300 (NZDT)
Message-ID: <b9175549-036c-4b9f-bdcd-3b585f9e26ac@sitehost.co.nz>
Date: Wed, 26 Mar 2025 16:51:13 +1300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [pve-devel] [PATCH container v4] api: record CT ID as used after
 a container is destroyed
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
References: <mailman.62.1731030290.372.pve-devel@lists.proxmox.com>
 <20241108014620.73352-1-severen.redwood@sitehost.co.nz>
 <mailman.64.1731030431.372.pve-devel@lists.proxmox.com>
 <1494603895.9133.1737980190457@webmail.proxmox.com>
Content-Language: en-NZ
From: Severen Redwood <severen.redwood@sitehost.co.nz>
In-Reply-To: <1494603895.9133.1737980190457@webmail.proxmox.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
	AWL                     0.049 Adjusted score from AWL reputation of From: address
	BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
	DMARC_PASS               -0.1 DMARC pass 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_PASS          -0.001 SPF: HELO matches SPF record
	SPF_PASS               -0.001 SPF: sender matches SPF record

On 28/01/2025 01:16, Fabian Grünbichler wrote:
> if we only add it when the VM is removed via the API, we might miss those where an admin just does "rm /etc/pve/../XXX.conf" (which might happen if something is blocking regular removal)? wouldn't it be safer to add them when creating the VM? or potentially in both cases to increase the likelihood of a VM being registered?
> 
> alternatively, a call to nextid already has both lists and could warn if there is a mismatch or even fix it up? i.e., if we don't only add on removal, but upon creation, then the intersection of currently used VMIDs and previously used VMIDs should be identical to the currently used VMIDs. if not, then any missing ones can be added/registered?
> 
> all of this obviously applies to containers and VMs..

This is a good point. I've implemented your first suggestion for a start and tried to position the calls to `add_id` where I think they would make sense (namely just after the config file is created for creating/cloning and just after it is deleted for destroying), but of course I don't have the most intimate knowledge of PVE. Please let me know what you think once I post the updated patch series :)



--===============6313688531353785723==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

--===============6313688531353785723==--