From 772b7398a7222e8b286848ba00c06006d6b68785 Mon Sep 17 00:00:00 2001 From: Rajesh Tailor Date: Tue, 29 Sep 2020 10:39:53 +0530 Subject: [PATCH] Expose new THT params for cpu model flags This change adds new THT parameters `NovaLibvirtCPUMode`, `NovaLibvirtCPUModels` and `NovaLibvirtCPUModelExtraFlags` which allows to configure `libvirt/cpu_mode`, `libvirt/cpu_models` and `libvirt/cpu_model_extra_flags` parameters respectively. Change-Id: I8df21d5d171976cbb8670dc5aef744b5fae657b2 --- .../nova/nova-compute-container-puppet.yaml | 36 +++++++++++++++++++ .../notes/cpu-flags-5b027db3eb2b86c2.yaml | 7 ++++ 2 files changed, 43 insertions(+) create mode 100644 releasenotes/notes/cpu-flags-5b027db3eb2b86c2.yaml diff --git a/deployment/nova/nova-compute-container-puppet.yaml b/deployment/nova/nova-compute-container-puppet.yaml index e753ba6160..bde181e635 100644 --- a/deployment/nova/nova-compute-container-puppet.yaml +++ b/deployment/nova/nova-compute-container-puppet.yaml @@ -458,6 +458,36 @@ parameters: type: boolean tags: - role_specific + NovaLibvirtCPUMode: + type: string + description: > + The libvirt CPU mode to configure. Defaults to 'host-model' if virt_type is + set to kvm, otherwise defaults to 'none' + default: 'none' + constraints: + - allowed_values: + - custom + - host-model + - none + - host-passthrough + tags: + - role_specific + NovaLibvirtCPUModels: + type: comma_delimited_list + description: > + The named libvirt CPU model (see names listed in /usr/share/libvirt/cpu_map.xml). + Only has effect if cpu_mode="custom" and virt_type="kvm|qemu" + default: [] + tags: + - role_specific + NovaLibvirtCPUModelExtraFlags: + type: string + description: > + This allows specifying granular CPU feature flags when specifying CPU models. + Only has effect if cpu_mode is not set to 'none'. + default: '' + tags: + - role_specific # DEPRECATED: the following options are deprecated and are currently maintained # for backwards compatibility. They will be removed in future release. @@ -561,6 +591,9 @@ resources: nova::compute::libvirt::swtpm_enabled: NovaEnableVTPM nova::compute::vgpu::vgpu_types_device_addresses_mapping: NovaVGPUTypesDeviceAddressesMapping compute_disable_irqbalance: NovaComputeDisableIrqBalance + nova::compute::libvirt::cpu_mode: NovaLibvirtCPUMode + nova::compute::libvirt::cpu_models: NovaLibvirtCPUModels + nova::compute::libvirt::cpu_model_extra_flags: NovaLibvirtCPUModelExtraFlags - values: {get_param: [RoleParameters]} - values: NovaVcpuPinSet: {get_param: NovaVcpuPinSet} @@ -639,6 +672,9 @@ resources: NovaImageCacheTTL: {get_param: NovaImageCacheTTL} NovaVGPUTypesDeviceAddressesMapping: {get_param: NovaVGPUTypesDeviceAddressesMapping} NovaComputeDisableIrqBalance: {get_param: NovaComputeDisableIrqBalance} + NovaLibvirtCPUMode: {get_param: NovaLibvirtCPUMode} + NovaLibvirtCPUModels: {get_param: NovaLibvirtCPUModels} + NovaLibvirtCPUModelExtraFlags: {get_param: NovaLibvirtCPUModelExtraFlags} conditions: diff --git a/releasenotes/notes/cpu-flags-5b027db3eb2b86c2.yaml b/releasenotes/notes/cpu-flags-5b027db3eb2b86c2.yaml new file mode 100644 index 0000000000..ed9831a197 --- /dev/null +++ b/releasenotes/notes/cpu-flags-5b027db3eb2b86c2.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Add parameters `NovaLibvirtCPUMode`, `NovaLibvirtCPUModels` + and `NovaLibvirtCPUModelExtraFlags` to allow configuration of + CPU related parameters `libvirt/cpu_mode`, `libvirt/cpu_models` and + `libvirt/cpu_model_extra_flags` respectively.