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

Fabian Ebner f.ebner at proxmox.com
Tue Jun 7 14:54:09 CEST 2022


Am 24.05.22 um 16:45 schrieb Stefan Hrdlicka:
> 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};

Messing with the uri params here is hacky. It destroys the consistency
between the API schema and what the API call actually handles.

It's not really required to proxy the call to a specific node. The only
downside is that we don't do an early storage access check if the
storage is not enabled for the current node.

> +	$node = "localhost" if !$node;
> +
> +	return $node;
> +    },
>      description => "Create a new storage.",
>      permissions => {
>  	check => ['perm', '/storage', ['Datastore.Allocate']],




More information about the pve-devel mailing list