[pve-devel] [PATCH 20/20] nexenta: add volume_clone

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


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

diff --git a/PVE/Storage/NexentaPlugin.pm b/PVE/Storage/NexentaPlugin.pm
index 25a097c..c1f7874 100644
--- a/PVE/Storage/NexentaPlugin.pm
+++ b/PVE/Storage/NexentaPlugin.pm
@@ -400,4 +400,18 @@ sub volume_unprotect {
     return undef;
 }
 
+sub volume_clone {
+    my ($class, $scfg, $storeid, $volname, $snap, $vmid) = @_;
+
+    my $volnamedst = $class->find_free_volname($storeid, $scfg, $vmid);
+
+    nexenta_request($scfg, 'clone', 'zvol', "$scfg->{pool}/$volname\@$snap", "$scfg->{pool}/$volnamedst");
+
+    nexenta_create_lu($scfg, $volnamedst);
+    nexenta_add_lun_mapping_entry($scfg, $volnamedst);
+
+    return $volnamedst;
+}
+
+
 1;
-- 
1.7.10.4




More information about the pve-devel mailing list