Bug 1125289

Summary: Failed to run vm with NumaNode
Product: [Retired] oVirt Reporter: Artyom <alukiano>
Component: vdsmAssignee: Bruce Shi <xiao-lei.shi>
Status: CLOSED CURRENTRELEASE QA Contact: Artyom <alukiano>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 3.5CC: alukiano, bazulay, bugs, danken, ecohen, gchaplik, gklein, iheim, mgoldboi, rbalakri, yeylon
Target Milestone: ---Keywords: TestBlocker, Triaged
Target Release: 3.5.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: sla
Fixed In Version: vt4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-17 12:43:57 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:
Attachments:
Description Flags
vdsm.log none

Description Artyom 2014-07-31 13:45:37 UTC
Description of problem:
Failed to run vm with NumaNode

Version-Release number of selected component (if applicable):
vdsm-4.16.1-0.gita4d9abf.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Create new vm and add via REST to vm numa node:
<vm_numa_node>
<index>0</index>
<memory>1024</memory>
<cpu>
<cores>
<core index="0"/>
<core index="1"/>
</cores>
</cpu>
</vm_numa_node>
2. Run vm
3.

Actual results:
Vm failed to run with exception in vdsm.log
Traceback (most recent call last):
  File "/usr/share/vdsm/virt/vm.py", line 2235, in _startUnderlyingVm
    self._run()
  File "/usr/share/vdsm/virt/vm.py", line 3255, in _run
    domxml = hooks.before_vm_start(self._buildCmdLine(), self.conf)
  File "/usr/share/vdsm/virt/vm.py", line 3045, in _buildCmdLine
    domxml.appendCpu()
  File "/usr/share/vdsm/virt/vm.py", line 931, in appendCpu
    self.conf.get('guestNumaNodes'), key=itemgetter('nodeIndex'))
KeyError: 'nodeIndex'


Expected results:
Vm success to run without any exceptions

Additional info:
If I change line:
guestNumaNodes = sorted(
                self.conf.get('guestNumaNodes'), key=itemgetter('nodeIndex'))
to 
guestNumaNodes = self.conf.get('guestNumaNodes') and restart vdsm all works fine

Comment 1 Dan Kenigsberg 2014-07-31 14:19:02 UTC
Could you attach vdsm.log from the vmCreate line down to that exception?

Comment 2 Artyom 2014-07-31 14:37:48 UTC
Created attachment 922951 [details]
vdsm.log

Comment 3 Bruce Shi 2014-08-04 01:49:25 UTC
This root cause of this bug is in engine side, and the related patches are already posted.

Comment 4 Gilad Chaplik 2014-08-05 13:27:19 UTC
(In reply to Bruce Shi from comment #3)
> This root cause of this bug is in engine side, and the related patches are
> already posted.

actually I think that: http://gerrit.ovirt.org/#/c/27987/3/vdsm/virt/vm.py solves it.

Comment 5 Bruce Shi 2014-08-06 01:19:04 UTC
No, i don't think so. Yes, http://gerrit.ovirt.org/#/c/27987/3/vdsm/virt/vm.py is to fix the bug of missing index when create vm numa nodes, but it also needs the support of several engine patches, including the following:
http://gerrit.ovirt.org/#/c/28341/
http://gerrit.ovirt.org/#/c/27830/
http://gerrit.ovirt.org/#/c/27988/
the above engine patches are still in reviewing. So we need to merge these patches to fix this issue.

Comment 6 Bruce Shi 2014-09-23 01:43:16 UTC
Since the related engine patches are merged, this bug should be modified.

Comment 7 Artyom 2014-10-05 12:42:27 UTC
Verified on rhevm-3.5.0-0.13.beta.el6ev.noarch
Run vm with NUMA node success without any problem.

Comment 8 Sandro Bonazzola 2014-10-17 12:43:57 UTC
oVirt 3.5 has been released and should include the fix for this issue.