summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c2182c4)
Refuse to clone a container to a remote node when using
local storage.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
die "unable to create CT $newid: config file already exists\n"
if -f $conffile;
die "unable to create CT $newid: config file already exists\n"
if -f $conffile;
foreach my $opt (keys %$src_conf) {
next if $opt =~ m/^unused\d+$/;
foreach my $opt (keys %$src_conf) {
next if $opt =~ m/^unused\d+$/;
my ($sid, $volname) = PVE::Storage::parse_volume_id($volid);
$sid = $storage if defined($storage);
my $scfg = PVE::Storage::storage_config($storecfg, $sid);
my ($sid, $volname) = PVE::Storage::parse_volume_id($volid);
$sid = $storage if defined($storage);
my $scfg = PVE::Storage::storage_config($storecfg, $sid);
+ if (!$scfg->{shared}) {
+ $sharedvm = 0;
+ warn "found non-shared volume: $volid\n" if $target;
+ }
$rpcenv->check($authuser, "/storage/$sid", ['Datastore.AllocateSpace']);
$rpcenv->check($authuser, "/storage/$sid", ['Datastore.AllocateSpace']);
$newconf->{$opt} = $value;
}
}
$newconf->{$opt} = $value;
}
}
+ die "can't clone CT to node '$target' (CT uses local storage)\n"
+ if $target && !$sharedvm;
# Replace the 'disk' lock with a 'create' lock.
$newconf->{lock} = 'create';
# Replace the 'disk' lock with a 'create' lock.
$newconf->{lock} = 'create';