Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 928689

Summary: [Backend] CPU pinning can be set on non migratable VM's with no specific host to run on
Product: Red Hat Enterprise Virtualization Manager Reporter: Ido Begun <ibegun>
Component: ovirt-engineAssignee: ofri <omasad>
Status: CLOSED CURRENTRELEASE QA Contact: Ido Begun <ibegun>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.2.0CC: acathrow, dfediuck, dyasny, gchaplik, iheim, lpeer, oramraz, pstehlik, Rhev-m-bugs, sgrinber, yeylon, ykaul
Target Milestone: ---   
Target Release: 3.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sla
Fixed In Version: sf15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:
Attachments:
Description Flags
engine.log none

Description Ido Begun 2013-03-28 08:54:54 UTC
Created attachment 717529 [details]
engine.log

Description of problem:
Considering https://bugzilla.redhat.com/show_bug.cgi?id=905831#c8 , it's possible to set CPU pinning to a non migratable ('pinned' placement affinity) with 'Run on any host in cluster' (no specific host to run on).

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

How reproducible:
100%

Steps to Reproduce:
Create VM;
In UI:
Run on: "Any host in cluster"
Migration options: "Do not allow migration"
Cpu pinning: "0#0"

In API:
<vm>
...
<cpu>
<cpu_tune>
<vcpu_pin vcpu="0" cpu_set="0"/>
</cpu_tune>
</cpu>
<placement_policy>
<affinity>pinned</affinity>
</placement_policy>
</vm>

Actual results:
Success

Expected results:
Should fail and proper error should be given

Comment 1 ofri 2013-04-02 13:03:25 UTC
This will be allowed (in 3.3).
When the user selects 'Do not allow migration' and 'Run on any host in cluster' the engine will select a host to run on on Run-Vm. The VM will not migrate from that host once it is running. (for each run of the VM the host may choose a different host)

Comment 2 ofri 2013-04-04 06:46:50 UTC
correction: When the user selects 'Do not allow migration' and 'Run on any host in cluster' the engine will select a host to run on on Run-Vm. But "CPU pinning will not be allowed in this case" 


A = cpu pinning
B = use host cpu
* = will be available on 3.2 - deprecated from 3.3 onward
** = will be available from 3.3 (currently blocked on Run-VM)

For RHEV:
                              Any                 Selected
                              Host                   Host
-------------------------------------------------------------
Allow auto migration                                    
Allow Man. migration           B*                    
Do not allow migration         B**                   A+B



For oVirt:
                              Any                 Selected
                              Host                   Host
-------------------------------------------------------------
Allow auto migration                                  A  
Allow Man. migration           B*                     A
Do not allow migration         B**                   A+B

Comment 3 Ido Begun 2013-04-14 11:55:53 UTC
Tested on SF13.1:

In UI:
Setting CPU pinning to a VM with "Do not allow migration" with "Run on any host in cluster" is disabled.

In API:
<vm>
...
<cpu>
<cpu_tune>
<vcpu_pin vcpu="0" cpu_set="0"/>
</cpu_tune>
</cpu>
<placement_policy>
<affinity>pinned</affinity>
</placement_policy>
</vm>

Status: 200 OK

Comment 4 Doron Fediuck 2013-04-14 12:14:09 UTC
(In reply to comment #3)
> Tested on SF13.1:
> 
> In UI:
> Setting CPU pinning to a VM with "Do not allow migration" with "Run on any
> host in cluster" is disabled.
> 

Ido,
based on comment 2 pinning should always fail in RHEV, unless selected 
"Do not allow migration + "Selected Host". So it works as expected. Why
did you fail it?

Comment 5 Ido Begun 2013-04-14 12:41:50 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Tested on SF13.1:
> > 
> > In UI:
> > Setting CPU pinning to a VM with "Do not allow migration" with "Run on any
> > host in cluster" is disabled.
> > 
> 
> Ido,
> based on comment 2 pinning should always fail in RHEV, unless selected 
> "Do not allow migration + "Selected Host". So it works as expected. Why
> did you fail it?

I was able to reproduce the bug using API: it's possible to set CPU pinning when selecting "Do not allow migration" and "Run on any host in cluster".

Comment 6 Ido Begun 2013-05-05 07:04:16 UTC
OK - SF15

In addition to being blocked in UI, CPU pinning is now blocked when setting it on a VM with no specific host to run on, and a proper error is given:
[Cannot set host CPU pinning when host is not selected]

Comment 7 Itamar Heim 2013-06-11 08:31:16 UTC
3.2 has been released

Comment 8 Itamar Heim 2013-06-11 08:31:23 UTC
3.2 has been released

Comment 9 Itamar Heim 2013-06-11 08:32:55 UTC
3.2 has been released