[pve-devel] [PATCH guest-common v2 2/2] AbstractMigrate: use get_ssh_base_cmd to assemble ssh_cmd
Thomas Lamprecht
t.lamprecht at proxmox.com
Thu Feb 2 16:31:36 CET 2017
this sets the HostKeyAlias for us, so that users using the dedicated
migration network do not need to add each cluster node to every
cluster members known_hosts file for each network they want to use
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
changes since v1:
* rebased on new guest-common package
PVE/AbstractMigrate.pm | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/PVE/AbstractMigrate.pm b/PVE/AbstractMigrate.pm
index 8655d8b..11629ef 100644
--- a/PVE/AbstractMigrate.pm
+++ b/PVE/AbstractMigrate.pm
@@ -125,9 +125,6 @@ my $eval_int = sub {
};
};
-my @ssh_opts = ('-o', 'BatchMode=yes');
-my @ssh_cmd = ('/usr/bin/ssh', @ssh_opts);
-
sub migrate {
my ($class, $node, $nodeip, $vmid, $opts) = @_;
@@ -139,7 +136,7 @@ sub migrate {
vmid => $vmid,
node => $node,
nodeip => $nodeip,
- rem_ssh => [ @ssh_cmd, "root\@$nodeip" ],
+ rem_ssh => PVE::Cluster::get_ssh_base_cmd($node, $nodeip),
};
$self = bless $self, $class;
@@ -166,7 +163,7 @@ sub migrate {
if (defined($remote_migration_ip)) {
$nodeip = $remote_migration_ip;
$self->{nodeip} = $remote_migration_ip;
- $self->{rem_ssh} = [ @ssh_cmd, "root\@$nodeip" ];
+ $self->{rem_ssh} = PVE::Cluster::get_ssh_base_cmd($node, $nodeip),
$self->log('info', "use dedicated network address for sending " .
"migration traffic ($self->{nodeip})");
--
2.1.4
More information about the pve-devel
mailing list