public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [RFC PATCH many 00/12] snapshot attributes for tags and pools of PVE guests, tape job filter
@ 2026-11-13  8:56 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
                   ` (13 more replies)
  0 siblings, 14 replies; 25+ messages in thread
From: Jakob-Tobias Winter @ 2026-11-13  8:56 UTC (permalink / raw)
  To: pbs-devel; +Cc: Jakob-Tobias Winter

Tape backup jobs on a Proxmox Backup Server select backup groups by
type and ID only. Splitting guests over media pools by what they are,
say production and test guests with different retention, means keeping
lists of IDs up to date by hand in every job. In Proxmox VE the same
guests are already organized with tags and resource pools, but the
backup server knows about neither.

This series lets Proxmox VE store the tags and the resource pool of a
guest with each backup, as attributes of the snapshot, and adds a
filter on such attributes to tape backup jobs:

  # proxmox-tape backup-job create prod --store store1 --drive lto1 \
      --pool prod --attribute-filter pve-tag=prod
  # proxmox-tape backup-job create rest --store store1 --drive lto1 \
      --pool rest --attribute-filter exclude:pve-tag=prod

It is an RFC, as it defines a format and names that others would have
to live with, and because [1] is assigned already. If there is work in
progress for it, I am happy to adapt this series to it or to drop
whatever overlaps.

Proxmox Backup Server
---------------------

proxmox 1-2, proxmox-backup 3-7

Snapshots get attributes, a map from a key to a list of values. They
are kept in the unprotected part of the manifest, as suggested in [0],
so they can be set for encrypted backups without touching the
signature, and they stay with a snapshot that is synced or written to
tape. A guest with several tags gets one value per tag, nothing is
joined into one string.

They are read and set through a new endpoint next to the notes,
GET/PUT /admin/datastore/{store}/attributes, with the privileges of
the notes, as a list of KEY=VALUE entries. A PUT replaces all
attributes of the snapshot. An empty set is stored as well, to tell a
guest without tags from a client which never set anything.

Tape backup jobs get the option 'attribute-filter', a list of
[exclude:|include:]KEY=VALUE with the include and exclude rules of
group filters, applied after the group filter. A group has the
attributes of its newest finished snapshot that has some, so a single
backup without attributes does not move a group to another media pool.
Besides the API there is the option for 'proxmox-tape', a field in the
job window, a column in the job list and documentation.

The server does not interpret keys or values.

Proxmox VE
----------

storage 8, guest-common 9, manager 10-11, docs 12

After a backup to a PBS storage, vzdump sets 'pve-tag' (one value per
tag) and 'pve-pool', with the prefix suggested in [0], directly
through the API like the protection flag. A guest in a nested pool
gets that pool and each of its parent pools as values, so a filter
for a pool also matches the guests of the pools nested in it. A
server without the endpoint answers 404, which is only noted in the
task log.

As the attributes are not encrypted, the new vzdump option
'pbs-snapshot-attributes' (default on) can turn this off for a job, a
single call, or a node in /etc/vzdump.conf.

Compatibility
-------------

* Jobs without the new option select the same groups as before, and
  nothing changes on tape or in the catalogs. A tape job written by
  4.2.9 was read and run unchanged.
* The other way round, a version without the series cannot parse a
  tape-job.cfg in which the option is used (unknown property), like
  with other new job properties.
* A backup server without the series leaves the attributes in the
  manifest alone (tried with 4.2.9).
* A PVE node without the series ignores the vzdump option in jobs.cfg
  with a warning.

Open questions
--------------

* The names: 'pve-tag', 'pve-pool', 'attribute-filter' and
  'pbs-snapshot-attributes'.
* A guest in the pool 'a/b' gets the 'pve-pool' values 'a/b' and 'a',
  so one filter covers a pool with everything nested in it. A backup
  job for the pool 'a' in Proxmox VE only takes the direct members of
  'a'. Is that difference fine, or should only 'a/b' be stored?
  Since nested pools are quite new I wasn't sure about that at all.
* Setting the attributes after the backup, like notes and protection,
  needs no change in the backup protocol or in the QEMU library. But
  a user that may only append, as in [2], could then not set them.
  Passing them when the backup is created would solve that, at the
  price of changes in proxmox-backup-qemu, pve-qemu, qemu-server and
  pve-container which I found a bit excessive for some attributes. 
* On by default with the option to opt out, or the other way round?
  Is the switch needed at all?
* This is a separate job option and not a new kind of group filter,
  as group filters are shared with sync jobs and match on the name of
  a group only. Using attributes in other jobs and showing them in the
  web interface could follow, if wanted.
* For a group in which no snapshot has attributes, all its manifests
  are read when a job with a filter runs. Is that acceptable, or
  should only the newest few be looked at?

Testing
-------

proxmox-backup master (4.2.11) with the series: rustfmt, clippy
without new warnings, every commit builds, 'cargo test --workspace'
passes (162 tests, one of them new), the docs build as HTML and man
pages. The tests of pbs-api-types pass, with five new ones for the
filter. pbs-api-types 1.0.22 came from the proxmox repository, as it
is not in the devel repository yet.

The PVE patches are perltidy and biome clean, and the test suites of
the three Perl repositories give the same results with and without
them.

End to end in an unprivileged sandbox with the real daemons of both
products: the packages of PVE 9.2.26 with the PVE patches applied and
a backup server built from master with the series. There is no KVM in
it, so the guests were stopped VMs and a container.

* vzdump of VMs and a container to a plain and an encrypted PBS
  storage, the latter with a namespace, as a user with DatastoreBackup
  only; several tags, pools nested up to three levels, changed and
  removed tags; the option per call, per job (also run by pvescheduler
  and from the web interface) and in /etc/vzdump.conf; restore of an
  encrypted backup
* the same against 4.2.9 and plain master: noted in the task log, no
  warning, the backup is fine
* the API as owner, as another user, as auditor and as admin; invalid
  values; verification, notes, protection and a local sync job keep
  the attributes
* tape jobs on the virtual tape drive (needs [3]) selecting by tag, by
  pool and by the parent of a nested pool, combined with a group
  filter and with namespaces, started by hand and by the scheduler; a
  restore from tape keeps the attributes
* both web interfaces in a browser

Not yet tested: real tape hardware, clusters with more than one node,
datastores with an S3 backend.

I wasn't sure if I was supposed to send to pbs-devel and pve-devel.

[0] https://bugzilla.proxmox.com/show_bug.cgi?id=4186#c32
[1] https://bugzilla.proxmox.com/show_bug.cgi?id=7452
[2] https://lore.proxmox.com/pbs-devel/20261106172235.890542-1-c.ebner@proxmox.com/
[3] https://lore.proxmox.com/pbs-devel/20261111204853.531985-2-tobias@stuttgart.de/


proxmox:

Jakob-Tobias Winter (2):
  pbs-api-types: add types and schemas for snapshot attributes
  pbs-api-types: tape: add attribute filter to backup jobs

 pbs-api-types/src/datastore.rs                |  22 ++-
 pbs-api-types/src/jobs.rs                     |  98 ++++++++++-
 pbs-api-types/src/lib.rs                      |   3 +
 pbs-api-types/tests/attribute_filter_tests.rs | 155 ++++++++++++++++++
 4 files changed, 276 insertions(+), 2 deletions(-)
 create mode 100644 pbs-api-types/tests/attribute_filter_tests.rs


proxmox-backup:

Jakob-Tobias Winter (5):
  datastore: add attributes to backup snapshots
  fix #7452: api: datastore: add endpoints for snapshot attributes
  tape: backup job: allow selecting groups by snapshot attributes
  ui: tape backup job: add attribute filter
  docs: describe snapshot attributes and the tape job attribute filter

 docs/pve-integration.rst           |  23 ++++++
 docs/tape-backup.rst               |  27 ++++++
 docs/terminology.rst               |  33 ++++++++
 pbs-datastore/src/backup_info.rs   |  18 +++-
 pbs-datastore/src/datastore.rs     |  15 +++-
 pbs-datastore/src/manifest.rs      |  87 +++++++++++++++++++-
 src/api2/admin/datastore.rs        | 128 ++++++++++++++++++++++++++++-
 src/api2/config/tape_backup_job.rs |   8 ++
 src/api2/tape/backup.rs            |  19 ++++-
 src/bin/proxmox-tape.rs            |  11 ++-
 www/tape/BackupJobs.js             |   7 ++
 www/tape/window/TapeBackupJob.js   |  27 +++++-
 12 files changed, 391 insertions(+), 12 deletions(-)


storage:

Jakob-Tobias Winter (1):
  pbs: add helper to set the attributes of a backup snapshot

 src/PVE/Storage/PBSPlugin.pm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)


guest-common:

Jakob-Tobias Winter (1):
  vzdump: add pbs-snapshot-attributes option

 src/PVE/VZDump/Common.pm | 8 ++++++++
 1 file changed, 8 insertions(+)


manager:

Jakob-Tobias Winter (2):
  vzdump: store guest tags and pool as snapshot attributes on PBS
  ui: backup job: add selector for PBS snapshot attributes

 PVE/VZDump.pm                               | 42 +++++++++++++++++++++
 configs/vzdump.conf                         |  1 +
 www/manager6/panel/BackupAdvancedOptions.js | 22 +++++++++++
 3 files changed, 65 insertions(+)


docs:

Jakob-Tobias Winter (1):
  vzdump: describe snapshot attributes on Proxmox Backup Server

 vzdump.adoc | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)


Summary over all repositories:
  22 files changed, 799 insertions(+), 14 deletions(-)

-- 
2.53.0




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [RFC PATCH proxmox 01/12] pbs-api-types: add types and schemas for snapshot attributes
  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 ` 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
                   ` (12 subsequent siblings)
  13 siblings, 2 replies; 25+ messages in thread
From: Jakob-Tobias Winter @ 2026-11-13  8:56 UTC (permalink / raw)
  To: pbs-devel; +Cc: Jakob-Tobias Winter

Snapshots get attributes, each of them a key with a list of values.
They are meant for information a client knows about the source of a
backup, like the tags and the resource pool of a Proxmox VE guest.

An attribute is passed as 'KEY=VALUE', once per value of a key. A
value is never joined with other values into one string, so a list
of tags cannot be garbled by a separator.

Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
---
 pbs-api-types/src/datastore.rs | 22 +++++++++++++++++++++-
 pbs-api-types/src/lib.rs       |  3 +++
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index 7685deee..978253ee 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -1,4 +1,5 @@
 use std::borrow::Borrow;
+use std::collections::{BTreeMap, BTreeSet};
 use std::convert::{AsRef, TryFrom};
 use std::fmt;
 use std::hash::{Hash, Hasher};
@@ -28,7 +29,7 @@ use crate::{
     DATASTORE_NOTIFY_STRING_SCHEMA, Fingerprint, GC_SCHEDULE_SCHEMA,
     GROUP_OR_SNAPSHOT_PATH_REGEX_STR, GroupFilter, MaintenanceMode, MaintenanceType,
     PROXMOX_SAFE_ID_FORMAT, PROXMOX_SAFE_ID_REGEX_STR, PRUNE_SCHEDULE_SCHEMA, SHA256_HEX_REGEX,
-    SINGLE_LINE_COMMENT_SCHEMA, SNAPSHOT_PATH_REGEX_STR, UPID, Userid,
+    SINGLE_LINE_COMMENT_SCHEMA, SNAPSHOT_ATTRIBUTE_RE, SNAPSHOT_PATH_REGEX_STR, UPID, Userid,
     VERIFY_JOB_READ_THREADS_SCHEMA, VERIFY_JOB_VERIFY_THREADS_SCHEMA,
 };
 
@@ -52,6 +53,8 @@ const_regex! {
     pub GROUP_OR_SNAPSHOT_PATH_REGEX = concatcp!(r"^", GROUP_OR_SNAPSHOT_PATH_REGEX_STR, r"$");
 
     pub DATASTORE_MAP_REGEX = concatcp!(r"^(?:", PROXMOX_SAFE_ID_REGEX_STR, r"=)?", PROXMOX_SAFE_ID_REGEX_STR, r"$");
+
+    pub SNAPSHOT_ATTRIBUTE_REGEX = concatcp!(r"^", SNAPSHOT_ATTRIBUTE_RE, r"$");
 }
 
 pub const CHUNK_DIGEST_FORMAT: ApiStringFormat = ApiStringFormat::Pattern(&SHA256_HEX_REGEX);
@@ -90,6 +93,23 @@ pub const BACKUP_GROUP_SCHEMA: Schema = StringSchema::new("Backup Group")
     .format(&BACKUP_GROUP_FORMAT)
     .schema();
 
+pub const SNAPSHOT_ATTRIBUTE_FORMAT: ApiStringFormat =
+    ApiStringFormat::Pattern(&SNAPSHOT_ATTRIBUTE_REGEX);
+
+pub const SNAPSHOT_ATTRIBUTE_SCHEMA: Schema = StringSchema::new(
+    "Snapshot attribute, a key and one of its values. A key with several values is given once \
+    per value.",
+)
+.format(&SNAPSHOT_ATTRIBUTE_FORMAT)
+.type_text("KEY=VALUE")
+.schema();
+
+pub const SNAPSHOT_ATTRIBUTE_LIST_SCHEMA: Schema =
+    ArraySchema::new("List of snapshot attributes.", &SNAPSHOT_ATTRIBUTE_SCHEMA).schema();
+
+/// The attributes of a snapshot, each key has a set of values.
+pub type SnapshotAttributes = BTreeMap<String, BTreeSet<String>>;
+
 /// The maximal, inclusive depth for namespaces from the root ns downwards
 ///
 /// The datastore root name space is at depth zero (0), so we have in total eight (8) levels
diff --git a/pbs-api-types/src/lib.rs b/pbs-api-types/src/lib.rs
index 21ef733d..cb1c231c 100644
--- a/pbs-api-types/src/lib.rs
+++ b/pbs-api-types/src/lib.rs
@@ -94,6 +94,9 @@ pub const GROUP_OR_SNAPSHOT_PATH_REGEX_STR: &str =
         r"(", BACKUP_TYPE_RE, ")/(", BACKUP_ID_RE, ")(?:/(", BACKUP_TIME_RE, r"))?",
     );
 
+#[rustfmt::skip]
+pub const SNAPSHOT_ATTRIBUTE_RE: &str = r"[a-z][a-z0-9\-]{0,31}=[A-Za-z0-9._+/\-]{1,128}";
+
 mod acl;
 pub use acl::*;
 

base-commit: 9bf4383b6ad4225367c7824023ad74769388de8f
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [RFC PATCH proxmox 02/12] pbs-api-types: tape: add attribute filter to backup jobs
  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-13  8:56 ` 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
                   ` (11 subsequent siblings)
  13 siblings, 1 reply; 25+ messages in thread
From: Jakob-Tobias Winter @ 2026-11-13  8:56 UTC (permalink / raw)
  To: pbs-devel; +Cc: Jakob-Tobias Winter

Tape backup jobs get a list of attribute filters to select backup
groups by the attributes of their snapshots, for example to write
the guests tagged as production and as test to different media
pools. A filter only matches a whole value of its key. Several
filters are combined like group filters: one of the include filters
has to match, if there are any, and none of the exclude filters.

The job option is optional. Existing job configurations stay valid
and select the same groups as before.

Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
---
 pbs-api-types/src/jobs.rs                     |  98 ++++++++++-
 pbs-api-types/tests/attribute_filter_tests.rs | 155 ++++++++++++++++++
 2 files changed, 252 insertions(+), 1 deletion(-)
 create mode 100644 pbs-api-types/tests/attribute_filter_tests.rs

diff --git a/pbs-api-types/src/jobs.rs b/pbs-api-types/src/jobs.rs
index 9a5d2b77..8e558e4a 100644
--- a/pbs-api-types/src/jobs.rs
+++ b/pbs-api-types/src/jobs.rs
@@ -15,7 +15,7 @@ use crate::{
     BackupType, CRYPT_KEY_ID_SCHEMA, DATASTORE_SCHEMA, DRIVE_NAME_SCHEMA, MEDIA_POOL_NAME_SCHEMA,
     NS_MAX_DEPTH_REDUCED_SCHEMA, NotificationMode, PROXMOX_SAFE_ID_FORMAT,
     PROXMOX_SAFE_ID_REGEX_STR, REMOTE_ID_SCHEMA, RateLimitConfig, SINGLE_LINE_COMMENT_SCHEMA,
-    Userid,
+    SNAPSHOT_ATTRIBUTE_REGEX, SnapshotAttributes, Userid,
 };
 
 const_regex! {
@@ -345,6 +345,10 @@ pub struct VerificationJobStatus {
             schema: GROUP_FILTER_LIST_SCHEMA,
             optional: true,
         },
+        "attribute-filter": {
+            schema: ATTRIBUTE_FILTER_LIST_SCHEMA,
+            optional: true,
+        },
         ns: {
             type: BackupNamespace,
             optional: true,
@@ -379,6 +383,8 @@ pub struct TapeBackupJobSetup {
     pub notification_mode: Option<NotificationMode>,
     #[serde(skip_serializing_if = "Option::is_none")]
     pub group_filter: Option<Vec<GroupFilter>>,
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub attribute_filter: Option<Vec<AttributeFilter>>,
     #[serde(skip_serializing_if = "Option::is_none", default)]
     pub ns: Option<BackupNamespace>,
     #[serde(skip_serializing_if = "Option::is_none", default)]
@@ -550,6 +556,96 @@ pub const GROUP_FILTER_SCHEMA: Schema = StringSchema::new(
 pub const GROUP_FILTER_LIST_SCHEMA: Schema =
     ArraySchema::new("List of group filters.", &GROUP_FILTER_SCHEMA).schema();
 
+#[derive(Clone, Debug, PartialEq, Eq)]
+/// Filter for matching the attributes of a snapshot.
+pub struct AttributeFilter {
+    pub is_exclude: bool,
+    pub key: String,
+    pub value: String,
+}
+
+impl AttributeFilter {
+    /// Returns whether the value of the filter is one of the values the attributes have for its
+    /// key.
+    pub fn matches(&self, attributes: &SnapshotAttributes) -> bool {
+        attributes
+            .get(&self.key)
+            .is_some_and(|values| values.contains(&self.value))
+    }
+
+    /// Returns whether the attributes pass the filters.
+    ///
+    /// If there are include filters, at least one of them has to match. No exclude filter may
+    /// match.
+    pub fn apply_filters(filters: &[AttributeFilter], attributes: &SnapshotAttributes) -> bool {
+        let is_included = if filters.iter().filter(|f| !f.is_exclude).count() == 0 {
+            true
+        } else {
+            filters
+                .iter()
+                .filter(|f| !f.is_exclude)
+                .any(|filter| filter.matches(attributes))
+        };
+
+        is_included
+            && !filters
+                .iter()
+                .filter(|f| f.is_exclude)
+                .any(|filter| filter.matches(attributes))
+    }
+}
+
+impl std::str::FromStr for AttributeFilter {
+    type Err = anyhow::Error;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        let (is_exclude, attribute) = match s.split_once(':') {
+            Some(("include", value)) => (false, value),
+            Some(("exclude", value)) => (true, value),
+            _ => (false, s),
+        };
+
+        match attribute.split_once('=') {
+            Some((key, value)) if SNAPSHOT_ATTRIBUTE_REGEX.is_match(attribute) => {
+                Ok(AttributeFilter {
+                    is_exclude,
+                    key: key.to_string(),
+                    value: value.to_string(),
+                })
+            }
+            _ => bail!("input doesn't match expected format '[<exclude:|include:>]KEY=VALUE'"),
+        }
+    }
+}
+
+// used for serializing below, caution!
+impl std::fmt::Display for AttributeFilter {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        if self.is_exclude {
+            f.write_str("exclude:")?;
+        }
+        write!(f, "{}={}", self.key, self.value)
+    }
+}
+
+proxmox_serde::forward_deserialize_to_from_str!(AttributeFilter);
+proxmox_serde::forward_serialize_to_display!(AttributeFilter);
+
+fn verify_attribute_filter(input: &str) -> Result<(), anyhow::Error> {
+    AttributeFilter::from_str(input).map(|_| ())
+}
+
+pub const ATTRIBUTE_FILTER_SCHEMA: Schema = StringSchema::new(
+    "Attribute filter, matches if the given value is one of the values of the key. Can be \
+    inverted by prepending 'exclude:'.",
+)
+.format(&ApiStringFormat::VerifyFn(verify_attribute_filter))
+.type_text("[<exclude:|include:>]KEY=VALUE")
+.schema();
+
+pub const ATTRIBUTE_FILTER_LIST_SCHEMA: Schema =
+    ArraySchema::new("List of attribute filters.", &ATTRIBUTE_FILTER_SCHEMA).schema();
+
 pub const TRANSFER_LAST_SCHEMA: Schema =
     IntegerSchema::new("Limit transfer to last N snapshots (per group), skipping others")
         .minimum(1)
diff --git a/pbs-api-types/tests/attribute_filter_tests.rs b/pbs-api-types/tests/attribute_filter_tests.rs
new file mode 100644
index 00000000..c355e6b4
--- /dev/null
+++ b/pbs-api-types/tests/attribute_filter_tests.rs
@@ -0,0 +1,155 @@
+use pbs_api_types::{AttributeFilter, SnapshotAttributes};
+use std::str::FromStr;
+
+fn attributes(list: &[(&str, &[&str])]) -> SnapshotAttributes {
+    list.iter()
+        .map(|(key, values)| {
+            (
+                key.to_string(),
+                values.iter().map(|value| value.to_string()).collect(),
+            )
+        })
+        .collect()
+}
+
+fn filters(list: &[&str]) -> Vec<AttributeFilter> {
+    list.iter()
+        .map(|filter| AttributeFilter::from_str(filter).unwrap())
+        .collect()
+}
+
+#[test]
+fn test_parse_filter() {
+    let filter = AttributeFilter::from_str("pve-tag=prod").unwrap();
+    assert!(!filter.is_exclude);
+    assert_eq!(filter.key, "pve-tag");
+    assert_eq!(filter.value, "prod");
+    assert_eq!(filter.to_string(), "pve-tag=prod");
+
+    let filter = AttributeFilter::from_str("include:pve-tag=prod").unwrap();
+    assert!(!filter.is_exclude);
+    assert_eq!(filter.to_string(), "pve-tag=prod");
+
+    let filter = AttributeFilter::from_str("exclude:pve-pool=customers/a_1.test").unwrap();
+    assert!(filter.is_exclude);
+    assert_eq!(filter.key, "pve-pool");
+    assert_eq!(filter.value, "customers/a_1.test");
+    assert_eq!(filter.to_string(), "exclude:pve-pool=customers/a_1.test");
+
+    let invalid = [
+        "",
+        "pve-tag",
+        "pve-tag=",
+        "=prod",
+        "Pve-Tag=prod",
+        "1tag=prod",
+        "pve-tag=prod;web",
+        "pve-tag=prod,web",
+        "pve-tag=prod web",
+        "pve-tag=prod=web",
+        "pve-tag=prod:web",
+        "other:pve-tag=prod",
+        "exclude:exclude:pve-tag=prod",
+    ];
+
+    for filter in invalid {
+        assert!(
+            AttributeFilter::from_str(filter).is_err(),
+            "'{filter}' must not parse"
+        );
+    }
+}
+
+#[test]
+fn test_no_filters() {
+    let filters = [];
+
+    assert!(AttributeFilter::apply_filters(&filters, &attributes(&[])));
+    assert!(AttributeFilter::apply_filters(
+        &filters,
+        &attributes(&[("pve-tag", &["prod", "web"])])
+    ));
+}
+
+#[test]
+fn test_include_filters() {
+    let filters = filters(&["pve-tag=prod", "pve-pool=customer1"]);
+
+    let do_backup = [
+        attributes(&[("pve-tag", &["prod"])]),
+        attributes(&[("pve-tag", &["db", "prod", "web"])]),
+        attributes(&[("pve-pool", &["customer1"])]),
+        attributes(&[("pve-pool", &["customer1"]), ("pve-tag", &["test"])]),
+    ];
+
+    let dont_backup = [
+        attributes(&[]),
+        attributes(&[("pve-tag", &[])]),
+        attributes(&[("pve-tag", &["nonprod", "prod-eu", "pro", "Prod"])]),
+        attributes(&[("pve-pool", &["prod"])]),
+        attributes(&[("pve-pool", &["customer1/sub", "customer10"])]),
+        attributes(&[("other", &["prod", "customer1"])]),
+    ];
+
+    for attributes in do_backup {
+        assert!(AttributeFilter::apply_filters(&filters, &attributes));
+    }
+
+    for attributes in dont_backup {
+        assert!(!AttributeFilter::apply_filters(&filters, &attributes));
+    }
+}
+
+#[test]
+fn test_exclude_filters() {
+    let filters = filters(&["exclude:pve-tag=prod", "exclude:pve-tag=test"]);
+
+    let do_backup = [
+        attributes(&[]),
+        attributes(&[("pve-tag", &["web"])]),
+        attributes(&[("pve-pool", &["prod"])]),
+    ];
+
+    let dont_backup = [
+        attributes(&[("pve-tag", &["prod"])]),
+        attributes(&[("pve-tag", &["test", "web"])]),
+        attributes(&[("pve-tag", &["prod", "test"])]),
+    ];
+
+    for attributes in do_backup {
+        assert!(AttributeFilter::apply_filters(&filters, &attributes));
+    }
+
+    for attributes in dont_backup {
+        assert!(!AttributeFilter::apply_filters(&filters, &attributes));
+    }
+}
+
+#[test]
+fn test_include_and_exclude_filters() {
+    let filters = filters(&[
+        "exclude:pve-tag=test",
+        "pve-pool=customer1",
+        "pve-pool=customer2",
+    ]);
+
+    let do_backup = [
+        attributes(&[("pve-pool", &["customer1"])]),
+        attributes(&[("pve-pool", &["customer2"]), ("pve-tag", &["prod"])]),
+    ];
+
+    let dont_backup = [
+        attributes(&[]),
+        attributes(&[("pve-tag", &["prod"])]),
+        attributes(&[("pve-pool", &["customer3"])]),
+        attributes(&[("pve-pool", &["customer1"]), ("pve-tag", &["test"])]),
+    ];
+
+    for attributes in do_backup {
+        assert!(AttributeFilter::apply_filters(&filters, &attributes));
+    }
+
+    for attributes in dont_backup {
+        assert!(!AttributeFilter::apply_filters(&filters, &attributes));
+    }
+}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [RFC PATCH proxmox-backup 03/12] datastore: add attributes to backup snapshots
  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-13  8:56 ` [RFC PATCH proxmox 02/12] pbs-api-types: tape: add attribute filter to backup jobs Jakob-Tobias Winter
@ 2026-11-13  8:56 ` 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
                   ` (10 subsequent siblings)
  13 siblings, 2 replies; 25+ messages in thread
From: Jakob-Tobias Winter @ 2026-11-13  8:56 UTC (permalink / raw)
  To: pbs-devel; +Cc: Jakob-Tobias Winter

A backup server knows little about where a backup comes from. Things
like the tags and the resource pool of a Proxmox VE guest are only
known to the client, but they are what users want to select backups
by, for example in tape backup jobs.

Allow storing such information as attributes of a snapshot. They are
kept in the unprotected part of the manifest, as suggested in [0].
That way they can also be set for encrypted backups, and they stay
with the snapshot when it is synced or written to tape.

Each attribute is a key with a list of values. A guest with several
tags gets one list element for each tag, instead of one string that
has to be split again.

A backup group has the attributes of its newest snapshot which has
attributes. Snapshots without attributes are skipped on purpose: a
client which does not set them, or fails to set them once, must not
make a group lose its attributes.

The unprotected part of the manifest can be uploaded by the client,
so values with an invalid format are dropped when reading it.

[0] https://bugzilla.proxmox.com/show_bug.cgi?id=4186#c32

Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
---
The patches for proxmox-backup need the pbs-api-types of patches 1 and
2, so the dependency has to be bumped once they are released.

 pbs-datastore/src/backup_info.rs | 18 ++++++-
 pbs-datastore/src/datastore.rs   | 15 +++++-
 pbs-datastore/src/manifest.rs    | 87 +++++++++++++++++++++++++++++++-
 3 files changed, 117 insertions(+), 3 deletions(-)

diff --git a/pbs-datastore/src/backup_info.rs b/pbs-datastore/src/backup_info.rs
index cce2b699f..ea9dc9a2a 100644
--- a/pbs-datastore/src/backup_info.rs
+++ b/pbs-datastore/src/backup_info.rs
@@ -17,7 +17,7 @@ use proxmox_systemd::escape_unit;
 
 use pbs_api_types::{
     ArchiveType, Authid, BACKUP_DATE_REGEX, BackupArchiveName, BackupGroupDeleteStats,
-    BackupNamespace, BackupType, GroupFilter, MANIFEST_BLOB_NAME, VerifyState,
+    BackupNamespace, BackupType, GroupFilter, MANIFEST_BLOB_NAME, SnapshotAttributes, VerifyState,
 };
 use pbs_config::{BackupLockGuard, open_backup_lockfile};
 
@@ -148,6 +148,22 @@ impl BackupGroup {
             .max_by_key(|item| item.backup_dir.backup_time()))
     }
 
+    /// Returns the attributes of the backup group
+    ///
+    /// These are the attributes of the newest finished snapshot which has some stored. Snapshots
+    /// without stored attributes are skipped, so a group keeps its attributes if a client did not
+    /// provide them for newer snapshots.
+    pub fn attributes(&self) -> Result<SnapshotAttributes, Error> {
+        let mut backups = self.list_backups()?;
+        BackupInfo::sort_list(&mut backups, false);
+
+        Ok(backups
+            .iter()
+            .filter(|info| info.is_finished())
+            .find_map(|info| info.backup_dir.load_manifest().ok()?.0.attributes())
+            .unwrap_or_default())
+    }
+
     pub fn last_successful_backup(&self) -> Result<Option<i64>, Error> {
         let mut last = None;
 
diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
index e6766a3b9..5b094a095 100644
--- a/pbs-datastore/src/datastore.rs
+++ b/pbs-datastore/src/datastore.rs
@@ -34,7 +34,7 @@ use pbs_api_types::{
     ArchiveType, Authid, BackupGroupDeleteStats, BackupNamespace, BackupType, ChunkOrder,
     DEFAULT_SNAPSHOT_TIME_SKEW_SECS, DataStoreConfig, DatastoreBackendConfig, DatastoreBackendType,
     GarbageCollectionCacheStats, GarbageCollectionStatus, MAX_NAMESPACE_DEPTH, MaintenanceMode,
-    MaintenanceType, Operation, S3Statistics, UPID,
+    MaintenanceType, Operation, S3Statistics, SnapshotAttributes, UPID,
 };
 use pbs_config::s3::S3_CFG_TYPE_ID;
 use pbs_config::{BackupLockGuard, ConfigVersionCache};
@@ -3458,6 +3458,19 @@ impl DataStore {
         Ok(())
     }
 
+    /// Set the attributes for the given snapshot, replacing the existing ones.
+    pub fn set_attributes(
+        self: &Arc<Self>,
+        attributes: SnapshotAttributes,
+        snapshot: BackupDir,
+    ) -> Result<(), Error> {
+        let backend = self.backend().context("failed to get backend")?;
+        snapshot
+            .update_manifest(&backend, |manifest| manifest.set_attributes(&attributes))
+            .map_err(|err| format_err!("unable to update manifest blob - {err}"))?;
+        Ok(())
+    }
+
     /// Renames a corrupt chunk, returning the new path if the chunk was renamed successfully.
     /// Returns with `Ok(None)` if the chunk source was not found.
     pub fn rename_corrupt_chunk(&self, digest: &[u8; 32]) -> Result<Option<PathBuf>, Error> {
diff --git a/pbs-datastore/src/manifest.rs b/pbs-datastore/src/manifest.rs
index 16f9668f2..61982d64a 100644
--- a/pbs-datastore/src/manifest.rs
+++ b/pbs-datastore/src/manifest.rs
@@ -9,7 +9,7 @@ use proxmox_sys::fs::{CreateOptions, replace_file};
 
 use pbs_api_types::{
     BackupArchiveName, BackupType, CLIENT_LOG_BLOB_NAME, CryptMode, Fingerprint,
-    MANIFEST_BLOB_NAME, SnapshotVerifyState,
+    MANIFEST_BLOB_NAME, SNAPSHOT_ATTRIBUTE_REGEX, SnapshotAttributes, SnapshotVerifyState,
 };
 use pbs_tools::crypt_config::CryptConfig;
 
@@ -273,6 +273,27 @@ impl BackupManifest {
         Ok(Some(serde_json::from_value::<SnapshotVerifyState>(verify)?))
     }
 
+    /// Get the attributes of the snapshot
+    ///
+    /// Returns `None` if no attributes were stored for the snapshot. The unprotected part of the
+    /// manifest can be provided by the client, so values with an invalid format are dropped and
+    /// attributes which are not a list of values for each key count as not stored.
+    pub fn attributes(&self) -> Option<SnapshotAttributes> {
+        let mut attributes =
+            SnapshotAttributes::deserialize(&self.unprotected["attributes"]).ok()?;
+
+        for (key, values) in attributes.iter_mut() {
+            values.retain(|value| SNAPSHOT_ATTRIBUTE_REGEX.is_match(&format!("{key}={value}")));
+        }
+
+        Some(attributes)
+    }
+
+    /// Set the attributes of the snapshot, replacing the existing ones
+    pub fn set_attributes(&mut self, attributes: &SnapshotAttributes) {
+        self.unprotected["attributes"] = json!(attributes);
+    }
+
     /// Set the sync-source-signature used to detect snapshot changes across encrypted/decrypted
     /// sync flows.
     ///
@@ -597,3 +618,67 @@ fn test_manifest_eq_ignoring_verify_state() -> Result<(), Error> {
 
     Ok(())
 }
+
+#[test]
+fn test_manifest_attributes() -> Result<(), Error> {
+    let crypt_config = CryptConfig::new([7; 32])?;
+    let mut manifest = BackupManifest::new("vm/100/2020-06-26T13:56:05Z".parse()?);
+    manifest.add_file(
+        &"drive-scsi0.img.fidx".try_into()?,
+        200,
+        [1; 32],
+        CryptMode::Encrypt,
+    )?;
+
+    // nothing stored yet
+    assert!(manifest.attributes().is_none());
+
+    let signature = manifest.signature(&crypt_config)?;
+
+    let mut attributes = SnapshotAttributes::new();
+    for (key, value) in [
+        ("pve-tag", "web"),
+        ("pve-tag", "prod"),
+        ("pve-pool", "customers/a"),
+    ] {
+        attributes
+            .entry(key.to_string())
+            .or_default()
+            .insert(value.to_string());
+    }
+    manifest.set_attributes(&attributes);
+
+    // not covered by the signature, so attributes can be set for encrypted backups
+    assert_eq!(manifest.signature(&crypt_config)?, signature);
+
+    // each value is a list element of its own, in a stable order
+    assert_eq!(
+        manifest.unprotected["attributes"],
+        json!({ "pve-pool": ["customers/a"], "pve-tag": ["prod", "web"] }),
+    );
+
+    let data = manifest.to_string(Some(&crypt_config))?;
+    let mut manifest = BackupManifest::from_data(data.as_bytes(), Some(&crypt_config), false)?;
+    assert_eq!(manifest.attributes(), Some(attributes));
+
+    // stored, but empty
+    manifest.set_attributes(&SnapshotAttributes::new());
+    assert_eq!(manifest.attributes(), Some(SnapshotAttributes::new()));
+
+    // data which does not come from the server
+    manifest.unprotected["attributes"] = json!("pve-tag=prod");
+    assert!(manifest.attributes().is_none());
+
+    manifest.unprotected["attributes"] = json!({ "pve-tag": "prod;web" });
+    assert!(manifest.attributes().is_none());
+
+    manifest.unprotected["attributes"] = json!({
+        "pve-tag": ["prod", "with space", "web;db"],
+        "Invalid Key": ["prod"],
+    });
+    let attributes = manifest.attributes().unwrap();
+    assert_eq!(attributes["pve-tag"].iter().collect::<Vec<_>>(), ["prod"]);
+    assert!(attributes["Invalid Key"].is_empty());
+
+    Ok(())
+}

base-commit: a7eb4e8a1477df960570fa72e9e7e2b8ac58bdab
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [RFC PATCH proxmox-backup 04/12] fix #7452: api: datastore: add endpoints for snapshot attributes
  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
                   ` (2 preceding siblings ...)
  2026-11-13  8:56 ` [RFC PATCH proxmox-backup 03/12] datastore: add attributes to backup snapshots Jakob-Tobias Winter
@ 2026-11-13  8:56 ` 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
                   ` (9 subsequent siblings)
  13 siblings, 1 reply; 25+ messages in thread
From: Jakob-Tobias Winter @ 2026-11-13  8:56 UTC (permalink / raw)
  To: pbs-devel; +Cc: Jakob-Tobias Winter

The attributes of a snapshot can be read and set next to its notes
and its protection flag, with the privileges required for the notes.
A client which may set the notes of its backups can therefore set
the attributes after a backup without further permissions.

Attributes are passed as a list of 'KEY=VALUE' entries, with one
entry for each value of a key. Setting them replaces all attributes
of the snapshot. An empty list is stored as well, so that a snapshot
without attributes can be told from one whose client never set any.

Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
---
 src/api2/admin/datastore.rs | 128 +++++++++++++++++++++++++++++++++++-
 1 file changed, 126 insertions(+), 2 deletions(-)

diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
index 3ba25934f..6b907da32 100644
--- a/src/api2/admin/datastore.rs
+++ b/src/api2/admin/datastore.rs
@@ -43,8 +43,9 @@ use pbs_api_types::{
     IGNORE_VERIFIED_BACKUPS_SCHEMA, JobScheduleStatus, KeepOptions, MAX_NAMESPACE_DEPTH,
     MaintenanceMode, MaintenanceType, NS_MAX_DEPTH_SCHEMA, Operation, PRIV_DATASTORE_AUDIT,
     PRIV_DATASTORE_BACKUP, PRIV_DATASTORE_MODIFY, PRIV_DATASTORE_PRUNE, PRIV_DATASTORE_READ,
-    PRIV_DATASTORE_VERIFY, PRIV_SYS_MODIFY, PruneJobOptions, SnapshotListItem, SyncJobConfig, UPID,
-    UPID_SCHEMA, VERIFICATION_OUTDATED_AFTER_SCHEMA, VERIFY_JOB_READ_THREADS_SCHEMA,
+    PRIV_DATASTORE_VERIFY, PRIV_SYS_MODIFY, PruneJobOptions, SNAPSHOT_ATTRIBUTE_LIST_SCHEMA,
+    SnapshotAttributes, SnapshotListItem, SyncJobConfig, UPID, UPID_SCHEMA,
+    VERIFICATION_OUTDATED_AFTER_SCHEMA, VERIFY_JOB_READ_THREADS_SCHEMA,
     VERIFY_JOB_VERIFY_THREADS_SCHEMA, print_ns_and_snapshot, print_store_and_ns,
 };
 use pbs_client::pxar::{create_tar, create_zip};
@@ -2223,6 +2224,123 @@ pub fn set_notes(
     Ok(())
 }
 
+#[api(
+    input: {
+        properties: {
+            store: { schema: DATASTORE_SCHEMA },
+            ns: {
+                type: BackupNamespace,
+                optional: true,
+            },
+            backup_dir: {
+                type: pbs_api_types::BackupDir,
+                flatten: true,
+            },
+        },
+    },
+    returns: {
+        schema: SNAPSHOT_ATTRIBUTE_LIST_SCHEMA,
+    },
+    access: {
+        permission: &Permission::Anybody,
+        description: "Requires on /datastore/{store}[/{namespace}] either DATASTORE_AUDIT for any \
+            or DATASTORE_BACKUP and being the owner of the group",
+    },
+)]
+/// Get the attributes of a specific backup
+pub fn get_attributes(
+    store: String,
+    ns: Option<BackupNamespace>,
+    backup_dir: pbs_api_types::BackupDir,
+    rpcenv: &mut dyn RpcEnvironment,
+) -> Result<Vec<String>, Error> {
+    let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
+    let ns = ns.unwrap_or_default();
+
+    let datastore = check_privs_and_load_store(
+        &store,
+        &ns,
+        &auth_id,
+        PRIV_DATASTORE_AUDIT,
+        PRIV_DATASTORE_BACKUP,
+        Operation::Read,
+        &backup_dir.group,
+    )?;
+
+    let backup_dir = datastore.backup_dir(ns, backup_dir)?;
+
+    let (manifest, _) = backup_dir.load_manifest()?;
+
+    let attributes = manifest.attributes().unwrap_or_default();
+
+    Ok(attributes
+        .iter()
+        .flat_map(|(key, values)| values.iter().map(move |value| format!("{key}={value}")))
+        .collect())
+}
+
+#[api(
+    input: {
+        properties: {
+            store: { schema: DATASTORE_SCHEMA },
+            ns: {
+                type: BackupNamespace,
+                optional: true,
+            },
+            backup_dir: {
+                type: pbs_api_types::BackupDir,
+                flatten: true,
+            },
+            attributes: {
+                schema: SNAPSHOT_ATTRIBUTE_LIST_SCHEMA,
+                optional: true,
+            },
+        },
+    },
+    access: {
+        permission: &Permission::Anybody,
+        description: "Requires on /datastore/{store}[/{namespace}] either DATASTORE_MODIFY for any \
+            or DATASTORE_BACKUP and being the owner of the group",
+    },
+)]
+/// Set the attributes of a specific backup, replacing the existing ones
+pub fn set_attributes(
+    store: String,
+    ns: Option<BackupNamespace>,
+    backup_dir: pbs_api_types::BackupDir,
+    attributes: Option<Vec<String>>,
+    rpcenv: &mut dyn RpcEnvironment,
+) -> Result<(), Error> {
+    let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
+    let ns = ns.unwrap_or_default();
+
+    let datastore = check_privs_and_load_store(
+        &store,
+        &ns,
+        &auth_id,
+        PRIV_DATASTORE_MODIFY,
+        PRIV_DATASTORE_BACKUP,
+        Operation::Write,
+        &backup_dir.group,
+    )?;
+
+    let mut attribute_map = SnapshotAttributes::new();
+    for attribute in attributes.unwrap_or_default() {
+        // the format is ensured by the schema
+        if let Some((key, value)) = attribute.split_once('=') {
+            attribute_map
+                .entry(key.to_string())
+                .or_default()
+                .insert(value.to_string());
+        }
+    }
+
+    let backup_dir = datastore.backup_dir(ns, backup_dir)?;
+    datastore.set_attributes(attribute_map, backup_dir)?;
+
+    Ok(())
+}
+
 #[api(
     input: {
         properties: {
@@ -2930,6 +3048,12 @@ const DATASTORE_INFO_SUBDIRS: SubdirMap = &[
         "active-operations",
         &Router::new().get(&API_METHOD_GET_ACTIVE_OPERATIONS),
     ),
+    (
+        "attributes",
+        &Router::new()
+            .get(&API_METHOD_GET_ATTRIBUTES)
+            .put(&API_METHOD_SET_ATTRIBUTES),
+    ),
     ("catalog", &Router::new().get(&API_METHOD_CATALOG)),
     (
         "change-owner",
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [RFC PATCH proxmox-backup 05/12] tape: backup job: allow selecting groups by snapshot attributes
  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
                   ` (3 preceding siblings ...)
  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-13  8:56 ` Jakob-Tobias Winter
  2026-11-18 13:06   ` Samuel Rufinatscha
  2026-11-13  8:56 ` [RFC PATCH proxmox-backup 06/12] ui: tape backup job: add attribute filter Jakob-Tobias Winter
                   ` (8 subsequent siblings)
  13 siblings, 1 reply; 25+ messages in thread
From: Jakob-Tobias Winter @ 2026-11-13  8:56 UTC (permalink / raw)
  To: pbs-devel; +Cc: Jakob-Tobias Winter

Tape backup jobs can only select backup groups by type and ID so
far. Such filters have to be kept up to date by hand for every new
guest, and an ID says nothing about how important a guest is.

Add an attribute filter to tape backup jobs. With a client which
stores the tags of a guest as snapshot attributes, production and
test guests can be written to different media pools with different
retention policies, by using one job for each media pool. The media
sets of the production guests then need fewer tapes and are faster
to restore.

A group is included if it has one of the attributes given as include
filter, or if there are no include filters, and none of the
attributes given as exclude filter. The filter is applied in
addition to the group filter.

Jobs without an attribute filter select the same groups as before.

Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
---
A version without this patch cannot parse a tape-job.cfg in which the
new option is used (unknown property 'attribute-filter').

 src/api2/config/tape_backup_job.rs |  8 ++++++++
 src/api2/tape/backup.rs            | 19 ++++++++++++++++---
 src/bin/proxmox-tape.rs            | 11 ++++++++---
 3 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/src/api2/config/tape_backup_job.rs b/src/api2/config/tape_backup_job.rs
index 4bfc7f871..cb9e63ea6 100644
--- a/src/api2/config/tape_backup_job.rs
+++ b/src/api2/config/tape_backup_job.rs
@@ -144,6 +144,8 @@ pub enum DeletableProperty {
     NotificationMode,
     /// Delete the 'group_filter' property
     GroupFilter,
+    /// Delete the 'attribute-filter' property
+    AttributeFilter,
     /// Delete the 'max-depth' property
     MaxDepth,
     /// Delete the 'ns' property
@@ -227,6 +229,9 @@ pub fn update_tape_backup_job(
                 DeletableProperty::GroupFilter => {
                     data.setup.group_filter = None;
                 }
+                DeletableProperty::AttributeFilter => {
+                    data.setup.attribute_filter = None;
+                }
                 DeletableProperty::MaxDepth => {
                     data.setup.max_depth = None;
                 }
@@ -268,6 +273,9 @@ pub fn update_tape_backup_job(
     if update.setup.group_filter.is_some() {
         data.setup.group_filter = update.setup.group_filter;
     }
+    if update.setup.attribute_filter.is_some() {
+        data.setup.attribute_filter = update.setup.attribute_filter;
+    }
     if update.setup.ns.is_some() {
         data.setup.ns = update.setup.ns;
     }
diff --git a/src/api2/tape/backup.rs b/src/api2/tape/backup.rs
index c0a4ca65b..c2797a97a 100644
--- a/src/api2/tape/backup.rs
+++ b/src/api2/tape/backup.rs
@@ -11,9 +11,9 @@ use proxmox_schema::api;
 use proxmox_worker_task::WorkerTaskContext;
 
 use pbs_api_types::{
-    Authid, JOB_ID_SCHEMA, MediaPoolConfig, Operation, PRIV_TAPE_AUDIT, TapeBackupJobConfig,
-    TapeBackupJobSetup, TapeBackupJobStatus, UPID_SCHEMA, print_ns_and_snapshot,
-    print_store_and_ns,
+    AttributeFilter, Authid, JOB_ID_SCHEMA, MediaPoolConfig, Operation, PRIV_TAPE_AUDIT,
+    TapeBackupJobConfig, TapeBackupJobSetup, TapeBackupJobStatus, UPID_SCHEMA,
+    print_ns_and_snapshot, print_store_and_ns,
 };
 
 use pbs_config::CachedUserInfo;
@@ -391,6 +391,19 @@ fn backup_worker(
         None => group_list,
     };
 
+    let group_list = match &setup.attribute_filter {
+        Some(filters) => {
+            let mut filtered = Vec::new();
+            for group in group_list {
+                if AttributeFilter::apply_filters(filters, &group.attributes()?) {
+                    filtered.push(group);
+                }
+            }
+            filtered
+        }
+        None => group_list,
+    };
+
     info!(
         "found {} groups (out of {group_count_full} total)",
         group_list.len()
diff --git a/src/bin/proxmox-tape.rs b/src/bin/proxmox-tape.rs
index dcbf2d0fb..6ea46b709 100644
--- a/src/bin/proxmox-tape.rs
+++ b/src/bin/proxmox-tape.rs
@@ -19,9 +19,10 @@ use pbs_config::drive::complete_drive_name;
 use pbs_config::media_pool::complete_pool_name;
 
 use pbs_api_types::{
-    Authid, BackupNamespace, DATASTORE_MAP_LIST_SCHEMA, DATASTORE_SCHEMA, DRIVE_NAME_SCHEMA,
-    GROUP_FILTER_LIST_SCHEMA, GroupListItem, MEDIA_LABEL_SCHEMA, MEDIA_POOL_NAME_SCHEMA,
-    NS_MAX_DEPTH_SCHEMA, TAPE_RESTORE_NAMESPACE_SCHEMA, TAPE_RESTORE_SNAPSHOT_SCHEMA, Userid,
+    ATTRIBUTE_FILTER_LIST_SCHEMA, Authid, BackupNamespace, DATASTORE_MAP_LIST_SCHEMA,
+    DATASTORE_SCHEMA, DRIVE_NAME_SCHEMA, GROUP_FILTER_LIST_SCHEMA, GroupListItem,
+    MEDIA_LABEL_SCHEMA, MEDIA_POOL_NAME_SCHEMA, NS_MAX_DEPTH_SCHEMA, TAPE_RESTORE_NAMESPACE_SCHEMA,
+    TAPE_RESTORE_SNAPSHOT_SCHEMA, Userid,
 };
 use pbs_tape::{BlockReadError, MediaContentHeader, PROXMOX_BACKUP_CONTENT_HEADER_MAGIC_1_0};
 
@@ -850,6 +851,10 @@ async fn clean_drive(mut param: Value) -> Result<(), Error> {
                 schema: GROUP_FILTER_LIST_SCHEMA,
                 optional: true,
             },
+            "attribute-filter": {
+                schema: ATTRIBUTE_FILTER_LIST_SCHEMA,
+                optional: true,
+            },
             ns: {
                 type: BackupNamespace,
                 optional: true,
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [RFC PATCH proxmox-backup 06/12] ui: tape backup job: add attribute filter
  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
                   ` (4 preceding siblings ...)
  2026-11-13  8:56 ` [RFC PATCH proxmox-backup 05/12] tape: backup job: allow selecting groups by " Jakob-Tobias Winter
@ 2026-11-13  8:56 ` 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
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 25+ messages in thread
From: Jakob-Tobias Winter @ 2026-11-13  8:56 UTC (permalink / raw)
  To: pbs-devel; +Cc: Jakob-Tobias Winter

Allow editing the attribute filter of a job in its group filter tab,
as a list of filters in a text field, and show it in the job
overview next to the group filter.

The group filter and the attribute filter can both ask for their
option to be removed when a job is saved. Collect these requests,
instead of letting the group filter overwrite the other ones.

Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
---
 www/tape/BackupJobs.js           |  7 +++++++
 www/tape/window/TapeBackupJob.js | 27 ++++++++++++++++++++++++++-
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/www/tape/BackupJobs.js b/www/tape/BackupJobs.js
index 68d808af5..fb79685c7 100644
--- a/www/tape/BackupJobs.js
+++ b/www/tape/BackupJobs.js
@@ -9,6 +9,7 @@ Ext.define('pbs-tape-backup-job-status', {
         'schedule',
         'comment',
         'group-filter',
+        'attribute-filter',
         { name: 'eject-media', type: 'boolean' },
         { name: 'export-media-set', type: 'boolean' },
         { name: 'latest-only', type: 'boolean' },
@@ -252,6 +253,12 @@ Ext.define('PBS.config.TapeBackupJobView', {
             renderer: (v) => (v ? Ext.String.htmlEncode(v) : gettext('All')),
             width: 80,
         },
+        {
+            header: gettext('Attribute Filter'),
+            dataIndex: 'attribute-filter',
+            renderer: (v) => (v ? Ext.String.htmlEncode(v) : gettext('All')),
+            width: 80,
+        },
         {
             header: gettext('Schedule'),
             dataIndex: 'schedule',
diff --git a/www/tape/window/TapeBackupJob.js b/www/tape/window/TapeBackupJob.js
index ad03b6076..83fd736a1 100644
--- a/www/tape/window/TapeBackupJob.js
+++ b/www/tape/window/TapeBackupJob.js
@@ -200,7 +200,7 @@ Ext.define('PBS.TapeManagement.BackupJobEdit', {
                         values['group-filter'].length === 0
                     ) {
                         delete values['group-filter'];
-                        values.delete = 'group-filter';
+                        Proxmox.Utils.assemble_field_data(values, { delete: 'group-filter' });
                     }
                     if (this.isCreate) {
                         delete values.delete;
@@ -216,6 +216,31 @@ Ext.define('PBS.TapeManagement.BackupJobEdit', {
                         xtype: 'pbsGroupFilter',
                         name: 'group-filter',
                     },
+                    {
+                        xtype: 'proxmoxtextfield',
+                        name: 'attribute-filter',
+                        fieldLabel: gettext('Attribute Filter'),
+                        emptyText: gettext('All'),
+                        anchor: '100%',
+                        margin: '10 0 0 0',
+                        autoEl: {
+                            tag: 'div',
+                            'data-qtip': gettext(
+                                "Select groups by 'KEY=VALUE', skip them with 'exclude:KEY=VALUE'.",
+                            ),
+                        },
+                        cbind: {
+                            deleteEmpty: '{!isCreate}',
+                        },
+                        valueToRaw: (value) =>
+                            Ext.isArray(value) ? value.join(', ') : (value ?? ''),
+                        getSubmitValue: function () {
+                            let filters = this.getRawValue()
+                                .split(/[\s,;]+/)
+                                .filter((filter) => filter !== '');
+                            return filters.length > 0 ? filters : null;
+                        },
+                    },
                 ],
             },
             {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [RFC PATCH proxmox-backup 07/12] docs: describe snapshot attributes and the tape job attribute filter
  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
                   ` (5 preceding siblings ...)
  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 ` 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
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 25+ messages in thread
From: Jakob-Tobias Winter @ 2026-11-13  8:56 UTC (permalink / raw)
  To: pbs-devel; +Cc: Jakob-Tobias Winter

Explain what snapshot attributes are, where they are stored and who
can read them, which attributes Proxmox VE sets, and how to select
backup groups by them in a tape backup job.

Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
---
 docs/pve-integration.rst | 23 +++++++++++++++++++++++
 docs/tape-backup.rst     | 27 +++++++++++++++++++++++++++
 docs/terminology.rst     | 33 +++++++++++++++++++++++++++++++++
 3 files changed, 83 insertions(+)

diff --git a/docs/pve-integration.rst b/docs/pve-integration.rst
index e3a91af39..860a34f4e 100644
--- a/docs/pve-integration.rst
+++ b/docs/pve-integration.rst
@@ -67,3 +67,26 @@ device within the environment (see `Proxmox VE Admin Guide: Backup and Restore
 <https://pve.proxmox.com/pve-docs/pve-admin-guide.html#chapter_vzdump>`_.
 
 
+.. _pve_snapshot_attributes:
+
+Guest Tags and Resource Pool
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+When `Proxmox VE`_ backs up a guest, it stores the tags and the resource pool
+of the guest as :ref:`attributes <term_snapshot_attributes>` of the new backup
+snapshot:
+
+* ``pve-tag`` has one value for each tag of the guest.
+* ``pve-pool`` has the resource pool of the guest as its value. For a guest in
+  a nested pool, each parent pool is a value as well: a guest in the pool
+  ``customers/acme`` has the values ``customers/acme`` and ``customers``.
+
+The backup server does not interpret these attributes, but they can be used to
+select backups. For example, a :ref:`tape backup job <tape_backup_job_config>`
+can write the guests tagged ``prod`` to another media pool than the remaining
+guests. Selecting by a pool also covers the guests of the pools nested in it.
+
+.. note:: The attributes are stored unencrypted, also for encrypted backups. If
+   the tags and the resource pool of the guests should not be known to the
+   backup server, disable the ``pbs-snapshot-attributes`` option of the backup
+   jobs in Proxmox VE.
diff --git a/docs/tape-backup.rst b/docs/tape-backup.rst
index a22606909..8ac459235 100644
--- a/docs/tape-backup.rst
+++ b/docs/tape-backup.rst
@@ -742,6 +742,33 @@ backup. You can specify a single namespace with ``ns`` and a depth with
 
 If no `max-depth` is given, it will include all recursive namespaces.
 
+Backup groups can be selected by their :ref:`attributes
+<term_snapshot_attributes>` with the ``attribute-filter`` option. For example,
+to only include the guests which have the tag ``prod`` in Proxmox VE:
+
+.. code-block:: console
+
+ # proxmox-tape backup-job update job2 --attribute-filter pve-tag=prod
+
+A filter matches a group if its value is one of the values the group has for
+the key. With several filters, a group is included if at least one of them
+matches. Prepend ``exclude:`` to a filter to skip the groups it matches. For
+example, to include all guests which are neither tagged ``prod`` nor ``test``:
+
+.. code-block:: console
+
+ # proxmox-tape backup-job update job3 --attribute-filter exclude:pve-tag=prod \
+   --attribute-filter exclude:pve-tag=test
+
+This allows writing guests to different media pools, depending on their tags or
+their resource pool, by using one job for each media pool.
+
+The attributes of a group are those of its newest snapshot which has
+attributes. A newer snapshot without attributes, for example from a client
+which does not set them, does not change them. A group which never got
+attributes is only included by jobs without a filter or with exclude filters
+only.
+
 .. image:: images/screenshots/pbs-gui-tape-backup-jobs-add.png
   :target: _images/pbs-gui-tape-backup-jobs-add.png
   :align: right
diff --git a/docs/terminology.rst b/docs/terminology.rst
index 7ba8910cf..dcac79b31 100644
--- a/docs/terminology.rst
+++ b/docs/terminology.rst
@@ -130,3 +130,36 @@ As you can see, the time format is RFC3339_ with Coordinated
 Universal Time (UTC_, identified by the trailing *Z*).
 
 
+.. _term_snapshot_attributes:
+
+Snapshot Attributes
+-------------------
+
+A backup snapshot can have attributes. They carry information about the source
+of a backup, which the backup server cannot know on its own, and can be used to
+select backups, for example in a :ref:`tape backup job
+<tape_backup_job_config>`. An attribute is a key with a list of values.
+
+.. code-block:: console
+   :caption: Snapshot Attribute Examples
+
+    pve-tag=prod
+    pve-tag=web
+    pve-pool=customer1
+
+In this example, the key ``pve-tag`` has the values ``prod`` and ``web``. Each
+value is stored on its own, a list of values is never joined into one string.
+
+A key consists of up to 32 lowercase letters, digits and ``-`` and starts with
+a letter. A value consists of up to 128 letters, digits and the characters
+``.``, ``_``, ``+``, ``/`` and ``-``.
+
+The attributes of a snapshot are set by the client after the backup has
+finished. Setting them replaces all attributes the snapshot had before. They
+are stored in the unprotected part of the manifest, so they are neither signed
+nor encrypted. Everyone who is allowed to see a snapshot can read its
+attributes, also if the backup itself is encrypted. They are kept when a
+snapshot is synced to another datastore or written to tape.
+
+`Proxmox VE`_ uses attributes to store the tags and the resource pool of a
+guest, see :ref:`pve_snapshot_attributes`.
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [RFC PATCH storage 08/12] pbs: add helper to set the attributes of a backup snapshot
  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
                   ` (6 preceding siblings ...)
  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 ` Jakob-Tobias Winter
  2026-11-13  8:56 ` [RFC PATCH guest-common 09/12] vzdump: add pbs-snapshot-attributes option Jakob-Tobias Winter
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 25+ messages in thread
From: Jakob-Tobias Winter @ 2026-11-13  8:56 UTC (permalink / raw)
  To: pbs-devel; +Cc: Jakob-Tobias Winter

Proxmox Backup Server can store attributes for a backup snapshot,
keys with a list of values, for information about the source of a
backup which the server cannot know on its own.

Add a helper to set them, so that vzdump can store the tags and the
resource pool of a guest with its backups. It talks to the API of
the server directly, like the code for the protection flag, to not
depend on the version of the installed backup client.

A server which does not support snapshot attributes yet is not an
error. The helper tells the caller instead, so that backups to older
servers keep working without warnings.

The attributes are specific to Proxmox Backup Server, so this is not
made part of the storage plugin API.

Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
---
 src/PVE/Storage/PBSPlugin.pm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/PVE/Storage/PBSPlugin.pm b/src/PVE/Storage/PBSPlugin.pm
index 6adafa3..107b13d 100644
--- a/src/PVE/Storage/PBSPlugin.pm
+++ b/src/PVE/Storage/PBSPlugin.pm
@@ -959,6 +959,29 @@ sub update_volume_attribute {
     die "attribute '$attribute' is not supported for storage type '$scfg->{type}'\n";
 }
 
+# Replace the attributes of a backup snapshot on the Proxmox Backup Server.
+#
+# Expects a list of 'KEY=VALUE' strings, a key with several values is passed once for each value.
+# Returns false if the server is not recent enough to support snapshot attributes.
+sub update_snapshot_attributes {
+    my ($class, $scfg, $storeid, $volname, $attributes) = @_;
+
+    my $param = api_param_from_volname($class, $scfg, $volname);
+    $param->{attributes} = $attributes;
+
+    my $password = pbs_get_password($scfg, $storeid);
+    my $conn = pbs_api_connect($scfg, $password);
+    my $datastore = $scfg->{datastore};
+
+    eval { $conn->put("/api2/json/admin/datastore/$datastore/attributes", $param); };
+    if (my $err = $@) {
+        return 0 if ref($err) && $err->{code} == 404; # not supported
+        die $err;
+    }
+
+    return 1;
+}
+
 sub volume_size_info {
     my ($class, $scfg, $storeid, $volname, $timeout) = @_;
 

base-commit: 50bbabb4d6cec50d5b049f0b7a49f1a87dbdc30e
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [RFC PATCH guest-common 09/12] vzdump: add pbs-snapshot-attributes option
  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
                   ` (7 preceding siblings ...)
  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 ` 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
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 25+ messages in thread
From: Jakob-Tobias Winter @ 2026-11-13  8:56 UTC (permalink / raw)
  To: pbs-devel; +Cc: Jakob-Tobias Winter

Backups to a Proxmox Backup Server will store the tags and the
resource pool of a guest as attributes of the backup snapshot, so
that the server can select backups by them, for example in tape
backup jobs.

The attributes are stored unencrypted, also for encrypted backups,
and everyone with access to the backup snapshot on the server can
read them. Tags and pool names can reveal more about a setup than
its admin wants the backup server to know, so add an option to turn
this off. It can be set for single jobs and, as default for all
backups of a node, in /etc/vzdump.conf.

The option is enabled by default, so that selecting backups by tag
works without changing every job.

Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
---
 src/PVE/VZDump/Common.pm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/PVE/VZDump/Common.pm b/src/PVE/VZDump/Common.pm
index 2cb48a3..7a87c45 100644
--- a/src/PVE/VZDump/Common.pm
+++ b/src/PVE/VZDump/Common.pm
@@ -384,6 +384,14 @@ my $confdesc = {
         optional => 1,
         enum => ['legacy', 'data', 'metadata'],
     },
+    'pbs-snapshot-attributes' => {
+        type => 'boolean',
+        description => "Store the tags and the resource pool of the guest as attributes of the"
+            . " backup snapshot on a Proxmox Backup Server. The attributes are not encrypted and"
+            . " can be read by everyone with access to the backup snapshot.",
+        optional => 1,
+        default => 1,
+    },
 };
 
 sub get_confdesc {

base-commit: 3d32b926e7664f095611d7192944926ebdd5ca14
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [RFC PATCH manager 10/12] vzdump: store guest tags and pool as snapshot attributes on PBS
  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
                   ` (8 preceding siblings ...)
  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 ` 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
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 25+ messages in thread
From: Jakob-Tobias Winter @ 2026-11-13  8:56 UTC (permalink / raw)
  To: pbs-devel; +Cc: Jakob-Tobias Winter

A Proxmox Backup Server only knows the type and the ID of a guest,
so its jobs cannot select backups by what guests are organized with
in Proxmox VE: tags and resource pools.

After a backup to a Proxmox Backup Server, store the tags and the
resource pool of the guest as attributes of the new snapshot. A tape
backup job on the server can then, for example, write the guests
tagged as production to another media pool than the test guests.

The keys 'pve-tag' and 'pve-pool' are prefixed as suggested in [0],
to tell them from attributes set by others. There is one 'pve-tag'
value for each tag, tags are never joined into one value.

A guest in a nested pool gets a 'pve-pool' value for that pool and
for each of its parent pools. That way a filter for a pool on the
server also matches the guests of the pools nested in it, without
naming each of them.

Like for the notes, a failure is only logged as warning. A server
which does not support attributes yet only causes a note in the log,
so backups to older servers are not affected. The attributes are
also set for guests without tags and pool, so the server can tell
them from guests which were backed up without this feature.

This can be disabled with the pbs-snapshot-attributes option, as the
attributes are stored unencrypted.

[0] https://bugzilla.proxmox.com/show_bug.cgi?id=4186#c32

Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
---
Needs versioned dependency bumps for libpve-storage-perl (patch 8) and
libpve-guest-common-perl (patch 9). Without the helper of patch 8 each
backup to a PBS storage would log a warning, without the option of
patch 9 no attributes are set.

 PVE/VZDump.pm       | 42 ++++++++++++++++++++++++++++++++++++++++++
 configs/vzdump.conf |  1 +
 2 files changed, 43 insertions(+)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 56d2aea3..aa337dc9 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -16,6 +16,7 @@ use Time::Local;
 use PVE::Cluster qw(cfs_read_file);
 use PVE::DataCenterConfig;
 use PVE::Exception qw(raise_param_exc);
+use PVE::GuestHelpers;
 use PVE::HA::Config;
 use PVE::HA::Env::PVE2;
 use PVE::JSONSchema qw(get_standard_option);
@@ -144,6 +145,31 @@ my $generate_notes = sub {
     return $notes_template;
 };
 
+# Returns the tags and the resource pool of a guest as list of snapshot attributes for a Proxmox
+# Backup Server. Each attribute is a 'KEY=VALUE' string, so there is one entry for each tag, and
+# for a guest in a nested pool one entry for that pool and for each of its parent pools.
+my $get_snapshot_attributes = sub {
+    my ($vmid) = @_;
+
+    my $attributes = [];
+
+    my $props = PVE::Cluster::get_guest_config_properties(['tags'], $vmid);
+    my $tags = PVE::GuestHelpers::get_unique_tags($props->{$vmid}->{tags}, 1);
+    for my $tag ($tags->@*) {
+        push $attributes->@*, "pve-tag=$tag"
+            if defined(PVE::JSONSchema::pve_verify_tag($tag, 1));
+    }
+
+    my $usercfg = cfs_read_file('user.cfg');
+    my $pool = $usercfg->{vms}->{$vmid};
+    while (defined($pool)) {
+        push $attributes->@*, "pve-pool=$pool";
+        ($pool) = $pool =~ m!^(.+)/[^/]+$!; # continue with the parent of a nested pool
+    }
+
+    return $attributes;
+};
+
 sub parse_fleecing {
     my ($param) = @_;
 
@@ -1237,6 +1263,22 @@ sub exec_backup_task {
                 }
             }
 
+            if ($opts->{pbs} && $opts->{'pbs-snapshot-attributes'}) {
+                debugmsg('info', "adding tags and pool as snapshot attributes", $logfd);
+                eval {
+                    my $attributes = $get_snapshot_attributes->($vmid);
+                    my $supported = PVE::Storage::PBSPlugin->update_snapshot_attributes(
+                        $opts->{scfg}, $storeid, "backup/$volname", $attributes,
+                    );
+                    debugmsg(
+                        'info',
+                        "snapshot attributes are not supported by the server",
+                        $logfd,
+                    ) if !$supported;
+                };
+                debugmsg('warn', "unable to add snapshot attributes - $@", $logfd) if $@;
+            }
+
             if ($opts->{protected}) {
                 debugmsg('info', "marking backup as protected", $logfd);
                 eval { PVE::Storage::update_volume_attribute($cfg, $volid, 'protected', 1) };
diff --git a/configs/vzdump.conf b/configs/vzdump.conf
index 1835e208..7573878f 100644
--- a/configs/vzdump.conf
+++ b/configs/vzdump.conf
@@ -17,4 +17,5 @@
 #pigz: N
 #notes-template: {{guestname}}
 #pbs-change-detection-mode: legacy|data|metadata
+#pbs-snapshot-attributes: BOOLEAN
 #fleecing: enabled=BOOLEAN,storage=STORAGE_ID

base-commit: 59c704fe844ad8027a46551ae58a3082f837db15
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [RFC PATCH manager 11/12] ui: backup job: add selector for PBS snapshot attributes
  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
                   ` (9 preceding siblings ...)
  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 ` Jakob-Tobias Winter
  2026-11-13  8:56 ` [RFC PATCH docs 12/12] vzdump: describe snapshot attributes on Proxmox Backup Server Jakob-Tobias Winter
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 25+ messages in thread
From: Jakob-Tobias Winter @ 2026-11-13  8:56 UTC (permalink / raw)
  To: pbs-devel; +Cc: Jakob-Tobias Winter

Allow turning the snapshot attributes off for a job in its advanced
options. Like for the other options there, the default leaves the
decision to the node-specific vzdump.conf and the schema default.

Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
---
 www/manager6/panel/BackupAdvancedOptions.js | 22 +++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/www/manager6/panel/BackupAdvancedOptions.js b/www/manager6/panel/BackupAdvancedOptions.js
index fe8cc3bf..0794fca4 100644
--- a/www/manager6/panel/BackupAdvancedOptions.js
+++ b/www/manager6/panel/BackupAdvancedOptions.js
@@ -295,6 +295,28 @@ Ext.define('PVE.panel.BackupAdvancedOptions', {
                 ),
             },
         },
+        {
+            xtype: 'pveTwoColumnContainer',
+            startColumn: {
+                xtype: 'proxmoxKVComboBox',
+                fieldLabel: gettext('PBS snapshot attributes'),
+                name: 'pbs-snapshot-attributes',
+                deleteEmpty: true,
+                value: '__default__',
+                comboItems: [
+                    ['__default__', Proxmox.Utils.defaultText],
+                    [1, Proxmox.Utils.yesText],
+                    [0, Proxmox.Utils.noText],
+                ],
+            },
+            endFlex: 2,
+            endColumn: {
+                xtype: 'displayfield',
+                value: gettext(
+                    'Store guest tags and resource pool with backups on PBS (unencrypted).',
+                ),
+            },
+        },
         {
             xtype: 'component',
             padding: '5 1',
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [RFC PATCH docs 12/12] vzdump: describe snapshot attributes on Proxmox Backup Server
  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
                   ` (10 preceding siblings ...)
  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 ` 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 14:22 ` Samuel Rufinatscha
  13 siblings, 0 replies; 25+ messages in thread
From: Jakob-Tobias Winter @ 2026-11-13  8:56 UTC (permalink / raw)
  To: pbs-devel; +Cc: Jakob-Tobias Winter

Explain which attributes are stored with a backup on a Proxmox
Backup Server, what they can be used for, that they are not
encrypted and how to disable them.

Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
---

 vzdump.adoc | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/vzdump.adoc b/vzdump.adoc
index 44db027..25ace9e 100644
--- a/vzdump.adoc
+++ b/vzdump.adoc
@@ -450,6 +450,42 @@ Currently supported are:
 When specified via API or CLI, it needs to be a single line, where newline and
 backslash need to be escaped as literal `\n` and `\\` respectively.
 
+[[vzdump_pbs_snapshot_attributes]]
+Snapshot Attributes on Proxmox Backup Server
+--------------------------------------------
+
+When a guest is backed up to a Proxmox Backup Server, its tags and its resource
+pool are stored as attributes of the backup snapshot:
+
+* `pve-tag` has one value for each tag of the guest
+* `pve-pool` has the resource pool of the guest as its value, and for a nested
+  pool also each of its parent pools
+
+For example, a guest in the pool `customers/acme` gets the `pve-pool` values
+`customers/acme` and `customers`.
+
+The attributes describe the guest at the time of the backup. On the Proxmox
+Backup Server they can be used to select backups, for example to write the
+backups of all guests with a certain tag to a separate tape media pool.
+Selecting by a pool also covers the guests of the pools nested in it.
+
+NOTE: The attributes are not encrypted, also if the backup itself is encrypted.
+Everyone who can see the backup snapshot on the Proxmox Backup Server can read
+them, and they are part of synced copies and tape backups of the snapshot.
+
+If the tags and the resource pool should not be known to the backup server,
+disable the `pbs-snapshot-attributes` option. This can be done for single backup
+jobs, or for all backups created on a node, by adding the following line to
+`/etc/vzdump.conf`:
+
+----
+pbs-snapshot-attributes: 0
+----
+
+Attributes can only be stored if the Proxmox Backup Server supports them. With
+older versions the backup works as before, and the backup log notes that the
+attributes were not stored.
+
 [[vzdump_restore]]
 Restore
 -------

base-commit: 3f9fbc189be60dc64c1213191cafee3fffa30981
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [RFC PATCH many 00/12] snapshot attributes for tags and pools of PVE guests, tape job filter
  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
                   ` (11 preceding siblings ...)
  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 ` Christian Ebner
  2026-11-18 13:07   ` Samuel Rufinatscha
  2026-11-18 14:22 ` Samuel Rufinatscha
  13 siblings, 1 reply; 25+ messages in thread
From: Christian Ebner @ 2026-11-16 14:57 UTC (permalink / raw)
  To: Jakob-Tobias Winter, pbs-devel

Thanks for the patches, I took a first look and think the overall 
approach does look fine, left a few comments on the individual patches.

CC'ing Samuel since he started looking into snapshot attributes recently 
and might have other/additional comments and suggestions.

On 11/13/26 10:07 AM, Jakob-Tobias Winter wrote:
> Tape backup jobs on a Proxmox Backup Server select backup groups by
> type and ID only. Splitting guests over media pools by what they are,
> say production and test guests with different retention, means keeping
> lists of IDs up to date by hand in every job. In Proxmox VE the same
> guests are already organized with tags and resource pools, but the
> backup server knows about neither.
> 
> This series lets Proxmox VE store the tags and the resource pool of a
> guest with each backup, as attributes of the snapshot, and adds a
> filter on such attributes to tape backup jobs:
> 
>    # proxmox-tape backup-job create prod --store store1 --drive lto1 \
>        --pool prod --attribute-filter pve-tag=prod
>    # proxmox-tape backup-job create rest --store store1 --drive lto1 \
>        --pool rest --attribute-filter exclude:pve-tag=prod
> 
> It is an RFC, as it defines a format and names that others would have
> to live with, and because [1] is assigned already. If there is work in
> progress for it, I am happy to adapt this series to it or to drop
> whatever overlaps.
> 
> Proxmox Backup Server
> ---------------------
> 
> proxmox 1-2, proxmox-backup 3-7
> 
> Snapshots get attributes, a map from a key to a list of values. They
> are kept in the unprotected part of the manifest, as suggested in [0],
> so they can be set for encrypted backups without touching the
> signature, and they stay with a snapshot that is synced or written to
> tape. A guest with several tags gets one value per tag, nothing is
> joined into one string.
> 
> They are read and set through a new endpoint next to the notes,
> GET/PUT /admin/datastore/{store}/attributes, with the privileges of
> the notes, as a list of KEY=VALUE entries. A PUT replaces all
> attributes of the snapshot. An empty set is stored as well, to tell a
> guest without tags from a client which never set anything.
> 
> Tape backup jobs get the option 'attribute-filter', a list of
> [exclude:|include:]KEY=VALUE with the include and exclude rules of
> group filters, applied after the group filter. A group has the
> attributes of its newest finished snapshot that has some, so a single
> backup without attributes does not move a group to another media pool.
> Besides the API there is the option for 'proxmox-tape', a field in the
> job window, a column in the job list and documentation.
> 
> The server does not interpret keys or values.
> 
> Proxmox VE
> ----------
> 
> storage 8, guest-common 9, manager 10-11, docs 12
> 
> After a backup to a PBS storage, vzdump sets 'pve-tag' (one value per
> tag) and 'pve-pool', with the prefix suggested in [0], directly
> through the API like the protection flag. A guest in a nested pool
> gets that pool and each of its parent pools as values, so a filter
> for a pool also matches the guests of the pools nested in it. A
> server without the endpoint answers 404, which is only noted in the
> task log.
> 
> As the attributes are not encrypted, the new vzdump option
> 'pbs-snapshot-attributes' (default on) can turn this off for a job, a
> single call, or a node in /etc/vzdump.conf.
> 
> Compatibility
> -------------
> 
> * Jobs without the new option select the same groups as before, and
>    nothing changes on tape or in the catalogs. A tape job written by
>    4.2.9 was read and run unchanged.
> * The other way round, a version without the series cannot parse a
>    tape-job.cfg in which the option is used (unknown property), like
>    with other new job properties.
> * A backup server without the series leaves the attributes in the
>    manifest alone (tried with 4.2.9).
> * A PVE node without the series ignores the vzdump option in jobs.cfg
>    with a warning.
> 
> Open questions
> --------------
> 
> * The names: 'pve-tag', 'pve-pool', 'attribute-filter' and
>    'pbs-snapshot-attributes'.

One potential issue I see arise is the additional potential for naming 
conflicts. While I would expect the backup groups to be organized within 
different namespaces, that might not always be the case. So maybe it 
makes sense to add the cluster name as additional tag as well?

However, each additional tag leaks more information to the PBS, which 
might not be what some users expect. So a bit torn on this one....

Maybe it would make sense to allow users to control which information is 
being set as attribute? E.g. tags only?

> * A guest in the pool 'a/b' gets the 'pve-pool' values 'a/b' and 'a',
>    so one filter covers a pool with everything nested in it. A backup
>    job for the pool 'a' in Proxmox VE only takes the direct members of
>    'a'. Is that difference fine, or should only 'a/b' be stored?

IMHO this should reflect the exact pool. While it may be convenient to 
only have to specify e.g. a filter on `a` on the PBS side, I think this 
would not reflect the actual state? Filters on the PBS side can any-ways 
be additive? Further, what if one wants snapshots from pool `a/b` but 
not `a`?

>    Since nested pools are quite new I wasn't sure about that at all.
> * Setting the attributes after the backup, like notes and protection,
>    needs no change in the backup protocol or in the QEMU library. But
>    a user that may only append, as in [2], could then not set them.
>    Passing them when the backup is created would solve that, at the
>    price of changes in proxmox-backup-qemu, pve-qemu, qemu-server and
>    pve-container which I found a bit excessive for some attributes.

Although more work and dependency churn, adding this for exactly the 
append only backup you mentioned makes this the way to go IMHO.

> * On by default with the option to opt out, or the other way round?
>    Is the switch needed at all?

I would prefer this to be opt-in, especially since it leaks tags and 
pool information to the PBS instance even if snapshots are encrypted, so 
any user should explicitly opt-in after being made aware of that.

> * This is a separate job option and not a new kind of group filter,
>    as group filters are shared with sync jobs and match on the name of
>    a group only. Using attributes in other jobs and showing them in the
>    web interface could follow, if wanted.

Yes, extending this to other jobs and especially show this kind of 
information to users with the required permissions in the PBS UI would 
be the natural followups.

> * For a group in which no snapshot has attributes, all its manifests
>    are read when a job with a filter runs. Is that acceptable, or
>    should only the newest few be looked at?

As noted on the individual patch for this, I'm not so sure about the 
group attributes as defined at all. Might make sense to do this on a 
per-snapshot level like e.g. for sync jobs with the 
encrypted-only/verified-only flags.

> 
> Testing
> -------
> 
> proxmox-backup master (4.2.11) with the series: rustfmt, clippy
> without new warnings, every commit builds, 'cargo test --workspace'
> passes (162 tests, one of them new), the docs build as HTML and man
> pages. The tests of pbs-api-types pass, with five new ones for the
> filter. pbs-api-types 1.0.22 came from the proxmox repository, as it
> is not in the devel repository yet.
> 
> The PVE patches are perltidy and biome clean, and the test suites of
> the three Perl repositories give the same results with and without
> them.
> 
> End to end in an unprivileged sandbox with the real daemons of both
> products: the packages of PVE 9.2.26 with the PVE patches applied and
> a backup server built from master with the series. There is no KVM in
> it, so the guests were stopped VMs and a container.
> 
> * vzdump of VMs and a container to a plain and an encrypted PBS
>    storage, the latter with a namespace, as a user with DatastoreBackup
>    only; several tags, pools nested up to three levels, changed and
>    removed tags; the option per call, per job (also run by pvescheduler
>    and from the web interface) and in /etc/vzdump.conf; restore of an
>    encrypted backup
> * the same against 4.2.9 and plain master: noted in the task log, no
>    warning, the backup is fine
> * the API as owner, as another user, as auditor and as admin; invalid
>    values; verification, notes, protection and a local sync job keep
>    the attributes
> * tape jobs on the virtual tape drive (needs [3]) selecting by tag, by
>    pool and by the parent of a nested pool, combined with a group
>    filter and with namespaces, started by hand and by the scheduler; a
>    restore from tape keeps the attributes
> * both web interfaces in a browser
> 
> Not yet tested: real tape hardware, clusters with more than one node,
> datastores with an S3 backend.
> 
> I wasn't sure if I was supposed to send to pbs-devel and pve-devel.
> 
> [0] https://bugzilla.proxmox.com/show_bug.cgi?id=4186#c32
> [1] https://bugzilla.proxmox.com/show_bug.cgi?id=7452
> [2] https://lore.proxmox.com/pbs-devel/20261106172235.890542-1-c.ebner@proxmox.com/
> [3] https://lore.proxmox.com/pbs-devel/20261111204853.531985-2-tobias@stuttgart.de/
> 
> 
> proxmox:
> 
> Jakob-Tobias Winter (2):
>    pbs-api-types: add types and schemas for snapshot attributes
>    pbs-api-types: tape: add attribute filter to backup jobs
> 
>   pbs-api-types/src/datastore.rs                |  22 ++-
>   pbs-api-types/src/jobs.rs                     |  98 ++++++++++-
>   pbs-api-types/src/lib.rs                      |   3 +
>   pbs-api-types/tests/attribute_filter_tests.rs | 155 ++++++++++++++++++
>   4 files changed, 276 insertions(+), 2 deletions(-)
>   create mode 100644 pbs-api-types/tests/attribute_filter_tests.rs
> 
> 
> proxmox-backup:
> 
> Jakob-Tobias Winter (5):
>    datastore: add attributes to backup snapshots
>    fix #7452: api: datastore: add endpoints for snapshot attributes
>    tape: backup job: allow selecting groups by snapshot attributes
>    ui: tape backup job: add attribute filter
>    docs: describe snapshot attributes and the tape job attribute filter
> 
>   docs/pve-integration.rst           |  23 ++++++
>   docs/tape-backup.rst               |  27 ++++++
>   docs/terminology.rst               |  33 ++++++++
>   pbs-datastore/src/backup_info.rs   |  18 +++-
>   pbs-datastore/src/datastore.rs     |  15 +++-
>   pbs-datastore/src/manifest.rs      |  87 +++++++++++++++++++-
>   src/api2/admin/datastore.rs        | 128 ++++++++++++++++++++++++++++-
>   src/api2/config/tape_backup_job.rs |   8 ++
>   src/api2/tape/backup.rs            |  19 ++++-
>   src/bin/proxmox-tape.rs            |  11 ++-
>   www/tape/BackupJobs.js             |   7 ++
>   www/tape/window/TapeBackupJob.js   |  27 +++++-
>   12 files changed, 391 insertions(+), 12 deletions(-)
> 
> 
> storage:
> 
> Jakob-Tobias Winter (1):
>    pbs: add helper to set the attributes of a backup snapshot
> 
>   src/PVE/Storage/PBSPlugin.pm | 23 +++++++++++++++++++++++
>   1 file changed, 23 insertions(+)
> 
> 
> guest-common:
> 
> Jakob-Tobias Winter (1):
>    vzdump: add pbs-snapshot-attributes option
> 
>   src/PVE/VZDump/Common.pm | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> 
> manager:
> 
> Jakob-Tobias Winter (2):
>    vzdump: store guest tags and pool as snapshot attributes on PBS
>    ui: backup job: add selector for PBS snapshot attributes
> 
>   PVE/VZDump.pm                               | 42 +++++++++++++++++++++
>   configs/vzdump.conf                         |  1 +
>   www/manager6/panel/BackupAdvancedOptions.js | 22 +++++++++++
>   3 files changed, 65 insertions(+)
> 
> 
> docs:
> 
> Jakob-Tobias Winter (1):
>    vzdump: describe snapshot attributes on Proxmox Backup Server
> 
>   vzdump.adoc | 36 ++++++++++++++++++++++++++++++++++++
>   1 file changed, 36 insertions(+)
> 
> 
> Summary over all repositories:
>    22 files changed, 799 insertions(+), 14 deletions(-)
> 





^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC PATCH proxmox 01/12] pbs-api-types: add types and schemas for snapshot attributes
  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
  1 sibling, 0 replies; 25+ messages in thread
From: Christian Ebner @ 2026-11-16 14:57 UTC (permalink / raw)
  To: Jakob-Tobias Winter, pbs-devel

On 11/13/26 10:07 AM, Jakob-Tobias Winter wrote:
> Snapshots get attributes, each of them a key with a list of values.
> They are meant for information a client knows about the source of a
> backup, like the tags and the resource pool of a Proxmox VE guest.
> 
> An attribute is passed as 'KEY=VALUE', once per value of a key. A
> value is never joined with other values into one string, so a list
> of tags cannot be garbled by a separator.
> 
> Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
> ---
>   pbs-api-types/src/datastore.rs | 22 +++++++++++++++++++++-
>   pbs-api-types/src/lib.rs       |  3 +++
>   2 files changed, 24 insertions(+), 1 deletion(-)
> 
> diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
> index 7685deee..978253ee 100644
> --- a/pbs-api-types/src/datastore.rs
> +++ b/pbs-api-types/src/datastore.rs
> @@ -1,4 +1,5 @@
>   use std::borrow::Borrow;
> +use std::collections::{BTreeMap, BTreeSet};
>   use std::convert::{AsRef, TryFrom};
>   use std::fmt;
>   use std::hash::{Hash, Hasher};
> @@ -28,7 +29,7 @@ use crate::{
>       DATASTORE_NOTIFY_STRING_SCHEMA, Fingerprint, GC_SCHEDULE_SCHEMA,
>       GROUP_OR_SNAPSHOT_PATH_REGEX_STR, GroupFilter, MaintenanceMode, MaintenanceType,
>       PROXMOX_SAFE_ID_FORMAT, PROXMOX_SAFE_ID_REGEX_STR, PRUNE_SCHEDULE_SCHEMA, SHA256_HEX_REGEX,
> -    SINGLE_LINE_COMMENT_SCHEMA, SNAPSHOT_PATH_REGEX_STR, UPID, Userid,
> +    SINGLE_LINE_COMMENT_SCHEMA, SNAPSHOT_ATTRIBUTE_RE, SNAPSHOT_PATH_REGEX_STR, UPID, Userid,
>       VERIFY_JOB_READ_THREADS_SCHEMA, VERIFY_JOB_VERIFY_THREADS_SCHEMA,
>   };
>   
> @@ -52,6 +53,8 @@ const_regex! {
>       pub GROUP_OR_SNAPSHOT_PATH_REGEX = concatcp!(r"^", GROUP_OR_SNAPSHOT_PATH_REGEX_STR, r"$");
>   
>       pub DATASTORE_MAP_REGEX = concatcp!(r"^(?:", PROXMOX_SAFE_ID_REGEX_STR, r"=)?", PROXMOX_SAFE_ID_REGEX_STR, r"$");
> +
> +    pub SNAPSHOT_ATTRIBUTE_REGEX = concatcp!(r"^", SNAPSHOT_ATTRIBUTE_RE, r"$");

nit: SNAPSHOT_ATTRIBUTE_RE is not used anywhere else AFAICS, so would be 
best in-lined directly. On the other hand, I think it would be 
preferable to have separate attribute key and attribute value types, so 
it would make sense to concatenate them from regex definitions for each 
of these.

>   }
>   
>   pub const CHUNK_DIGEST_FORMAT: ApiStringFormat = ApiStringFormat::Pattern(&SHA256_HEX_REGEX);
> @@ -90,6 +93,23 @@ pub const BACKUP_GROUP_SCHEMA: Schema = StringSchema::new("Backup Group")
>       .format(&BACKUP_GROUP_FORMAT)
>       .schema();
>   
> +pub const SNAPSHOT_ATTRIBUTE_FORMAT: ApiStringFormat =
> +    ApiStringFormat::Pattern(&SNAPSHOT_ATTRIBUTE_REGEX);
> +
> +pub const SNAPSHOT_ATTRIBUTE_SCHEMA: Schema = StringSchema::new(
> +    "Snapshot attribute, a key and one of its values. A key with several values is given once \
> +    per value.",
> +)
> +.format(&SNAPSHOT_ATTRIBUTE_FORMAT)
> +.type_text("KEY=VALUE")
> +.schema();
> +
> +pub const SNAPSHOT_ATTRIBUTE_LIST_SCHEMA: Schema =
> +    ArraySchema::new("List of snapshot attributes.", &SNAPSHOT_ATTRIBUTE_SCHEMA).schema();
> +
> +/// The attributes of a snapshot, each key has a set of values.
> +pub type SnapshotAttributes = BTreeMap<String, BTreeSet<String>>;

nit: Why was the BTreeMap and BTreeSet choosen over plain Vec<String, 
Vec<String>> here?

Not sure if the number of expected attributes would out-weight the 
additional memory footprint...

Further, instead of plain `String`s I would prefer dedicated types for 
key and value of attributes, to avoid possible misuse of this type by 
constructing it from unverified strings. See also comment on next patch...

> +
>   /// The maximal, inclusive depth for namespaces from the root ns downwards
>   ///
>   /// The datastore root name space is at depth zero (0), so we have in total eight (8) levels
> diff --git a/pbs-api-types/src/lib.rs b/pbs-api-types/src/lib.rs
> index 21ef733d..cb1c231c 100644
> --- a/pbs-api-types/src/lib.rs
> +++ b/pbs-api-types/src/lib.rs
> @@ -94,6 +94,9 @@ pub const GROUP_OR_SNAPSHOT_PATH_REGEX_STR: &str =
>           r"(", BACKUP_TYPE_RE, ")/(", BACKUP_ID_RE, ")(?:/(", BACKUP_TIME_RE, r"))?",
>       );
>   
> +#[rustfmt::skip]
> +pub const SNAPSHOT_ATTRIBUTE_RE: &str = r"[a-z][a-z0-9\-]{0,31}=[A-Za-z0-9._+/\-]{1,128}";
> +
>   mod acl;
>   pub use acl::*;
>   
> 
> base-commit: 9bf4383b6ad4225367c7824023ad74769388de8f





^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC PATCH proxmox 02/12] pbs-api-types: tape: add attribute filter to backup jobs
  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
  0 siblings, 0 replies; 25+ messages in thread
From: Christian Ebner @ 2026-11-16 14:57 UTC (permalink / raw)
  To: Jakob-Tobias Winter, pbs-devel

On 11/13/26 10:06 AM, Jakob-Tobias Winter wrote:
> Tape backup jobs get a list of attribute filters to select backup
> groups by the attributes of their snapshots, for example to write
> the guests tagged as production and as test to different media
> pools. A filter only matches a whole value of its key. Several
> filters are combined like group filters: one of the include filters
> has to match, if there are any, and none of the exclude filters.
> 
> The job option is optional. Existing job configurations stay valid
> and select the same groups as before.
> 
> Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
> ---
>   pbs-api-types/src/jobs.rs                     |  98 ++++++++++-
>   pbs-api-types/tests/attribute_filter_tests.rs | 155 ++++++++++++++++++
>   2 files changed, 252 insertions(+), 1 deletion(-)
>   create mode 100644 pbs-api-types/tests/attribute_filter_tests.rs
> 
> diff --git a/pbs-api-types/src/jobs.rs b/pbs-api-types/src/jobs.rs
> index 9a5d2b77..8e558e4a 100644
> --- a/pbs-api-types/src/jobs.rs
> +++ b/pbs-api-types/src/jobs.rs
> @@ -15,7 +15,7 @@ use crate::{
>       BackupType, CRYPT_KEY_ID_SCHEMA, DATASTORE_SCHEMA, DRIVE_NAME_SCHEMA, MEDIA_POOL_NAME_SCHEMA,
>       NS_MAX_DEPTH_REDUCED_SCHEMA, NotificationMode, PROXMOX_SAFE_ID_FORMAT,
>       PROXMOX_SAFE_ID_REGEX_STR, REMOTE_ID_SCHEMA, RateLimitConfig, SINGLE_LINE_COMMENT_SCHEMA,
> -    Userid,
> +    SNAPSHOT_ATTRIBUTE_REGEX, SnapshotAttributes, Userid,
>   };
>   
>   const_regex! {
> @@ -345,6 +345,10 @@ pub struct VerificationJobStatus {
>               schema: GROUP_FILTER_LIST_SCHEMA,
>               optional: true,
>           },
> +        "attribute-filter": {
> +            schema: ATTRIBUTE_FILTER_LIST_SCHEMA,
> +            optional: true,
> +        },
>           ns: {
>               type: BackupNamespace,
>               optional: true,
> @@ -379,6 +383,8 @@ pub struct TapeBackupJobSetup {
>       pub notification_mode: Option<NotificationMode>,
>       #[serde(skip_serializing_if = "Option::is_none")]
>       pub group_filter: Option<Vec<GroupFilter>>,
> +    #[serde(skip_serializing_if = "Option::is_none")]
> +    pub attribute_filter: Option<Vec<AttributeFilter>>,
>       #[serde(skip_serializing_if = "Option::is_none", default)]
>       pub ns: Option<BackupNamespace>,
>       #[serde(skip_serializing_if = "Option::is_none", default)]
> @@ -550,6 +556,96 @@ pub const GROUP_FILTER_SCHEMA: Schema = StringSchema::new(
>   pub const GROUP_FILTER_LIST_SCHEMA: Schema =
>       ArraySchema::new("List of group filters.", &GROUP_FILTER_SCHEMA).schema();
>   
> +#[derive(Clone, Debug, PartialEq, Eq)]
> +/// Filter for matching the attributes of a snapshot.
> +pub struct AttributeFilter {
> +    pub is_exclude: bool,
> +    pub key: String,

as mentioned on patch 0001, key ...

> +    pub value: String,

... and value should preferably have dedicated types ...

> +}
> +
> +impl AttributeFilter {
> +    /// Returns whether the value of the filter is one of the values the attributes have for its
> +    /// key.
> +    pub fn matches(&self, attributes: &SnapshotAttributes) -> bool {
> +        attributes
> +            .get(&self.key)
> +            .is_some_and(|values| values.contains(&self.value))
> +    }
> +
> +    /// Returns whether the attributes pass the filters.
> +    ///
> +    /// If there are include filters, at least one of them has to match. No exclude filter may
> +    /// match.
> +    pub fn apply_filters(filters: &[AttributeFilter], attributes: &SnapshotAttributes) -> bool {
> +        let is_included = if filters.iter().filter(|f| !f.is_exclude).count() == 0 {
> +            true
> +        } else {
> +            filters
> +                .iter()
> +                .filter(|f| !f.is_exclude)
> +                .any(|filter| filter.matches(attributes))
> +        };
> +
> +        is_included
> +            && !filters
> +                .iter()
> +                .filter(|f| f.is_exclude)
> +                .any(|filter| filter.matches(attributes))
> +    }
> +}
> +
> +impl std::str::FromStr for AttributeFilter {
> +    type Err = anyhow::Error;
> +
> +    fn from_str(s: &str) -> Result<Self, Self::Err> {
> +        let (is_exclude, attribute) = match s.split_once(':') {
> +            Some(("include", value)) => (false, value),
> +            Some(("exclude", value)) => (true, value),
> +            _ => (false, s),
> +        };
> +
> +        match attribute.split_once('=') {
> +            Some((key, value)) if SNAPSHOT_ATTRIBUTE_REGEX.is_match(attribute) => {

... this can then use the dedicate types for parsing

> +                Ok(AttributeFilter {
> +                    is_exclude,
> +                    key: key.to_string(),
> +                    value: value.to_string(),
> +                })
> +            }
> +            _ => bail!("input doesn't match expected format '[<exclude:|include:>]KEY=VALUE'"),
> +        }
> +    }
> +}
> +
> +// used for serializing below, caution!
> +impl std::fmt::Display for AttributeFilter {
> +    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
> +        if self.is_exclude {
> +            f.write_str("exclude:")?;
> +        }
> +        write!(f, "{}={}", self.key, self.value)
> +    }
> +}
> +
> +proxmox_serde::forward_deserialize_to_from_str!(AttributeFilter);
> +proxmox_serde::forward_serialize_to_display!(AttributeFilter);
> +
> +fn verify_attribute_filter(input: &str) -> Result<(), anyhow::Error> {
> +    AttributeFilter::from_str(input).map(|_| ())
> +}
> +
> +pub const ATTRIBUTE_FILTER_SCHEMA: Schema = StringSchema::new(
> +    "Attribute filter, matches if the given value is one of the values of the key. Can be \
> +    inverted by prepending 'exclude:'.",
> +)
> +.format(&ApiStringFormat::VerifyFn(verify_attribute_filter))
> +.type_text("[<exclude:|include:>]KEY=VALUE")
> +.schema();
> +
> +pub const ATTRIBUTE_FILTER_LIST_SCHEMA: Schema =
> +    ArraySchema::new("List of attribute filters.", &ATTRIBUTE_FILTER_SCHEMA).schema();
> +
>   pub const TRANSFER_LAST_SCHEMA: Schema =
>       IntegerSchema::new("Limit transfer to last N snapshots (per group), skipping others")
>           .minimum(1)
> diff --git a/pbs-api-types/tests/attribute_filter_tests.rs b/pbs-api-types/tests/attribute_filter_tests.rs
> new file mode 100644
> index 00000000..c355e6b4
> --- /dev/null
> +++ b/pbs-api-types/tests/attribute_filter_tests.rs
> @@ -0,0 +1,155 @@
> +use pbs_api_types::{AttributeFilter, SnapshotAttributes};
> +use std::str::FromStr;
> +
> +fn attributes(list: &[(&str, &[&str])]) -> SnapshotAttributes {
> +    list.iter()
> +        .map(|(key, values)| {
> +            (
> +                key.to_string(),
> +                values.iter().map(|value| value.to_string()).collect(),
> +            )
> +        })
> +        .collect()
> +}
> +
> +fn filters(list: &[&str]) -> Vec<AttributeFilter> {
> +    list.iter()
> +        .map(|filter| AttributeFilter::from_str(filter).unwrap())
> +        .collect()
> +}
> +
> +#[test]
> +fn test_parse_filter() {
> +    let filter = AttributeFilter::from_str("pve-tag=prod").unwrap();
> +    assert!(!filter.is_exclude);
> +    assert_eq!(filter.key, "pve-tag");
> +    assert_eq!(filter.value, "prod");
> +    assert_eq!(filter.to_string(), "pve-tag=prod");
> +
> +    let filter = AttributeFilter::from_str("include:pve-tag=prod").unwrap();
> +    assert!(!filter.is_exclude);
> +    assert_eq!(filter.to_string(), "pve-tag=prod");
> +
> +    let filter = AttributeFilter::from_str("exclude:pve-pool=customers/a_1.test").unwrap();
> +    assert!(filter.is_exclude);
> +    assert_eq!(filter.key, "pve-pool");
> +    assert_eq!(filter.value, "customers/a_1.test");
> +    assert_eq!(filter.to_string(), "exclude:pve-pool=customers/a_1.test");
> +
> +    let invalid = [
> +        "",
> +        "pve-tag",
> +        "pve-tag=",
> +        "=prod",
> +        "Pve-Tag=prod",
> +        "1tag=prod",
> +        "pve-tag=prod;web",
> +        "pve-tag=prod,web",
> +        "pve-tag=prod web",
> +        "pve-tag=prod=web",
> +        "pve-tag=prod:web",
> +        "other:pve-tag=prod",
> +        "exclude:exclude:pve-tag=prod",
> +    ];
> +
> +    for filter in invalid {
> +        assert!(
> +            AttributeFilter::from_str(filter).is_err(),
> +            "'{filter}' must not parse"
> +        );
> +    }
> +}
> +
> +#[test]
> +fn test_no_filters() {
> +    let filters = [];
> +
> +    assert!(AttributeFilter::apply_filters(&filters, &attributes(&[])));
> +    assert!(AttributeFilter::apply_filters(
> +        &filters,
> +        &attributes(&[("pve-tag", &["prod", "web"])])
> +    ));
> +}
> +
> +#[test]
> +fn test_include_filters() {
> +    let filters = filters(&["pve-tag=prod", "pve-pool=customer1"]);
> +
> +    let do_backup = [
> +        attributes(&[("pve-tag", &["prod"])]),
> +        attributes(&[("pve-tag", &["db", "prod", "web"])]),
> +        attributes(&[("pve-pool", &["customer1"])]),
> +        attributes(&[("pve-pool", &["customer1"]), ("pve-tag", &["test"])]),
> +    ];
> +
> +    let dont_backup = [
> +        attributes(&[]),
> +        attributes(&[("pve-tag", &[])]),
> +        attributes(&[("pve-tag", &["nonprod", "prod-eu", "pro", "Prod"])]),
> +        attributes(&[("pve-pool", &["prod"])]),
> +        attributes(&[("pve-pool", &["customer1/sub", "customer10"])]),
> +        attributes(&[("other", &["prod", "customer1"])]),
> +    ];
> +
> +    for attributes in do_backup {
> +        assert!(AttributeFilter::apply_filters(&filters, &attributes));
> +    }
> +
> +    for attributes in dont_backup {
> +        assert!(!AttributeFilter::apply_filters(&filters, &attributes));
> +    }
> +}
> +
> +#[test]
> +fn test_exclude_filters() {
> +    let filters = filters(&["exclude:pve-tag=prod", "exclude:pve-tag=test"]);
> +
> +    let do_backup = [
> +        attributes(&[]),
> +        attributes(&[("pve-tag", &["web"])]),
> +        attributes(&[("pve-pool", &["prod"])]),
> +    ];
> +
> +    let dont_backup = [
> +        attributes(&[("pve-tag", &["prod"])]),
> +        attributes(&[("pve-tag", &["test", "web"])]),
> +        attributes(&[("pve-tag", &["prod", "test"])]),
> +    ];
> +
> +    for attributes in do_backup {
> +        assert!(AttributeFilter::apply_filters(&filters, &attributes));
> +    }
> +
> +    for attributes in dont_backup {
> +        assert!(!AttributeFilter::apply_filters(&filters, &attributes));
> +    }
> +}
> +
> +#[test]
> +fn test_include_and_exclude_filters() {
> +    let filters = filters(&[
> +        "exclude:pve-tag=test",
> +        "pve-pool=customer1",
> +        "pve-pool=customer2",
> +    ]);
> +
> +    let do_backup = [
> +        attributes(&[("pve-pool", &["customer1"])]),
> +        attributes(&[("pve-pool", &["customer2"]), ("pve-tag", &["prod"])]),
> +    ];
> +
> +    let dont_backup = [
> +        attributes(&[]),
> +        attributes(&[("pve-tag", &["prod"])]),
> +        attributes(&[("pve-pool", &["customer3"])]),
> +        attributes(&[("pve-pool", &["customer1"]), ("pve-tag", &["test"])]),
> +    ];
> +
> +    for attributes in do_backup {
> +        assert!(AttributeFilter::apply_filters(&filters, &attributes));
> +    }
> +
> +    for attributes in dont_backup {
> +        assert!(!AttributeFilter::apply_filters(&filters, &attributes));
> +    }
> +}





^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC PATCH proxmox-backup 04/12] fix #7452: api: datastore: add endpoints for snapshot attributes
  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
  0 siblings, 0 replies; 25+ messages in thread
From: Christian Ebner @ 2026-11-16 14:57 UTC (permalink / raw)
  To: Jakob-Tobias Winter, pbs-devel

On 11/13/26 10:06 AM, Jakob-Tobias Winter wrote:
> The attributes of a snapshot can be read and set next to its notes
> and its protection flag, with the privileges required for the notes.
> A client which may set the notes of its backups can therefore set
> the attributes after a backup without further permissions.

I think it would be better if the client cannot modify attributes of a 
snapshot, and modification can only be done by a highly privileged user 
on the PBS side (e.g. root@pam only)

It would be better if the client provides the list of attributes it 
wants to set for the to-be backed up snapshot as optional params during 
the backup session initialization, during the protocol upgrade in [0]. 
These should then be checked against the ones which a client may upload 
as part of the manifest, and reject if they do not match. The latter 
must be checked in [1].

This is especially of interest since attributes might be used for other 
jobs as well, e.g. pruning, where we do not want a client to overwrite 
the state again.


[0] 
https://git.proxmox.com/?p=proxmox-backup.git;a=blob;f=src/api2/backup/mod.rs;h=a9b1ca5c268016978d292ebc03aaa1a7d3afcaaa;hb=HEAD#l74
[1] 
https://git.proxmox.com/?p=proxmox-backup.git;a=blob;f=src/api2/backup/environment.rs;h=be70d74f828e33b0020d4b7b5825cf98af77901d;hb=HEAD#l798

> 
> Attributes are passed as a list of 'KEY=VALUE' entries, with one
> entry for each value of a key. Setting them replaces all attributes
> of the snapshot. An empty list is stored as well, so that a snapshot
> without attributes can be told from one whose client never set any.
> 
> Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
> ---
>   src/api2/admin/datastore.rs | 128 +++++++++++++++++++++++++++++++++++-
>   1 file changed, 126 insertions(+), 2 deletions(-)
> 
> diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
> index 3ba25934f..6b907da32 100644
> --- a/src/api2/admin/datastore.rs
> +++ b/src/api2/admin/datastore.rs
> @@ -43,8 +43,9 @@ use pbs_api_types::{
>       IGNORE_VERIFIED_BACKUPS_SCHEMA, JobScheduleStatus, KeepOptions, MAX_NAMESPACE_DEPTH,
>       MaintenanceMode, MaintenanceType, NS_MAX_DEPTH_SCHEMA, Operation, PRIV_DATASTORE_AUDIT,
>       PRIV_DATASTORE_BACKUP, PRIV_DATASTORE_MODIFY, PRIV_DATASTORE_PRUNE, PRIV_DATASTORE_READ,
> -    PRIV_DATASTORE_VERIFY, PRIV_SYS_MODIFY, PruneJobOptions, SnapshotListItem, SyncJobConfig, UPID,
> -    UPID_SCHEMA, VERIFICATION_OUTDATED_AFTER_SCHEMA, VERIFY_JOB_READ_THREADS_SCHEMA,
> +    PRIV_DATASTORE_VERIFY, PRIV_SYS_MODIFY, PruneJobOptions, SNAPSHOT_ATTRIBUTE_LIST_SCHEMA,
> +    SnapshotAttributes, SnapshotListItem, SyncJobConfig, UPID, UPID_SCHEMA,
> +    VERIFICATION_OUTDATED_AFTER_SCHEMA, VERIFY_JOB_READ_THREADS_SCHEMA,
>       VERIFY_JOB_VERIFY_THREADS_SCHEMA, print_ns_and_snapshot, print_store_and_ns,
>   };
>   use pbs_client::pxar::{create_tar, create_zip};
> @@ -2223,6 +2224,123 @@ pub fn set_notes(
>       Ok(())
>   }
>   
> +#[api(
> +    input: {
> +        properties: {
> +            store: { schema: DATASTORE_SCHEMA },
> +            ns: {
> +                type: BackupNamespace,
> +                optional: true,
> +            },
> +            backup_dir: {
> +                type: pbs_api_types::BackupDir,
> +                flatten: true,
> +            },
> +        },
> +    },
> +    returns: {
> +        schema: SNAPSHOT_ATTRIBUTE_LIST_SCHEMA,
> +    },
> +    access: {
> +        permission: &Permission::Anybody,
> +        description: "Requires on /datastore/{store}[/{namespace}] either DATASTORE_AUDIT for any \
> +            or DATASTORE_BACKUP and being the owner of the group",
> +    },
> +)]
> +/// Get the attributes of a specific backup
> +pub fn get_attributes(
> +    store: String,
> +    ns: Option<BackupNamespace>,
> +    backup_dir: pbs_api_types::BackupDir,
> +    rpcenv: &mut dyn RpcEnvironment,
> +) -> Result<Vec<String>, Error> {
> +    let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
> +    let ns = ns.unwrap_or_default();
> +
> +    let datastore = check_privs_and_load_store(
> +        &store,
> +        &ns,
> +        &auth_id,
> +        PRIV_DATASTORE_AUDIT,
> +        PRIV_DATASTORE_BACKUP,
> +        Operation::Read,
> +        &backup_dir.group,
> +    )?;
> +
> +    let backup_dir = datastore.backup_dir(ns, backup_dir)?;
> +
> +    let (manifest, _) = backup_dir.load_manifest()?;
> +
> +    let attributes = manifest.attributes().unwrap_or_default();
> +
> +    Ok(attributes
> +        .iter()
> +        .flat_map(|(key, values)| values.iter().map(move |value| format!("{key}={value}")))

comment: The formatting here is better defined as helper on the api 
type, that is an implementation detail. Further, given that the result 
here is a Vec<String>, it would make sense to define the AttributeItem 
as dedicated API type instead? This introduces basically a second type 
of serialization next to the json one.

> +        .collect())
> +}
> +
> +#[api(
> +    input: {
> +        properties: {
> +            store: { schema: DATASTORE_SCHEMA },
> +            ns: {
> +                type: BackupNamespace,
> +                optional: true,
> +            },
> +            backup_dir: {
> +                type: pbs_api_types::BackupDir,
> +                flatten: true,
> +            },
> +            attributes: {
> +                schema: SNAPSHOT_ATTRIBUTE_LIST_SCHEMA,
> +                optional: true,
> +            },
> +        },
> +    },
> +    access: {
> +        permission: &Permission::Anybody,
> +        description: "Requires on /datastore/{store}[/{namespace}] either DATASTORE_MODIFY for any \
> +            or DATASTORE_BACKUP and being the owner of the group",
> +    },
> +)]
> +/// Set the attributes of a specific backup, replacing the existing ones
> +pub fn set_attributes(
> +    store: String,
> +    ns: Option<BackupNamespace>,
> +    backup_dir: pbs_api_types::BackupDir,
> +    attributes: Option<Vec<String>>,

same as for others, this would be better defined as dedicated type, 
which also holds the deserialization logic ...

> +    rpcenv: &mut dyn RpcEnvironment,
> +) -> Result<(), Error> {
> +    let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
> +    let ns = ns.unwrap_or_default();
> +
> +    let datastore = check_privs_and_load_store(
> +        &store,
> +        &ns,
> +        &auth_id,
> +        PRIV_DATASTORE_MODIFY,
> +        PRIV_DATASTORE_BACKUP,
> +        Operation::Write,
> +        &backup_dir.group,
> +    )?;
> +
> +    let mut attribute_map = SnapshotAttributes::new();
> +    for attribute in attributes.unwrap_or_default() {
> +        // the format is ensured by the schema
> +        if let Some((key, value)) = attribute.split_once('=') {
> +            attribute_map
> +                .entry(key.to_string())
> +                .or_default()
> +                .insert(value.to_string());

... so this would live on the type in pbs-api-types instead, as this is 
an implementation detail thereof.

> +        }
> +    }
> +
> +    let backup_dir = datastore.backup_dir(ns, backup_dir)?;
> +    datastore.set_attributes(attribute_map, backup_dir)?;
> +
> +    Ok(())
> +}
> +
>   #[api(
>       input: {
>           properties: {
> @@ -2930,6 +3048,12 @@ const DATASTORE_INFO_SUBDIRS: SubdirMap = &[
>           "active-operations",
>           &Router::new().get(&API_METHOD_GET_ACTIVE_OPERATIONS),
>       ),
> +    (
> +        "attributes",
> +        &Router::new()
> +            .get(&API_METHOD_GET_ATTRIBUTES)
> +            .put(&API_METHOD_SET_ATTRIBUTES),
> +    ),
>       ("catalog", &Router::new().get(&API_METHOD_CATALOG)),
>       (
>           "change-owner",





^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC PATCH proxmox-backup 03/12] datastore: add attributes to backup snapshots
  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
  1 sibling, 0 replies; 25+ messages in thread
From: Christian Ebner @ 2026-11-16 14:57 UTC (permalink / raw)
  To: Jakob-Tobias Winter, pbs-devel

On 11/13/26 10:06 AM, Jakob-Tobias Winter wrote:
> A backup server knows little about where a backup comes from. Things
> like the tags and the resource pool of a Proxmox VE guest are only
> known to the client, but they are what users want to select backups
> by, for example in tape backup jobs.
> 
> Allow storing such information as attributes of a snapshot. They are
> kept in the unprotected part of the manifest, as suggested in [0].
> That way they can also be set for encrypted backups, and they stay
> with the snapshot when it is synced or written to tape.
> 
> Each attribute is a key with a list of values. A guest with several
> tags gets one list element for each tag, instead of one string that
> has to be split again.
> 
> A backup group has the attributes of its newest snapshot which has
> attributes. Snapshots without attributes are skipped on purpose: a
> client which does not set them, or fails to set them once, must not
> make a group lose its attributes.
> 
> The unprotected part of the manifest can be uploaded by the client,
> so values with an invalid format are dropped when reading it.
> 
> [0] https://bugzilla.proxmox.com/show_bug.cgi?id=4186#c32
> 
> Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
> ---
> The patches for proxmox-backup need the pbs-api-types of patches 1 and
> 2, so the dependency has to be bumped once they are released.
> 
>   pbs-datastore/src/backup_info.rs | 18 ++++++-
>   pbs-datastore/src/datastore.rs   | 15 +++++-
>   pbs-datastore/src/manifest.rs    | 87 +++++++++++++++++++++++++++++++-
>   3 files changed, 117 insertions(+), 3 deletions(-)
> 
> diff --git a/pbs-datastore/src/backup_info.rs b/pbs-datastore/src/backup_info.rs
> index cce2b699f..ea9dc9a2a 100644
> --- a/pbs-datastore/src/backup_info.rs
> +++ b/pbs-datastore/src/backup_info.rs
> @@ -17,7 +17,7 @@ use proxmox_systemd::escape_unit;
>   
>   use pbs_api_types::{
>       ArchiveType, Authid, BACKUP_DATE_REGEX, BackupArchiveName, BackupGroupDeleteStats,
> -    BackupNamespace, BackupType, GroupFilter, MANIFEST_BLOB_NAME, VerifyState,
> +    BackupNamespace, BackupType, GroupFilter, MANIFEST_BLOB_NAME, SnapshotAttributes, VerifyState,
>   };
>   use pbs_config::{BackupLockGuard, open_backup_lockfile};
>   
> @@ -148,6 +148,22 @@ impl BackupGroup {
>               .max_by_key(|item| item.backup_dir.backup_time()))
>       }
>   
> +    /// Returns the attributes of the backup group
> +    ///
> +    /// These are the attributes of the newest finished snapshot which has some stored. Snapshots
> +    /// without stored attributes are skipped, so a group keeps its attributes if a client did not
> +    /// provide them for newer snapshots.
> +    pub fn attributes(&self) -> Result<SnapshotAttributes, Error> {
> +        let mut backups = self.list_backups()?;
> +        BackupInfo::sort_list(&mut backups, false);
> +
> +        Ok(backups
> +            .iter()
> +            .filter(|info| info.is_finished())
> +            .find_map(|info| info.backup_dir.load_manifest().ok()?.0.attributes())
> +            .unwrap_or_default())
> +    }

while I see the intention here, I think this is not ideal: What if you 
have a malicious client which writes a new backup to the group with some 
bogus/unrelated attributes? That would lead for the group to now present 
completely unrelated attributes, potentially excluding/including it once 
filters are being applied to it.

It might make more sense to do the filtering on the snapshot level only, 
although that comes with its own downsides.

> +
>       pub fn last_successful_backup(&self) -> Result<Option<i64>, Error> {
>           let mut last = None;
>   
> diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
> index e6766a3b9..5b094a095 100644
> --- a/pbs-datastore/src/datastore.rs
> +++ b/pbs-datastore/src/datastore.rs
> @@ -34,7 +34,7 @@ use pbs_api_types::{
>       ArchiveType, Authid, BackupGroupDeleteStats, BackupNamespace, BackupType, ChunkOrder,
>       DEFAULT_SNAPSHOT_TIME_SKEW_SECS, DataStoreConfig, DatastoreBackendConfig, DatastoreBackendType,
>       GarbageCollectionCacheStats, GarbageCollectionStatus, MAX_NAMESPACE_DEPTH, MaintenanceMode,
> -    MaintenanceType, Operation, S3Statistics, UPID,
> +    MaintenanceType, Operation, S3Statistics, SnapshotAttributes, UPID,
>   };
>   use pbs_config::s3::S3_CFG_TYPE_ID;
>   use pbs_config::{BackupLockGuard, ConfigVersionCache};
> @@ -3458,6 +3458,19 @@ impl DataStore {
>           Ok(())
>       }
>   
> +    /// Set the attributes for the given snapshot, replacing the existing ones.
> +    pub fn set_attributes(
> +        self: &Arc<Self>,
> +        attributes: SnapshotAttributes,
> +        snapshot: BackupDir,
> +    ) -> Result<(), Error> {
> +        let backend = self.backend().context("failed to get backend")?;
> +        snapshot
> +            .update_manifest(&backend, |manifest| manifest.set_attributes(&attributes))
> +            .map_err(|err| format_err!("unable to update manifest blob - {err}"))?;
> +        Ok(())
> +    }
> +
>       /// Renames a corrupt chunk, returning the new path if the chunk was renamed successfully.
>       /// Returns with `Ok(None)` if the chunk source was not found.
>       pub fn rename_corrupt_chunk(&self, digest: &[u8; 32]) -> Result<Option<PathBuf>, Error> {
> diff --git a/pbs-datastore/src/manifest.rs b/pbs-datastore/src/manifest.rs
> index 16f9668f2..61982d64a 100644
> --- a/pbs-datastore/src/manifest.rs
> +++ b/pbs-datastore/src/manifest.rs
> @@ -9,7 +9,7 @@ use proxmox_sys::fs::{CreateOptions, replace_file};
>   
>   use pbs_api_types::{
>       BackupArchiveName, BackupType, CLIENT_LOG_BLOB_NAME, CryptMode, Fingerprint,
> -    MANIFEST_BLOB_NAME, SnapshotVerifyState,
> +    MANIFEST_BLOB_NAME, SNAPSHOT_ATTRIBUTE_REGEX, SnapshotAttributes, SnapshotVerifyState,
>   };
>   use pbs_tools::crypt_config::CryptConfig;
>   
> @@ -273,6 +273,27 @@ impl BackupManifest {
>           Ok(Some(serde_json::from_value::<SnapshotVerifyState>(verify)?))
>       }
>   
> +    /// Get the attributes of the snapshot
> +    ///
> +    /// Returns `None` if no attributes were stored for the snapshot. The unprotected part of the
> +    /// manifest can be provided by the client, so values with an invalid format are dropped and
> +    /// attributes which are not a list of values for each key count as not stored.
> +    pub fn attributes(&self) -> Option<SnapshotAttributes> {
> +        let mut attributes =
> +            SnapshotAttributes::deserialize(&self.unprotected["attributes"]).ok()?;
> +
> +        for (key, values) in attributes.iter_mut() {
> +            values.retain(|value| SNAPSHOT_ATTRIBUTE_REGEX.is_match(&format!("{key}={value}")));
> +        }
> +
> +        Some(attributes)
> +    }
> +
> +    /// Set the attributes of the snapshot, replacing the existing ones
> +    pub fn set_attributes(&mut self, attributes: &SnapshotAttributes) {
> +        self.unprotected["attributes"] = json!(attributes);
> +    }
> +
>       /// Set the sync-source-signature used to detect snapshot changes across encrypted/decrypted
>       /// sync flows.
>       ///
> @@ -597,3 +618,67 @@ fn test_manifest_eq_ignoring_verify_state() -> Result<(), Error> {
>   
>       Ok(())
>   }
> +
> +#[test]
> +fn test_manifest_attributes() -> Result<(), Error> {
> +    let crypt_config = CryptConfig::new([7; 32])?;
> +    let mut manifest = BackupManifest::new("vm/100/2020-06-26T13:56:05Z".parse()?);
> +    manifest.add_file(
> +        &"drive-scsi0.img.fidx".try_into()?,
> +        200,
> +        [1; 32],
> +        CryptMode::Encrypt,
> +    )?;
> +
> +    // nothing stored yet
> +    assert!(manifest.attributes().is_none());
> +
> +    let signature = manifest.signature(&crypt_config)?;
> +
> +    let mut attributes = SnapshotAttributes::new();
> +    for (key, value) in [
> +        ("pve-tag", "web"),
> +        ("pve-tag", "prod"),
> +        ("pve-pool", "customers/a"),
> +    ] {
> +        attributes
> +            .entry(key.to_string())
> +            .or_default()
> +            .insert(value.to_string());
> +    }
> +    manifest.set_attributes(&attributes);
> +
> +    // not covered by the signature, so attributes can be set for encrypted backups
> +    assert_eq!(manifest.signature(&crypt_config)?, signature);
> +
> +    // each value is a list element of its own, in a stable order
> +    assert_eq!(
> +        manifest.unprotected["attributes"],
> +        json!({ "pve-pool": ["customers/a"], "pve-tag": ["prod", "web"] }),
> +    );
> +
> +    let data = manifest.to_string(Some(&crypt_config))?;
> +    let mut manifest = BackupManifest::from_data(data.as_bytes(), Some(&crypt_config), false)?;
> +    assert_eq!(manifest.attributes(), Some(attributes));
> +
> +    // stored, but empty
> +    manifest.set_attributes(&SnapshotAttributes::new());
> +    assert_eq!(manifest.attributes(), Some(SnapshotAttributes::new()));
> +
> +    // data which does not come from the server
> +    manifest.unprotected["attributes"] = json!("pve-tag=prod");
> +    assert!(manifest.attributes().is_none());
> +
> +    manifest.unprotected["attributes"] = json!({ "pve-tag": "prod;web" });
> +    assert!(manifest.attributes().is_none());
> +
> +    manifest.unprotected["attributes"] = json!({
> +        "pve-tag": ["prod", "with space", "web;db"],
> +        "Invalid Key": ["prod"],
> +    });
> +    let attributes = manifest.attributes().unwrap();
> +    assert_eq!(attributes["pve-tag"].iter().collect::<Vec<_>>(), ["prod"]);
> +    assert!(attributes["Invalid Key"].is_empty());
> +
> +    Ok(())
> +}
> 
> base-commit: a7eb4e8a1477df960570fa72e9e7e2b8ac58bdab





^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC PATCH proxmox 01/12] pbs-api-types: add types and schemas for snapshot attributes
  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
  1 sibling, 0 replies; 25+ messages in thread
From: Samuel Rufinatscha @ 2026-11-18 12:54 UTC (permalink / raw)
  To: Jakob-Tobias Winter, pbs-devel

On 11/13/26 10:07 AM, Jakob-Tobias Winter wrote:
> Snapshots get attributes, each of them a key with a list of values.
> They are meant for information a client knows about the source of a
> backup, like the tags and the resource pool of a Proxmox VE guest.
> 
> An attribute is passed as 'KEY=VALUE', once per value of a key. A
> value is never joined with other values into one string, so a list
> of tags cannot be garbled by a separator.
> 
> Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
> ---
>   pbs-api-types/src/datastore.rs | 22 +++++++++++++++++++++-
>   pbs-api-types/src/lib.rs       |  3 +++
>   2 files changed, 24 insertions(+), 1 deletion(-)
> 
> diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
> index 7685deee..978253ee 100644
> --- a/pbs-api-types/src/datastore.rs
> +++ b/pbs-api-types/src/datastore.rs
> @@ -1,4 +1,5 @@
>   use std::borrow::Borrow;
> +use std::collections::{BTreeMap, BTreeSet};
>   use std::convert::{AsRef, TryFrom};
>   use std::fmt;
>   use std::hash::{Hash, Hasher};
> @@ -28,7 +29,7 @@ use crate::{
>       DATASTORE_NOTIFY_STRING_SCHEMA, Fingerprint, GC_SCHEDULE_SCHEMA,
>       GROUP_OR_SNAPSHOT_PATH_REGEX_STR, GroupFilter, MaintenanceMode, MaintenanceType,
>       PROXMOX_SAFE_ID_FORMAT, PROXMOX_SAFE_ID_REGEX_STR, PRUNE_SCHEDULE_SCHEMA, SHA256_HEX_REGEX,
> -    SINGLE_LINE_COMMENT_SCHEMA, SNAPSHOT_PATH_REGEX_STR, UPID, Userid,
> +    SINGLE_LINE_COMMENT_SCHEMA, SNAPSHOT_ATTRIBUTE_RE, SNAPSHOT_PATH_REGEX_STR, UPID, Userid,
>       VERIFY_JOB_READ_THREADS_SCHEMA, VERIFY_JOB_VERIFY_THREADS_SCHEMA,
>   };
>   
> @@ -52,6 +53,8 @@ const_regex! {
>       pub GROUP_OR_SNAPSHOT_PATH_REGEX = concatcp!(r"^", GROUP_OR_SNAPSHOT_PATH_REGEX_STR, r"$");
>   
>       pub DATASTORE_MAP_REGEX = concatcp!(r"^(?:", PROXMOX_SAFE_ID_REGEX_STR, r"=)?", PROXMOX_SAFE_ID_REGEX_STR, r"$");
> +
> +    pub SNAPSHOT_ATTRIBUTE_REGEX = concatcp!(r"^", SNAPSHOT_ATTRIBUTE_RE, r"$");
>   }
>   
>   pub const CHUNK_DIGEST_FORMAT: ApiStringFormat = ApiStringFormat::Pattern(&SHA256_HEX_REGEX);
> @@ -90,6 +93,23 @@ pub const BACKUP_GROUP_SCHEMA: Schema = StringSchema::new("Backup Group")
>       .format(&BACKUP_GROUP_FORMAT)
>       .schema();
>   
> +pub const SNAPSHOT_ATTRIBUTE_FORMAT: ApiStringFormat =
> +    ApiStringFormat::Pattern(&SNAPSHOT_ATTRIBUTE_REGEX);
> +
> +pub const SNAPSHOT_ATTRIBUTE_SCHEMA: Schema = StringSchema::new(
> +    "Snapshot attribute, a key and one of its values. A key with several values is given once \
> +    per value.",
> +)
> +.format(&SNAPSHOT_ATTRIBUTE_FORMAT)
> +.type_text("KEY=VALUE")
> +.schema();
> +
> +pub const SNAPSHOT_ATTRIBUTE_LIST_SCHEMA: Schema =
> +    ArraySchema::new("List of snapshot attributes.", &SNAPSHOT_ATTRIBUTE_SCHEMA).schema();
> +
> +/// The attributes of a snapshot, each key has a set of values.
> +pub type SnapshotAttributes = BTreeMap<String, BTreeSet<String>>;
> +
>   /// The maximal, inclusive depth for namespaces from the root ns downwards
>   ///
>   /// The datastore root name space is at depth zero (0), so we have in total eight (8) levels
> diff --git a/pbs-api-types/src/lib.rs b/pbs-api-types/src/lib.rs
> index 21ef733d..cb1c231c 100644
> --- a/pbs-api-types/src/lib.rs
> +++ b/pbs-api-types/src/lib.rs
> @@ -94,6 +94,9 @@ pub const GROUP_OR_SNAPSHOT_PATH_REGEX_STR: &str =
>           r"(", BACKUP_TYPE_RE, ")/(", BACKUP_ID_RE, ")(?:/(", BACKUP_TIME_RE, r"))?",
>       );
>   
> +#[rustfmt::skip]
> +pub const SNAPSHOT_ATTRIBUTE_RE: &str = r"[a-z][a-z0-9\-]{0,31}=[A-Za-z0-9._+/\-]{1,128}";
> +

Is the 128 character limit on attribute values intentional?
PVE accepts longer tags and pool names. Considering pool names can be
nested, it may exceed the limit. I think this should be aligned to make
sure it works with current definitions, also please make sure the
docs are updated.

>   mod acl;
>   pub use acl::*;
>   
> 
> base-commit: 9bf4383b6ad4225367c7824023ad74769388de8f





^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC PATCH proxmox-backup 03/12] datastore: add attributes to backup snapshots
  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
  1 sibling, 0 replies; 25+ messages in thread
From: Samuel Rufinatscha @ 2026-11-18 12:55 UTC (permalink / raw)
  To: Jakob-Tobias Winter, pbs-devel

On 11/13/26 10:06 AM, Jakob-Tobias Winter wrote:
> A backup server knows little about where a backup comes from. Things
> like the tags and the resource pool of a Proxmox VE guest are only
> known to the client, but they are what users want to select backups
> by, for example in tape backup jobs.
> 
> Allow storing such information as attributes of a snapshot. They are
> kept in the unprotected part of the manifest, as suggested in [0].
> That way they can also be set for encrypted backups, and they stay
> with the snapshot when it is synced or written to tape.
> 
> Each attribute is a key with a list of values. A guest with several
> tags gets one list element for each tag, instead of one string that
> has to be split again.
> 
> A backup group has the attributes of its newest snapshot which has
> attributes. Snapshots without attributes are skipped on purpose: a
> client which does not set them, or fails to set them once, must not
> make a group lose its attributes.
> 
> The unprotected part of the manifest can be uploaded by the client,
> so values with an invalid format are dropped when reading it.
> 
> [0] https://bugzilla.proxmox.com/show_bug.cgi?id=4186#c32
> 
> Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
> ---
> The patches for proxmox-backup need the pbs-api-types of patches 1 and
> 2, so the dependency has to be bumped once they are released.
> 
>   pbs-datastore/src/backup_info.rs | 18 ++++++-
>   pbs-datastore/src/datastore.rs   | 15 +++++-
>   pbs-datastore/src/manifest.rs    | 87 +++++++++++++++++++++++++++++++-
>   3 files changed, 117 insertions(+), 3 deletions(-)
> 
> diff --git a/pbs-datastore/src/backup_info.rs b/pbs-datastore/src/backup_info.rs
> index cce2b699f..ea9dc9a2a 100644
> --- a/pbs-datastore/src/backup_info.rs
> +++ b/pbs-datastore/src/backup_info.rs
> @@ -17,7 +17,7 @@ use proxmox_systemd::escape_unit;
>   
>   use pbs_api_types::{
>       ArchiveType, Authid, BACKUP_DATE_REGEX, BackupArchiveName, BackupGroupDeleteStats,
> -    BackupNamespace, BackupType, GroupFilter, MANIFEST_BLOB_NAME, VerifyState,
> +    BackupNamespace, BackupType, GroupFilter, MANIFEST_BLOB_NAME, SnapshotAttributes, VerifyState,
>   };
>   use pbs_config::{BackupLockGuard, open_backup_lockfile};
>   
> @@ -148,6 +148,22 @@ impl BackupGroup {
>               .max_by_key(|item| item.backup_dir.backup_time()))
>       }
>   
> +    /// Returns the attributes of the backup group
> +    ///
> +    /// These are the attributes of the newest finished snapshot which has some stored. Snapshots
> +    /// without stored attributes are skipped, so a group keeps its attributes if a client did not
> +    /// provide them for newer snapshots.
> +    pub fn attributes(&self) -> Result<SnapshotAttributes, Error> {
> +        let mut backups = self.list_backups()?;
> +        BackupInfo::sort_list(&mut backups, false);
> +
> +        Ok(backups
> +            .iter()
> +            .filter(|info| info.is_finished())
> +            .find_map(|info| info.backup_dir.load_manifest().ok()?.0.attributes())

this ok() would silently skip an unreadable/corrupt manifest and
fallback to an older snapshot. i think it would make sense to
propagate it instead

> +            .unwrap_or_default())
> +    }
> +
>       pub fn last_successful_backup(&self) -> Result<Option<i64>, Error> {
>           let mut last = None;
>   
> diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
> index e6766a3b9..5b094a095 100644
> --- a/pbs-datastore/src/datastore.rs
> +++ b/pbs-datastore/src/datastore.rs
> @@ -34,7 +34,7 @@ use pbs_api_types::{
>       ArchiveType, Authid, BackupGroupDeleteStats, BackupNamespace, BackupType, ChunkOrder,
>       DEFAULT_SNAPSHOT_TIME_SKEW_SECS, DataStoreConfig, DatastoreBackendConfig, DatastoreBackendType,
>       GarbageCollectionCacheStats, GarbageCollectionStatus, MAX_NAMESPACE_DEPTH, MaintenanceMode,
> -    MaintenanceType, Operation, S3Statistics, UPID,
> +    MaintenanceType, Operation, S3Statistics, SnapshotAttributes, UPID,
>   };
>   use pbs_config::s3::S3_CFG_TYPE_ID;
>   use pbs_config::{BackupLockGuard, ConfigVersionCache};
> @@ -3458,6 +3458,19 @@ impl DataStore {
>           Ok(())
>       }
>   
> +    /// Set the attributes for the given snapshot, replacing the existing ones.
> +    pub fn set_attributes(
> +        self: &Arc<Self>,
> +        attributes: SnapshotAttributes,
> +        snapshot: BackupDir,
> +    ) -> Result<(), Error> {
> +        let backend = self.backend().context("failed to get backend")?;
> +        snapshot
> +            .update_manifest(&backend, |manifest| manifest.set_attributes(&attributes))
> +            .map_err(|err| format_err!("unable to update manifest blob - {err}"))?;
> +        Ok(())
> +    }
> +
>       /// Renames a corrupt chunk, returning the new path if the chunk was renamed successfully.
>       /// Returns with `Ok(None)` if the chunk source was not found.
>       pub fn rename_corrupt_chunk(&self, digest: &[u8; 32]) -> Result<Option<PathBuf>, Error> {
> diff --git a/pbs-datastore/src/manifest.rs b/pbs-datastore/src/manifest.rs
> index 16f9668f2..61982d64a 100644
> --- a/pbs-datastore/src/manifest.rs
> +++ b/pbs-datastore/src/manifest.rs
> @@ -9,7 +9,7 @@ use proxmox_sys::fs::{CreateOptions, replace_file};
>   
>   use pbs_api_types::{
>       BackupArchiveName, BackupType, CLIENT_LOG_BLOB_NAME, CryptMode, Fingerprint,
> -    MANIFEST_BLOB_NAME, SnapshotVerifyState,
> +    MANIFEST_BLOB_NAME, SNAPSHOT_ATTRIBUTE_REGEX, SnapshotAttributes, SnapshotVerifyState,
>   };
>   use pbs_tools::crypt_config::CryptConfig;
>   
> @@ -273,6 +273,27 @@ impl BackupManifest {
>           Ok(Some(serde_json::from_value::<SnapshotVerifyState>(verify)?))
>       }
>   
> +    /// Get the attributes of the snapshot
> +    ///
> +    /// Returns `None` if no attributes were stored for the snapshot. The unprotected part of the
> +    /// manifest can be provided by the client, so values with an invalid format are dropped and
> +    /// attributes which are not a list of values for each key count as not stored.
> +    pub fn attributes(&self) -> Option<SnapshotAttributes> {
> +        let mut attributes =
> +            SnapshotAttributes::deserialize(&self.unprotected["attributes"]).ok()?;
> +
> +        for (key, values) in attributes.iter_mut() {
> +            values.retain(|value| SNAPSHOT_ATTRIBUTE_REGEX.is_match(&format!("{key}={value}")));
> +        }
> +
> +        Some(attributes)
> +    }
> +
> +    /// Set the attributes of the snapshot, replacing the existing ones
> +    pub fn set_attributes(&mut self, attributes: &SnapshotAttributes) {
> +        self.unprotected["attributes"] = json!(attributes);
> +    }
> +
>       /// Set the sync-source-signature used to detect snapshot changes across encrypted/decrypted
>       /// sync flows.
>       ///
> @@ -597,3 +618,67 @@ fn test_manifest_eq_ignoring_verify_state() -> Result<(), Error> {
>   
>       Ok(())
>   }
> +
> +#[test]
> +fn test_manifest_attributes() -> Result<(), Error> {
> +    let crypt_config = CryptConfig::new([7; 32])?;
> +    let mut manifest = BackupManifest::new("vm/100/2020-06-26T13:56:05Z".parse()?);
> +    manifest.add_file(
> +        &"drive-scsi0.img.fidx".try_into()?,
> +        200,
> +        [1; 32],
> +        CryptMode::Encrypt,
> +    )?;
> +
> +    // nothing stored yet
> +    assert!(manifest.attributes().is_none());
> +
> +    let signature = manifest.signature(&crypt_config)?;
> +
> +    let mut attributes = SnapshotAttributes::new();
> +    for (key, value) in [
> +        ("pve-tag", "web"),
> +        ("pve-tag", "prod"),
> +        ("pve-pool", "customers/a"),
> +    ] {
> +        attributes
> +            .entry(key.to_string())
> +            .or_default()
> +            .insert(value.to_string());
> +    }
> +    manifest.set_attributes(&attributes);
> +
> +    // not covered by the signature, so attributes can be set for encrypted backups
> +    assert_eq!(manifest.signature(&crypt_config)?, signature);
> +
> +    // each value is a list element of its own, in a stable order
> +    assert_eq!(
> +        manifest.unprotected["attributes"],
> +        json!({ "pve-pool": ["customers/a"], "pve-tag": ["prod", "web"] }),
> +    );
> +
> +    let data = manifest.to_string(Some(&crypt_config))?;
> +    let mut manifest = BackupManifest::from_data(data.as_bytes(), Some(&crypt_config), false)?;
> +    assert_eq!(manifest.attributes(), Some(attributes));
> +
> +    // stored, but empty
> +    manifest.set_attributes(&SnapshotAttributes::new());
> +    assert_eq!(manifest.attributes(), Some(SnapshotAttributes::new()));
> +
> +    // data which does not come from the server
> +    manifest.unprotected["attributes"] = json!("pve-tag=prod");
> +    assert!(manifest.attributes().is_none());
> +
> +    manifest.unprotected["attributes"] = json!({ "pve-tag": "prod;web" });
> +    assert!(manifest.attributes().is_none());
> +
> +    manifest.unprotected["attributes"] = json!({
> +        "pve-tag": ["prod", "with space", "web;db"],
> +        "Invalid Key": ["prod"],
> +    });
> +    let attributes = manifest.attributes().unwrap();
> +    assert_eq!(attributes["pve-tag"].iter().collect::<Vec<_>>(), ["prod"]);
> +    assert!(attributes["Invalid Key"].is_empty());
> +
> +    Ok(())
> +}
> 
> base-commit: a7eb4e8a1477df960570fa72e9e7e2b8ac58bdab





^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC PATCH proxmox-backup 05/12] tape: backup job: allow selecting groups by snapshot attributes
  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
  0 siblings, 1 reply; 25+ messages in thread
From: Samuel Rufinatscha @ 2026-11-18 13:06 UTC (permalink / raw)
  To: Jakob-Tobias Winter, pbs-devel

On 11/13/26 10:06 AM, Jakob-Tobias Winter wrote:
> Tape backup jobs can only select backup groups by type and ID so
> far. Such filters have to be kept up to date by hand for every new
> guest, and an ID says nothing about how important a guest is.
> 
> Add an attribute filter to tape backup jobs. With a client which
> stores the tags of a guest as snapshot attributes, production and
> test guests can be written to different media pools with different
> retention policies, by using one job for each media pool. The media
> sets of the production guests then need fewer tapes and are faster
> to restore.
> 
> A group is included if it has one of the attributes given as include
> filter, or if there are no include filters, and none of the
> attributes given as exclude filter. The filter is applied in
> addition to the group filter.
> 
> Jobs without an attribute filter select the same groups as before.
> 
> Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
> ---
> A version without this patch cannot parse a tape-job.cfg in which the
> new option is used (unknown property 'attribute-filter').
> 
>   src/api2/config/tape_backup_job.rs |  8 ++++++++
>   src/api2/tape/backup.rs            | 19 ++++++++++++++++---
>   src/bin/proxmox-tape.rs            | 11 ++++++++---
>   3 files changed, 32 insertions(+), 6 deletions(-)
> 
> diff --git a/src/api2/config/tape_backup_job.rs b/src/api2/config/tape_backup_job.rs
> index 4bfc7f871..cb9e63ea6 100644
> --- a/src/api2/config/tape_backup_job.rs
> +++ b/src/api2/config/tape_backup_job.rs
> @@ -144,6 +144,8 @@ pub enum DeletableProperty {
>       NotificationMode,
>       /// Delete the 'group_filter' property
>       GroupFilter,
> +    /// Delete the 'attribute-filter' property
> +    AttributeFilter,
>       /// Delete the 'max-depth' property
>       MaxDepth,
>       /// Delete the 'ns' property
> @@ -227,6 +229,9 @@ pub fn update_tape_backup_job(
>                   DeletableProperty::GroupFilter => {
>                       data.setup.group_filter = None;
>                   }
> +                DeletableProperty::AttributeFilter => {
> +                    data.setup.attribute_filter = None;
> +                }
>                   DeletableProperty::MaxDepth => {
>                       data.setup.max_depth = None;
>                   }
> @@ -268,6 +273,9 @@ pub fn update_tape_backup_job(
>       if update.setup.group_filter.is_some() {
>           data.setup.group_filter = update.setup.group_filter;
>       }
> +    if update.setup.attribute_filter.is_some() {
> +        data.setup.attribute_filter = update.setup.attribute_filter;
> +    }
>       if update.setup.ns.is_some() {
>           data.setup.ns = update.setup.ns;
>       }
> diff --git a/src/api2/tape/backup.rs b/src/api2/tape/backup.rs
> index c0a4ca65b..c2797a97a 100644
> --- a/src/api2/tape/backup.rs
> +++ b/src/api2/tape/backup.rs
> @@ -11,9 +11,9 @@ use proxmox_schema::api;
>   use proxmox_worker_task::WorkerTaskContext;
>   
>   use pbs_api_types::{
> -    Authid, JOB_ID_SCHEMA, MediaPoolConfig, Operation, PRIV_TAPE_AUDIT, TapeBackupJobConfig,
> -    TapeBackupJobSetup, TapeBackupJobStatus, UPID_SCHEMA, print_ns_and_snapshot,
> -    print_store_and_ns,
> +    AttributeFilter, Authid, JOB_ID_SCHEMA, MediaPoolConfig, Operation, PRIV_TAPE_AUDIT,
> +    TapeBackupJobConfig, TapeBackupJobSetup, TapeBackupJobStatus, UPID_SCHEMA,
> +    print_ns_and_snapshot, print_store_and_ns,
>   };
>   
>   use pbs_config::CachedUserInfo;
> @@ -391,6 +391,19 @@ fn backup_worker(
>           None => group_list,
>       };
>   
> +    let group_list = match &setup.attribute_filter {
> +        Some(filters) => {
> +            let mut filtered = Vec::new();
> +            for group in group_list {
> +                if AttributeFilter::apply_filters(filters, &group.attributes()?) {

once we filter for individual snapshots as suggested by @Christian,
how should latest-only behave?

For example, if monday and tuesday are tagged with "test" and wednesday
is tagged with "prod", should a test job copy the tuesday snapshot or
skip the group because the latest backup in the group is on "prod"?

I would lean towards copying tuesday’s snapshot in this example since
it’s the newest one and it matches the job’s filter

> +                    filtered.push(group);
> +                }
> +            }
> +            filtered
> +        }
> +        None => group_list,
> +    };
> +
>       info!(
>           "found {} groups (out of {group_count_full} total)",
>           group_list.len()
> diff --git a/src/bin/proxmox-tape.rs b/src/bin/proxmox-tape.rs
> index dcbf2d0fb..6ea46b709 100644
> --- a/src/bin/proxmox-tape.rs
> +++ b/src/bin/proxmox-tape.rs
> @@ -19,9 +19,10 @@ use pbs_config::drive::complete_drive_name;
>   use pbs_config::media_pool::complete_pool_name;
>   
>   use pbs_api_types::{
> -    Authid, BackupNamespace, DATASTORE_MAP_LIST_SCHEMA, DATASTORE_SCHEMA, DRIVE_NAME_SCHEMA,
> -    GROUP_FILTER_LIST_SCHEMA, GroupListItem, MEDIA_LABEL_SCHEMA, MEDIA_POOL_NAME_SCHEMA,
> -    NS_MAX_DEPTH_SCHEMA, TAPE_RESTORE_NAMESPACE_SCHEMA, TAPE_RESTORE_SNAPSHOT_SCHEMA, Userid,
> +    ATTRIBUTE_FILTER_LIST_SCHEMA, Authid, BackupNamespace, DATASTORE_MAP_LIST_SCHEMA,
> +    DATASTORE_SCHEMA, DRIVE_NAME_SCHEMA, GROUP_FILTER_LIST_SCHEMA, GroupListItem,
> +    MEDIA_LABEL_SCHEMA, MEDIA_POOL_NAME_SCHEMA, NS_MAX_DEPTH_SCHEMA, TAPE_RESTORE_NAMESPACE_SCHEMA,
> +    TAPE_RESTORE_SNAPSHOT_SCHEMA, Userid,
>   };
>   use pbs_tape::{BlockReadError, MediaContentHeader, PROXMOX_BACKUP_CONTENT_HEADER_MAGIC_1_0};
>   
> @@ -850,6 +851,10 @@ async fn clean_drive(mut param: Value) -> Result<(), Error> {
>                   schema: GROUP_FILTER_LIST_SCHEMA,
>                   optional: true,
>               },
> +            "attribute-filter": {
> +                schema: ATTRIBUTE_FILTER_LIST_SCHEMA,
> +                optional: true,
> +            },
>               ns: {
>                   type: BackupNamespace,
>                   optional: true,





^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC PATCH many 00/12] snapshot attributes for tags and pools of PVE guests, tape job filter
  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
  0 siblings, 0 replies; 25+ messages in thread
From: Samuel Rufinatscha @ 2026-11-18 13:07 UTC (permalink / raw)
  To: Christian Ebner, Jakob-Tobias Winter, pbs-devel

Agree with @Christian's points here. Please see two more comments
inline.

On 11/16/26 3:57 PM, Christian Ebner wrote:
> Thanks for the patches, I took a first look and think the overall 
> approach does look fine, left a few comments on the individual patches.
> 
> CC'ing Samuel since he started looking into snapshot attributes recently 
> and might have other/additional comments and suggestions.
> 
> On 11/13/26 10:07 AM, Jakob-Tobias Winter wrote:
>> Tape backup jobs on a Proxmox Backup Server select backup groups by
>> type and ID only. Splitting guests over media pools by what they are,
>> say production and test guests with different retention, means keeping
>> lists of IDs up to date by hand in every job. In Proxmox VE the same
>> guests are already organized with tags and resource pools, but the
>> backup server knows about neither.
>>
>> This series lets Proxmox VE store the tags and the resource pool of a
>> guest with each backup, as attributes of the snapshot, and adds a
>> filter on such attributes to tape backup jobs:
>>
>>    # proxmox-tape backup-job create prod --store store1 --drive lto1 \
>>        --pool prod --attribute-filter pve-tag=prod
>>    # proxmox-tape backup-job create rest --store store1 --drive lto1 \
>>        --pool rest --attribute-filter exclude:pve-tag=prod
>>
>> It is an RFC, as it defines a format and names that others would have
>> to live with, and because [1] is assigned already. If there is work in
>> progress for it, I am happy to adapt this series to it or to drop
>> whatever overlaps.
>>
>> Proxmox Backup Server
>> ---------------------
>>
>> proxmox 1-2, proxmox-backup 3-7
>>
>> Snapshots get attributes, a map from a key to a list of values. They
>> are kept in the unprotected part of the manifest, as suggested in [0],
>> so they can be set for encrypted backups without touching the
>> signature, and they stay with a snapshot that is synced or written to
>> tape. A guest with several tags gets one value per tag, nothing is
>> joined into one string.
>>
>> They are read and set through a new endpoint next to the notes,
>> GET/PUT /admin/datastore/{store}/attributes, with the privileges of
>> the notes, as a list of KEY=VALUE entries. A PUT replaces all
>> attributes of the snapshot. An empty set is stored as well, to tell a
>> guest without tags from a client which never set anything.
>>
>> Tape backup jobs get the option 'attribute-filter', a list of
>> [exclude:|include:]KEY=VALUE with the include and exclude rules of
>> group filters, applied after the group filter. A group has the
>> attributes of its newest finished snapshot that has some, so a single
>> backup without attributes does not move a group to another media pool.
>> Besides the API there is the option for 'proxmox-tape', a field in the
>> job window, a column in the job list and documentation.
>>
>> The server does not interpret keys or values.
>>
>> Proxmox VE
>> ----------
>>
>> storage 8, guest-common 9, manager 10-11, docs 12
>>
>> After a backup to a PBS storage, vzdump sets 'pve-tag' (one value per
>> tag) and 'pve-pool', with the prefix suggested in [0], directly
>> through the API like the protection flag. A guest in a nested pool
>> gets that pool and each of its parent pools as values, so a filter
>> for a pool also matches the guests of the pools nested in it. A
>> server without the endpoint answers 404, which is only noted in the
>> task log.
>>
>> As the attributes are not encrypted, the new vzdump option
>> 'pbs-snapshot-attributes' (default on) can turn this off for a job, a
>> single call, or a node in /etc/vzdump.conf.
>>
>> Compatibility
>> -------------
>>
>> * Jobs without the new option select the same groups as before, and
>>    nothing changes on tape or in the catalogs. A tape job written by
>>    4.2.9 was read and run unchanged.
>> * The other way round, a version without the series cannot parse a
>>    tape-job.cfg in which the option is used (unknown property), like
>>    with other new job properties.
>> * A backup server without the series leaves the attributes in the
>>    manifest alone (tried with 4.2.9).
>> * A PVE node without the series ignores the vzdump option in jobs.cfg
>>    with a warning.
>>
>> Open questions
>> --------------
>>
>> * The names: 'pve-tag', 'pve-pool', 'attribute-filter' and
>>    'pbs-snapshot-attributes'.
> 
> One potential issue I see arise is the additional potential for naming 
> conflicts. While I would expect the backup groups to be organized within 
> different namespaces, that might not always be the case. So maybe it 
> makes sense to add the cluster name as additional tag as well?
> 
> However, each additional tag leaks more information to the PBS, which 
> might not be what some users expect. So a bit torn on this one....
> 

More of a workaround but for setups where clusters share a namespace,
maybe requiring an additional user defined PVE tag would be fine for
now? An user could additionally tag the relevant guests with the
cluster name (or any other prefered alias) and filter based on that.

> Maybe it would make sense to allow users to control which information is 
> being set as attribute? E.g. tags only?
> 
>> * A guest in the pool 'a/b' gets the 'pve-pool' values 'a/b' and 'a',
>>    so one filter covers a pool with everything nested in it. A backup
>>    job for the pool 'a' in Proxmox VE only takes the direct members of
>>    'a'. Is that difference fine, or should only 'a/b' be stored?
> 
> IMHO this should reflect the exact pool. While it may be convenient to 
> only have to specify e.g. a filter on `a` on the PBS side, I think this 
> would not reflect the actual state? Filters on the PBS side can any-ways 
> be additive? Further, what if one wants snapshots from pool `a/b` but 
> not `a`?
> 
>>    Since nested pools are quite new I wasn't sure about that at all.
>> * Setting the attributes after the backup, like notes and protection,
>>    needs no change in the backup protocol or in the QEMU library. But
>>    a user that may only append, as in [2], could then not set them.
>>    Passing them when the backup is created would solve that, at the
>>    price of changes in proxmox-backup-qemu, pve-qemu, qemu-server and
>>    pve-container which I found a bit excessive for some attributes.
> 
> Although more work and dependency churn, adding this for exactly the 
> append only backup you mentioned makes this the way to go IMHO.
> 
>> * On by default with the option to opt out, or the other way round?
>>    Is the switch needed at all?
> 
> I would prefer this to be opt-in, especially since it leaks tags and 
> pool information to the PBS instance even if snapshots are encrypted, so 
> any user should explicitly opt-in after being made aware of that.
> 
>> * This is a separate job option and not a new kind of group filter,
>>    as group filters are shared with sync jobs and match on the name of
>>    a group only. Using attributes in other jobs and showing them in the
>>    web interface could follow, if wanted.
> 
> Yes, extending this to other jobs and especially show this kind of 
> information to users with the required permissions in the PBS UI would 
> be the natural followups.

I think showing the stored attributes under Datastore > Content
when a snapshot is inspected would be a good start, considering the 
permissions hold for that? this may help users check which keys and 
values to use when configuring a job.

> 
>> * For a group in which no snapshot has attributes, all its manifests
>>    are read when a job with a filter runs. Is that acceptable, or
>>    should only the newest few be looked at?
> 
> As noted on the individual patch for this, I'm not so sure about the 
> group attributes as defined at all. Might make sense to do this on a 
> per-snapshot level like e.g. for sync jobs with the encrypted-only/ 
> verified-only flags.
> 
>>
>> Testing
>> -------
>>
>> proxmox-backup master (4.2.11) with the series: rustfmt, clippy
>> without new warnings, every commit builds, 'cargo test --workspace'
>> passes (162 tests, one of them new), the docs build as HTML and man
>> pages. The tests of pbs-api-types pass, with five new ones for the
>> filter. pbs-api-types 1.0.22 came from the proxmox repository, as it
>> is not in the devel repository yet.
>>
>> The PVE patches are perltidy and biome clean, and the test suites of
>> the three Perl repositories give the same results with and without
>> them.
>>
>> End to end in an unprivileged sandbox with the real daemons of both
>> products: the packages of PVE 9.2.26 with the PVE patches applied and
>> a backup server built from master with the series. There is no KVM in
>> it, so the guests were stopped VMs and a container.
>>
>> * vzdump of VMs and a container to a plain and an encrypted PBS
>>    storage, the latter with a namespace, as a user with DatastoreBackup
>>    only; several tags, pools nested up to three levels, changed and
>>    removed tags; the option per call, per job (also run by pvescheduler
>>    and from the web interface) and in /etc/vzdump.conf; restore of an
>>    encrypted backup
>> * the same against 4.2.9 and plain master: noted in the task log, no
>>    warning, the backup is fine
>> * the API as owner, as another user, as auditor and as admin; invalid
>>    values; verification, notes, protection and a local sync job keep
>>    the attributes
>> * tape jobs on the virtual tape drive (needs [3]) selecting by tag, by
>>    pool and by the parent of a nested pool, combined with a group
>>    filter and with namespaces, started by hand and by the scheduler; a
>>    restore from tape keeps the attributes
>> * both web interfaces in a browser
>>
>> Not yet tested: real tape hardware, clusters with more than one node,
>> datastores with an S3 backend.
>>
>> I wasn't sure if I was supposed to send to pbs-devel and pve-devel.
>>
>> [0] https://bugzilla.proxmox.com/show_bug.cgi?id=4186#c32
>> [1] https://bugzilla.proxmox.com/show_bug.cgi?id=7452
>> [2] https://lore.proxmox.com/pbs-devel/20261106172235.890542-1- 
>> c.ebner@proxmox.com/
>> [3] https://lore.proxmox.com/pbs-devel/20261111204853.531985-2- 
>> tobias@stuttgart.de/
>>
>>
>> proxmox:
>>
>> Jakob-Tobias Winter (2):
>>    pbs-api-types: add types and schemas for snapshot attributes
>>    pbs-api-types: tape: add attribute filter to backup jobs
>>
>>   pbs-api-types/src/datastore.rs                |  22 ++-
>>   pbs-api-types/src/jobs.rs                     |  98 ++++++++++-
>>   pbs-api-types/src/lib.rs                      |   3 +
>>   pbs-api-types/tests/attribute_filter_tests.rs | 155 ++++++++++++++++++
>>   4 files changed, 276 insertions(+), 2 deletions(-)
>>   create mode 100644 pbs-api-types/tests/attribute_filter_tests.rs
>>
>>
>> proxmox-backup:
>>
>> Jakob-Tobias Winter (5):
>>    datastore: add attributes to backup snapshots
>>    fix #7452: api: datastore: add endpoints for snapshot attributes
>>    tape: backup job: allow selecting groups by snapshot attributes
>>    ui: tape backup job: add attribute filter
>>    docs: describe snapshot attributes and the tape job attribute filter
>>
>>   docs/pve-integration.rst           |  23 ++++++
>>   docs/tape-backup.rst               |  27 ++++++
>>   docs/terminology.rst               |  33 ++++++++
>>   pbs-datastore/src/backup_info.rs   |  18 +++-
>>   pbs-datastore/src/datastore.rs     |  15 +++-
>>   pbs-datastore/src/manifest.rs      |  87 +++++++++++++++++++-
>>   src/api2/admin/datastore.rs        | 128 ++++++++++++++++++++++++++++-
>>   src/api2/config/tape_backup_job.rs |   8 ++
>>   src/api2/tape/backup.rs            |  19 ++++-
>>   src/bin/proxmox-tape.rs            |  11 ++-
>>   www/tape/BackupJobs.js             |   7 ++
>>   www/tape/window/TapeBackupJob.js   |  27 +++++-
>>   12 files changed, 391 insertions(+), 12 deletions(-)
>>
>>
>> storage:
>>
>> Jakob-Tobias Winter (1):
>>    pbs: add helper to set the attributes of a backup snapshot
>>
>>   src/PVE/Storage/PBSPlugin.pm | 23 +++++++++++++++++++++++
>>   1 file changed, 23 insertions(+)
>>
>>
>> guest-common:
>>
>> Jakob-Tobias Winter (1):
>>    vzdump: add pbs-snapshot-attributes option
>>
>>   src/PVE/VZDump/Common.pm | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>>
>> manager:
>>
>> Jakob-Tobias Winter (2):
>>    vzdump: store guest tags and pool as snapshot attributes on PBS
>>    ui: backup job: add selector for PBS snapshot attributes
>>
>>   PVE/VZDump.pm                               | 42 +++++++++++++++++++++
>>   configs/vzdump.conf                         |  1 +
>>   www/manager6/panel/BackupAdvancedOptions.js | 22 +++++++++++
>>   3 files changed, 65 insertions(+)
>>
>>
>> docs:
>>
>> Jakob-Tobias Winter (1):
>>    vzdump: describe snapshot attributes on Proxmox Backup Server
>>
>>   vzdump.adoc | 36 ++++++++++++++++++++++++++++++++++++
>>   1 file changed, 36 insertions(+)
>>
>>
>> Summary over all repositories:
>>    22 files changed, 799 insertions(+), 14 deletions(-)
>>
> 





^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC PATCH many 00/12] snapshot attributes for tags and pools of PVE guests, tape job filter
  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
                   ` (12 preceding siblings ...)
  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 14:22 ` Samuel Rufinatscha
  2026-11-19 11:58   ` Jakob-Tobias Winter
  13 siblings, 1 reply; 25+ messages in thread
From: Samuel Rufinatscha @ 2026-11-18 14:22 UTC (permalink / raw)
  To: Jakob-Tobias Winter, pbs-devel

Thanks for the series @Jakob and thanks for looping me in @Christian.

The overall approach looks good to me too.
I left a few additional inline comments on the individual patches.

I agree with Christian’s suggestion to supply the attributes when the
backup session starts and check each snapshot’s own attributes when
filtering.

Could we also show the stored attributes when inspecting a snapshot
under Datastore > Content? That would make it easier to see which keys
and values to use in a job filter

On 11/13/26 10:07 AM, Jakob-Tobias Winter wrote:
> Tape backup jobs on a Proxmox Backup Server select backup groups by
> type and ID only. Splitting guests over media pools by what they are,
> say production and test guests with different retention, means keeping
> lists of IDs up to date by hand in every job. In Proxmox VE the same
> guests are already organized with tags and resource pools, but the
> backup server knows about neither.
> 
> This series lets Proxmox VE store the tags and the resource pool of a
> guest with each backup, as attributes of the snapshot, and adds a
> filter on such attributes to tape backup jobs:
> 
>    # proxmox-tape backup-job create prod --store store1 --drive lto1 \
>        --pool prod --attribute-filter pve-tag=prod
>    # proxmox-tape backup-job create rest --store store1 --drive lto1 \
>        --pool rest --attribute-filter exclude:pve-tag=prod
> 
> It is an RFC, as it defines a format and names that others would have
> to live with, and because [1] is assigned already. If there is work in
> progress for it, I am happy to adapt this series to it or to drop
> whatever overlaps.
> 
> Proxmox Backup Server
> ---------------------
> 
> proxmox 1-2, proxmox-backup 3-7
> 
> Snapshots get attributes, a map from a key to a list of values. They
> are kept in the unprotected part of the manifest, as suggested in [0],
> so they can be set for encrypted backups without touching the
> signature, and they stay with a snapshot that is synced or written to
> tape. A guest with several tags gets one value per tag, nothing is
> joined into one string.
> 
> They are read and set through a new endpoint next to the notes,
> GET/PUT /admin/datastore/{store}/attributes, with the privileges of
> the notes, as a list of KEY=VALUE entries. A PUT replaces all
> attributes of the snapshot. An empty set is stored as well, to tell a
> guest without tags from a client which never set anything.
> 
> Tape backup jobs get the option 'attribute-filter', a list of
> [exclude:|include:]KEY=VALUE with the include and exclude rules of
> group filters, applied after the group filter. A group has the
> attributes of its newest finished snapshot that has some, so a single
> backup without attributes does not move a group to another media pool.
> Besides the API there is the option for 'proxmox-tape', a field in the
> job window, a column in the job list and documentation.
> 
> The server does not interpret keys or values.
> 
> Proxmox VE
> ----------
> 
> storage 8, guest-common 9, manager 10-11, docs 12
> 
> After a backup to a PBS storage, vzdump sets 'pve-tag' (one value per
> tag) and 'pve-pool', with the prefix suggested in [0], directly
> through the API like the protection flag. A guest in a nested pool
> gets that pool and each of its parent pools as values, so a filter
> for a pool also matches the guests of the pools nested in it. A
> server without the endpoint answers 404, which is only noted in the
> task log.
> 
> As the attributes are not encrypted, the new vzdump option
> 'pbs-snapshot-attributes' (default on) can turn this off for a job, a
> single call, or a node in /etc/vzdump.conf.
> 
> Compatibility
> -------------
> 
> * Jobs without the new option select the same groups as before, and
>    nothing changes on tape or in the catalogs. A tape job written by
>    4.2.9 was read and run unchanged.
> * The other way round, a version without the series cannot parse a
>    tape-job.cfg in which the option is used (unknown property), like
>    with other new job properties.
> * A backup server without the series leaves the attributes in the
>    manifest alone (tried with 4.2.9).
> * A PVE node without the series ignores the vzdump option in jobs.cfg
>    with a warning.
> 
> Open questions
> --------------
> 
> * The names: 'pve-tag', 'pve-pool', 'attribute-filter' and
>    'pbs-snapshot-attributes'.
> * A guest in the pool 'a/b' gets the 'pve-pool' values 'a/b' and 'a',
>    so one filter covers a pool with everything nested in it. A backup
>    job for the pool 'a' in Proxmox VE only takes the direct members of
>    'a'. Is that difference fine, or should only 'a/b' be stored?
>    Since nested pools are quite new I wasn't sure about that at all.
> * Setting the attributes after the backup, like notes and protection,
>    needs no change in the backup protocol or in the QEMU library. But
>    a user that may only append, as in [2], could then not set them.
>    Passing them when the backup is created would solve that, at the
>    price of changes in proxmox-backup-qemu, pve-qemu, qemu-server and
>    pve-container which I found a bit excessive for some attributes.
> * On by default with the option to opt out, or the other way round?
>    Is the switch needed at all?
> * This is a separate job option and not a new kind of group filter,
>    as group filters are shared with sync jobs and match on the name of
>    a group only. Using attributes in other jobs and showing them in the
>    web interface could follow, if wanted.
> * For a group in which no snapshot has attributes, all its manifests
>    are read when a job with a filter runs. Is that acceptable, or
>    should only the newest few be looked at?
> 
> Testing
> -------
> 
> proxmox-backup master (4.2.11) with the series: rustfmt, clippy
> without new warnings, every commit builds, 'cargo test --workspace'
> passes (162 tests, one of them new), the docs build as HTML and man
> pages. The tests of pbs-api-types pass, with five new ones for the
> filter. pbs-api-types 1.0.22 came from the proxmox repository, as it
> is not in the devel repository yet.
> 
> The PVE patches are perltidy and biome clean, and the test suites of
> the three Perl repositories give the same results with and without
> them.
> 
> End to end in an unprivileged sandbox with the real daemons of both
> products: the packages of PVE 9.2.26 with the PVE patches applied and
> a backup server built from master with the series. There is no KVM in
> it, so the guests were stopped VMs and a container.
> 
> * vzdump of VMs and a container to a plain and an encrypted PBS
>    storage, the latter with a namespace, as a user with DatastoreBackup
>    only; several tags, pools nested up to three levels, changed and
>    removed tags; the option per call, per job (also run by pvescheduler
>    and from the web interface) and in /etc/vzdump.conf; restore of an
>    encrypted backup
> * the same against 4.2.9 and plain master: noted in the task log, no
>    warning, the backup is fine
> * the API as owner, as another user, as auditor and as admin; invalid
>    values; verification, notes, protection and a local sync job keep
>    the attributes
> * tape jobs on the virtual tape drive (needs [3]) selecting by tag, by
>    pool and by the parent of a nested pool, combined with a group
>    filter and with namespaces, started by hand and by the scheduler; a
>    restore from tape keeps the attributes
> * both web interfaces in a browser
> 
> Not yet tested: real tape hardware, clusters with more than one node,
> datastores with an S3 backend.
> 
> I wasn't sure if I was supposed to send to pbs-devel and pve-devel.
> 
> [0] https://bugzilla.proxmox.com/show_bug.cgi?id=4186#c32
> [1] https://bugzilla.proxmox.com/show_bug.cgi?id=7452
> [2] https://lore.proxmox.com/pbs-devel/20261106172235.890542-1-c.ebner@proxmox.com/
> [3] https://lore.proxmox.com/pbs-devel/20261111204853.531985-2-tobias@stuttgart.de/
> 
> 
> proxmox:
> 
> Jakob-Tobias Winter (2):
>    pbs-api-types: add types and schemas for snapshot attributes
>    pbs-api-types: tape: add attribute filter to backup jobs
> 
>   pbs-api-types/src/datastore.rs                |  22 ++-
>   pbs-api-types/src/jobs.rs                     |  98 ++++++++++-
>   pbs-api-types/src/lib.rs                      |   3 +
>   pbs-api-types/tests/attribute_filter_tests.rs | 155 ++++++++++++++++++
>   4 files changed, 276 insertions(+), 2 deletions(-)
>   create mode 100644 pbs-api-types/tests/attribute_filter_tests.rs
> 
> 
> proxmox-backup:
> 
> Jakob-Tobias Winter (5):
>    datastore: add attributes to backup snapshots
>    fix #7452: api: datastore: add endpoints for snapshot attributes
>    tape: backup job: allow selecting groups by snapshot attributes
>    ui: tape backup job: add attribute filter
>    docs: describe snapshot attributes and the tape job attribute filter
> 
>   docs/pve-integration.rst           |  23 ++++++
>   docs/tape-backup.rst               |  27 ++++++
>   docs/terminology.rst               |  33 ++++++++
>   pbs-datastore/src/backup_info.rs   |  18 +++-
>   pbs-datastore/src/datastore.rs     |  15 +++-
>   pbs-datastore/src/manifest.rs      |  87 +++++++++++++++++++-
>   src/api2/admin/datastore.rs        | 128 ++++++++++++++++++++++++++++-
>   src/api2/config/tape_backup_job.rs |   8 ++
>   src/api2/tape/backup.rs            |  19 ++++-
>   src/bin/proxmox-tape.rs            |  11 ++-
>   www/tape/BackupJobs.js             |   7 ++
>   www/tape/window/TapeBackupJob.js   |  27 +++++-
>   12 files changed, 391 insertions(+), 12 deletions(-)
> 
> 
> storage:
> 
> Jakob-Tobias Winter (1):
>    pbs: add helper to set the attributes of a backup snapshot
> 
>   src/PVE/Storage/PBSPlugin.pm | 23 +++++++++++++++++++++++
>   1 file changed, 23 insertions(+)
> 
> 
> guest-common:
> 
> Jakob-Tobias Winter (1):
>    vzdump: add pbs-snapshot-attributes option
> 
>   src/PVE/VZDump/Common.pm | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> 
> manager:
> 
> Jakob-Tobias Winter (2):
>    vzdump: store guest tags and pool as snapshot attributes on PBS
>    ui: backup job: add selector for PBS snapshot attributes
> 
>   PVE/VZDump.pm                               | 42 +++++++++++++++++++++
>   configs/vzdump.conf                         |  1 +
>   www/manager6/panel/BackupAdvancedOptions.js | 22 +++++++++++
>   3 files changed, 65 insertions(+)
> 
> 
> docs:
> 
> Jakob-Tobias Winter (1):
>    vzdump: describe snapshot attributes on Proxmox Backup Server
> 
>   vzdump.adoc | 36 ++++++++++++++++++++++++++++++++++++
>   1 file changed, 36 insertions(+)
> 
> 
> Summary over all repositories:
>    22 files changed, 799 insertions(+), 14 deletions(-)
> 





^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC PATCH proxmox-backup 05/12] tape: backup job: allow selecting groups by snapshot attributes
  2026-11-18 13:06   ` Samuel Rufinatscha
@ 2026-11-18 15:19     ` Christian Ebner
  0 siblings, 0 replies; 25+ messages in thread
From: Christian Ebner @ 2026-11-18 15:19 UTC (permalink / raw)
  To: Samuel Rufinatscha, Jakob-Tobias Winter, pbs-devel

On 11/18/26 2:07 PM, Samuel Rufinatscha wrote:
> On 11/13/26 10:06 AM, Jakob-Tobias Winter wrote:
>> Tape backup jobs can only select backup groups by type and ID so
>> far. Such filters have to be kept up to date by hand for every new
>> guest, and an ID says nothing about how important a guest is.
>>
>> Add an attribute filter to tape backup jobs. With a client which
>> stores the tags of a guest as snapshot attributes, production and
>> test guests can be written to different media pools with different
>> retention policies, by using one job for each media pool. The media
>> sets of the production guests then need fewer tapes and are faster
>> to restore.
>>
>> A group is included if it has one of the attributes given as include
>> filter, or if there are no include filters, and none of the
>> attributes given as exclude filter. The filter is applied in
>> addition to the group filter.
>>
>> Jobs without an attribute filter select the same groups as before.
>>
>> Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
>> ---
>> A version without this patch cannot parse a tape-job.cfg in which the
>> new option is used (unknown property 'attribute-filter').
>>
>>   src/api2/config/tape_backup_job.rs |  8 ++++++++
>>   src/api2/tape/backup.rs            | 19 ++++++++++++++++---
>>   src/bin/proxmox-tape.rs            | 11 ++++++++---
>>   3 files changed, 32 insertions(+), 6 deletions(-)
>>
>> diff --git a/src/api2/config/tape_backup_job.rs b/src/api2/config/ 
>> tape_backup_job.rs
>> index 4bfc7f871..cb9e63ea6 100644
>> --- a/src/api2/config/tape_backup_job.rs
>> +++ b/src/api2/config/tape_backup_job.rs

[..]

>> @@ -391,6 +391,19 @@ fn backup_worker(
>>           None => group_list,
>>       };
>> +    let group_list = match &setup.attribute_filter {
>> +        Some(filters) => {
>> +            let mut filtered = Vec::new();
>> +            for group in group_list {
>> +                if AttributeFilter::apply_filters(filters, 
>> &group.attributes()?) {
> 
> once we filter for individual snapshots as suggested by @Christian,
> how should latest-only behave?
> 
> For example, if monday and tuesday are tagged with "test" and wednesday
> is tagged with "prod", should a test job copy the tuesday snapshot or
> skip the group because the latest backup in the group is on "prod"?

I lean towards handling this similar to verified-/encrypted-only is 
handled in sync jobs, where transfer-last is only applied after 
filtering [0]. That attribute filters are applied before cutoff via 
latest-only must then be documented explicitly.

> I would lean towards copying tuesday’s snapshot in this example since
> it’s the newest one and it matches the job’s filter

[0] 
https://git.proxmox.com/?p=proxmox-backup.git;a=blob;f=src/server/pull.rs;h=763fdb5d3bf873d68281ceca5f2e9abab385e196;hb=HEAD#l1204




^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC PATCH many 00/12] snapshot attributes for tags and pools of PVE guests, tape job filter
  2026-11-18 14:22 ` Samuel Rufinatscha
@ 2026-11-19 11:58   ` Jakob-Tobias Winter
  0 siblings, 0 replies; 25+ messages in thread
From: Jakob-Tobias Winter @ 2026-11-19 11:58 UTC (permalink / raw)
  To: pbs-devel

Thanks to both for your feedback, I will be able to invest some more 
time next week.


On 11/18/26 15:22, Samuel Rufinatscha wrote:
> Thanks for the series @Jakob and thanks for looping me in @Christian.
> 
> The overall approach looks good to me too.
> I left a few additional inline comments on the individual patches.
> 
> I agree with Christian’s suggestion to supply the attributes when the
> backup session starts and check each snapshot’s own attributes when
> filtering.
> 
> Could we also show the stored attributes when inspecting a snapshot
> under Datastore > Content? That would make it easier to see which keys
> and values to use in a job filter
> 
> On 11/13/26 10:07 AM, Jakob-Tobias Winter wrote:
>> Tape backup jobs on a Proxmox Backup Server select backup groups by
>> type and ID only. Splitting guests over media pools by what they are,
>> say production and test guests with different retention, means keeping
>> lists of IDs up to date by hand in every job. In Proxmox VE the same
>> guests are already organized with tags and resource pools, but the
>> backup server knows about neither.
>>
>> This series lets Proxmox VE store the tags and the resource pool of a
>> guest with each backup, as attributes of the snapshot, and adds a
>> filter on such attributes to tape backup jobs:
>>
>>    # proxmox-tape backup-job create prod --store store1 --drive lto1 \
>>        --pool prod --attribute-filter pve-tag=prod
>>    # proxmox-tape backup-job create rest --store store1 --drive lto1 \
>>        --pool rest --attribute-filter exclude:pve-tag=prod
>>
>> It is an RFC, as it defines a format and names that others would have
>> to live with, and because [1] is assigned already. If there is work in
>> progress for it, I am happy to adapt this series to it or to drop
>> whatever overlaps.
>>
>> Proxmox Backup Server
>> ---------------------
>>
>> proxmox 1-2, proxmox-backup 3-7
>>
>> Snapshots get attributes, a map from a key to a list of values. They
>> are kept in the unprotected part of the manifest, as suggested in [0],
>> so they can be set for encrypted backups without touching the
>> signature, and they stay with a snapshot that is synced or written to
>> tape. A guest with several tags gets one value per tag, nothing is
>> joined into one string.
>>
>> They are read and set through a new endpoint next to the notes,
>> GET/PUT /admin/datastore/{store}/attributes, with the privileges of
>> the notes, as a list of KEY=VALUE entries. A PUT replaces all
>> attributes of the snapshot. An empty set is stored as well, to tell a
>> guest without tags from a client which never set anything.
>>
>> Tape backup jobs get the option 'attribute-filter', a list of
>> [exclude:|include:]KEY=VALUE with the include and exclude rules of
>> group filters, applied after the group filter. A group has the
>> attributes of its newest finished snapshot that has some, so a single
>> backup without attributes does not move a group to another media pool.
>> Besides the API there is the option for 'proxmox-tape', a field in the
>> job window, a column in the job list and documentation.
>>
>> The server does not interpret keys or values.
>>
>> Proxmox VE
>> ----------
>>
>> storage 8, guest-common 9, manager 10-11, docs 12
>>
>> After a backup to a PBS storage, vzdump sets 'pve-tag' (one value per
>> tag) and 'pve-pool', with the prefix suggested in [0], directly
>> through the API like the protection flag. A guest in a nested pool
>> gets that pool and each of its parent pools as values, so a filter
>> for a pool also matches the guests of the pools nested in it. A
>> server without the endpoint answers 404, which is only noted in the
>> task log.
>>
>> As the attributes are not encrypted, the new vzdump option
>> 'pbs-snapshot-attributes' (default on) can turn this off for a job, a
>> single call, or a node in /etc/vzdump.conf.
>>
>> Compatibility
>> -------------
>>
>> * Jobs without the new option select the same groups as before, and
>>    nothing changes on tape or in the catalogs. A tape job written by
>>    4.2.9 was read and run unchanged.
>> * The other way round, a version without the series cannot parse a
>>    tape-job.cfg in which the option is used (unknown property), like
>>    with other new job properties.
>> * A backup server without the series leaves the attributes in the
>>    manifest alone (tried with 4.2.9).
>> * A PVE node without the series ignores the vzdump option in jobs.cfg
>>    with a warning.
>>
>> Open questions
>> --------------
>>
>> * The names: 'pve-tag', 'pve-pool', 'attribute-filter' and
>>    'pbs-snapshot-attributes'.
>> * A guest in the pool 'a/b' gets the 'pve-pool' values 'a/b' and 'a',
>>    so one filter covers a pool with everything nested in it. A backup
>>    job for the pool 'a' in Proxmox VE only takes the direct members of
>>    'a'. Is that difference fine, or should only 'a/b' be stored?
>>    Since nested pools are quite new I wasn't sure about that at all.
>> * Setting the attributes after the backup, like notes and protection,
>>    needs no change in the backup protocol or in the QEMU library. But
>>    a user that may only append, as in [2], could then not set them.
>>    Passing them when the backup is created would solve that, at the
>>    price of changes in proxmox-backup-qemu, pve-qemu, qemu-server and
>>    pve-container which I found a bit excessive for some attributes.
>> * On by default with the option to opt out, or the other way round?
>>    Is the switch needed at all?
>> * This is a separate job option and not a new kind of group filter,
>>    as group filters are shared with sync jobs and match on the name of
>>    a group only. Using attributes in other jobs and showing them in the
>>    web interface could follow, if wanted.
>> * For a group in which no snapshot has attributes, all its manifests
>>    are read when a job with a filter runs. Is that acceptable, or
>>    should only the newest few be looked at?
>>
>> Testing
>> -------
>>
>> proxmox-backup master (4.2.11) with the series: rustfmt, clippy
>> without new warnings, every commit builds, 'cargo test --workspace'
>> passes (162 tests, one of them new), the docs build as HTML and man
>> pages. The tests of pbs-api-types pass, with five new ones for the
>> filter. pbs-api-types 1.0.22 came from the proxmox repository, as it
>> is not in the devel repository yet.
>>
>> The PVE patches are perltidy and biome clean, and the test suites of
>> the three Perl repositories give the same results with and without
>> them.
>>
>> End to end in an unprivileged sandbox with the real daemons of both
>> products: the packages of PVE 9.2.26 with the PVE patches applied and
>> a backup server built from master with the series. There is no KVM in
>> it, so the guests were stopped VMs and a container.
>>
>> * vzdump of VMs and a container to a plain and an encrypted PBS
>>    storage, the latter with a namespace, as a user with DatastoreBackup
>>    only; several tags, pools nested up to three levels, changed and
>>    removed tags; the option per call, per job (also run by pvescheduler
>>    and from the web interface) and in /etc/vzdump.conf; restore of an
>>    encrypted backup
>> * the same against 4.2.9 and plain master: noted in the task log, no
>>    warning, the backup is fine
>> * the API as owner, as another user, as auditor and as admin; invalid
>>    values; verification, notes, protection and a local sync job keep
>>    the attributes
>> * tape jobs on the virtual tape drive (needs [3]) selecting by tag, by
>>    pool and by the parent of a nested pool, combined with a group
>>    filter and with namespaces, started by hand and by the scheduler; a
>>    restore from tape keeps the attributes
>> * both web interfaces in a browser
>>
>> Not yet tested: real tape hardware, clusters with more than one node,
>> datastores with an S3 backend.
>>
>> I wasn't sure if I was supposed to send to pbs-devel and pve-devel.
>>
>> [0] https://bugzilla.proxmox.com/show_bug.cgi?id=4186#c32
>> [1] https://bugzilla.proxmox.com/show_bug.cgi?id=7452
>> [2] https://lore.proxmox.com/pbs-devel/20261106172235.890542-1- 
>> c.ebner@proxmox.com/
>> [3] https://lore.proxmox.com/pbs-devel/20261111204853.531985-2- 
>> tobias@stuttgart.de/
>>
>>
>> proxmox:
>>
>> Jakob-Tobias Winter (2):
>>    pbs-api-types: add types and schemas for snapshot attributes
>>    pbs-api-types: tape: add attribute filter to backup jobs
>>
>>   pbs-api-types/src/datastore.rs                |  22 ++-
>>   pbs-api-types/src/jobs.rs                     |  98 ++++++++++-
>>   pbs-api-types/src/lib.rs                      |   3 +
>>   pbs-api-types/tests/attribute_filter_tests.rs | 155 ++++++++++++++++++
>>   4 files changed, 276 insertions(+), 2 deletions(-)
>>   create mode 100644 pbs-api-types/tests/attribute_filter_tests.rs
>>
>>
>> proxmox-backup:
>>
>> Jakob-Tobias Winter (5):
>>    datastore: add attributes to backup snapshots
>>    fix #7452: api: datastore: add endpoints for snapshot attributes
>>    tape: backup job: allow selecting groups by snapshot attributes
>>    ui: tape backup job: add attribute filter
>>    docs: describe snapshot attributes and the tape job attribute filter
>>
>>   docs/pve-integration.rst           |  23 ++++++
>>   docs/tape-backup.rst               |  27 ++++++
>>   docs/terminology.rst               |  33 ++++++++
>>   pbs-datastore/src/backup_info.rs   |  18 +++-
>>   pbs-datastore/src/datastore.rs     |  15 +++-
>>   pbs-datastore/src/manifest.rs      |  87 +++++++++++++++++++-
>>   src/api2/admin/datastore.rs        | 128 ++++++++++++++++++++++++++++-
>>   src/api2/config/tape_backup_job.rs |   8 ++
>>   src/api2/tape/backup.rs            |  19 ++++-
>>   src/bin/proxmox-tape.rs            |  11 ++-
>>   www/tape/BackupJobs.js             |   7 ++
>>   www/tape/window/TapeBackupJob.js   |  27 +++++-
>>   12 files changed, 391 insertions(+), 12 deletions(-)
>>
>>
>> storage:
>>
>> Jakob-Tobias Winter (1):
>>    pbs: add helper to set the attributes of a backup snapshot
>>
>>   src/PVE/Storage/PBSPlugin.pm | 23 +++++++++++++++++++++++
>>   1 file changed, 23 insertions(+)
>>
>>
>> guest-common:
>>
>> Jakob-Tobias Winter (1):
>>    vzdump: add pbs-snapshot-attributes option
>>
>>   src/PVE/VZDump/Common.pm | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>>
>> manager:
>>
>> Jakob-Tobias Winter (2):
>>    vzdump: store guest tags and pool as snapshot attributes on PBS
>>    ui: backup job: add selector for PBS snapshot attributes
>>
>>   PVE/VZDump.pm                               | 42 +++++++++++++++++++++
>>   configs/vzdump.conf                         |  1 +
>>   www/manager6/panel/BackupAdvancedOptions.js | 22 +++++++++++
>>   3 files changed, 65 insertions(+)
>>
>>
>> docs:
>>
>> Jakob-Tobias Winter (1):
>>    vzdump: describe snapshot attributes on Proxmox Backup Server
>>
>>   vzdump.adoc | 36 ++++++++++++++++++++++++++++++++++++
>>   1 file changed, 36 insertions(+)
>>
>>
>> Summary over all repositories:
>>    22 files changed, 799 insertions(+), 14 deletions(-)
>>
> 




^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2026-11-19 12:07 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

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