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

Alexandre Derumier aderumier at odiso.com
Tue Jan 8 15:45:26 CET 2013


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

diff --git a/PVE/Storage/NexentaPlugin.pm b/PVE/Storage/NexentaPlugin.pm
index 0c9c6f5..0c17ec4 100644
--- a/PVE/Storage/NexentaPlugin.pm
+++ b/PVE/Storage/NexentaPlugin.pm
@@ -408,4 +408,17 @@ sub volume_protect {
     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