[pve-devel] [PATCH 04/21] rbd : add volume_snapshot

Alexandre Derumier aderumier at odiso.com
Thu Sep 6 10:27:54 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