Add function volume_snapshot_delete_remote.
This function we need for replica to handle snapshots on remote nodes.
This commit is contained in:
committed by
Wolfgang Bumiller
parent
c4bb4a3d19
commit
4bd0b38f53
@ -725,6 +725,13 @@ sub volume_snapshot_rollback {
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub volume_snapshot_delete_remote {
|
||||
my ($class, $scfg, $storeid, $volname, $snap, $ip) = @_;
|
||||
|
||||
# implement in subclass
|
||||
die "Volume_snapshot_delete_remote is not implemented for $class";
|
||||
}
|
||||
|
||||
sub volume_snapshot_delete {
|
||||
my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
|
||||
|
||||
|
||||
@ -180,7 +180,10 @@ sub zfs_request {
|
||||
}
|
||||
|
||||
push @$cmd, @params;
|
||||
|
||||
if ($ip) {
|
||||
$ip = "[$ip]" if Net::IP::ip_is_ipv6($ip);
|
||||
unshift @$cmd, 'ssh', '-o', 'BatchMode=yes', "root\@${ip}", '--';
|
||||
}
|
||||
my $msg = '';
|
||||
|
||||
my $output = sub {
|
||||
@ -517,12 +520,20 @@ sub volume_send {
|
||||
}
|
||||
}
|
||||
|
||||
sub volume_snapshot_delete_remote {
|
||||
my ($class, $scfg, $storeid, $volname, $snap, $ip) = @_;
|
||||
|
||||
my $vname = ($class->parse_volname($volname))[1];
|
||||
$class->zfs_request($scfg, $ip, undef, 'destroy', "$scfg->{pool}/$vname\@$snap");
|
||||
}
|
||||
|
||||
sub volume_snapshot_delete {
|
||||
my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
|
||||
|
||||
my $vname = ($class->parse_volname($volname))[1];
|
||||
|
||||
$class->deactivate_volume($storeid, $scfg, $vname, $snap, {});
|
||||
|
||||
$class->zfs_request($scfg, undef, undef, 'destroy', "$scfg->{pool}/$vname\@$snap");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user