Add function volume_snapshot_delete_remote.

This function we need for replica to handle snapshots on remote nodes.
This commit is contained in:
Wolfgang Link
2017-04-24 17:15:29 +02:00
committed by Wolfgang Bumiller
parent c4bb4a3d19
commit 4bd0b38f53
3 changed files with 34 additions and 1 deletions

View File

@ -250,6 +250,21 @@ sub volume_snapshot_rollback {
}
}
sub volume_snapshot_delete_remote {
my ($cfg, $volid, $snap, $ip) = @_;
my ($storeid, $volname) = parse_volume_id($volid, 1);
if ($storeid) {
my $scfg = storage_config($cfg, $storeid);
my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
return $plugin->volume_snapshot_delete_remote($scfg, $storeid, $volname, $snap, $ip);
} elsif ($volid =~ m|^(/.+)$| && -e $volid) {
die "snapshot delete file/device '$volid' is not possible\n";
} else {
die "unable to parse volume ID '$volid'\n";
}
}
sub volume_snapshot_delete {
my ($cfg, $volid, $snap, $running) = @_;