Bug 1332611 - vm getting wrong vnic profile
Summary: vm getting wrong vnic profile
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 3.6.5
Hardware: x86_64
OS: Linux
unspecified
low vote
Target Milestone: ---
: ---
Assignee: Dan Kenigsberg
QA Contact: Pavel Stehlik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-03 14:51 UTC by enax
Modified: 2016-05-04 08:22 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-04 08:22:28 UTC
oVirt Team: Network
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?


Attachments (Terms of Use)
engine.log (1.21 KB, text/plain)
2016-05-03 14:51 UTC, enax
no flags Details

Description enax 2016-05-03 14:51:10 UTC
Created attachment 1153460 [details]
engine.log

Description of problem:

Vm getting wrong vnic profile after nic attach.

How reproducible:

Steps to Reproduce:
1. Make at least two vnic profile

in my case: 
name:public1011-100 id:dfbd7e0a-7f8a-496a-8488-3c1ef18eafaa
name:public1011-1000 id:41c50e4e-17c9-4266-b041-d4cb396e6732

network id:c89ff8e8-1c34-4af5-b825-cdbd8576ed10

2. create a vm with python sdk
3. add a nic

nic= params.NIC(name='nic1', vnic_profile= params.VnicProfile(id='41c50e4e-17c9-4266-b041-d4cb396e6732'), network=params.Network(id='c89ff8e8-1c34-4af5-b825-cdbd8576ed10'), interface='virtio')

vm.nics.add(nic)

Actual results:

print api.vms.get(id=vm_id).nics.list()[0].vnic_profile.id

dfbd7e0a-7f8a-496a-8488-3c1ef18eafaa

Expected results:
41c50e4e-17c9-4266-b041-d4cb396e6732

Additional info:

Comment 1 Juan Hernández 2016-05-03 16:29:58 UTC
Currently if both the NIC profile and the network are specified then the network takes precedence, and the NIC profile is just ignored. As the NIC profile already contains a reference to the network you can just remove the "network" parameter:

  nic = params.NIC(
    name='nic1', 
    vnic_profile=params.VnicProfile(
      id='41c50e4e-17c9-4266-b041-d4cb396e6732'
    ),
    interface='virtio',
  )

In addition the "network" parameter will be removed in version 4 of the API, so it is good if you stop using it already.

Comment 2 Juan Hernández 2016-05-03 16:35:51 UTC
Michal, not sure if this should be Virt or Network, please correct me as needed.

Comment 3 Michal Skrivanek 2016-05-03 16:58:44 UTC
Since it won't be an issue in 4.0 I suppose we won't do anything in 3.6 anyway. Moving to network in case I missed any semantic probleem it might cause

Comment 4 enax 2016-05-04 08:19:03 UTC
(In reply to Juan Hernández from comment #1)
> Currently if both the NIC profile and the network are specified then the
> network takes precedence, and the NIC profile is just ignored. As the NIC
> profile already contains a reference to the network you can just remove the
> "network" parameter:
> 
>   nic = params.NIC(
>     name='nic1', 
>     vnic_profile=params.VnicProfile(
>       id='41c50e4e-17c9-4266-b041-d4cb396e6732'
>     ),
>     interface='virtio',
>   )
> 
> In addition the "network" parameter will be removed in version 4 of the API,
> so it is good if you stop using it already.

Thanks, working well now.


Note You need to log in before you can comment on or make changes to this bug.