rbd: purge snapshots before delete volume
we can't delete a rbd volume if snapshots exist Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
45c2ee3526
commit
c30470a35e
@ -214,7 +214,10 @@ sub alloc_image {
|
||||
sub free_image {
|
||||
my ($class, $storeid, $scfg, $volname) = @_;
|
||||
|
||||
my $cmd = &$rbd_cmd($scfg, $storeid, 'rm', $volname);
|
||||
my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'purge', $volname);
|
||||
run_command($cmd, errmsg => "rbd snap purge $volname' error", outfunc => sub {}, errfunc => sub {});
|
||||
|
||||
$cmd = &$rbd_cmd($scfg, $storeid, 'rm', $volname);
|
||||
run_command($cmd, errmsg => "rbd rm $volname' error", outfunc => sub {}, errfunc => sub {});
|
||||
|
||||
return undef;
|
||||
|
||||
Reference in New Issue
Block a user