From 2f9b31a93f1a1825e3841dc02e2d4e816842fc07 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Fri, 4 Sep 2020 14:25:59 -0700 Subject: [PATCH] Wait for ipv6 addrs when launching nodes When launching new nodes with launch-node.py we need to wait for ipv6 addresses to configure prior to running ping6 sanity checks. The reason for this is some clouds rely on router advertisements to configure ipv6 addrs on VMs. These happen periodically and the VM may not have its ipv6 address configured yet when we try to ping6 otherwise. Change-Id: I77515fec481e4146765630cd230dd3c2c296958f --- launch/launch-node.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/launch/launch-node.py b/launch/launch-node.py index 5474f5004c..ca0af86409 100755 --- a/launch/launch-node.py +++ b/launch/launch-node.py @@ -126,6 +126,14 @@ def bootstrap_server(server, key, name, volume_device, keep, ssh_client.ssh('(ifdown eth0 && ifup eth0) || true') if server.public_v6: + # The server may be waiting on Router Advertisements to configure + # this address. Wait for that to complete before pinging. + ssh_client.ssh("bash -c 'count=0 ; " + "while ! ip addr | grep -q %s && [\"$count\" -le 60 ] ; do " + " count=$((count + 1)) ; " + " echo \"Waiting for IPv6 address to configure\" ; " + " sleep 1 ; " + "done'" % server.public_v6) ssh_client.ssh('ping6 -c5 -Q 0x10 review.openstack.org ' '|| ping6 -c5 -Q 0x10 wiki.openstack.org')