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

Bug 1479484

Summary: VM with vNIC profile configured as passthrough fails to run on SR-IOV based host
Product: [oVirt] vdsm Reporter: Mor <mkalfon>
Component: CoreAssignee: Arik <ahadas>
Status: CLOSED CURRENTRELEASE QA Contact: Mor <mkalfon>
Severity: high Docs Contact:
Priority: high    
Version: 4.20.0CC: bugs, fromani, mburman, michal.skrivanek, myakove, obensass
Target Milestone: ovirt-4.2.0Keywords: Automation, Regression
Target Release: ---Flags: rule-engine: ovirt-4.2+
rule-engine: blocker+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-20 11:10:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1478054    
Bug Blocks:    
Attachments:
Description Flags
vdsm supervdsm and engine logs none

Description Mor 2017-08-08 15:48:54 UTC
Description of problem:
VM with vNIC profile configured as 'passthrough' fails to run on an SR-IOV host with free VF allocated.

Vdsm reports the following error:
2017-08-08 10:55:50,243+0300 ERROR (vm/f70e5764) [virt.vm] (vmId='f70e5764-9d97-499b-97f4-1fe8b0e44733') The vm start process failed (vm:808)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vm.py", line 742, in _startUnderlyingVm
    self._run()
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vm.py", line 2327, in _run
    self._devices = self._make_devices()
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vm.py", line 2315, in _make_devices
    self.id, self.domain, self._md_desc, self.log
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vmdevices/common.py", line 200, in dev_map_from_domain_xml
    dev_obj = dev_class.from_xml_tree(log, dev_elem, dev_meta)
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vmdevices/network.py", line 74, in from_xml_tree
    params.update(_get_hostdev_params(dev))
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vmdevices/network.py", line 480, in _get_hostdev_params
    src_dev = vmxml.find_first(dev, 'source')
  File "/usr/lib/python2.7/site-packages/vdsm/virt/vmxml.py", line 105, in find_first
    raise NotFound((element, tag,))
NotFound: (<Element 'interface' at 0x7f24d80378d0>, 'source')

Version-Release number of selected component (if applicable):
4.2.0-0.0.master.20170807212757.gitfe2e304.el7.centos

How reproducible:
100%

Steps to Reproduce:
1. On SR-IOV host, select SR-IOV interface and set allocated VFs to 1.
2. Create new VM network 'test' and configure the vnic profile for 'test' to be 'Passthrough'.
3. Attach the default vNIC to the network 'test'.
4. Start VM.

Actual results:
VM fails to run.

Expected results:
VM should run.

Comment 1 Mor 2017-08-08 15:51:54 UTC
Created attachment 1310708 [details]
vdsm supervdsm and engine logs

Comment 2 Mor 2017-08-08 15:53:58 UTC
Vdsm packages:

vdsm-hook-vmfex-dev-4.20.2-41.gitd789a5e.el7.centos.noarch
vdsm-api-4.20.2-41.gitd789a5e.el7.centos.noarch
vdsm-jsonrpc-4.20.2-41.gitd789a5e.el7.centos.noarch
vdsm-python-4.20.2-41.gitd789a5e.el7.centos.noarch
vdsm-http-4.20.2-41.gitd789a5e.el7.centos.noarch
vdsm-hook-ethtool-options-4.20.2-41.gitd789a5e.el7.centos.noarch
vdsm-yajsonrpc-4.20.2-41.gitd789a5e.el7.centos.noarch
vdsm-client-4.20.2-41.gitd789a5e.el7.centos.noarch
vdsm-4.20.2-41.gitd789a5e.el7.centos.x86_64

Comment 3 Red Hat Bugzilla Rules Engine 2017-08-09 07:30:41 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 4 Dan Kenigsberg 2017-08-15 13:24:26 UTC
I suspect that this is related to the Engine domxml work.

Comment 5 Francesco Romani 2017-08-21 08:27:08 UTC
here's what Vdsm received:

            <interface type="hostdev" managed="no">
                <driver name="vfio"></driver>
                <vlan>
                    <tag id="4"></tag>
                </vlan>
                <mac address="00:1a:4a:16:91:d8"></mac>
                <bandwidth>
                </bandwidth>
            </interface>


Vdsm doesn't expect one hostdev device without the source address, like (made-up example):

              <source>
                <address type='pci' domain='0x0000' bus='0x05'
                    slot='0x00' function='0x1'/>
              </source>

Not sure if/how Vdsm should handle that or if it is just Engine bug.

Comment 6 Michal Skrivanek 2017-08-21 08:37:27 UTC
it's missing the source element in hostdev case of writeInterface()

Comment 7 Mor 2017-08-24 08:23:34 UTC
Verified on:
4.2.0-0.0.master.20170823165744.git116f435.el7.centos

Comment 8 Sandro Bonazzola 2017-12-20 11:10:22 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.