[pve-devel] [PATCH] rbd : clone volume to same pool that base volume

Alexandre Derumier aderumier at odiso.com
Tue May 14 08:01:04 CEST 2013


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Storage/RBDPlugin.pm |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index 81a7b98..0b1e24d 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -325,8 +325,9 @@ sub clone_image {
     warn "clone $volname: $basename to $name\n";
 
     my $newvol = "$basename/$name";
+    my $pool =  $scfg->{pool} ? $scfg->{pool} : 'rbd';
 
-    my $cmd = &$rbd_cmd($scfg, $storeid, 'clone', $basename, '--snap', $snap, $name);
+    my $cmd = &$rbd_cmd($scfg, $storeid, 'clone', $basename, '--snap', $snap, "$pool/$name");
     run_command($cmd, errmsg => "rbd clone $basename' error", errfunc => sub {});
 
     return $newvol;
-- 
1.7.10.4




More information about the pve-devel mailing list