Add support for more migration parameters

Change-Id: I4a6c05e47a0e1ce2e6498a2ccbf075e0f1216335
This commit is contained in:
Rocky 2020-10-14 21:39:15 +11:00 committed by Takashi Kajinami
parent 6ebae70f28
commit 9f8c4c9785
3 changed files with 62 additions and 21 deletions

View File

@ -51,6 +51,22 @@
# to 0 to disable timeouts.
# Defaults to $::os_service_default
#
# [*live_migration_permit_post_copy*]
# (optional) This option allows nova to switch an on-going live migration
# to post-copy mode, i.e., switch the active VM to the one on the destination
# node before the migration is complete, therefore ensuring an upper bound
# on the memory that needs to be transferred.
# Post-copy requires libvirt>=1.3.3 and QEMU>=2.5.0.
# Defaults to $::os_service_default
#
# [*live_migration_permit_auto_converge*]
# (optional) This option allows nova to start live migration with auto
# converge on. Auto converge throttles down CPU if a progress of on-going
# live migration is slow. Auto converge will only be used if this flag is
# set to True and post copy is not permitted or post copy is unavailable
# due to the version of libvirt and QEMU in use.
# Defaults to $::os_service_default
#
# [*override_uuid*]
# (optional) Set uuid not equal to output from dmidecode (boolean)
# Defaults to false
@ -95,22 +111,24 @@
# Defaults to ::nova::compute::libvirt::version::default
#
class nova::migration::libvirt(
$transport = undef,
$auth = 'none',
$listen_address = undef,
$live_migration_inbound_addr = $::os_service_default,
$live_migration_tunnelled = $::os_service_default,
$live_migration_with_native_tls = $::os_service_default,
$live_migration_completion_timeout = $::os_service_default,
$override_uuid = false,
$configure_libvirt = true,
$configure_nova = true,
$client_user = undef,
$client_port = undef,
$client_extraparams = {},
$ca_file = undef,
$crl_file = undef,
$libvirt_version = $::nova::compute::libvirt::version::default,
$transport = undef,
$auth = 'none',
$listen_address = undef,
$live_migration_inbound_addr = $::os_service_default,
$live_migration_tunnelled = $::os_service_default,
$live_migration_with_native_tls = $::os_service_default,
$live_migration_completion_timeout = $::os_service_default,
$live_migration_permit_post_copy = $::os_service_default,
$live_migration_permit_auto_converge = $::os_service_default,
$override_uuid = false,
$configure_libvirt = true,
$configure_nova = true,
$client_user = undef,
$client_port = undef,
$client_extraparams = {},
$ca_file = undef,
$crl_file = undef,
$libvirt_version = $::nova::compute::libvirt::version::default,
) inherits nova::compute::libvirt::version {
include nova::deps
@ -165,11 +183,13 @@ class nova::migration::libvirt(
$live_migration_uri = "qemu+${transport_real}://${prefix}%s${postfix}/system${extra_params}"
nova_config {
'libvirt/live_migration_uri': value => $live_migration_uri;
'libvirt/live_migration_tunnelled': value => $live_migration_tunnelled;
'libvirt/live_migration_with_native_tls': value => $live_migration_with_native_tls;
'libvirt/live_migration_completion_timeout': value => $live_migration_completion_timeout;
'libvirt/live_migration_inbound_addr': value => $live_migration_inbound_addr;
'libvirt/live_migration_uri': value => $live_migration_uri;
'libvirt/live_migration_tunnelled': value => $live_migration_tunnelled;
'libvirt/live_migration_with_native_tls': value => $live_migration_with_native_tls;
'libvirt/live_migration_completion_timeout': value => $live_migration_completion_timeout;
'libvirt/live_migration_inbound_addr': value => $live_migration_inbound_addr;
'libvirt/live_migration_permit_post_copy': value => $live_migration_permit_post_copy;
'libvirt/live_migration_permit_auto_converge': value => $live_migration_permit_auto_converge;
}
}

View File

@ -0,0 +1,8 @@
---
features:
- |
The new ``nova::migration::libvirt::live_migration_permit_post_copy``
parameter has been added to support post copy mode in live migration.
- |
The new ``nova::migration::libvirt::live_migration_permit_auto_converge``
parameter has been added to support auto converge in live migration.

View File

@ -42,6 +42,8 @@ describe 'nova::migration::libvirt' do
it { is_expected.to contain_nova_config('libvirt/live_migration_completion_timeout').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_nova_config('libvirt/live_migration_uri').with_value('qemu+tcp://%s/system') }
it { is_expected.to contain_nova_config('libvirt/live_migration_inbound_addr').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_nova_config('libvirt/live_migration_permit_post_copy').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_nova_config('libvirt/live_migration_permit_auto_converge').with_value('<SERVICE DEFAULT>')}
end
context 'with override_uuid enabled' do
@ -109,6 +111,17 @@ describe 'nova::migration::libvirt' do
it { is_expected.to contain_nova_config('libvirt/live_migration_completion_timeout').with_value('1500') }
end
context 'with live migration auto converge on' do
let :params do
{
:live_migration_permit_post_copy => false,
:live_migration_permit_auto_converge => true,
}
end
it { is_expected.to contain_nova_config('libvirt/live_migration_permit_post_copy').with(:value => false) }
it { is_expected.to contain_nova_config('libvirt/live_migration_permit_auto_converge').with(:value => true) }
end
context 'with auth set to sasl' do
let :params do
{