proxyto => 'node',
protected => 1,
permissions => {
- check => ['perm', '/', ['Sys.Modify', 'Datastore.Allocate']],
+ description => "Requires additionally 'Datastore.Allocate' on /storage when setting 'add_storage'",
+ check => ['perm', '/', ['Sys.Modify']],
},
description => "Create a Filesystem on an unused disk. Will be mounted under '/mnt/pve/NAME'.",
parameters => {
my $verify_params = [qw(path)];
if ($param->{add_storage}) {
+ $rpcenv->check($user, "/storage", ['Datastore.Allocate']);
+
# reserve the name and add as disabled, will be enabled below if creation works out
PVE::API2::Storage::Config->create_or_update(
$name, $node, $storage_params, $verify_params, 1);
proxyto => 'node',
protected => 1,
permissions => {
- check => ['perm', '/', ['Sys.Modify', 'Datastore.Allocate']],
+ description => "Requires additionally 'Datastore.Allocate' on /storage when setting 'cleanup-config'",
+ check => ['perm', '/', ['Sys.Modify']],
},
description => "Unmounts the storage and removes the mount unit.",
parameters => {
my $rpcenv = PVE::RPCEnvironment::get();
my $user = $rpcenv->get_user();
+ $rpcenv->check($user, "/storage", ['Datastore.Allocate']) if $param->{'cleanup-config'};
+
my $name = $param->{name};
my $node = $param->{node};
proxyto => 'node',
protected => 1,
permissions => {
- check => ['perm', '/', ['Sys.Modify', 'Datastore.Allocate']],
+ description => "Requires additionally 'Datastore.Allocate' on /storage when setting 'add_storage'",
+ check => ['perm', '/', ['Sys.Modify']],
},
description => "Create an LVM Volume Group",
parameters => {
my $verify_params = [qw(vgname)];
if ($param->{add_storage}) {
+ $rpcenv->check($user, "/storage", ['Datastore.Allocate']);
+
# reserve the name and add as disabled, will be enabled below if creation works out
PVE::API2::Storage::Config->create_or_update(
$name, $node, $storage_params, $verify_params, 1);
proxyto => 'node',
protected => 1,
permissions => {
- check => ['perm', '/', ['Sys.Modify', 'Datastore.Allocate']],
+ description => "Requires additionally 'Datastore.Allocate' on /storage when setting 'cleanup-config'",
+ check => ['perm', '/', ['Sys.Modify']],
},
description => "Remove an LVM Volume Group.",
parameters => {
my $rpcenv = PVE::RPCEnvironment::get();
my $user = $rpcenv->get_user();
+ $rpcenv->check($user, "/storage", ['Datastore.Allocate']) if $param->{'cleanup-config'};
+
my $name = $param->{name};
my $node = $param->{node};
proxyto => 'node',
protected => 1,
permissions => {
- check => ['perm', '/', ['Sys.Modify', 'Datastore.Allocate']],
+ description => "Requires additionally 'Datastore.Allocate' on /storage when setting 'add_storage'",
+ check => ['perm', '/', ['Sys.Modify']],
},
description => "Create an LVM thinpool",
parameters => {
my $verify_params = [qw(vgname thinpool)];
if ($param->{add_storage}) {
+ $rpcenv->check($user, "/storage", ['Datastore.Allocate']);
+
# reserve the name and add as disabled, will be enabled below if creation works out
PVE::API2::Storage::Config->create_or_update(
$name, $node, $storage_params, $verify_params, 1);
proxyto => 'node',
protected => 1,
permissions => {
- check => ['perm', '/', ['Sys.Modify', 'Datastore.Allocate']],
+ description => "Requires additionally 'Datastore.Allocate' on /storage when setting 'cleanup-config'",
+ check => ['perm', '/', ['Sys.Modify']],
},
description => "Remove an LVM thin pool.",
parameters => {
my $rpcenv = PVE::RPCEnvironment::get();
my $user = $rpcenv->get_user();
+ $rpcenv->check($user, "/storage", ['Datastore.Allocate']) if $param->{'cleanup-config'};
+
my $vg = $param->{'volume-group'};
my $lv = $param->{name};
my $node = $param->{node};
proxyto => 'node',
protected => 1,
permissions => {
- check => ['perm', '/', ['Sys.Modify', 'Datastore.Allocate']],
+ description => "Requires additionally 'Datastore.Allocate' on /storage when setting 'add_storage'",
+ check => ['perm', '/', ['Sys.Modify']],
},
description => "Create a ZFS pool.",
parameters => {
my $verify_params = [qw(pool)];
if ($param->{add_storage}) {
+ $rpcenv->check($user, "/storage", ['Datastore.Allocate']);
+
# reserve the name and add as disabled, will be enabled below if creation works out
PVE::API2::Storage::Config->create_or_update(
$name, $node, $storage_params, $verify_params, 1);
proxyto => 'node',
protected => 1,
permissions => {
- check => ['perm', '/', ['Sys.Modify', 'Datastore.Allocate']],
+ description => "Requires additionally 'Datastore.Allocate' on /storage when setting 'cleanup-config'",
+ check => ['perm', '/', ['Sys.Modify']],
},
description => "Destroy a ZFS pool.",
parameters => {
my $rpcenv = PVE::RPCEnvironment::get();
my $user = $rpcenv->get_user();
+ $rpcenv->check($user, "/storage", ['Datastore.Allocate']) if $param->{'cleanup-config'};
+
my $name = $param->{name};
my $node = $param->{node};