[pve-devel] [PATCH 2/2] migrate: use nodename as HostKeyAlias to verify a node

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Mar 7 17:57:02 CET 2017


this is usefull when setting a dedicated migration network, as here
we normally have the target node management IP in our (the clusters)
known_hosts file and not the one of the dedicated network.

Simply tell ssh to use the nodename as HostKeyAlias for the
migration.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

 PVE/AbstractMigrate.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/PVE/AbstractMigrate.pm b/PVE/AbstractMigrate.pm
index 8655d8b..69d8f5d 100644
--- a/PVE/AbstractMigrate.pm
+++ b/PVE/AbstractMigrate.pm
@@ -133,6 +133,9 @@ sub migrate {
 
     $class = ref($class) || $class;
 
+    # verify by node name not by IP
+    push @ssh_cmd, '-o', "HostKeyAlias=$node";
+
     my $self = {
 	delayed_interrupt => 0,
 	opts => $opts,
-- 
2.1.4





More information about the pve-devel mailing list