my $volid = $drive->{file};
- if (!$isCDROM && ($volid =~ m/^(([^:\s]+):)?(\d+(\.\d+)?)$/)) {
+ if (!$volid || $volid eq 'none') {
+ # nothing to check
+ } elsif (!$isCDROM && ($volid =~ m/^(([^:\s]+):)?(\d+(\.\d+)?)$/)) {
my ($storeid, $size) = ($2 || $default_storage, $3);
die "no storage ID specified (and no default storage)\n" if !$storeid;
$rpcenv->check_storage_perm($authuser, $vmid, $pool, $storeid, [ 'Datastore.AllocateSpace' ]);
my $volid = $disk->{file};
- if ($volid =~ m/^(([^:\s]+):)?(\d+(\.\d+)?)$/) {
+ if (!$volid || $volid eq 'none') {
+ $res->{$ds} = $settings->{$ds};
+ } elsif ($volid =~ m/^(([^:\s]+):)?(\d+(\.\d+)?)$/) {
my ($storeid, $size) = ($2 || $default_storage, $3);
die "no storage ID specified (and no default storage)\n" if !$storeid;
my $defformat = PVE::Storage::storage_default_format($storecfg, $storeid);
} else {
my $path = &$check_volume_access($rpcenv, $authuser, $storecfg, $vmid, $volid, $pool);
die "image '$path' does not exists\n" if (!(-f $path || -b $path));
- $res->{$ds} = $settings->{ds};
+ $res->{$ds} = $settings->{$ds};
}
});