This introduces the native resource type to manipulate qemu.conf, so that we can define the resources in the same way for all libvirt config files. This also updates all libvirt config resource types to convert boolean values automatically, because libvirt does not support raw boolean values and the values should be converted to 1/0. Change-Id: I562d19299e0377e02f2587f5ef36d35069b5a5cd
43 lines
1.1 KiB
Puppet
43 lines
1.1 KiB
Puppet
# == Class: nova::migration::qemu
|
|
#
|
|
# Sets qemu config that is required for migration
|
|
#
|
|
# === Parameters:
|
|
#
|
|
# [*configure_qemu*]
|
|
# (optional) Whether or not configure qemu bits.
|
|
# Defaults to false.
|
|
#
|
|
# [*migration_port_min*]
|
|
# (optional) Lower limit of port range used for migration.
|
|
# Defaults to $facts['os_service_default'].
|
|
#
|
|
# [*migration_port_max*]
|
|
# (optional) Higher limit of port range used for migration.
|
|
# Defaults to $facts['os_service_default'].
|
|
#
|
|
class nova::migration::qemu(
|
|
$configure_qemu = false,
|
|
$migration_port_min = $facts['os_service_default'],
|
|
$migration_port_max = $facts['os_service_default'],
|
|
){
|
|
|
|
include nova::deps
|
|
|
|
validate_legacy(Boolean, 'validate_bool', $configure_qemu)
|
|
|
|
Qemu_config<||> ~> Service<| tag == 'libvirt-qemu-service' |>
|
|
|
|
if $configure_qemu {
|
|
qemu_config {
|
|
'migration_port_min': value => $migration_port_min;
|
|
'migration_port_max': value => $migration_port_max;
|
|
}
|
|
} else {
|
|
qemu_config {
|
|
'migration_port_min': ensure => absent;
|
|
'migration_port_max': ensure => absent;
|
|
}
|
|
}
|
|
}
|