Skip to content

Commit

Permalink
Expose the Libvirt cpu_model and cpu_model_extra_flags options
Browse files Browse the repository at this point in the history
Being able to set cpu_mode to "custom" is nice but doesn't do us
much good if users then have to resort to nova_nova_conf_overrides
to set cpu_model and/or cpu_model_extra_flags.

Instead, honor nova_cpu_model and nova_cpu_model_extra_flags variable.
Also add a release note saying that for those users who did previously
set these flags via nova_nova_conf_overrides, they should move
those bits to the newly understood variables.

Change-Id: I889e70826c5c631b86305b512b86fba2b89521b4
  • Loading branch information
fghaas committed Nov 6, 2018
1 parent b1d5e97 commit 58bad8e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions releasenotes/notes/nova-cpu-model-006da20048168842.yaml
@@ -0,0 +1,18 @@
---
features:
- You can now set the Libvirt CPU model and feature flags from the
appropriate entry under the ``nova_virt_types`` dictionary variable
(normally ``kvm``).
``nova_cpu_model`` is a string value that sets the CPU model; this
value is ignored if you set any ``nova_cpu_mode`` other than
``custom``.
``nova_cpu_model_extra_flags`` is a list that allows you to specify
extra CPU feature flags not normally passed through with
``host-model``, or the ``custom`` CPU model of your choice.
upgrade:
- If your configuration previously set the ``libvirt/cpu_model``
and/or ``libvirt/cpu_model_extra_flags`` variables in a
``nova_nova_conf_overrides`` dictionary, you should consider
moving those to ``nova_cpu_model`` and
``nova_cpu_model_extra_flags`` in the appropriate entry (normally
``kvm``) in the ``nova_virt_types`` dictionary.
6 changes: 6 additions & 0 deletions templates/nova.conf.j2
Expand Up @@ -258,6 +258,12 @@ virt_type = {{ nova_virt_type }}
remove_unused_resized_minimum_age_seconds = {{ nova_remove_unused_resized_minimum_age_seconds }}
{% if nova_cpu_mode is defined %}
cpu_mode = {{ nova_cpu_mode }}
{% if nova_cpu_mode == 'custom' %}
cpu_model = {{ nova_cpu_model }}
{% endif %}
{% if nova_cpu_model_extra_flags is defined %}
cpu_model_extra_flags = {{ nova_cpu_model_extra_flags | join(',') }}
{% endif %}
{% endif %}

{% if nova_libvirt_images_rbd_pool is defined %}
Expand Down

0 comments on commit 58bad8e

Please sign in to comment.