public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Lukas Wagner" <l.wagner@proxmox.com>
To: "Thomas Lamprecht" <t.lamprecht@proxmox.com>,
	"Lukas Wagner" <l.wagner@proxmox.com>,
	"Fiona Ebner" <f.ebner@proxmox.com>,
	<pbs-devel@lists.proxmox.com>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH pve-storage 7/7] api: add /nodes/<node>/storage/<storage>/identity route
Date: Thu, 23 Apr 2026 11:25:57 +0200	[thread overview]
Message-ID: <DI0FD9593NZF.3BFAH9TPYVSM4@proxmox.com> (raw)
In-Reply-To: <4cf9b5ee-5a27-4bf1-a32f-645660b0b58a@proxmox.com>

On Wed Apr 22, 2026 at 5:13 PM CEST, Thomas Lamprecht wrote:
> Am 22.04.26 um 09:47 schrieb Lukas Wagner:
>> So in summary, as of now, we have
>>   - the storage API route is called `identity` and the response contains
>>     `pbs-instance-id`
>>   - the PBSClient method is called `get_server_identity`, returning a
>>     hash that contains a `pbs-instance-id`
>>   - in PBS, the route is `/nodes/localhost/server-identity` and the
>>     response contains a `pbs-instance-id` field
>>   - the PBS client binary has a `server-identity` sub-command
>> 
>> In your reply you stated a preference for `instance-id`, but also I did
>> not understand it as concrete instructions for the next version. With my
>> (hopefully) more elaborated reasoning above, is there any one of those
>> that you'd like me change before this gets applied (and if so, what
>> exactly should they be named?) -- just to avoid any misunderstandings
>> and churn for the next version of this series.
>
> OK, to close this out with something concrete instead of all to much
> naming bike-shed back-and-forth:
>
> First, and largely separate from the naming: FWICT it really wouldn't
> be much extra work to wire up a proper plugin method in pve-storage
> right away. Bump APIVER + APIAGE in PVE::Storage, add a get_identity()
> (or similar) plugin method with a default impl that dies or returns
> undef, and have PBSPlugin override it.
> Here we then just call `$plugin->get_identity(...)` and the
> `if $scfg->{type} ne 'pbs'` special-case can be dropped.
> You wouldn't have to implement the method on any non-PBS plugin for
> now though; the main point is that the API surface isn't hard-wired
> to `pbs` at the API endpoint level any more, so opting another type in
> later mostly needs implementing the method in the respective plugin.
>
> With that in place IMO the response properties should be generic too,
> otherwise the plugin-method is a bit odd combined with using
> `pbs-instance-id` here, one option might be a sort of oneOf schema,
> but I'd actually rather go with an sorta "adjacently-tagged" (like
> serde would call it) `{ type: "<plugin>", id: "<string>" }` from the
> endpoint.
> PDM (or other clients) can then reconstruct and, if needed, also
> correctly verify the full identifier itself.
>
> The `pbs-instance-id` field name can stay PBS-side (ServerIdentity
> struct + PBS API return), where it's PBS-specific by construction, it
> just shouldn't sneak into the generic pve-storage endpoint (but in case
> you strongly favor that: I'd not be totally opposed to oneOf).
>
> While this has IMO no objective true answer, the consolidated naming
> I'd use, to make my reply a bit less ambiguous:
>
> - PBS API: `/nodes/<node>/identity` - drop `server-`, reasoning: we're
>   on the server, the qualifier is redundant there.
> - PBS client CLI + Perl PBSClient: keep `server-identity` /
>   `get_server_identity`, client-side the qualifier is worth it to
>   correctly relay what this identifies.
> - pve-storage API: keep bare `identity`, adding server isn't true for
>   all storage types after all and I do not find instance-id that much
>   better to really request it, especially given that others found the
>   "identity" variant better I'm fine with it.
> - pve-storage response: `{ type, id }` via the new plugin method.
> - PBS-internal `ServerIdentity { pbs_instance_id }`: unchanged.
>
> btw. CC'ing Max, in case this overlaps with his storage UI/schema work -
> definitively not a blocker here, just so it's on his radar.

Thanks for the elaborate response!

Sounds good to me in general. 

One last point, but maybe I'm overthinking this:

To me, the { type: "<plugin>", id: "<string" } approach kind of implies that
this ID would uniquely identify the PBS instance *as well as* the
datastore/namespace, which it does not at the moment.

Would you think that it would make sense for PBS storage plugin to
maybe combine the datastore, namespace and the
pbs-instance-id into a single identifier here?

Maybe something like, in pseudo-regex

<datastore>(/<namespace>)?@<pbs-instance-id>

e.g. store/some/name/space@dade89fe26104bc3858ae719c23594a7

This would then actually uniquely identify the PBS storage (as in, two
storages with the same ID should always point to the same content),
while still allowing PDM to parse the identifier to retrieve the
pbs-instance-id, if needed.

Happy to hear your thoughts on this.




  reply	other threads:[~2026-04-23  9:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-15 11:58 [PATCH common/proxmox{,-backup}/storage 0/7] establish unique instance-id for PBS nodes Lukas Wagner
2026-04-15 11:58 ` [PATCH proxmox 1/7] pbs-api-types: add ServerIdentity response type Lukas Wagner
2026-04-15 11:58 ` [PATCH proxmox 2/7] systemd: add support for machine-id generation Lukas Wagner
2026-04-15 11:58 ` [PATCH proxmox-backup 3/7] api: add /nodes/localhost/server-identity Lukas Wagner
2026-04-15 11:58 ` [PATCH proxmox-backup 4/7] client: add 'server-identity' sub-command Lukas Wagner
2026-04-15 11:58 ` [PATCH proxmox-backup 5/7] manager: add 'server-identity' subcommand Lukas Wagner
2026-04-15 11:58 ` [PATCH common 6/7] pbs-client: add support for the 'server-identity' command Lukas Wagner
2026-04-15 11:58 ` [PATCH pve-storage 7/7] api: add /nodes/<node>/storage/<storage>/identity route Lukas Wagner
2026-04-17  8:54   ` Fiona Ebner
2026-04-17  9:11     ` Lukas Wagner
2026-04-21 12:35       ` Thomas Lamprecht
2026-04-21 13:07         ` Lukas Wagner
2026-04-21 13:52           ` Thomas Lamprecht
2026-04-21 14:06             ` Christian Ebner
2026-04-22  7:48             ` Lukas Wagner
2026-04-22 15:13               ` Thomas Lamprecht
2026-04-23  9:25                 ` Lukas Wagner [this message]
2026-04-23 23:05                   ` Thomas Lamprecht
2026-04-24  6:56                     ` Lukas Wagner
2026-04-21 12:20 ` [PATCH common/proxmox{,-backup}/storage 0/7] establish unique instance-id for PBS nodes Christian Ebner
2026-04-24  8:31 ` superseded: " Lukas Wagner

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=DI0FD9593NZF.3BFAH9TPYVSM4@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=f.ebner@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@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 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