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

Bug 1478007

Summary: Failed to run VM with <Empty> nic profile
Product: [oVirt] ovirt-engine Reporter: Michael Burman <mburman>
Component: BLL.NetworkAssignee: Leon Goldberg <lgoldber>
Status: CLOSED CURRENTRELEASE QA Contact: Michael Burman <mburman>
Severity: high Docs Contact:
Priority: high    
Version: 4.2.0CC: ahadas, bugs, danken, fromani, ylavi
Target Milestone: ovirt-4.2.0Keywords: Automation, Regression
Target Release: ---Flags: rule-engine: ovirt-4.2+
rule-engine: blocker+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ovirt-engine-4.2.0-0.0.master.20170913112412.git2eb3c0a.el7.centos.noarch.rpm Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-20 11:03:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
engine log none

Description Michael Burman 2017-08-03 12:49:51 UTC
Created attachment 1308722 [details]
engine log

Description of problem:
Failed to run VM with <Empty> nic profile

Version-Release number of selected component (if applicable):
ovirt-engine-4.2.0-0.0.master.20170802210223.git338a2bc.el7.centos.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create VM on latest master 4.2
2. Add vNIC to the VM with <Empty> vNIC
3. Try to run VM

Actual results:
Nothing happens. VM failed to start.
No error on engine or vdsm side.
Only this on engine:
Failed to run VM 'VM2': EngineException: java.lang.RuntimeException: java.lang.NullPointerException (Failed with error ENGINE and code 5001)

But no exception in the engine log.

Expected results:
Must work as expected. VM should run with empty profile vNIC

Comment 1 Red Hat Bugzilla Rules Engine 2017-08-09 07:40:07 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 2 Dan Kenigsberg 2017-08-15 13:25:47 UTC
I suspect that this regression is related to the Engine domxml work. Could Virt team take a look?

Comment 3 Arik 2017-08-21 14:48:38 UTC
It was indeed a regression caused by the switch to engine xml, but now it fails on code added as part of https://gerrit.ovirt.org/#/c/80481/. Since it is not clear to me what should happen in that case (which network name should be taken), moving back to network team to decide how should it be fixed.

Comment 4 Dan Kenigsberg 2017-08-22 09:39:21 UTC
Arik, Vdsm should see only vdsm_name of a network. <Empty> used to be translated by Engine to the empty string, and later translated by vdsm to ';vdsmdummy;' bridge name.

How do you think this should be done in the age of Engine DomainXML?

Comment 5 Arik 2017-08-22 09:53:36 UTC
(In reply to Dan Kenigsberg from comment #4)
> How do you think this should be done in the age of Engine DomainXML?

If that's the mapping that we always do, let's set it directly on the engine side IMO.
Francesco, 
1. what do you think?
2. I saw in the metadata examples that there is a network-name set per-nic - what's the intended use of it?

Comment 6 Dan Kenigsberg 2017-08-22 10:13:41 UTC
(In reply to Arik from comment #5)

> 2. I saw in the metadata examples that there is a network-name set per-nic -
> what's the intended use of it?

For ovs switchType, vdsm maps the requested network name to a host-specific bridge name, that is unknown to Engine.
Another use for the (empty) network name is the one I've already mentioed (map the empty string to the ;vdsmdummy; bridge, which is also an entity unknown to Engine).

Comment 7 Francesco Romani 2017-08-22 16:46:58 UTC
(In reply to Arik from comment #5)
> (In reply to Dan Kenigsberg from comment #4)
> > How do you think this should be done in the age of Engine DomainXML?
> 
> If that's the mapping that we always do, let's set it directly on the engine
> side IMO.
> Francesco, 
> 1. what do you think?

It could work. See below

> 2. I saw in the metadata examples that there is a network-name set per-nic -
> what's the intended use of it?

Vdsm can easily and safely learn from engine XML the network to use for the VM NICs (vmdevices.Interface.network) only in the case of linux bridge. 
In this case we can trivially parse the domain XML and learn the network to use.

In the case of OVS, Vdsm cannot (or should not) reverse the mapping, so the network name has to be set explicitely, hence the need for metadata

            ovs_bridge = supervdsm.getProxy().ovs_bridge(self.network)
                                              ^^^^^^^^^^^^^^^^^^^^^^^
            if ovs_bridge:
                if ovs_bridge['dpdk_enabled']:
                    self._source_ovsdpdk_bridge(iface, ovs_bridge['name'])
                else:
                    self._source_ovs_bridge(iface, ovs_bridge['name'])
            else:
                iface.appendChildWithArgs('source', bridge=self.network)

SR-IOV and hostdev there is no need to use the network name.

In turn, Vdsm needs the network name to properly initialize the vmdevices.Interface object. It is not just to build the engine XML, we do logic on device setup/teardown for OVS/DPDK and this logic should be kept in Vdsm[1]
IMHO.

Comment 8 Francesco Romani 2017-08-22 16:48:47 UTC
Hit 'send' too soon...

Vdsm should handle the case on which network='' (empty string), we handle this for linux bridges already but for metadata we will need a small patch.

Comment 9 Michael Burman 2017-09-17 05:33:29 UTC
Verified on - 4.2.0-0.0.master.20170915203601.git96df02d.el7.centos

Comment 10 Sandro Bonazzola 2017-12-20 11:03:56 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.