[PATCH pve-storage v2 7/9] plugin: add get_identity method

Lukas Wagner
2026-04-24T08:31:38Z

This one should return a unique identifier for each distinct storage
entity.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
src/PVE/Storage/PBSPlugin.pm | 9 +++++++++
src/PVE/Storage/Plugin.pm | 17 +++++++++++++++++
2 files changed, 26 insertions(+)

diff --git a/src/PVE/Storage/PBSPlugin.pm b/src/PVE/Storage/PBSPlugin.pm
index 17e285a..b916fe4 100644
--- a/src/PVE/Storage/PBSPlugin.pm
+++ b/src/PVE/Storage/PBSPlugin.pm
@@ -1002,4 +1002,13 @@ sub volume_has_feature {
return undef;
}

+sub get_identity {
+ my ($class, $scfg, $storeid) = @_;
+
+ my $client = PVE::PBSClient->new($scfg, $storeid);
+ my $ret = $client->get_server_identity();
+
+ return $ret->{'pbs-instance-id'};
+}
+
1;
diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm
index afd3141..691aad3 100644
--- a/src/PVE/Storage/Plugin.pm
+++ b/src/PVE/Storage/Plugin.pm
@@ -2569,4 +2569,21 @@ sub config_aware_base_mkdir {
}
}

+=pod
+
+=head3 get_identity
+
+ $plugin->get_identity($scfg, $storeid)
+
+Return a unique identifier for this storage instance. The exact format and semantics
+may vary based on the concrete plugin implementation.
+
+=cut
+
+sub get_identity {
+ my ($class, $scfg, $storeid) = @_;
+
+ die("get_identity not implemented for this plugin");
+}
+
1;
--
2.47.3