neutron filters of OpenContrail not work

Bug #1685764 reported by ding xiang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.2
Fix Committed
Undecided
Bruno Fernando
R3.2.3.x
Fix Committed
Undecided
Bruno Fernando
R4.0
Fix Committed
Undecided
Bruno Fernando
Trunk
Fix Committed
Undecided
Bruno Fernando

Bug Description

OpenStack : Liberty
OpenContrail:3.0.3

I use this cmd to want to filter the subnet I want ,but it seems just work with the condition of network_id

 curl -i -k -v -H "X-Auth-Token:1c3dd3b51c6c48a4830cbdbb2e6b3116" http://189.43.133.201:9696/v2.0/subnets?network_id=6abaaf14-d0b5-4f4a-a436-7b728ab66c69\&cidr=2001:db2::/48\&enable_dhcp=true\&gateway_ip=null

The response is

{"subnets": [{"name": "", "enable_dhcp": true, "network_id": "6abaaf14-d0b5-4f4a-a436-7b728ab66c69", "tenant_id": "c5fadfacec6148eb81a6fd1585763dde", "dns_nameservers": [], "ipv6_ra_mode": null, "allocation_pools": [{"start": "182.16.0.10", "end": "182.16.0.100"}], "gateway_ip": "182.16.0.254", "ipv6_address_mode": null, "ip_version": 4, "host_routes": [], "cidr": "182.16.0.0/16", "id": "74bdee0a-1e09-4d74-97ac-7d48faada404"}, {"name": "test", "enable_dhcp": true, "network_id": "6abaaf14-d0b5-4f4a-a436-7b728ab66c69", "tenant_id": "c5fadfacec6148eb81a6fd1585763dde", "dns_nameservers": [], "ipv6_ra_mode": null, "allocation_pools": [{"start": "2001:db2::2", "end": "2001:db2:0:ffff:ffff:ffff:ffff:fffe"}], "gateway_ip": "2001:db2::1", "ipv6_address_mode": null, "ip_version": 6, "host_routes": [], "cidr": "2001:db2::/48", "id": "5840f97e-8574-4841-bca2-2ed492c0b124"}]}

Just the condition of network_id seems work and reported me two subnets of the network.

The log on neutron is
2017-04-24 17:30:57.482 650 DEBUG keystoneclient.session [-] REQ: curl -g -i -X GET http://189.43.133.172:35357/v3/auth/tokens -H "X-Subject-Token: {SHA1}ac10054fc4ef440481adecddfc2556ac163cd6a0" -H "User-Agent: python-keystoneclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}7782e1f4c7813c70198660e1b26cff3092dd3f5e" _http_log_request /usr/lib/python2.7/dist-packages/keystoneclient/session.py:198
2017-04-24 17:30:57.549 650 DEBUG keystoneclient.session [-] RESP: [200] Content-Length: 4236 X-Subject-Token: {SHA1}ac10054fc4ef440481adecddfc2556ac163cd6a0 Vary: X-Auth-Token Keep-Alive: timeout=5, max=100 Server: Apache/2.4.7 (Ubuntu) Connection: Keep-Alive Date: Mon, 24 Apr 2017 17:30:57 GMT x-openstack-request-id: req-7d41df19-f0ce-464d-b349-0da7e480d1a7 Content-Type: application/json X-Distribution: Ubuntu
RESP BODY: {"token": {"methods": ["password", "token"], "roles": [{"id": "9fe2ff9ee4384b1894a90878d3e92bab", "name": "_member_"}, {"id": "5cd4cb4a977f4c348621996e8ba7daa0", "name": "admin"}, {"id": "25acf9ff434f44d2a1a320cb1918d5c2", "name": "Member"}], "expires_at": "2017-04-24T18:28:32.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "c5fadfacec6148eb81a6fd1585763dde", "name": "CloudEdge"}, "catalog": "<removed>", "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": "7496e29fc1c141a081301bd9484f59c3", "name": "CloudEdge"}, "audit_ids": ["GTVlubKPR7qQYbZqkYOnjg"], "issued_at": "2017-04-24T17:28:32.963663"}}
 _http_log_response /usr/lib/python2.7/dist-packages/keystoneclient/session.py:215
2017-04-24 17:30:57.678 650 DEBUG neutron_plugin_contrail.plugins.opencontrail.contrail_plugin [req-7104ac89-1938-4856-9916-0a4999ab96b1 7496e29fc1c141a081301bd9484f59c3 c5fadfacec6148eb81a6fd1585763dde - - -] get_subnet(): filters: {u'network_id': [u'6abaaf14-d0b5-4f4a-a436-7b728ab66c69'], u'cidr': [u'2001:db2::/48'], u'gateway_ip': [u'null'], u'enable_dhcp': [True]} data: [{u'name': u'', u'enable_dhcp': True, u'network_id': u'6abaaf14-d0b5-4f4a-a436-7b728ab66c69', u'tenant_id': u'c5fadfacec6148eb81a6fd1585763dde', u'dns_nameservers': [], u'gateway_ip': u'182.16.0.254', u'ipv6_ra_mode': None, u'allocation_pools': [{u'start': u'182.16.0.10', u'end': u'182.16.0.100'}], u'host_routes': [], u'shared': False, u'ip_version': 4, u'ipv6_address_mode': None, u'cidr': u'182.16.0.0/16', u'id': u'74bdee0a-1e09-4d74-97ac-7d48faada404'}, {u'name': u'test', u'enable_dhcp': True, u'network_id': u'6abaaf14-d0b5-4f4a-a436-7b728ab66c69', u'tenant_id': u'c5fadfacec6148eb81a6fd1585763dde', u'dns_nameservers': [], u'gateway_ip': u'2001:db2::1', u'ipv6_ra_mode': None, u'allocation_pools': [{u'start': u'2001:db2::2', u'end': u'2001:db2:0:ffff:ffff:ffff:ffff:fffe'}], u'host_routes': [], u'shared': False, u'ip_version': 6, u'ipv6_address_mode': None, u'cidr': u'2001:db2::/48', u'id': u'5840f97e-8574-4841-bca2-2ed492c0b124'}] _list_resource /usr/lib/python2.7/dist-packages/neutron_plugin_contrail/plugins/opencontrail/contrail_plugin.py:331
2017-04-24 17:30:57.679 650 INFO neutron.wsgi [req-7104ac89-1938-4856-9916-0a4999ab96b1 7496e29fc1c141a081301bd9484f59c3 c5fadfacec6148eb81a6fd1585763dde - - -] 189.43.133.201 - - [24/Apr/2017 17:30:57] "GET /v2.0/subnets?network_id=6abaaf14-d0b5-4f4a-a436-7b728ab66c69&cidr=2001:db2::/48&enable_dhcp=true&gateway_ip=null HTTP/1.1" 200 1065 0.198209

I can see the condition has send by neutron , but it doesn't work

affects: horizon → opencontrail
Changed in opencontrail:
assignee: nobody → Bruno Fernando (bfernando)
Changed in juniperopenstack:
assignee: nobody → Bruno Fernando (bfernando)
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/30940
Submitter: Bruno Fernando (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/30940
Committed: http://github.com/Juniper/contrail-controller/commit/8ff6c714ebe4afde5613b0d3cb4d3ff0ac2ee504
Submitter: Zuul (<email address hidden>)
Branch: master

commit 8ff6c714ebe4afde5613b0d3cb4d3ff0ac2ee504
Author: bfernando <email address hidden>
Date: Tue May 2 16:32:55 2017 +0200

Fix nework-id and device-id filters management

* When both filters (network-id and device-id) are used, the
vnc_openstack has to compare the device-id and the network-id. Both
have to be present in the vmi_obj refs. The vnc_lib with both refs returns
a result with an OR logical operation, therefore with the current comparison
the vnc_openstack returns a result with an AND on both filters.
* Add a new conditional entry that manages the case if there is only the
network-id provided in the filters.

Change-Id: I3054345a84caeb892e85a350533e4e600f353665
Closes-Bug: #1685764

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.0

Review in progress for https://review.opencontrail.org/31404
Submitter: Bruno Fernando (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.2

Review in progress for https://review.opencontrail.org/31405
Submitter: Bruno Fernando (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/31405
Committed: http://github.com/Juniper/contrail-controller/commit/1843234b248fac966ed21cae98109c18a9e8532e
Submitter: Zuul (<email address hidden>)
Branch: R3.2

commit 1843234b248fac966ed21cae98109c18a9e8532e
Author: bfernando <email address hidden>
Date: Tue May 2 16:32:55 2017 +0200

Fix nework-id and device-id filters management

* When both filters (network-id and device-id) are used, the
vnc_openstack has to compare the device-id and the network-id. Both
have to be present in the vmi_obj refs. The vnc_lib with both refs returns
a result with an OR logical operation, therefore with the current comparison
the vnc_openstack returns a result with an AND on both filters.
* Add a new conditional entry that manages the case if there is only the
network-id provided in the filters.

Change-Id: I3054345a84caeb892e85a350533e4e600f353665
Closes-Bug: #1685764
(cherry picked from commit 8ff6c714ebe4afde5613b0d3cb4d3ff0ac2ee504)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/31404
Committed: http://github.com/Juniper/contrail-controller/commit/9dc653de35a3605c88d4b36c4ce80597790f09a5
Submitter: Zuul (<email address hidden>)
Branch: R4.0

commit 9dc653de35a3605c88d4b36c4ce80597790f09a5
Author: bfernando <email address hidden>
Date: Tue May 2 16:32:55 2017 +0200

Fix nework-id and device-id filters management

* When both filters (network-id and device-id) are used, the
vnc_openstack has to compare the device-id and the network-id. Both
have to be present in the vmi_obj refs. The vnc_lib with both refs returns
a result with an OR logical operation, therefore with the current comparison
the vnc_openstack returns a result with an AND on both filters.
* Add a new conditional entry that manages the case if there is only the
network-id provided in the filters.

Change-Id: I3054345a84caeb892e85a350533e4e600f353665
Closes-Bug: #1685764
(cherry picked from commit 8ff6c714ebe4afde5613b0d3cb4d3ff0ac2ee504)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.2.3.x

Review in progress for https://review.opencontrail.org/32578
Submitter: Vinay Vithal Mahuli (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/32578
Committed: http://github.com/Juniper/contrail-controller/commit/003fae9806be30ffee748e0c8fb9687021ec5157
Submitter: Zuul (<email address hidden>)
Branch: R3.2.3.x

commit 003fae9806be30ffee748e0c8fb9687021ec5157
Author: bfernando <email address hidden>
Date: Tue May 2 16:32:55 2017 +0200

Fix nework-id and device-id filters management

* When both filters (network-id and device-id) are used, the
vnc_openstack has to compare the device-id and the network-id. Both
have to be present in the vmi_obj refs. The vnc_lib with both refs returns
a result with an OR logical operation, therefore with the current comparison
the vnc_openstack returns a result with an AND on both filters.
* Add a new conditional entry that manages the case if there is only the
network-id provided in the filters.

Change-Id: I3054345a84caeb892e85a350533e4e600f353665
Closes-Bug: #1685764
(cherry picked from commit 8ff6c714ebe4afde5613b0d3cb4d3ff0ac2ee504)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/33705
Submitter: ?douard Thuleau (<email address hidden>)

Sachin Bansal (sbansal)
no longer affects: opencontrail
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.