From 0a6edfa4493161c671075bfac9cde8fa6fffd6e8 Mon Sep 17 00:00:00 2001 From: Joao Fracarolli Date: Fri, 11 Jul 2025 14:45:55 -0300 Subject: [PATCH] Adds support to UUID deployment-provisioning configuration This change adds new fields in Nova's values.yaml file to allow the choice of deployment-provisioning the compute node's UUID. This is done by including two options into the file. The first one, 'hosts_uuids', is a list containing the hostnames and uuids of the compute nodes where nova-compute pods are being deployed. Each node is identified by two key-value pairs (name: and uuid: ). It defaults to an empty list and can be populated via overrides. The next option is a boolean value indicating if self provisioning should be enabled/disabled, 'manifests.compute_uuid_self_provisioning'. It defaults to true, meaning that nova-compute will provision the compute node's UUID. When set to false, the deployment-provisioning is enabled. This change also adds a code in nova-compute-init.sh that searches for the current node's UUID and copies it to the directory indicated by the 'state_path' field in nova.conf file, if self-provision is disabled. By doing this, we are provisioning the UUID, accordingly to [1]. [1] https://docs.openstack.org/nova/latest/admin/compute-node-identification.html Change-Id: I3101e5bcdd6acf2b950e196e9b54d5f900501e68 Signed-off-by: Joao Fracarolli --- nova/templates/bin/_nova-compute-init.sh.tpl | 10 ++++++++++ nova/values.yaml | 7 +++++++ releasenotes/notes/nova-e8350419e59bc440.yaml | 4 ++++ 3 files changed, 21 insertions(+) create mode 100644 releasenotes/notes/nova-e8350419e59bc440.yaml diff --git a/nova/templates/bin/_nova-compute-init.sh.tpl b/nova/templates/bin/_nova-compute-init.sh.tpl index 4bc71a393d..5218d37072 100644 --- a/nova/templates/bin/_nova-compute-init.sh.tpl +++ b/nova/templates/bin/_nova-compute-init.sh.tpl @@ -16,6 +16,16 @@ limitations under the License. set -ex +{{- if and .Values.hosts_uuids (not .Values.manifests.compute_uuid_self_provisioning) }} +# Extract Host's uuid from helm chart and save it to the compute_id file + {{- range $host := .Values.hosts_uuids }} +hostname="{{- $host.name}}" +if [ "$hostname" == $HOSTNAME ]; then + echo "{{ $host.uuid }}" > {{ $.Values.conf.nova.DEFAULT.state_path }}/compute_id +fi + {{- end }} +{{- end }} + # Make the Nova Instances Dir as this is not autocreated. mkdir -p /var/lib/nova/instances diff --git a/nova/values.yaml b/nova/values.yaml index 65eec287c1..a7970d4473 100644 --- a/nova/values.yaml +++ b/nova/values.yaml @@ -2676,6 +2676,7 @@ tls: manifests: certificates: false + compute_uuid_self_provisioning: true configmap_bin: true configmap_etc: true cron_job_cell_setup: true @@ -2728,4 +2729,10 @@ manifests: service_spiceproxy: true service_osapi: true statefulset_compute_ironic: false + +# List of compute hosts and its respective uuids +# Items should be in the following format +# - name: compute-node-hostname +# uuid: +hosts_uuids: [] ... diff --git a/releasenotes/notes/nova-e8350419e59bc440.yaml b/releasenotes/notes/nova-e8350419e59bc440.yaml new file mode 100644 index 0000000000..343c272a6c --- /dev/null +++ b/releasenotes/notes/nova-e8350419e59bc440.yaml @@ -0,0 +1,4 @@ +--- +nova: + - Adds support to UUID deployment-provisioning configuration +...