From 7189e6c9165485af6d152089e8607881773bbf9a Mon Sep 17 00:00:00 2001 From: Thales Elero Cervi Date: Mon, 25 Sep 2023 15:34:55 -0300 Subject: [PATCH] Nova: Add IP addresses search control flag Add options to nova to enable/disable the use of: 1. The vnc or spice server proxyclient address found by the console compute init container 2. The my_ip hypervisor address found by compute init container 3. The libvirt live_migration_inbound_addr used by nova compute to live-migrate instances These options can be used to prevent cases where the found addresses overwrite what has already been defined in nova.conf by per host nova compute DaemonSet overrides. It is important to allow the flexibility of using or not the default ConfigMap - DaemonSet cluster level configuration, allowing the possibility of having custom per host overrides definitions that will not be overwrite by nova-compute-init.sh One use case (live-migration) for this flexibility is the following: Originally the nova-compute-init.sh script received the capability of selection a target interface (by name, in a ConfigMap level) through which the live-migration traffic should be handled [1], allowing the possibility of selecting a separate network to handle live-migration traffic. This was not assuming any interface/network IP if users did not set .Values.conf.libvirt.live_migration_interface. Later [2], same script was updated to fall-back to default gateway IP resolution in case the live_migration_interface is not defined. So, currently it is mandatory to define a "cluster level config" for the interface name (i.e., through ConfigMap) or to rely on default gateway IP resolution for live-migration addresses. This can be problematic for use cases were: * There are many networks defined for the cluster and a host default gateway might not resolve to the desired network IP; * There is the need of having a per host definition of nova.conf, since nova-compute-init.sh will create a new .conf that will overwrite it. [1] commit 31be86079d711c698b2560b4bed654e23373a596 [2] commit 8f0a15413839c92d6d527bf7cbc441380de6c2af Change-Id: Iaf86e0a215802001f58d607a1a3a18acf83f5e81 Signed-off-by: Thales Elero Cervi Signed-off-by: Robert Church --- nova/Chart.yaml | 2 +- nova/templates/bin/_nova-compute.sh.tpl | 6 ++++++ nova/values.yaml | 6 +++++- releasenotes/notes/nova.yaml | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/nova/Chart.yaml b/nova/Chart.yaml index 40d1aa51f5..c0229ab496 100644 --- a/nova/Chart.yaml +++ b/nova/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Nova name: nova -version: 0.3.24 +version: 0.3.25 home: https://docs.openstack.org/nova/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Nova/OpenStack_Project_Nova_vertical.png sources: diff --git a/nova/templates/bin/_nova-compute.sh.tpl b/nova/templates/bin/_nova-compute.sh.tpl index 23ce3475f3..702e3b9211 100644 --- a/nova/templates/bin/_nova-compute.sh.tpl +++ b/nova/templates/bin/_nova-compute.sh.tpl @@ -18,9 +18,15 @@ set -ex exec nova-compute \ --config-file /etc/nova/nova.conf \ +{{- if .Values.console.address_search_enabled }} --config-file /tmp/pod-shared/nova-console.conf \ +{{- end }} +{{- if .Values.conf.libvirt.address_search_enabled }} --config-file /tmp/pod-shared/nova-libvirt.conf \ +{{- end }} {{- if and ( empty .Values.conf.nova.DEFAULT.host ) ( .Values.pod.use_fqdn.compute ) }} --config-file /tmp/pod-shared/nova-compute-fqdn.conf \ {{- end }} +{{- if .Values.conf.hypervisor.address_search_enabled }} --config-file /tmp/pod-shared/nova-hypervisor.conf +{{- end }} diff --git a/nova/values.yaml b/nova/values.yaml index 5e0ad1978b..7a05ff12ac 100644 --- a/nova/values.yaml +++ b/nova/values.yaml @@ -503,6 +503,7 @@ console: vncproxy: # IF blank, search default routing interface vncserver_proxyclient_interface: + address_search_enabled: true ceph_client: configmap: ceph-etc @@ -1338,10 +1339,13 @@ conf: cpu_allocation_ratio: 1.0 reserved_host_memory_mb: 0 libvirt: - # Get the IP address to be used as the target for live migration traffic using interface name. + address_search_enabled: true + # When "address_search_enabled", get the IP address to be used as the target for live migration + # traffic using interface name. # If this option is set to None, the hostname of the migration target compute node will be used. live_migration_interface: hypervisor: + address_search_enabled: true # my_ip can be set automatically through this interface name. host_interface: # This list is the keys to exclude from the config file ingested by nova-compute diff --git a/releasenotes/notes/nova.yaml b/releasenotes/notes/nova.yaml index 7b89c00068..4b9c46b2f5 100644 --- a/releasenotes/notes/nova.yaml +++ b/releasenotes/notes/nova.yaml @@ -93,4 +93,5 @@ nova: - 0.3.22 Replace deprecated configuration vncserver_proxyclient_address to server_proxyclient_address - 0.3.23 Add Ubuntu Jammy overrides - 0.3.24 Create a certificate for novnc vencrypt separately + - 0.3.25 Add IP addresses search control flag ...