[pve-devel] [PATCH pve-storage 1/2] fix #2822: add lvm, lvmthin & zfs storage on all cluster nodes

Stefan Hrdlicka s.hrdlicka at proxmox.com
Tue May 24 16:45:30 CEST 2022


this enables forwarding of request to the correct node if a node is set

Signed-off-by: Stefan Hrdlicka <s.hrdlicka at proxmox.com>
---
 PVE/API2/Storage/Config.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/PVE/API2/Storage/Config.pm b/PVE/API2/Storage/Config.pm
index 6bd770e..82b73ca 100755
--- a/PVE/API2/Storage/Config.pm
+++ b/PVE/API2/Storage/Config.pm
@@ -146,6 +146,13 @@ __PACKAGE__->register_method ({
     protected => 1,
     path => '',
     method => 'POST',
+    proxyto_callback => sub {
+	my ($rpcenv, $proxyto, $uri_param) = @_;
+	my $node = delete $uri_param->{node};
+	$node = "localhost" if !$node;
+
+	return $node;
+    },
     description => "Create a new storage.",
     permissions => {
 	check => ['perm', '/storage', ['Datastore.Allocate']],
-- 
2.30.2





More information about the pve-devel mailing list