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 <andrefernandozanella.kantek@windriver.com>
This commit is contained in:
Andre Kantek 2025-03-19 12:49:52 -03:00
parent 1b054d2a90
commit bcaaab6c63
2 changed files with 7 additions and 1 deletions

View File

@ -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")

View File

@ -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"')