From 73885a6159312b3146cf047be3d56a47b6a2346f Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Wed, 14 Jul 2021 20:28:58 +0200 Subject: [PATCH] copr-be: another hack for ipv6 convergence 'nmcli con up' failed sometimes as the eth1 device was not yet in appropriate state. So before enabling that connection, wait for the device to be ready. Also remove the redundant ping6 check. --- .../backend/templates/provision/libvirt-new | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/roles/copr/backend/templates/provision/libvirt-new b/roles/copr/backend/templates/provision/libvirt-new index 1dea1c7dc8..f839434e37 100755 --- a/roles/copr/backend/templates/provision/libvirt-new +++ b/roles/copr/backend/templates/provision/libvirt-new @@ -220,15 +220,6 @@ class LibvirtSpawner: "mount -o remount /", ])) - def ping_to_wake_up_ipv6(self): - """ - For some reason, this makes makes the networking to converge much - faster. - """ - self.append_startup_script("\n".join([ - "ping6 fedoraproject.org -c 5 -d || :" - ])) - def generate_config_iso(self): """ Generate the ISO file that is attached to the VM and used by the early @@ -327,9 +318,14 @@ class LibvirtSpawner: f"nmcli con modify '{con_name}' ipv6.address {ipv6_addr}", f"nmcli con modify '{con_name}' ipv6.gateway {ipv6_gw}", f"nmcli con modify '{con_name}' ipv4.method disabled", + # Sometimes 'con up' fails since device doesn't exist yet, for some + # reason ppc64 machines go directly to "connecting" state, while on + # x86_64 they are "disconnected" + f"while ! nmcli device | grep {device} | grep -e disconnected -e connecting; do sleep 0.1; done", + # manually enable the device f"nmcli con up '{con_name}'", # This makes the IPv6 networking to converge faster - 'for _ in `seq 180`; do ping6 -c 1 fedoraproject.org && break ; sleep 1; done', + 'for _ in `seq 20`; do ping6 -c 1 fedoraproject.org && break ; sleep 1; done', ])) self.ipv6 = ipv6_addr.split("/")[0] @@ -460,7 +456,6 @@ def _main(): spawner.swap_vol_size = str(args.swap_vol_size) + "GB" spawner.add_nat_network() spawner.add_bridged_network("Wired connection 2", "eth1", ip6_a, ip6_g) - spawner.ping_to_wake_up_ipv6() success = False try: