public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: Jakob-Tobias Winter <tobias@stuttgart.de>, pbs-devel@lists.proxmox.com
Subject: Re: [RFC PATCH many 00/12] snapshot attributes for tags and pools of PVE guests, tape job filter
Date: Tue, 1 Dec 2026 09:54:33 +0100	[thread overview]
Message-ID: <87b30906-147f-4439-ba12-beaa3f82c263@proxmox.com> (raw)
In-Reply-To: <e9f1b46a-1cd2-4596-af3d-63b403f8484c@stuttgart.de>

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!




  reply	other threads:[~2026-12-01  8:54 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13  8:56 [RFC PATCH many 00/12] snapshot attributes for tags and pools of PVE guests, tape job filter Jakob-Tobias Winter
2026-11-13  8:56 ` [RFC PATCH proxmox 01/12] pbs-api-types: add types and schemas for snapshot attributes Jakob-Tobias Winter
2026-11-16 14:57   ` Christian Ebner
2026-11-18 12:54   ` Samuel Rufinatscha
2026-11-13  8:56 ` [RFC PATCH proxmox 02/12] pbs-api-types: tape: add attribute filter to backup jobs Jakob-Tobias Winter
2026-11-16 14:57   ` Christian Ebner
2026-11-13  8:56 ` [RFC PATCH proxmox-backup 03/12] datastore: add attributes to backup snapshots Jakob-Tobias Winter
2026-11-16 14:57   ` Christian Ebner
2026-11-18 12:55   ` Samuel Rufinatscha
2026-11-13  8:56 ` [RFC PATCH proxmox-backup 04/12] fix #7452: api: datastore: add endpoints for snapshot attributes Jakob-Tobias Winter
2026-11-16 14:57   ` Christian Ebner
2026-11-13  8:56 ` [RFC PATCH proxmox-backup 05/12] tape: backup job: allow selecting groups by " Jakob-Tobias Winter
2026-11-18 13:06   ` Samuel Rufinatscha
2026-11-18 15:19     ` Christian Ebner
2026-11-13  8:56 ` [RFC PATCH proxmox-backup 06/12] ui: tape backup job: add attribute filter Jakob-Tobias Winter
2026-11-13  8:56 ` [RFC PATCH proxmox-backup 07/12] docs: describe snapshot attributes and the tape job " Jakob-Tobias Winter
2026-11-13  8:56 ` [RFC PATCH storage 08/12] pbs: add helper to set the attributes of a backup snapshot Jakob-Tobias Winter
2026-11-13  8:56 ` [RFC PATCH guest-common 09/12] vzdump: add pbs-snapshot-attributes option Jakob-Tobias Winter
2026-11-13  8:56 ` [RFC PATCH manager 10/12] vzdump: store guest tags and pool as snapshot attributes on PBS Jakob-Tobias Winter
2026-11-13  8:56 ` [RFC PATCH manager 11/12] ui: backup job: add selector for PBS snapshot attributes Jakob-Tobias Winter
2026-11-13  8:56 ` [RFC PATCH docs 12/12] vzdump: describe snapshot attributes on Proxmox Backup Server Jakob-Tobias Winter
2026-11-16 14:57 ` [RFC PATCH many 00/12] snapshot attributes for tags and pools of PVE guests, tape job filter Christian Ebner
2026-11-18 13:07   ` Samuel Rufinatscha
2026-11-18 14:22 ` Samuel Rufinatscha
2026-11-19 11:58   ` Jakob-Tobias Winter
2026-11-28 12:31     ` Jakob-Tobias Winter
2026-12-01  8:54       ` Christian Ebner [this message]
2026-12-01 11:23         ` Samuel Rufinatscha
2026-12-01 14:51           ` Christian Ebner
2026-12-01 15:07             ` Samuel Rufinatscha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87b30906-147f-4439-ba12-beaa3f82c263@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=tobias@stuttgart.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal