[pve-devel] [PATCH 12/21] nexenta: add volume_snapshot_rollback

Alexandre Derumier aderumier at odiso.com
Thu Sep 6 10:28:02 CEST 2012


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

diff --git a/PVE/Storage/NexentaPlugin.pm b/PVE/Storage/NexentaPlugin.pm
index af2c4c6..04fb09f 100644
--- a/PVE/Storage/NexentaPlugin.pm
+++ b/PVE/Storage/NexentaPlugin.pm
@@ -344,4 +344,17 @@ sub volume_snapshot {
     return undef;
 }
 
+sub volume_snapshot_rollback {
+    my ($class, $scfg, $storeid, $volname, $snap) = @_;
+
+    eval { nexenta_delete_lu($volname, $scfg); };
+
+    my $json = '{"method": "rollback","object" : "snapshot","params": ["'.$scfg->{pool}.'/'.$volname.'@'.$snap.'", ""]}';
+    nexenta_request($scfg, $json);
+    
+    eval { nexenta_create_lu($volname, $scfg); };
+
+    nexenta_add_lun_mapping_entry($volname, $scfg);
+}
+
 1;
-- 
1.7.2.5




More information about the pve-devel mailing list