From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 085D71FF0B4 for ; Tue, 10 Nov 2026 14:04:33 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id EA62221638; Tue, 10 Nov 2026 14:04:28 +0100 (CET) Message-ID: Date: Tue, 10 Nov 2026 14:04:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH guest-common v8 05/22] add module to track previously used guest IDs To: =?UTF-8?Q?Michael_K=C3=B6ppl?= , pve-devel@lists.proxmox.com References: <20261012154600.877830-1-m.koeppl@proxmox.com> <20261012154600.877830-6-m.koeppl@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20261012154600.877830-6-m.koeppl@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794315862702 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.135 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: ZB45JZU55Z3J42GEADMSKFJKVSOQGV54 X-Message-ID-Hash: ZB45JZU55Z3J42GEADMSKFJKVSOQGV54 X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Am 12.10.26 um 5:49 PM schrieb Michael Köppl: > The /cluster/nextid API endpoint always suggests the lowest free > guest ID, so IDs of destroyed guests get handed out again. Offering > an opt-out requires recording every ID that has ever been in use > somewhere both the endpoint and the guest create and destroy paths > can reach. > > Store them in /etc/pve/virtual-guest/used-guest-ids and register it as > a cfs file, so the list is kept in sync cluster-wide. IDs are stored as > "-" ranges and are not expanded per ID since cfs_read_file() > hands out a deep copy of the parsed data on every call, which gets > expensive on clusters that churn through many guests. Adjacent ranges > are merged on write to keep the file small. Entries that do not parse, > ranges with reversed bounds included, are skipped with a warning instead > of failing the whole read. > > get_next_unused_id() returns the lowest ID at or above a given one that > is neither in use nor recorded as having been used previously. > > Recording failures are non-critical and will only warn while 'unique' is > off. > > Originally-by: Daniel Krambrock > Originally-by: Severen Redwood > Signed-off-by: Michael Köppl Consider this one too: Reviewed-by: Fiona Ebner Nice work!