Created attachment 1239016 [details]
Description of problem:
[SR-IOV] - UI - Reflect 'No Filter' for passthrough vNIC profile that was created via rest api.
When creating/editing vNIC profile with a 'passthrough' property in the UI, it is immediately reflects as grayed out and 'No Filter' displayed.
But when creating/editing the same the vNIC profile with a 'passthrough' property via the rest api, the engine UI, display it as grayed out, but the 'vdsm-no-mac-spoofing' filter still visible, but it shouldn't.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create vNIC profile with 'passthrough' property via rest api
In the UI, the 'vdsm-no-mac-spoofing' filter still visible
If 'passthrough' checked we shouldn't see any network filter.
What happens when the VM is started? Does Engine request filter=vdsm-no-mac-spoofing ?
(In reply to Dan Kenigsberg from comment #1)
> What happens when the VM is started? Does Engine request
> filter=vdsm-no-mac-spoofing ?
No, it is just a small ui bug. When VM starts it has no filter
I don't believe it's small ui bug, I believe it's bigger backend bug. But I cannot tell, because there's no REST request you used or explaining description how you achieved this. Please next time provide that for simplifying flow.
What I assume you did: you took existing response returned via GET method, and used that to create new vNIC profile; you just removed ID and changed name in that xml. That would mean, that there's specified network_filter having name vdsm-no-mac-spoofing. Which is invalid request, because only "no network filter" can be specified. Am I right?
If I am, then there's incomplete validation phase in:
while UI is fine.
Can you confirm this?
checking deeper, error (?) seems to be in REST layer.
If someone tries to add new vnic_profile using request, which lacks specified network_filter, default one is used, which currently happens to be vdsm-no-mac-spoofing.
So it seems (please correct me if I'm wrong), that you cannot create vnic_profile without network_filter via REST. You can do it only via UI.
If that's correct, I can easily fix that automatic use of default, but this will harm backward compatibility. Shall this be fixed?
To solve this specific bug, I can 'override' this logic and set no filter for each passthrough vnic_profile, but error mentioned above is probably worse.
This creates new vnic_profile without network filter.
<network href="/ovirt-engine/api/networks/030cdc7e-c153-4253-b843-10482e798e1e" id="030cdc7e-c153-4253-b843-10482e798e1e">
<description>Default Management Network</description>
<link href="/ovirt-engine/api/networks/030cdc7e-c153-4253-b843-10482e798e1e/vnicprofiles" rel="vnicprofiles"/>
<link href="/ovirt-engine/api/networks/030cdc7e-c153-4253-b843-10482e798e1e/permissions" rel="permissions"/>
<link href="/ovirt-engine/api/networks/030cdc7e-c153-4253-b843-10482e798e1e/networklabels" rel="networklabels"/>
<data_center href="/ovirt-engine/api/datacenters/345f8890-24a6-4395-a767-6c78570e45ed" id="345f8890-24a6-4395-a767-6c78570e45ed"/>
thanks for info about rest. Then it's about missing validations on bll layer. Seems to working after change, waiting for review.
No longer depend on bz 1445759 as it has WA if sending network filter as null.
Verified on - 4.1.2-0.1.el7