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

Alexandre Derumier aderumier at odiso.com
Tue Dec 4 12:20:29 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 0f4a66f..2f26ed3 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -389,6 +389,18 @@ sub volume_protect {
     }
 }
 
+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