From d86f35a8072c7dcaabd9de1394cc3ac6288e7983 Mon Sep 17 00:00:00 2001 From: Alec Warren Date: Tue, 5 Mar 2024 22:57:06 -0500 Subject: [PATCH] chore(ephemeral): add debug log when bringing up ephemeral network (#5010) A debug message is logged whenever an instance is able to connect to the IMDS but when it can't, and an ephemeral network needs brought up, nothing is logged. Adding a log message here will help improve readability of logs and help troubleshoot failure paths when an instance is having issues with networking. --- cloudinit/net/ephemeral.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cloudinit/net/ephemeral.py b/cloudinit/net/ephemeral.py index 46b1c653b36..1862b0ea6c1 100644 --- a/cloudinit/net/ephemeral.py +++ b/cloudinit/net/ephemeral.py @@ -86,7 +86,12 @@ def __enter__(self): self.connectivity_url_data["url"], ) return - + else: + LOG.debug( + "Instance does not have connectivity to %s. Bringing up " + "ephemeral network now.", + self.connectivity_url_data["url"], + ) try: self._bringup_device()