5
0
mirror of git://git.proxmox.com/git/pve-storage.git synced 2025-01-29 21:47:19 +03:00

rbd -p parameter is only valid for the src (see man). Add the pool to the target as well.

Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
This commit is contained in:
Stefan Priebe 2013-04-21 20:04:57 +02:00 committed by Dietmar Maurer
parent 87cf5d409c
commit 8897f5dcc5

View File

@ -17,6 +17,14 @@ sub rbd_unittobytes {
}
}
my $add_pool_to_disk = sub {
my ($scfg, $disk) = @_;
my $pool = $scfg->{pool} ? $scfg->{pool} : 'rbd';
return "$pool/$disk";
};
my $rbd_cmd = sub {
my ($scfg, $storeid, $op, @options) = @_;
@ -283,7 +291,7 @@ sub create_base {
my $newvolname = $basename ? "$basename/$newname" : "$newname";
my $cmd = &$rbd_cmd($scfg, $storeid, 'rename', $name, $newname);
my $cmd = &$rbd_cmd($scfg, $storeid, 'rename', &$add_pool_to_disk($scfg, $name), &$add_pool_to_disk($scfg, $newname));
run_command($cmd, errmsg => "rbd rename $name' error", errfunc => sub {});
my $running = undef; #fixme : is create_base always offline ?