Allow modification of OAM IP addr, in AIO-SX, without locking the host

Users will be able to change the OAM IP address without a lock/unlock
cycle. To achieve this some services will be restarted (sm, sm-api,
haproxy and vim-webserver) to reopen the L4 ports using the old IP
address as part of the socket.

Some config files in /etc are being updated also with the new address.

Story: 2008531
Task: 42060
Depends-On: https://review.opendev.org/c/starlingx/stx-puppet/+/780955
Change-Id: I9e77fc60882f20d4f31c3e38b5305b1f207f40d9
Signed-off-by: Andre Fernando Zanella Kantek <AndreFernandoZanella.Kantek@windriver.com>
This commit is contained in:
Andre Fernando Zanella Kantek 2021-03-11 05:52:11 -05:00
parent f6aa3dbe69
commit f8f826f960
1 changed files with 28 additions and 8 deletions

View File

@ -6517,24 +6517,44 @@ class ConductorManager(service.PeriodicService):
def update_oam_config(self, context):
"""Update the OAM network configuration"""
# update kube-apiserver cert's SANs at runtime
personalities = [constants.CONTROLLER]
config_uuid = self._config_update_hosts(context, personalities)
config_dict = {
"personalities": personalities,
"classes": ['platform::kubernetes::certsans::runtime']
}
config_dict = {}
is_aio_simplex_system = cutils.is_aio_simplex_system(self.dbapi)
if is_aio_simplex_system:
# update all necessary config at runtime for AIO-SX
config_dict = {
"personalities": personalities,
"classes": ['platform::network::runtime',
'platform::kubernetes::certsans::runtime',
'platform::firewall::runtime',
'platform::smapi',
'platform::sm::update_oam_config::runtime',
'platform::nfv::webserver::runtime',
'platform::haproxy::runtime',
'platform::dockerdistribution::config',
'platform::dockerdistribution::runtime']
}
else:
# update kube-apiserver cert's SANs at runtime
config_dict = {
"personalities": personalities,
"classes": ['platform::kubernetes::certsans::runtime']
}
self._config_apply_runtime_manifest(context, config_uuid, config_dict)
# there is still pending reboot required config to apply
self._config_update_hosts(context, [constants.CONTROLLER], reboot=True)
# there is still pending reboot required config to apply if not AIO-SX
if not is_aio_simplex_system:
self._config_update_hosts(context, [constants.CONTROLLER], reboot=True)
extoam = self.dbapi.iextoam_get_one()
self._update_hosts_file('oamcontroller', extoam.oam_floating_ip,
active=False)
if utils.get_system_mode(self.dbapi) != constants.SYSTEM_MODE_SIMPLEX:
if not is_aio_simplex_system:
cutils.touch(
self._get_oam_runtime_apply_file(standby_controller=True))