Disable CPU pinning on migration with cpu_mask=all (#1261)
authorCalum Calder <calumcalder@users.noreply.github.com>
Tue, 1 Aug 2017 08:03:10 +0000 (09:03 +0100)
committerMorg <morgawr@gmail.com>
Tue, 1 Aug 2017 08:03:10 +0000 (10:03 +0200)
Setting the cpu_mask hypervisor parameter with cpu_mask=all disables
CPU pinning, allowing Ganeti to run without dependence on psutil.

Reviewed-by: Federico Morg Pareschi <morg@google.com>

lib/hypervisor/hv_kvm/__init__.py

index 0f23962..3569a20 100644 (file)
@@ -1900,7 +1900,8 @@ class KVMHypervisor(hv_base.BaseHypervisor):
     # during instance startup anyway, and to avoid problems when soft
     # rebooting the instance.
     cpu_pinning = False
-    if up_hvp.get(constants.HV_CPU_MASK, None):
+    if up_hvp.get(constants.HV_CPU_MASK, None) \
+        and up_hvp[constants.HV_CPU_MASK] != constants.CPU_PINNING_ALL:
       cpu_pinning = True
 
     if security_model == constants.HT_SM_POOL: