[pve-devel] [PATCH 20/20] nexenta: add volume_clone
Alexandre Derumier
aderumier at odiso.com
Tue Dec 4 12:20:34 CET 2012
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 5ca385d..8c09058 100644
--- a/PVE/Storage/NexentaPlugin.pm
+++ b/PVE/Storage/NexentaPlugin.pm
@@ -394,4 +394,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