rbd : add volume_snapshot

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier
2012-09-06 10:27:54 +02:00
committed by Dietmar Maurer
parent 50a19c0987
commit 788dd8e182

View File

@ -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;