1
0

Compare commits

...

6 Commits

Author SHA1 Message Date
Arnaud Morin
1ff264100d G 2019-10-07 12:01:22 +02:00
Arnaud Morin
cf24853205 F 2019-10-07 12:01:13 +02:00
Arnaud Morin
3fcdfa03ca E 2019-10-07 12:01:01 +02:00
Arnaud Morin
cb8c71a99e D 2019-10-07 11:58:36 +02:00
Arnaud Morin
849ef266c7 C 2019-10-07 11:58:19 +02:00
Arnaud Morin
372c155800 B 2019-10-07 11:57:52 +02:00

View File

@ -33,6 +33,12 @@
# cpu_mode="custom" and virt_type="kvm|qemu". # cpu_mode="custom" and virt_type="kvm|qemu".
# Defaults to undef # Defaults to undef
# #
# [*libvirt_cpu_model_extra_flags*]
# (optional) This allows specifying granular CPU feature flags when
# specifying CPU models. Only has effect if cpu_mode is not set
# to 'none'.
# Defaults to undef
#
# [*libvirt_snapshot_image_format*] # [*libvirt_snapshot_image_format*]
# (optional) Format to save snapshots to. Some filesystems # (optional) Format to save snapshots to. Some filesystems
# have a preference and only operate on raw or qcow2 # have a preference and only operate on raw or qcow2
@ -131,6 +137,26 @@
# https://libvirt.org/logging.html # https://libvirt.org/logging.html
# Defaults to undef # Defaults to undef
# #
# [*rx_queue_size*]
# (optional) virtio-net rx queue size
# Valid values are 256, 512, 1024
# Defaults to $::os_service_default
#
# [*tx_queue_size*]
# (optional) virtio-net tx queue size
# Valid values are 256, 512, 1024
# Defaults to $::os_service_default
#
# [*file_backed_memory*]
# (optional) Available capacity in MiB for file-backed memory.
# Defaults to $::os_service_default
#
# [*volume_use_multipath*]
# (optional) Use multipath connection of the
# iSCSI or FC volume. Volumes can be connected in the
# LibVirt as multipath devices.
# Defaults to $::os_service_default
#
class nova::compute::libvirt ( class nova::compute::libvirt (
$ensure_package = 'present', $ensure_package = 'present',
$libvirt_virt_type = 'kvm', $libvirt_virt_type = 'kvm',
@ -138,6 +164,7 @@ class nova::compute::libvirt (
$migration_support = false, $migration_support = false,
$libvirt_cpu_mode = false, $libvirt_cpu_mode = false,
$libvirt_cpu_model = undef, $libvirt_cpu_model = undef,
$libvirt_cpu_model_extra_flags = undef,
$libvirt_snapshot_image_format = $::os_service_default, $libvirt_snapshot_image_format = $::os_service_default,
$libvirt_disk_cachemodes = [], $libvirt_disk_cachemodes = [],
$libvirt_hw_disk_discard = $::os_service_default, $libvirt_hw_disk_discard = $::os_service_default,
@ -156,6 +183,10 @@ class nova::compute::libvirt (
$preallocate_images = $::os_service_default, $preallocate_images = $::os_service_default,
$manage_libvirt_services = true, $manage_libvirt_services = true,
$log_outputs = undef, $log_outputs = undef,
$rx_queue_size = $::os_service_default,
$tx_queue_size = $::os_service_default,
$file_backed_memory = undef,
$volume_use_multipath = $::os_service_default,
) inherits nova::params { ) inherits nova::params {
include ::nova::deps include ::nova::deps
@ -192,6 +223,14 @@ class nova::compute::libvirt (
} }
} }
unless $rx_queue_size == $::os_service_default or $rx_queue_size in [256, 512, 1024] {
fail("Invalid rx_queue_size parameter: ${rx_queue_size}")
}
unless $tx_queue_size == $::os_service_default or $tx_queue_size in [256, 512, 1024] {
fail("Invalid_tx_queue_size parameter: ${tx_queue_size}")
}
# manage_libvirt_services is here for backward compatibility to support # manage_libvirt_services is here for backward compatibility to support
# deployments that do not include nova::compute::libvirt::services # deployments that do not include nova::compute::libvirt::services
# #
@ -227,12 +266,16 @@ class nova::compute::libvirt (
'libvirt/hw_disk_discard': value => $libvirt_hw_disk_discard; 'libvirt/hw_disk_discard': value => $libvirt_hw_disk_discard;
'libvirt/hw_machine_type': value => $libvirt_hw_machine_type; 'libvirt/hw_machine_type': value => $libvirt_hw_machine_type;
'libvirt/enabled_perf_events': value => join(any2array($libvirt_enabled_perf_events), ','); 'libvirt/enabled_perf_events': value => join(any2array($libvirt_enabled_perf_events), ',');
'libvirt/rx_queue_size': value => $rx_queue_size;
'libvirt/tx_queue_size': value => $tx_queue_size;
'libvirt/file_backed_memory': value => $file_backed_memory;
'libvirt/volume_use_multipath': value => $volume_use_multipath;
} }
# cpu_model param is only valid if cpu_mode=custom # cpu_model param is only valid if cpu_mode=custom
# otherwise it should be commented out # otherwise it should be commented out
if $libvirt_cpu_mode_real == 'custom' { if $libvirt_cpu_mode_real == 'custom' {
validate_string($libvirt_cpu_model) validate_legacy(String, 'validate_string', $libvirt_cpu_model)
nova_config { nova_config {
'libvirt/cpu_model': value => $libvirt_cpu_model; 'libvirt/cpu_model': value => $libvirt_cpu_model;
} }
@ -245,6 +288,20 @@ class nova::compute::libvirt (
} }
} }
if $libvirt_cpu_mode_real != 'none' {
validate_legacy(String, 'validate_string', $libvirt_cpu_model_extra_flags)
nova_config {
'libvirt/cpu_model_extra_flags': value => $libvirt_cpu_model_extra_flags;
}
} else {
nova_config {
'libvirt/cpu_model_extra_flags': ensure => absent;
}
if $libvirt_cpu_model_extra_flags {
warning('$libvirt_cpu_model_extra_flags requires that $libvirt_cpu_mode is not set to "none" and will be ignored')
}
}
if size($libvirt_disk_cachemodes) > 0 { if size($libvirt_disk_cachemodes) > 0 {
nova_config { nova_config {
'libvirt/disk_cachemodes': value => join($libvirt_disk_cachemodes, ','); 'libvirt/disk_cachemodes': value => join($libvirt_disk_cachemodes, ',');