Validate virt_type and cpu_mode

Nova accepts only specific values for these two options. Enforce
the same supported choices at the input.

Change-Id: I7c147896f1c04962117ebd1a9b483536826617ac
This commit is contained in:
Takashi Kajinami 2024-07-11 13:32:04 +09:00
parent 554d7b1ce0
commit b40efa36dc
3 changed files with 14 additions and 2 deletions

View File

@ -237,10 +237,10 @@
#
class nova::compute::libvirt (
$ensure_package = 'present',
$virt_type = 'kvm',
Nova::VirtType $virt_type = 'kvm',
$vncserver_listen = '127.0.0.1',
Boolean $migration_support = false,
$cpu_mode = undef,
Optional[Nova::CpuMode] $cpu_mode = undef,
Array[String[1]] $cpu_models = [],
$cpu_model_extra_flags = undef,
$cpu_power_management = $facts['os_service_default'],

6
types/cpumode.pp Normal file
View File

@ -0,0 +1,6 @@
type Nova::CpuMode = Enum[
'host-model',
'host-passthrough',
'custom',
'none'
]

6
types/virttype.pp Normal file
View File

@ -0,0 +1,6 @@
type Nova::VirtType = Enum[
'kvm',
'lxc',
'qemu',
'parallels'
]