From ff415cad242deeefe6741dfed8d4f554d964fb04 Mon Sep 17 00:00:00 2001 From: Anh Vo Date: Tue, 2 Nov 2021 15:06:39 -0400 Subject: Azure: fallback nic needs to be reevaluated during reprovisioning (#1094) During reprovisioning, VM network will change. fallback nic should be cleared after use so that it can be re-evaluated after reprovisioning --- cloudinit/sources/DataSourceAzure.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cloudinit/sources') diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py index d52c6a7f..93493fa0 100755 --- a/cloudinit/sources/DataSourceAzure.py +++ b/cloudinit/sources/DataSourceAzure.py @@ -498,6 +498,11 @@ class DataSourceAzure(sources.DataSource): self.fallback_interface, retries=10 ) + + # reset _fallback_interface so that if the code enters reprovisioning + # flow, it will force re-evaluation of new fallback nic. + self._fallback_interface = None + if not imds_md and not ovf_is_accessible: msg = 'No OVF or IMDS available' report_diagnostic_event(msg) -- cgit v1.2.3