[pve-devel] [PATCH 15/20] rbd: add volume_clone

Alexandre Derumier aderumier at odiso.com
Mon Dec 3 14:32:40 CET 2012


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

diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index 143804e..0fc9c94 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -402,6 +402,18 @@ sub volume_unprotect {
     }
 }
 
+sub volume_clone {
+    my ($class, $scfg, $storeid, $volname, $snap, $vmid) = @_;
+
+    my $volnamedst = $class->find_free_volname($storeid, $scfg, $vmid);
+
+    my $cmd = &$rbd_cmd($scfg, $storeid, 'clone', $volname, '--snap', $snap, $volnamedst);
+    run_command($cmd, errmsg => "rbd clone $volname' error", errfunc => sub {});
+
+    return $volnamedst;
+}
+
+
 
 
 1;
-- 
1.7.10.4




More information about the pve-devel mailing list