[pve-devel] [RFC pve-storage 2/7] Make volume_snapshot_delete on remote nodes.

Wolfgang Link w.link at proxmox.com
Wed Apr 12 12:41:21 CEST 2017


This function we need for replica to handle snapshots on remote nodes.

Conflicts:
	PVE/Storage/ZFSPoolPlugin.pm
---
 PVE/Storage/ZFSPoolPlugin.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index 5286ba1..b94497c 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -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 {
@@ -519,7 +522,7 @@ sub volume_send {
 }
 
 sub volume_snapshot_delete {
-    my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
+    my ($class, $scfg, $storeid, $volname, $snap, $running, $ip) = @_;
 
     my $vname = ($class->parse_volname($volname))[1];
 
-- 
2.1.4





More information about the pve-devel mailing list