lxc-apt-update/DNS requests fail sometimes
We have a problem where sometimes the lxc-apt-update
action fails due to a failing DNS request:
Everytime this happens, we observe that the LXC got an IPv6 address only:
To verify that this is correlated, we added a delay to wait for an IPv4 address to the LXC code:
diff --git a/lava_dispatcher/actions/boot/lxc.py.bak b/lava_dispatcher/actions/boot/lxc.py
index 64bcfc2..a0677d7 100644
--- a/lxc.py.bak
+++ b/lxc.py
@@ -177,7 +177,11 @@ class LxcStartAction(Action):
while True:
command_output = self.run_command(lxc_cmd, allow_fail=True)
if command_output:
+ self.logger.debug("'%s' Wait 30 seconds", lxc_name)
+ time.sleep(30)
+ command_output = self.run_command(lxc_cmd, allow_fail=True)
break
+ self.logger.debug("'%s' Wait 10 seconds before next poll", lxc_name)
time.sleep(self.sleep) # poll every 10 seconds.
self.logger.info("'%s' IP address is: '%s'", lxc_name, command_output.strip())
return connection
Afterwards the LXC gets IPv4 and IPv6 addresses:
And the lxc-apt-update
action succeeds:
Is this something anybody else has observed? Can we maybe add some kind of flag to ensure that LXC devices get both an IPv4 and IPv6 address?
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information