[pve-devel] [PATCH 21/48] nexenta: add volume_clone
Alexandre Derumier
aderumier at odiso.com
Tue Jan 29 17:14:03 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 d4806f3..dfd2d34 100644
--- a/PVE/Storage/NexentaPlugin.pm
+++ b/PVE/Storage/NexentaPlugin.pm
@@ -409,4 +409,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 "$volname/$volnamedst";
+}
+
1;
--
1.7.10.4
More information about the pve-devel
mailing list