[pve-devel] [PATCH 4/7] rbd : add volume_snapshot

Alexandre Derumier aderumier at odiso.com
Wed Sep 5 10:08:53 CEST 2012


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

diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index 1699dbc..7a2222e 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -278,4 +278,14 @@ sub volume_resize {
     return undef;
 }
 
+sub volume_snapshot {
+    my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
+
+    return 1 if $running;
+
+    my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'create', '--snap', $snap, $volname);
+    run_command($cmd, errmsg => "rbd snapshot $volname' error", errfunc => sub {});
+    return undef;
+}
+
 1;
-- 
1.7.2.5




More information about the pve-devel mailing list