From 7b0de8749c769f889dc9f4bde593cf1e0433716b Mon Sep 17 00:00:00 2001 From: Fabiano Correa Mercer Date: Thu, 15 Jun 2023 16:42:11 -0300 Subject: [PATCH] Use FQDN for MGMT network The management network is used extensively for all internal communication. Since the original use of the network was a private network before it was exposed for external communication in a distributed cloud configuration, it was never designed to be reconfigured. To support MGMT network reconfiguration the idea is to configure the applications to use the hostname/FQDN instead of a static MGMT IP address. In this way the MGMT network can be changed and the services and applications will still work since they are using the hostname/FQDN and the DNS will be responsible to translate to the current MGMT IP address. The use of FQDN will be applied for all installation modes: AIO-SX, AIO-DX, Standard, AIO-PLUS, and DC subclouds. But given the complexities of supporting the multi-host reconfiguration, the MGMT network reconfiguration will focus on support for AIO-SX only. The DNSMASQ service must start as soon as possible to translate the FQDN to IP address. Test plan ( Debian only ) - AIO-SX and AIO-DX virtualbox installation IPv4/IPv6 - Standard virtualbox installation IPv6 - DC virtualbox installation IPv4 ( AIO-SX/DX subclouds ) - AIO-SX and AIO-DX installation IPv4/IPv6 - AIO-DX plus installation IPv6 - DC IPv6 and subcloud AIO-SX - AIO-DX host-swact - DC IPv4 virtualbox with subcloud AIO-DX and AIO-DX - AIO-SX to AIO-DX migration - netstat -tupl ( no services are using the MGMT IP address ) - Ran sanity/regression tests Story: 2010722 Task: 48468 Depends-On: https://review.opendev.org/c/starlingx/config/+/886208 Change-Id: I10c19b0cb7625e473fc95a36fbddb5f7cc660d6a Signed-off-by: Fabiano Correa Mercer --- python3-k8sapp-snmp/k8sapp_snmp/k8sapp_snmp/helm/snmp.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python3-k8sapp-snmp/k8sapp_snmp/k8sapp_snmp/helm/snmp.py b/python3-k8sapp-snmp/k8sapp_snmp/k8sapp_snmp/helm/snmp.py index e6e141b..af89f31 100644 --- a/python3-k8sapp-snmp/k8sapp_snmp/k8sapp_snmp/helm/snmp.py +++ b/python3-k8sapp-snmp/k8sapp_snmp/k8sapp_snmp/helm/snmp.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2022 Wind River Systems, Inc. +# Copyright (c) 2020-2023 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # @@ -14,6 +14,7 @@ from six import ensure_text from six import string_types from sysinv.common import constants from sysinv.common import exception +from sysinv.common import utils from sysinv.db import api from sysinv.helm import base from sysinv.helm import common @@ -71,7 +72,9 @@ class SnmpHelm(base.BaseHelm): return ret_password def _get_database_connection(self): - host_url = self._format_url_address(self._get_management_address()) + host_url = (constants.CONTROLLER_FQDN if utils.is_fqdn_ready_to_use() + else self._format_url_address(self._get_management_address())) + auth_password = self._get_keyring_password( self.SERVICE_FM_NAME, 'database') connection = "postgresql://%s:%s@%s/%s" %\