public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pdm-devel] [PATCH proxmox-datacenter-manager 1/1] api-types: resource: fix storage identifier
@ 2025-12-02 14:38 Stefan Hanreich
  2025-12-02 15:33 ` [pdm-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Hanreich @ 2025-12-02 14:38 UTC (permalink / raw)
  To: pdm-devel

Storages in PVE are uniquely identified by their name and the node
they reside on. The current method only includes the name of the
storage, not the node. Since the ID method is used in the UI for
generating the deep URLs to the respective PVE resources, the
generated URLs are wrong.

The generated global ID is correct, because the map_pve_storage
function uses the id field returned by the PVE API directly, which
includes the node name already.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
 lib/pdm-api-types/src/resource.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/pdm-api-types/src/resource.rs b/lib/pdm-api-types/src/resource.rs
index af3a211e..93f8bd2a 100644
--- a/lib/pdm-api-types/src/resource.rs
+++ b/lib/pdm-api-types/src/resource.rs
@@ -36,7 +36,7 @@ impl Resource {
     /// `qemu/<vmid>`
     pub fn id(&self) -> String {
         match self {
-            Resource::PveStorage(r) => format!("storage/{}", r.storage),
+            Resource::PveStorage(r) => format!("storage/{}/{}", r.node, r.storage),
             Resource::PveQemu(r) => format!("qemu/{}", r.vmid),
             Resource::PveLxc(r) => format!("lxc/{}", r.vmid),
             Resource::PveNode(r) => format!("node/{}", r.node),
-- 
2.47.3


_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


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

* [pdm-devel] applied: [PATCH proxmox-datacenter-manager 1/1] api-types: resource: fix storage identifier
  2025-12-02 14:38 [pdm-devel] [PATCH proxmox-datacenter-manager 1/1] api-types: resource: fix storage identifier Stefan Hanreich
@ 2025-12-02 15:33 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2025-12-02 15:33 UTC (permalink / raw)
  To: pdm-devel, Stefan Hanreich

On Tue, 02 Dec 2025 15:38:06 +0100, Stefan Hanreich wrote:
> Storages in PVE are uniquely identified by their name and the node
> they reside on. The current method only includes the name of the
> storage, not the node. Since the ID method is used in the UI for
> generating the deep URLs to the respective PVE resources, the
> generated URLs are wrong.
> 
> The generated global ID is correct, because the map_pve_storage
> function uses the id field returned by the PVE API directly, which
> includes the node name already.
> 
> [...]

Applied, thanks!

[1/1] api-types: resource: fix storage identifier
      commit: 19f1cc2121e23fe7dd6df05a53e90c90705542b8


_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


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

end of thread, other threads:[~2025-12-02 15:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-02 14:38 [pdm-devel] [PATCH proxmox-datacenter-manager 1/1] api-types: resource: fix storage identifier Stefan Hanreich
2025-12-02 15:33 ` [pdm-devel] applied: " Thomas Lamprecht

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