Hide Forgot
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:
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.
Michal, not sure if this should be Virt or Network, please correct me as needed.
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
(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.