nova/nova/conf
Kashyap Chamarthy 1c6b2fce28 libvirt: Allow to specify granular CPU feature flags
The recent "Meltdown" CVE fixes have resulted in a critical performance
penalty[*] that will impact every Nova guest with certain CPU models.

I.e. assume you have applied all the "Meltdown" CVE fixes, and performed
a cold reboot (explicit stop & start) of all Nova guests, for the
updates to take effect.  Now, if any guests that are booted with certain
named virtual CPU models (e.g. "IvyBridge", "Westmere", etc), then those
guests, will incur noticeable performance degradation[*], while being
protected from the CVE itself.

To alleviate this guest performance impact, it is now important to
specify an obscure Intel CPU feature flag, 'PCID' (Process-Context ID)
-- for the virtual CPU models that don't already include it (more on
this below).  To that end, this change will allow Nova to explicitly
specify CPU feature flags via a new configuration attribute,
`cpu_model_extra_flags`, e.g. in `nova.conf`:

    ...
    [libvirt]
    cpu_mode = custom
    cpu_model = IvyBridge
    cpu_model_extra_flags = pcid
    ...

NB: In the first iteration, the choices for `cpu_model_extra_flags` is
restricted to only 'pcid' (the option is case-insensitive) -- to address
the earlier mentioned guest performance degradation.  A future patch
will remove this restriction, allowing to add / remove multiple CPU
feature flags, thus making way for other useful features.

Some have asked: "Why not simply hardcode the 'PCID' CPU feature flag
into Nova?"  That's not graceful, and more importantly, impractical:

  (1) Not every Intel CPU model has 'PCID':

       - The only Intel CPU models that include the 'PCID' capability
         are: "Haswell", "Broadwell", and "Skylake" variants.

       - The libvirt / QEMU Intel CPU models: "Nehalem", "Westmere",
         "SandyBridge", and "IvyBridge" will *not* expose the 'PCID'
         capability, even if the host CPUs by the same name include it.
         I.e. 'PCID' needs to be explicitly when using the said virtual
         CPU models.

  (2) Magically adding new CPU feature flags under the user's feet
      impacts live migration.

[*] https://groups.google.com/forum/m/#!topic/mechanical-sympathy/L9mHTbeQLNU

Conflicts:
        nova/virt/libvirt/driver.py

NOTE(lyarwood): The above is a trivial warning log translation conflict
required prior to stable/pike.

Closes-Bug: #1750829
Change-Id: I6bb956808aa3df58747c865c92e5b276e61aff44
(cherry picked from commit 6b601b7cf6)
(cherry picked from commit 98eb85f29c)
(cherry picked from commit 56350b977e)
2018-04-20 17:56:10 +00:00
..
__init__.py Use a service account to make vendordata requests. 2017-01-26 13:39:46 +00:00
api.py Optionally make dynamic vendordata failures fatal. 2017-01-26 13:39:53 +00:00
availability_zone.py conf: fix formatting in availability_zone 2016-11-10 13:44:54 -06:00
base.py conf: fix formatting in base 2016-12-14 14:36:15 +00:00
cache.py conf: Make list->dict conversion more specific 2016-09-14 12:10:29 +00:00
cells.py Clarify the [cells] config option help 2017-02-02 13:34:32 -05:00
cinder.py Remove support for the Cinder v1 API 2016-12-12 15:06:16 -05:00
cloudpipe.py conf: Move cloudpipe options to a group 2016-08-22 09:31:03 +01:00
compute.py conf: Fix invalid rST comments 2017-03-10 13:48:45 +00:00
conductor.py conf: Remove deprecated service manager opts 2016-12-05 23:28:49 +08:00
configdrive.py Config options consistency for configdrive.py 2016-07-26 21:56:36 +00:00
console.py Correctly set up deprecation warning 2017-03-10 10:55:47 -05:00
consoleauth.py conf: Move consoleauth options to a group 2016-10-07 13:43:43 +01:00
crypto.py Fix consistency in crypto conf 2016-08-12 01:06:16 +00:00
database.py Remove unused placement_database config options 2017-03-07 15:04:13 -05:00
ephemeral_storage.py Parse algorithm from cipher for ephemeral disk encryption 2017-05-19 10:45:46 -04:00
flavors.py Add deprecated_since parameter 2016-09-21 17:37:12 +01:00
floating_ips.py conf: Deprecate more nova-net options 2016-12-15 16:24:36 +00:00
glance.py conf: Remove deprecated ``use_glance_v1`` 2016-10-12 12:21:59 +00:00
guestfs.py Improve the help text for the guestfs options 2016-07-29 19:19:21 +00:00
hyperv.py HyperV: use os-brick for volume related operations 2016-11-17 18:36:05 +02:00
image_file_url.py Add deprecated_since parameter 2016-09-21 17:37:12 +01:00
ipv6.py Config Options: Improve help text for Ipv6 options 2016-08-05 11:10:40 +00:00
ironic.py conf: remove deprecated ironic options 2016-12-19 18:56:48 +00:00
key_manager.py conf: remove deprecated barbican options 2016-12-21 17:57:33 +00:00
libvirt.py libvirt: Allow to specify granular CPU feature flags 2018-04-20 17:56:10 +00:00
mks.py Help text for the mks options 2016-08-01 15:05:35 +00:00
netconf.py config options: improve help netconf 2016-08-18 17:39:24 +00:00
network.py Merge "conf: Remove 'virt' file" 2017-01-19 01:02:02 +00:00
neutron.py Remove deprecated flag in neutron.py 2016-09-14 23:22:22 +00:00
notifications.py Document the real behavior of notify_on_state_change 2017-11-27 12:24:18 +00:00
novnc.py Conf options: updated flags for novnc 2016-08-01 15:00:07 -05:00
opts.py conf: Make list->dict conversion more specific 2016-09-14 12:10:29 +00:00
osapi_v21.py conf: Add 'deprecated_reason' to osapi opts 2016-09-22 09:39:07 +01:00
paths.py Config options: base path configuration 2016-08-05 14:34:45 +01:00
pci.py Enhance PCI passthrough whitelist to support regex 2016-12-11 00:53:14 +02:00
placement.py Cleanup some issues with CONF.placement.os_interface 2017-02-15 09:26:48 -05:00
quota.py conf: Deprecate yet more nova-net options 2017-01-09 09:47:37 +00:00
rdp.py Config options consistency of rdp.py 2016-08-08 12:51:34 +00:00
remote_debug.py Config options: Consistency check for remote_debug options 2016-08-09 16:53:27 +00:00
scheduler.py Accept any scheduler driver entrypoint 2017-08-02 21:56:36 +00:00
serial_console.py Fix nova-serialproxy when registering cli options 2016-12-07 08:51:28 -05:00
service.py conf: Remove config option compute_ manager 2016-12-08 20:05:52 +08:00
service_token.py Add service_token for nova-neutron interaction 2017-01-12 14:33:58 -06:00
servicegroup.py Improve consistency in servicegroup opts 2016-07-28 13:43:51 -05:00
spice.py config options: Improve help for SPICE 2016-11-02 12:52:40 +01:00
ssl.py conf: Make list->dict conversion more specific 2016-09-14 12:10:29 +00:00
upgrade_levels.py Improve help text for upgrade_levels options 2016-10-10 15:45:54 +00:00
vendordata.py Use a service account to make vendordata requests. 2017-01-26 13:39:46 +00:00
vmware.py VMware: deprecate wsdl_location conf option 2016-09-23 01:39:43 +00:00
vnc.py Verified deprecation status for vnc options 2016-08-12 08:11:08 +00:00
workarounds.py Improve consistency in workarounds opts 2016-08-08 11:15:45 +01:00
wsgi.py conf: fix formatting in wsgi 2016-11-11 16:05:58 +00:00
xenserver.py conf: Fix invalid rST comments 2017-03-10 13:48:45 +00:00
xvp.py Updated flags for XVP config options 2016-08-16 14:09:39 +00:00