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 623cd68b1b..913fbc8872 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 +...