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 CE1A11FF09F for ; Tue, 01 Dec 2026 09:54:38 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 50F58207CA; Tue, 01 Dec 2026 09:54:38 +0100 (CET) Message-ID: <87b30906-147f-4439-ba12-beaa3f82c263@proxmox.com> Date: Tue, 1 Dec 2026 09:54:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH many 00/12] snapshot attributes for tags and pools of PVE guests, tape job filter To: Jakob-Tobias Winter , pbs-devel@lists.proxmox.com References: <20261113085637.57360-3-tobias@stuttgart.de> <751f5842-78cc-49cd-9e4e-8a4950e46d8f@proxmox.com> <559fc611-2d42-40c0-ac46-fab2866e501b@stuttgart.de> Content-Language: en-US, de-DE From: Christian Ebner In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1796115273842 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.190 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: AC5EBBHAW5OBSFVX5FO5I7TP2AECIXDQ X-Message-ID-Hash: AC5EBBHAW5OBSFVX5FO5I7TP2AECIXDQ X-MailFrom: c.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 Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 11/28/26 1:31 PM, Jakob-Tobias Winter wrote: > Hi Christian, hi Samuel, > > to have it in one place and not spread over the single threads, here is > what I would do for an RFC v2. Let me know if something needs more thought. > > Proxmox Backup Server > > * The client passes the attributes when it starts the backup session >   and cannot change them afterwards. finish_backup() refuses the >   backup if the uploaded manifest has attributes that differ. If the >   manifest has none, the server adds them, so a client only has to >   pass them once. Changing them later is only possible as root@pam, >   with the PUT call of v1. It would be preferable to keep the pre-existing backup protocol API endpoints but nevertheless avoid restrictions by the GET parameter length, so adding this as body on backup finish POST call, ideally in an optional manner also keeping future extensibility in mind. Attributes stored in the manifest must then match these provided at backup finish, non matching ones dropped before persisting the manifest to the backing storage. This is also relevant for sync jobs in push direction, as these use the backup API. > * pbs-api-types gets types for the key, the value and the KEY=VALUE >   item, which do the parsing and the formatting. The regexes are put >   together from the ones for key and value. Yes, having dedicated types and validation is a must. This should protect from any (accidental) misuse when using plain strings and sterilizers. Type construction from a serial stream should also always use the type specific deserialization and validation checks, if not already performed by the api macro. > * On BTreeMap and BTreeSet: that was only to have the attributes >   sorted and without duplicates, so the manifest does not depend on >   the order a client sends them in and two sets are easy to compare. >   I would keep that for the manifest, unless you prefer a sorted Vec >   of the new item type. The main concern was memory requirements from using these more complex data structures. If using these, an argument why they are preferable over less memory involved Vec's (at some runtime cost). How many attributes are to be expected? Should the number of allowed attributes be limited? > * A value can have up to 256 characters instead of 128. I found no >   upper limit for the length of a tag or of a pool name in PVE to >   align it with, so I took the one of a namespace. vzdump leaves out >   a value that does not fit, with a warning in the task log, and the >   docs say so. having an upper bound is justified IMHO, even if not enforce client side. > * Tape jobs filter per snapshot. The attributes of a group are gone, >   and with them the .ok() that skipped a manifest which could not be >   read. Such a manifest is reported instead. >   A snapshot without attributes, like all existing ones, then matches >   no include filter, and after the tags of a guest were changed its >   older snapshots are still selected by the old tags. Both go into >   the docs. > > * 'latest-only' is applied after the filter, like transfer-last in >   sync jobs, and documented that way. > > * The attributes are shown under Datastore > Content. The snapshot >   list needs Datastore.Audit, or Datastore.Backup as owner of the >   group, which is what reading them needed in v1, so the permissions >   hold. Using them in other jobs stays a follow-up. > > Proxmox VE > > * Nothing is stored by default. 'pbs-snapshot-attributes' becomes a >   list of what to store, for example 'tags,pool'. > > * For a guest in a nested pool only that pool is stored, without its >   parents. > > * No cluster name for now. Where clusters share a namespace the >   guests can get a tag for it, as Samuel suggested, and the list >   leaves room to add it later. > > Passing the attributes at session start has some consequences: > > * proxmox-backup-qemu, pve-qemu, qemu-server and pve-container need >   changes too. > > * A running VM gets attributes only once it runs a QEMU that knows >   the new argument of the backup command, so after it was restarted >   or migrated once after the update. vzdump sees that in >   query-proxmox-support and notes it in the task log. Stopped VMs and >   containers are not affected. > > * A sync job in push direction uploads the manifest of the source, so >   it has to pass the attributes of the source snapshot as well. > > One question before I build it. The session is started with a GET > request, so the attributes would be part of its query string: > > * A server without the change refuses the whole session. 4.2.9 >   answers 400, "parameter verification failed - 'attributes': schema >   does not allow additional properties". As the option is opt-in I >   would let the backup fail then, and say in the GUI and in the docs >   that the server has to support it. Instead of a hard backup failure, support could be checked by the client side first using e.g. the PBS /version endpoint, and if not supported, logged as warning and skipped. > * The REST server answers 414 if path and query are longer than 3072 >   bytes (MAX_URI_QUERY_LENGTH). Around 80 tags of 12 characters fit >   next to the other parameters, or 19 of 128. PVE limits neither the >   number nor the length of tags, so vzdump would leave out what does >   not fit, again with a warning. While having upper bounds for both, length and number of attributes makes sense, getting rid of it by using the POST body for the finish endpoint makes sense. > > Both would go away if the client passed the attributes with a call > inside the session instead, once and before 'finish', with the list > in the body (say POST attributes). The server would keep them in the > BackupEnvironment and check them in finish_backup() just the same. > An older server answers 404 for a call it does not know and the > session goes on (tried with 4.2.9), so the client can note that and > back up without attributes. The price is a new call in the backup > protocol instead of a new parameter. > > Do you prefer the parameter or the call? As stated above, using the backup /finish POST calls body is the better option IMO. Thanks!