diff --git a/nova/templates/bin/_nova-compute-init.sh.tpl b/nova/templates/bin/_nova-compute-init.sh.tpl index b163e82fd5..2dccfb4c29 100644 --- a/nova/templates/bin/_nova-compute-init.sh.tpl +++ b/nova/templates/bin/_nova-compute-init.sh.tpl @@ -23,3 +23,17 @@ mkdir -p /var/lib/nova/instances # Set Ownership of nova dirs to the nova user chown ${NOVA_USER_UID} /var/lib/nova /var/lib/nova/instances + +migration_interface="{{- .Values.conf.libvirt.live_migration_interface -}}" +if [[ -n $migration_interface ]]; then + # determine ip dynamically based on interface provided + migration_address=$(ip r | grep $migration_interface | grep -v default | awk '{print $9}') +fi + +touch /tmp/pod-shared/nova-libvirt.conf +if [[ -n $migration_address ]]; then +cat </tmp/pod-shared/nova-libvirt.conf +[libvirt] +live_migration_inbound_addr = $migration_address +EOF +fi diff --git a/nova/templates/bin/_nova-compute.sh.tpl b/nova/templates/bin/_nova-compute.sh.tpl index d80af987d3..84596a59c4 100644 --- a/nova/templates/bin/_nova-compute.sh.tpl +++ b/nova/templates/bin/_nova-compute.sh.tpl @@ -20,4 +20,5 @@ set -ex exec nova-compute \ --config-file /etc/nova/nova.conf \ - --config-file /tmp/pod-shared/nova-console.conf + --config-file /tmp/pod-shared/nova-console.conf \ + --config-file /tmp/pod-shared/nova-libvirt.conf diff --git a/nova/templates/daemonset-compute.yaml b/nova/templates/daemonset-compute.yaml index 4627836bed..0ed902b40e 100644 --- a/nova/templates/daemonset-compute.yaml +++ b/nova/templates/daemonset-compute.yaml @@ -67,6 +67,8 @@ spec: readOnly: true - name: varlibnova mountPath: /var/lib/nova + - name: pod-shared + mountPath: /tmp/pod-shared {{- if .Values.conf.ceph.enabled }} {{- if empty .Values.conf.ceph.cinder.keyring }} - name: ceph-admin-keyring-placement diff --git a/nova/values.yaml b/nova/values.yaml index 97718fb49f..df24a0fa13 100644 --- a/nova/values.yaml +++ b/nova/values.yaml @@ -1019,6 +1019,10 @@ conf: DEFAULT: scheduler_host_manager: ironic_host_manager compute_driver: ironic.IronicDriver + libvirt: + # 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: nova: DEFAULT: default_ephemeral_format: ext4