From 77913c5073585ceaf7aca329b1a0fabb6e8d3409 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 9 Feb 2024 17:57:48 +0900 Subject: [PATCH] qemu: Support a few more migration_* options This introduces support for a few more migration_* options for QEMU, which are used to determine the address/network used during migration. Change-Id: I5cd32eeee428b0bef53a79f5d8bfe9900e64db22 --- manifests/migration/qemu.pp | 15 +++++++++++++++ .../qemu-migration-opts-d4d52322ed7c705e.yaml | 8 ++++++++ spec/classes/nova_migration_qemu_spec.rb | 8 ++++++++ 3 files changed, 31 insertions(+) create mode 100644 releasenotes/notes/qemu-migration-opts-d4d52322ed7c705e.yaml diff --git a/manifests/migration/qemu.pp b/manifests/migration/qemu.pp index 69577c0b5..88edebf8d 100644 --- a/manifests/migration/qemu.pp +++ b/manifests/migration/qemu.pp @@ -8,6 +8,15 @@ # (optional) Whether or not configure qemu bits. # Defaults to false. # +# [*migration_address*] +# (optional) Override the listen address for all incoming migrations. +# Defaults to $facts['os_service_default']. +# +# [*migration_host*] +# (optional) The default hostname or IP address which will be used by +# a migration source for transferring migration data to this host. +# Defaults to $facts['os_service_default']. +# # [*migration_port_min*] # (optional) Lower limit of port range used for migration. # Defaults to $facts['os_service_default']. @@ -18,6 +27,8 @@ # class nova::migration::qemu( Boolean $configure_qemu = false, + $migration_address = $facts['os_service_default'], + $migration_host = $facts['os_service_default'], $migration_port_min = $facts['os_service_default'], $migration_port_max = $facts['os_service_default'], ){ @@ -28,11 +39,15 @@ class nova::migration::qemu( if $configure_qemu { qemu_config { + 'migration_address': value => $migration_address; + 'migration_host': value => $migration_host; 'migration_port_min': value => $migration_port_min; 'migration_port_max': value => $migration_port_max; } } else { qemu_config { + 'migration_address': ensure => absent; + 'migration_host': ensure => absent; 'migration_port_min': ensure => absent; 'migration_port_max': ensure => absent; } diff --git a/releasenotes/notes/qemu-migration-opts-d4d52322ed7c705e.yaml b/releasenotes/notes/qemu-migration-opts-d4d52322ed7c705e.yaml new file mode 100644 index 000000000..7e7e0fb32 --- /dev/null +++ b/releasenotes/notes/qemu-migration-opts-d4d52322ed7c705e.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + The following parameters have been added to the ``nova::migration::qemu`` + class. + + - ``migration_address`` + - ``migration_host`` diff --git a/spec/classes/nova_migration_qemu_spec.rb b/spec/classes/nova_migration_qemu_spec.rb index 9356168e9..ae7a18a89 100644 --- a/spec/classes/nova_migration_qemu_spec.rb +++ b/spec/classes/nova_migration_qemu_spec.rb @@ -12,6 +12,8 @@ describe 'nova::migration::qemu' do context 'when not configuring qemu' do it 'should clear all configurations' do + is_expected.to contain_qemu_config('migration_address').with_ensure('absent') + is_expected.to contain_qemu_config('migration_host').with_ensure('absent') is_expected.to contain_qemu_config('migration_port_min').with_ensure('absent') is_expected.to contain_qemu_config('migration_port_max').with_ensure('absent') end @@ -24,6 +26,8 @@ describe 'nova::migration::qemu' do } end it 'should configure the default values' do + is_expected.to contain_qemu_config('migration_address').with_value('') + is_expected.to contain_qemu_config('migration_host').with_value('') is_expected.to contain_qemu_config('migration_port_min').with_value('') is_expected.to contain_qemu_config('migration_port_max').with_value('') end @@ -33,11 +37,15 @@ describe 'nova::migration::qemu' do let :params do { :configure_qemu => true, + :migration_address => '0.0.0.0', + :migration_host => 'host.example.com', :migration_port_min => 61138, :migration_port_max => 61200, } end it 'should configure the given values' do + is_expected.to contain_qemu_config('migration_address').with_value('0.0.0.0') + is_expected.to contain_qemu_config('migration_host').with_value('host.example.com') is_expected.to contain_qemu_config('migration_port_min').with_value(61138) is_expected.to contain_qemu_config('migration_port_max').with_value(61200) end