Bug 1070890

Summary: Run vm with odd number of cores drop libvirt error
Product: [Retired] oVirt Reporter: Artyom <alukiano>
Component: ovirt-engine-coreAssignee: Roy Golan <rgolan>
Status: CLOSED CURRENTRELEASE QA Contact: Artyom <alukiano>
Severity: high Docs Contact:
Priority: high    
Version: 3.4CC: alukiano, asegundo, bugs, gklein, iheim, mavital, michal.skrivanek, parsonsa, rbalakri, s.kieske, yeylon
Target Milestone: ---Keywords: AutomationBlocker, Triaged
Target Release: 3.4.4   
Hardware: Unspecified   
OS: Linux   
Whiteboard: virt
Fixed In Version: ovirt-3.5.0_rc1.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-24 08:08:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1121295    
Attachments:
Description Flags
engine and vdsm logs none

Description Artyom 2014-02-27 16:32:43 UTC
Created attachment 868630 [details]
engine and vdsm logs

Description of problem:
Run vm with odd number of cores drop libvirt error:
libvirtError: Maximum CPUs greater than topology limit
But number of physical cores greater that number of virtual cores.

Version-Release number of selected component (if applicable):
ovirt-engine-3.4.0-0.11.beta3.el6.noarch

How reproducible:
Always

Steps to Reproduce:
1. Add host to engine
2. Add new vm with: 'virtual socket'= 1 and 'Cores Per Virtual Socket'= 3
3. Run Vm

Actual results:
Running Vm failed with libvirt error in vdsm log

Expected results:
Vm run successfully or if odd number not correct input appropriate warning message

Additional info:
host: sockets=2 and cores per socket=6

Comment 1 Artyom 2014-02-27 17:57:06 UTC
Also for the same host, vm with 1 socket and cores per socket 6, the same error appear and vm failed to run
If Count Threads As Cores enable, vm with 1 socket and cores per socket 12, the same error appear and vm failed to run

Comment 2 Michal Skrivanek 2014-02-28 10:56:04 UTC
is this REST or UI?

Comment 3 Itamar Heim 2014-03-02 05:42:05 UTC
Setting target release to current version for consideration and review. please
do not push non-RFE bugs to an undefined target release to make sure bugs are
reviewed for relevancy, fix, closure, etc.

Comment 4 Artyom 2014-03-02 05:49:30 UTC
The same thing via REST and UI

Comment 5 Sandro Bonazzola 2014-03-04 09:24:05 UTC
This is an automated message.
Re-targeting all non-blocker bugs still open on 3.4.0 to 3.4.1.

Comment 6 Michal Skrivanek 2014-03-05 12:39:54 UTC
the calculation is certainly wrong. VDSM is trying to create a 53-socket VM which correctly fails.
- the max vcpu calculation should be within the global topology limits (UI does that for normal VCPUs)
- the topology limitation, and limit for total vCPUs should NOT be related to host in any way.

Comment 7 Roy Golan 2014-03-06 07:38:36 UTC
its correct:

the actual setting is 3 vcpus with max of 160

<vcpu current="3">160</vcpu>

with toplogy that fits the odd numbers

<topology cores="3" sockets="53" threads="1"/>

> - the max vcpu calculation should be within the global topology limits (UI
> does that for normal VCPUs)

this also works fine

> - the topology limitation, and limit for total vCPUs should NOT be related
> to host in any way.

Artyom please specify libvirt version

Comment 8 Roy Golan 2014-03-06 08:49:11 UTC
the odd numbers is not related

what has changed in VDSM is the way the topology is calculated and what the engine sends

bottom line the <topology> should constraints  are:

sockets <= ConfigValues.MaxNumOfVmSockets
cores   <= ConfigValues.MaxNumOfCpuPerSocket


also remove the limitation on plugging to cpu according to the host limitation because this breaks overcommitment - altough it may exceed the scheduling policy

Comment 9 Sandro Bonazzola 2014-05-08 13:50:30 UTC
This is an automated message.

oVirt 3.4.1 has been released.
This issue has been retargeted to 3.4.2 as it has priority high, please retarget if needed.
If this is a blocker please add it to the tracker Bug #1095370

Comment 10 Michal Skrivanek 2014-07-14 12:09:48 UTC
(not converging yet, needs to wait for 3.4.4)

Comment 11 Roy Golan 2014-07-31 09:06:21 UTC
a breakdown and a solution:

engine sends along with createInfo the following:

smp                 // VM.numOfCpus
smpCoresPerSocket   // VM.cpuPerSocket validated against ConfigValue.MaxNumOfSockets currently = 16
maxVCpus            // ConfigValue.MaxNumberOfVmCpus
smpThreadsPerCore   // optional - we don't send so defaults to 1 - bug? 

we need to send also
 * MaxNumOfSockets

the xml should be calculated like this

 <vcpu current="smp">M</vcpu>
<topology cores="C" sockets="S" threads="T"/>

smp = smp
C   = smpCoresPerSocket
T   = cpuThreads
S   = MaxNumOfSockets / T
M   = (C * S) < maxVCpus

AI:
1. ENGINE - I'll add MaxNumOfSockets to engine create info
2. VDSM   - adjust the xml creation to the formula above

Comment 12 Roy Golan 2014-07-31 09:14:57 UTC
small correction - 

smpCoresPerSocket   // VM.cpuPerSocket validated against ConfigValue.MaxNumOfCpusSockets

Comment 13 Artyom 2014-08-25 08:58:29 UTC
Verified on ovirt-engine-3.5.0-0.0.master.20140821064931.gitb794d66.el6.noarch

Comment 14 Sandro Bonazzola 2014-09-24 08:08:45 UTC
oVirt 3.4.4 has been released.