Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1531998

Summary: routing: port's fixed_ips, device_owner and device_id should report valid values
Product: [oVirt] ovirt-provider-ovn Reporter: Alona Kaplan <alkaplan>
Component: providerAssignee: Dominik Holler <dholler>
Status: CLOSED CURRENTRELEASE QA Contact: Mor <mkalfon>
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: bugs, cpelland, danken, dholler, gblomqui, jfrey, jhardy, lveyde, mkalfon, obarenbo, ylavi
Target Milestone: ovirt-4.2.2Flags: rule-engine: ovirt-4.2+
rule-engine: exception+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-provider-ovn-1.2.7-2 Doc Type: Bug Fix
Doc Text:
Cause: In OpenStack Networking API the attributes fixed_ips, device_owner and device_id of ports connected to a router ware not reported or reported incorrect values. Consequence: It was not possible to detect if a port is connected to a router. Fix: In OpenStack Networking API the attributes fixed_ips, device_owner and device_id of ports connected to a router are reporting the correct values. Result: In OpenStack Networking API it is possible to detect that a port is connected to a specific router. This enables clients of OpenStack Networking API, e.g. ManageIQ and Ansible, to locate the ports of a router to remove them.
Story Points: ---
Clone Of: 1529108 Environment:
Last Closed: 2018-03-29 11:13:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: RHEVM Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1529108    

Comment 1 Alona Kaplan 2018-01-07 10:17:01 UTC
When an interface is added to a router with the subnet specified ('add_router_interface').
1. The "device_owner" of the port should be "network:router_interface" and not "oVirt".
2. The 'fixed_ips' of the port should contain the 'subnet_id'.
For example -
"fixed_ips": [
{
"ip_address": "10.0.0.1",
"subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2"
}
]

reference - https://developer.openstack.org/api-ref/network/v2/#ports
3. The "device_id" of the port should contain the ID of the device that uses this port. It our case, the id of the router.

Comment 2 Alona Kaplan 2018-01-07 12:22:39 UTC
According to https://developer.openstack.org/api-ref/network/v2/#remove-interface-from-router 'If this subnet ID is the last subnet on the port, this operation deletes the port itself'.
Currently the port is not removed. Please fix as well.

Comment 3 Dominik Holler 2018-01-17 14:15:07 UTC
(In reply to Alona Kaplan from comment #2)
> According to
> https://developer.openstack.org/api-ref/network/v2/#remove-interface-from-
> router 'If this subnet ID is the last subnet on the port, this operation
> deletes the port itself'.
> Currently the port is not removed. Please fix as well.

This is handled in
https://bugzilla.redhat.com/show_bug.cgi?id=1531112

Comment 4 Mor 2018-02-25 10:44:23 UTC
Dominik,

I tried to verify the fixes on ovirt-provider-ovn-1.2.7-2.el7ev.noarch (RHV 4.2.2.1-0.1.el7)
with the following use case - create a router that is attached to a subnet and a network.

Patches:
[1] https://gerrit.ovirt.org/#/c/86641/ --> We do not support updating multiple fixed_ips in a port:
When I attempt to do so, I get 400 error: "Specifying more then one fixed_ips value is not allowed"
can I verify this bug with this missing functionality?
[2] https://gerrit.ovirt.org/#/c/86415/ - Looks OK (see below)
[3] https://gerrit.ovirt.org/#/c/86414/ - Looks OK (see below)

Router ports:
{'ports': [{u'admin_state_up': False,
   u'device_id': u'0ee5198a-f168-4bcf-a35e-0fcdbb0ed102', --> Reports router ID correctly (see routers list below)
   u'device_owner': u'network:router_interface', --> Entity name for router ports.
   u'fixed_ips': [{u'ip_address': u'1.0.0.254', u'subnet_id': u'9c3a111c-172f-4cc2-9325-d5df9499bdcf'}], --> fixed_ips reports a list, but with the inability to update fixed_ips on /ports with multiple IPs
   u'id': u'abaf521c-8053-438a-acb1-097404db7017',
   u'mac_address': u'router',
   u'name': u'router_port',
   u'network_id': u'15da670c-cfc8-4921-ae4d-072d6962d4f0',
   u'port_security_enabled': False,
   u'security_groups': [],
   u'tenant_id': u'00000000000000000000000000000001'}]}

Routers list:
{'routers': [{u'admin_state_up': True,
   u'external_gateway_info': None,
   u'id': u'0ee5198a-f168-4bcf-a35e-0fcdbb0ed102',
   u'name': u'router1',
   u'routes': [],
   u'status': u'ACTIVE',
   u'tenant_id': u'00000000000000000000000000000001'}]}

Comment 5 Mor 2018-02-25 11:46:38 UTC
Verified on RHV 4.2.2.1-0.1.el7 with ovirt-provider-ovn-1.2.7-2.el7ev.noarch

Comment 6 Sandro Bonazzola 2018-03-29 11:13:01 UTC
This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.2 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.