nova/nova
Kashyap Chamarthy 6b601b7cf6 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

Closes-Bug: #1750829
Change-Id: I6bb956808aa3df58747c865c92e5b276e61aff44
BluePrint: libvirt-cpu-model-extra-flags
2018-04-05 16:05:27 +02:00
..
api Move placement exceptions into the placement package 2018-03-19 15:28:02 +00:00
cells Add instance action record for snapshot instances 2017-12-11 17:46:38 +08:00
cmd Merge "Add --by-service to discover_hosts" 2018-03-19 05:07:53 +00:00
common
compute Merge "ironic: stop lying to the RT when ironic is down" 2018-03-21 15:46:40 +00:00
conductor Merge "conf: Remove '[conductor] topic' opt" 2018-03-13 08:00:43 +00:00
conf libvirt: Allow to specify granular CPU feature flags 2018-04-05 16:05:27 +02:00
console remove unnecessary conf imports 2018-03-09 14:30:10 -05:00
consoleauth Merge "Remove translation of log messages" 2017-08-10 11:39:03 +00:00
db Merge "Add disabled column to cell_mappings table." 2018-03-22 01:07:04 +00:00
hacking Merge "Removed unnecessary parantheses in yield statements" 2018-03-16 20:15:27 +00:00
image Workaround glanceclient bug when CONF.glance.api_servers not set 2018-02-08 09:06:48 -05:00
ipv6
keymgr Remove deprecated keymgr code 2017-09-11 15:48:30 -04:00
locale Imported Translations from Zanata 2018-02-18 06:12:37 +00:00
network Merge "Handle IpAddressAlreadyAllocated exception" 2018-03-08 14:45:06 +00:00
notifications Handle EndpointNotFound when building image_ref_url in notifications 2018-03-20 17:22:50 -04:00
objects Merge "Remove old flavor_create db api method" 2018-03-20 18:11:06 +00:00
pci remove unnecessary conf imports 2018-03-09 14:30:10 -05:00
policies trivial: Fix few policy doc 2018-02-01 03:04:00 +00:00
privsep Move makefs to privsep 2018-02-28 07:15:08 +11:00
scheduler Merge "Report client: Remove version discovery comment" 2018-03-20 00:04:53 +00:00
servicegroup iso8601.is8601.Utc No Longer Exists 2017-08-29 19:26:55 -04:00
tests libvirt: Allow to specify granular CPU feature flags 2018-04-05 16:05:27 +02:00
virt libvirt: Allow to specify granular CPU feature flags 2018-04-05 16:05:27 +02:00
vnc
volume Add the ability to get absolute limits from Cinder 2018-02-08 19:08:14 -05:00
__init__.py
availability_zones.py Avoid lazy-load error when getting instance AZ 2017-05-25 15:46:22 -04:00
baserpc.py
block_device.py Add uuid column to BlockDeviceMapping 2017-12-17 14:28:35 +00:00
cache_utils.py remove log translation tags from nova.cells 2017-04-10 14:48:07 +00:00
config.py
context.py Allow 'network' in RequestContext service_catalog 2018-02-28 15:51:47 +01:00
crypto.py crypto: Remove unused functions 2018-03-08 10:24:40 +00:00
debugger.py
exception.py Merge "ironic: stop lying to the RT when ironic is down" 2018-03-21 15:46:40 +00:00
exception_wrapper.py rename binary to source in versioned notifications 2017-07-25 17:36:04 +02:00
filters.py
hooks.py
i18n.py correct referenced url in comments 2018-01-18 09:16:37 +08:00
loadables.py
manager.py
policy.py Add policy granularity to the Flavors API 2017-07-19 15:56:47 -04:00
profiler.py
quota.py Remove unnecessary variables 2018-02-08 10:15:53 +09:00
rc_fields.py Move resource class fields 2018-03-13 09:01:30 +00:00
rpc.py Remove useless run_periodic_tasks call in ClientRouter 2018-03-20 23:54:21 +00:00
safe_utils.py Allow wrapping of closures 2017-07-20 10:07:52 +01:00
service.py Merge "Refactor WSGI apps and utils to limit imports" 2018-03-08 15:16:56 +00:00
service_auth.py Fix NoneType error when [service_user] is misconfigured 2017-11-28 12:22:30 -06:00
test.py Move resource provider objects into placement hierarchy 2018-03-13 09:01:31 +00:00
utils.py Merge "Refactor WSGI apps and utils to limit imports" 2018-03-08 15:16:56 +00:00
version.py
weights.py
wsgi.py Refactor WSGI apps and utils to limit imports 2018-03-06 22:05:12 +00:00