Bug 1475790 - [REST] Adding vNIC with network filter parameters to VM ends up with vNIC without the parameters
[REST] Adding vNIC with network filter parameters to VM ends up with vNIC wit...
Status: CLOSED NOTABUG
Product: ovirt-engine
Classification: oVirt
Component: RestAPI (Show other bugs)
4.2.0
x86_64 Linux
medium Severity medium (vote)
: ovirt-4.2.0
: ---
Assigned To: Ales Musil
Meni Yakove
: Automation
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-27 07:26 EDT by Meni Yakove
Modified: 2017-09-13 03:12 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-09-11 03:54:02 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Network
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
rule-engine: ovirt‑4.2+


Attachments (Terms of Use)
engine.log (181.29 KB, application/zip)
2017-07-27 07:26 EDT, Meni Yakove
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 80972 master POST restapi: Add mapping of NetworkFilterParameter to NIC 2017-08-29 07:00 EDT

  None (edit)
Description Meni Yakove 2017-07-27 07:26:52 EDT
Created attachment 1305299 [details]
engine.log

Description of problem:
Add vNIC to VM with network filter parameters succeded but the vNIC remain without the network filter parameters.



Version-Release number of selected component (if applicable):


Steps to Reproduce:
1. Add vNIC with network filter parameters via REST


Additional info:
vNIC profile with clear-traffic
url:ovirt-engine/api/vnicprofiles body:
<vnic_profile>
    <name>C9_network-filter-vnic-profile1</name>
    <network href="/ovirt-engine/api/networks/5568165a-73fd-4ded-ac24-a9d9af48eb35" id="5568165a-73fd-4ded-ac24-a9d9af48eb35">
        <name>ovirtmgmt</name>
        <description>Default Management Network</description>
        <link href="/ovirt-engine/api/networks/5568165a-73fd-4ded-ac24-a9d9af48eb35/permissions" rel="permissions"/>
        <link href="/ovirt-engine/api/networks/5568165a-73fd-4ded-ac24-a9d9af48eb35/vnicprofiles" rel="vnicprofiles"/>
        <link href="/ovirt-engine/api/networks/5568165a-73fd-4ded-ac24-a9d9af48eb35/networklabels" rel="networklabels"/>
        <mtu>0</mtu>
        <stp>false</stp>
        <usages>
            <usage>vm</usage>
        </usages>
        <data_center href="/ovirt-engine/api/datacenters/7c27202a-a4c9-4323-85f9-c3f7eade54e6" id="7c27202a-a4c9-4323-85f9-c3f7eade54e6"/>
    </network>
    <network_filter href="/ovirt-engine/api/networkfilters/5961f0d7-0199-019c-01ae-0000000003c6" id="5961f0d7-0199-019c-01ae-0000000003c6">
        <name>clean-traffic</name>
        <version>
            <major>3</major>
            <minor>6</minor>
        </version>
    </network_filter>
</vnic_profile>



CREATE url:/ovirt-engine/api/vms/3489b2f5-2a71-4ad9-8eae-38c5e15a4cee/nics body:
<nic>
    <name>C9_network_filter_vnic1</name>
    <network_filter_parameters>
        <network_filter_parameter>
            <name>IP</name>
            <value>1.2.3.4</value>
        </network_filter_parameter>
    </network_filter_parameters>
    <vnic_profile href="/ovirt-engine/api/vnicprofiles/c313c59a-7d00-4a49-9000-076fe03b8eef" id="c313c59a-7d00-4a49-9000-076fe03b8eef">
        <name>C9_network-filter-vnic-profile1</name>
        <link href="/ovirt-engine/api/vnicprofiles/c313c59a-7d00-4a49-9000-076fe03b8eef/permissions" rel="permissions"/>
        <pass_through>
            <mode>disabled</mode>
        </pass_through>
        <port_mirroring>false</port_mirroring>
        <network href="/ovirt-engine/api/networks/5568165a-73fd-4ded-ac24-a9d9af48eb35" id="5568165a-73fd-4ded-ac24-a9d9af48eb35"/>
        <network_filter href="/ovirt-engine/api/networkfilters/5961f0d7-0199-019c-01ae-0000000003c6" id="5961f0d7-0199-019c-01ae-0000000003c6"/>
    </vnic_profile>
</nic>
Comment 1 Ales Musil 2017-09-11 03:50:31 EDT
This behavior is correct. It is possible to add/update/remove Network Filter Parameters through subcollection. 

/ovirt-engine/api/vms/123/nics/456/networkfilterparameters


We want to avoid do the same thing by two different ways.
Comment 2 Meni Yakove 2017-09-11 10:43:41 EDT
We should be able to add vNIC to VM with network filter in one action.
Comment 3 Ales Musil 2017-09-13 03:12:06 EDT
Please refer to conversation here: https://gerrit.ovirt.org/#/c/80972/

As I said before, we want to avoid do the same by two different ways.

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