Updates after the mgmt network reconfiguration

In the first reboot after the management network
reconfiguration, the system is still using the
old mgmt IPs until the apply_network_config.sh
and puppet code updates the system.
The sw-patch services starts before or at same
time of these operations and can use the old
MGMT IPs and failed to answer audit requests.
For this reason the sw-patch services must
start just after the controller config is
completed.

Tests:
IPv6 mgmt network reconfig in subcloud AIO-SX
IPv4 mgmt network reconfig in standalone AIO-SX
AIO-DX Fresh install
AIO-SX Fresh install
AIO-SX IPv4 apply patch after mgmt reconfig
AIO-SX IPv4 apply patch-local before bootstrap

Story: 2010722
Task: 49227

Depends-On: https://review.opendev.org/c/starlingx/config/+/902132

Change-Id: I61cbf24574184dafd0e2e7a80363fecdfa99b5a6
Signed-off-by: Fabiano Correa Mercer <fabiano.correamercer@windriver.com>
This commit is contained in:
Fabiano Correa Mercer 2023-12-11 13:29:03 -03:00
parent 018eea2d51
commit 085d86e4a3

View File

@ -59,6 +59,7 @@ import cgcs_patch.messages as messages
import cgcs_patch.constants as constants
from tsconfig.tsconfig import INITIAL_CONFIG_COMPLETE_FLAG
from tsconfig.tsconfig import VOLATILE_CONTROLLER_CONFIG_COMPLETE
CONF = oslo_cfg.CONF
@ -2420,9 +2421,12 @@ class PatchControllerAuthApiThread(threading.Thread):
host = utils.get_versioned_address_all()
try:
# Can only launch authenticated server post-config
while not os.path.exists('/etc/platform/.initial_config_complete'):
while not os.path.exists(VOLATILE_CONTROLLER_CONFIG_COMPLETE):
LOG.info("Authorized API: Waiting for controller config complete.")
time.sleep(5)
LOG.info("Authorized API: Initializing")
# In order to support IPv6, server_class.address_family must be
# set to the correct address family. Because the unauthenticated
# API always uses IPv4 for the loopback address, the address_family