Bug 1279375

Summary: Reintroduce checks for online CPUs for cpu pinning
Product: [oVirt] ovirt-engine Reporter: Roman Mohr <rmohr>
Component: Backend.CoreAssignee: Roman Mohr <rmohr>
Status: CLOSED CURRENTRELEASE QA Contact: Artyom <alukiano>
Severity: medium Docs Contact:
Priority: high    
Version: 3.6.0CC: bugs, mgoldboi, rgolan
Target Milestone: ovirt-3.6.3Keywords: Triaged
Target Release: 3.6.3.2Flags: rule-engine: ovirt-3.6.z+
rule-engine: exception+
mgoldboi: planning_ack+
rgolan: devel_ack+
mavital: testing_ack+
Hardware: ppc64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: When starting a VM with cpu pinning, it was not validated if the required CPU is really online on the host. Consequence: vdsm/libvirt tried to start the VM even when the requested host cpu cores were not available. The result was a cryptic error message in the logs instead of an interactive feedback that a VM can't run on the target hosts. Fix: Add a CpuPinningPolicy which checks on start up and migration of a VM if target hosts have all the required CPUs and if they are online Result: When starting a VM with a specific CPU pinning the user will see an appropriate validation message which is emitted by the scheduler instead of a failed launch attempt from libvirt with an obscure error message.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-11 07:22:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Roman Mohr 2015-11-09 10:17:27 UTC
Description of problem:
Since the problem of reporting online cpu cores on PPC seems to be fixed (see Bug 1148092) validation of cpu pinning should be reintroduced.

Version-Release number of selected component (if applicable):


How reproducible:
Add a VM and pin virtual cpu core 1 to non existent hot cpu thread 10000000.

Steps to Reproduce:
1. Create VM
2. Add a cpu pinning string like 1#1000000
3. Obviously the host cpu thread 1000000 does not exist, but no warning is issued and when you try to start the VM, vdsm fails with an unexpected error.

Actual results:
Currently only syntactic correctness of the cpu pinning string is guaranteed.
No cpu policy or configuration checks are hindering you from assigning virtual cpu cores to non existent host cpu threads or cores.

Expected results:

1) Do a soft check when configuring VMs and warn the user about possible invalid cpu pinnings.
2) Add a policy unit which checks the host before starting the VM there and remove it from the list if it does not provide the specified pinning requirements.

Additional info:

VDSM currently cashes the host capabilities (which include online CPUs). We need to update the capabilities when online CPU status change.

Comment 1 Red Hat Bugzilla Rules Engine 2015-11-09 10:27:33 UTC
This bug is not marked for z-stream, yet the milestone is for a z-stream version, therefore the milestone has been reset.
Please set the correct milestone or add the z-stream flag.

Comment 2 Red Hat Bugzilla Rules Engine 2015-11-10 08:34:36 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 3 Red Hat Bugzilla Rules Engine 2015-11-10 08:46:18 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 4 Artyom 2016-02-21 13:30:19 UTC
Verified on rhevm-backend-3.6.3.2-0.1.el6.noarch
Error while executing action: 

golden_env_mixed_virtio_1_0:
Cannot run VM. There is no host that satisfies current scheduling constraints. See below for details:
The host host_mixed_1 did not satisfy internal filter CpuPinning because missing online cpu core(s) 31.
The host host_mixed_2 did not satisfy internal filter PinToHost.