]> git.proxmox.com Git - pve-manager.git/commitdiff
5to6: attempt to resolve corosync rings
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 8 Jul 2019 11:54:05 +0000 (13:54 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 8 Jul 2019 16:27:23 +0000 (18:27 +0200)
and only fail if unable to

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
(backported from commit 669211d8bbb0857275669068fcbf62560782b888)

use local copy of resolve_hostname_like_corosync instead of
pve-cluster's.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
PVE/CLI/pve5to6.pm

index 7d23ac3c08bf90180f95ed5998f785e9acbc3c0c..f84a8c1b205fdf09c67d555e74192d73460ce41e 100644 (file)
@@ -434,8 +434,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) = $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');