all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Jakob Klocker <j.klocker@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Jakob Klocker <j.klocker@proxmox.com>
Subject: [PATCH pve-storage 5/9] storage: expose plugin metadata in storage status
Date: Fri, 31 Jul 2026 17:36:13 +0200	[thread overview]
Message-ID: <20260731153617.358265-6-j.klocker@proxmox.com> (raw)
In-Reply-To: <20260731153617.358265-1-j.klocker@proxmox.com>

The plugin state determined when scanning custom plugins was so far only
available internally. Add it to the per-storage information, together
with the API version the plugin implements, the API version range this
PVE supports, whether the plugin is provided by a third party, and the
optional plugin URL.

This allows the GUI to tell users that a storage uses an outdated or
broken plugin and to point them at the plugin's homepage.

Signed-off-by: Jakob Klocker <j.klocker@proxmox.com>
---
 src/PVE/API2/Storage/Status.pm | 39 ++++++++++++++++++++++++++++++++++
 src/PVE/Storage.pm             | 16 ++++++++++++++
 2 files changed, 55 insertions(+)

diff --git a/src/PVE/API2/Storage/Status.pm b/src/PVE/API2/Storage/Status.pm
index 741d514..f044e7a 100644
--- a/src/PVE/API2/Storage/Status.pm
+++ b/src/PVE/API2/Storage/Status.pm
@@ -390,6 +390,45 @@ __PACKAGE__->register_method({
                 renderer => 'bytes',
                 optional => 1,
             },
+            plugin => {
+                description => "Metadata about the storage plugin backing this storage.",
+                type => 'object',
+                optional => 1,
+                properties => {
+                    external => {
+                        description =>
+                            "Set when the storage is provided by a third-party plugin.",
+                        type => 'boolean',
+                        optional => 1,
+                    },
+                    state => {
+                        description => "Plugin state: up-to-date, outdated, or load-error.",
+                        type => 'string',
+                        enum => ['up-to-date', 'outdated', 'load-error'],
+                        optional => 1,
+                    },
+                    'api-version' => {
+                        description => "API version implemented by the storage plugin.",
+                        type => 'integer',
+                        optional => 1,
+                    },
+                    'api-min' => {
+                        description => "Minimum plugin API version supported by this PVE.",
+                        type => 'integer',
+                        optional => 1,
+                    },
+                    'api-max' => {
+                        description => "Current plugin API version of this PVE.",
+                        type => 'integer',
+                        optional => 1,
+                    },
+                    url => {
+                        description => "URL to the plugin's homepage or documentation.",
+                        type => 'string',
+                        optional => 1,
+                    },
+                },
+            },
         },
     },
     code => sub {
diff --git a/src/PVE/Storage.pm b/src/PVE/Storage.pm
index b433efc..06be29d 100755
--- a/src/PVE/Storage.pm
+++ b/src/PVE/Storage.pm
@@ -1620,6 +1620,14 @@ sub storage_info {
         }
 
         my $type = $ids->{$storeid}->{type};
+        my $entry = custom_plugin_entry($type);
+        my $external = $entry ? 1 : 0;
+        my $state = get_plugin_state($type);
+        my $api_version = $entry ? $entry->{'api-version'} : APIVER;
+        my $plugin_url =
+            $entry
+            ? $entry->{'plugin-url'}
+            : eval { PVE::Storage::Plugin->lookup($type)->plugindata()->{'plugin-url'} };
 
         $info->{$storeid} = {
             type => $type,
@@ -1631,6 +1639,14 @@ sub storage_info {
                 PVE::Storage::Plugin::content_hash_to_string($ids->{$storeid}->{content}),
             active => 0,
             enabled => $storage_enabled ? 1 : 0,
+            plugin => {
+                external => $external,
+                state => $state,
+                'api-version' => $api_version,
+                'api-min' => (APIVER - APIAGE),
+                'api-max' => APIVER,
+                url => $plugin_url,
+            },
         };
     }
 
-- 
2.47.3




  parent reply	other threads:[~2026-07-31 15:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31 15:36 [PATCH manager/storage 0/9] storage: plugins: display failed and outdated storage plugins in the GUI Jakob Klocker
2026-07-31 15:36 ` [PATCH pve-storage 1/9] storage: drop unused variable in storage_info Jakob Klocker
2026-07-31 15:36 ` [PATCH pve-storage 2/9] storage: add `plugin-url` to built-in plugins Jakob Klocker
2026-07-31 15:36 ` [PATCH pve-storage 3/9] storage: add `unknown` flag to parse_config Jakob Klocker
2026-07-31 15:36 ` [PATCH pve-storage 4/9] storage: plugins: cache and classify custom storage plugins Jakob Klocker
2026-07-31 15:36 ` Jakob Klocker [this message]
2026-07-31 15:36 ` [PATCH pve-manager 6/9] cluster: backend: include storages with unloadable plugins Jakob Klocker
2026-07-31 15:36 ` [PATCH pve-manager 7/9] www: storage: show plugin state/external/url in StatusView Jakob Klocker
2026-07-31 15:36 ` [PATCH pve-manager 8/9] www: storage: distinguish failed/outdated storage plugins in resource tree Jakob Klocker
2026-07-31 15:36 ` [PATCH pve-manager 9/9] www: storage: display custom summary for failed plugins Jakob Klocker

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20260731153617.358265-6-j.klocker@proxmox.com \
    --to=j.klocker@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

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

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