Bug 842324

Summary: REST API: unable to add multiple vlans over the same interface via setupnetworks and rest api
Product: Red Hat Enterprise Virtualization Manager Reporter: Avi Tal <atal>
Component: ovirt-engine-restapiAssignee: Mike Kolesnik <mkolesni>
Status: CLOSED CURRENTRELEASE QA Contact: Yaniv Kaul <ykaul>
Severity: urgent Docs Contact:
Priority: high    
Version: 3.1.0CC: dyasny, ecohen, iheim, jkt, lpeer, mkolesni, mpastern, Rhev-m-bugs, sgrinber, srevivo, ykaul
Target Milestone: ---Keywords: TestBlocker
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: network
Fixed In Version: si14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-04 15:01:25 EST Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
engine log none

Description Avi Tal 2012-07-23 09:42:48 EDT
Created attachment 599780 [details]
engine log

I was trying to add multiple vlas over the same interface, a simple action which looks impossible vie REST API and setupnetworks

The idea in rest is to create the entire host_nics collections and send it to setupnetworks action.
The entire collection should look as followed (if you copy the final result of multiple vlans):

for example: adding sw1 vlan 164 and sw2 vlan 165 on top of eth1

<host_nics>
 <host_nic>
  <name>eth1</name>
  ...
 </host_nic>
 <host_nic>
  <name>eth1.164</name>
  <network>
   <name>sw1</name>
  </network>
  ...
 </host_nic>
 <host_nic>
  <name>eth1.165</name>
  <network>
   <name>sw2</name>
  </network>
  ....
 </host_nic>
</host_nics>

Sending this collection will cause ERROR [org.ovirt.engine.core.bll.SetupNetworksCommand] (ajp-/0.0.0.0:8009-6) [4d585298] Error during CanDoActionFailure.: java.lang.NullPointerException
...


BTW, when using only one vlan over eth1 the only thing we had to do is add sw1 as eth1's network.
for example:
<host_nics>
 <host_nic>
  <name>eth1</name>
  <network>
   <name>sw1</name>
  </network>
 </host_nic>
</host_nics>

and it automatically add eth1.164 element to the collection.

So The problem is that i can't really find a way to add multiple vlans over one interface through REST API and setupnetworks
Comment 8 Mike Kolesnik 2012-08-05 04:51:13 EDT
http://gerrit.ovirt.org/6895
Comment 13 Avi Tal 2012-08-20 11:00:49 EDT
Verify on SI14 - PASS

I have verified due to the modelling specified in the bug.
<host_nics>
 <host_nic>
  <name>eth1</name>
 </host_nic>
 <host_nic>
  <name>eth1.160</name>
  <network>
   <name>sw1</name>
  </network>
 </host_nic>
 <host_nic>
  <name>eth1.161</name>
  <network>
   <name>sw2</name>
  </network>
 </host_nic>
</host_nics>
Comment 14 Michael Pasternak 2012-08-20 11:16:07 EDT
i hope <name> is not mandatory <host_nic> param, as interface name should be 
derived from the nic.name+network.vlanid