From 0e78b5157e7a6b79019da9606874d500d6ce33d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Fri, 5 Jul 2019 14:44:05 +0200 Subject: [PATCH] 5to6: attempt to resolve corosync rings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and only fail if unable to Signed-off-by: Fabian Grünbichler --- PVE/CLI/pve5to6.pm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/PVE/CLI/pve5to6.pm b/PVE/CLI/pve5to6.pm index b0bd531b..79205aa1 100644 --- a/PVE/CLI/pve5to6.pm +++ b/PVE/CLI/pve5to6.pm @@ -370,8 +370,17 @@ sub check_cluster_corosync { my $verify_ring_ip = sub { my $key = shift; my $ring = $entry->{$key}; - if (defined($ring) && !PVE::JSONSchema::pve_verify_ip($ring, 1)) { - log_fail("$key '$ring' of node '$cs_node' is not an IP address, consider replacing it with the currently resolved IP address."); + if (defined($ring)) { + my ($resolved_ip, undef) = PVE::Corosync::resolve_hostname_like_corosync($ring, $conf); + if (defined($resolved_ip)) { + if ($resolved_ip ne $ring) { + log_warn("$key '$ring' of node '$cs_node' resolves to '$resolved_ip'.\n Consider replacing it with the currently resolved IP address."); + } else { + log_pass("$key is configured to use IP address '$ring'"); + } + } else { + log_fail("unable to resolve $key '$ring' of node '$cs_node' to an IP address according to Corosync's resolve strategy - cluster will fail with Corosync 3.x/kronosnet!"); + } } }; $verify_ring_ip->('ring0_addr');