From bcaaab6c636fcfa40200ca9f277306dcd499e47f Mon Sep 17 00:00:00 2001 From: Andre Kantek Date: Wed, 19 Mar 2025 12:49:52 -0300 Subject: [PATCH] Bring down labeled and base pxeboot interface after kickstart After the initial reboot following a kickstart installation, residual network configuration files remain, enabling the node to communicate with the active controller. During Puppet configuration, the script apply_network_config.py is intended to overwrite these configurations with those from the sysinv database. However, simply bringing down the labeled interface, without also addressing its associated base interfaces, prevented the new configuration from being applied. Consequently, the PXE boot interface was left without an IP address. This change brings down the base interface also. Test Plan: [PASS] install a Standard in IPv6 and configure mgmt and cluster-host in VLANs over the pxeboot interface. After install check that no communication alarms are triggered and the pxeboot interface on the compute nodes remains configured via DHCP. Closes-Bug: 2103645 Change-Id: I8eb36ebf1c6fd93c814ff664997aff1d6e0cb10d Signed-off-by: Andre Kantek --- puppet-manifests/src/bin/apply_network_config.py | 4 ++++ puppet-manifests/tests/test_apply_network_config.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/puppet-manifests/src/bin/apply_network_config.py b/puppet-manifests/src/bin/apply_network_config.py index fa28d5049..822e3bc21 100644 --- a/puppet-manifests/src/bin/apply_network_config.py +++ b/puppet-manifests/src/bin/apply_network_config.py @@ -814,6 +814,10 @@ def disable_pxeboot_interface(): for iface in ifaces.keys(): LOG.info(f"Turn off pxeboot install config for {iface}, will be turned on later") set_iface_down(iface) + if is_label(iface): + base_iface = get_base_iface(iface) + LOG.info(f"Turn off pxeboot for base interface {base_iface}") + set_iface_down(base_iface) LOG.info("Remove ifcfg-pxeboot, left from kickstart install phase") remove_iface_config_file("pxeboot") diff --git a/puppet-manifests/tests/test_apply_network_config.py b/puppet-manifests/tests/test_apply_network_config.py index 202a08c5c..0c7f81b8c 100644 --- a/puppet-manifests/tests/test_apply_network_config.py +++ b/puppet-manifests/tests/test_apply_network_config.py @@ -2191,9 +2191,11 @@ class GeneralTests(BaseTestCase): # pylint: disable=too-many-public-methods self.assertEqual([ ('info', 'Turn off pxeboot install config for enp0s8:2, will be turned on later'), ('info', 'Bringing enp0s8:2 down'), + ('info', 'Turn off pxeboot for base interface enp0s8'), + ('info', 'Bringing enp0s8 down'), ('info', 'Remove ifcfg-pxeboot, left from kickstart install phase'), ('info', 'Removing /etc/network/interfaces.d/ifcfg-pxeboot')], - self._log.get_history()[:4]) + self._log.get_history()[:6]) def test_execute_system_cmd(self): retcode, stdout = anc.execute_system_cmd('echo "test_execute_system_cmd"')