Bug 1267678 - Network names leak between datacenters / Used query (name=ovirtmgmt) produces ambiguous results
Summary: Network names leak between datacenters / Used query (name=ovirtmgmt) produces...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: ovirt-engine-cli
Classification: oVirt
Component: General
Version: 3.6.0.2
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ovirt-4.1.0-alpha
: ---
Assignee: Juan Hernández
QA Contact: Pavel Stehlik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-30 16:01 UTC by Jiri Belka
Modified: 2016-05-10 10:21 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-10 10:21:12 UTC
oVirt Team: Infra
juan.hernandez: ovirt-4.1?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?


Attachments (Terms of Use)

Description Jiri Belka 2015-09-30 16:01:39 UTC
Description of problem:
I had two DCs, each of them with 'ovirtmgmt' network.

[RHEVM shell (connected)]# add label --parent-datacenter-name Default --parent-network-name ovirtmgmt --id mylabel
  ====================================================================================================== ERROR ===================================================================================================
                                                                               Used query (name=ovirtmgmt) produces ambiguous results.
  ================================================================================================================================================================================================================

Seems strange as there is "filter" for 'Default' DC only.



* About to connect() to jb-rhevm36.rhev.lab.eng.brq.example.com port 443 (#0)
* Trying 127.0.0.1...
* connected
* Connected to jb-rhevm36.rhev.lab.eng.brq.example.com (127.0.0.1) port 443 (#0)
* skipping SSL peer certificate verification
* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA
* Server certificate:
* subject: CN=jb-rhevm36.rhev.lab.eng.brq.example.com,O=rhev.lab.eng.brq.example.com,C=US
* start date: Aug 16 11:37:40 2015 GMT
* expire date: Jul 21 11:37:40 2020 GMT
* common name: jb-rhevm36.rhev.lab.eng.brq.redhat.com
* issuer: CN=jb-rhevm36.rhev.lab.eng.brq.example.com.42113,O=rhev.lab.eng.brq.example.com,C=US
* Server auth using Basic with user 'admin@internal'
> GET /api/networks?search=name%3Dovirtmgmt HTTP/1.1
> Authorization: Basic YWRtaW5AaW50ZXJuYWw6MTIzNDU2
> User-Agent: PycURL/7.19.7
> Host: jb-rhevm36.rhev.lab.eng.brq.example.com
> Cookie: JSESSIONID=J4YWzIDlsER5C3yjSYy79+eO
> Content-Type: application/xml
> Accept: application/xml
> Filter: False
> Prefer: persistent-auth
> Content-Length: 0
< HTTP/1.1 200 OK
< Date: Wed, 30 Sep 2015 15:58:02 GMT
< Pragma: No-cache
< Cache-Control: no-cache
< Expires: Thu, 01 Jan 1970 01:00:00 CET
< JSESSIONID: J4YWzIDlsER5C3yjSYy79+eO
< Content-Type: application/xml
< Content-Length: 1597
< Vary: Accept-Encoding
< Connection: close
< 
< <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
< <networks>
<     <network href="/api/networks/3ce62ab4-7de1-47b6-88d6-4fff0c510581" id="3ce62ab4-7de1-47b6-88d6-4fff0c510581">
<         <name>ovirtmgmt</name>
<         <description>Default Management Network</description>
<         <link href="/api/networks/3ce62ab4-7de1-47b6-88d6-4fff0c510581/permissions" rel="permissions"/>
<         <link href="/api/networks/3ce62ab4-7de1-47b6-88d6-4fff0c510581/vnicprofiles" rel="vnicprofiles"/>
<         <link href="/api/networks/3ce62ab4-7de1-47b6-88d6-4fff0c510581/labels" rel="labels"/>
<         <data_center href="/api/datacenters/90ded66c-e9f4-46ef-ba0e-28d12d014648" id="90ded66c-e9f4-46ef-ba0e-28d12d014648"/>
<         <stp>false</stp>
<         <mtu>0</mtu>
<         <usages>
<             <usage>vm</usage>
<         </usages>
<     </network>
<     <network href="/api/networks/00000000-0000-0000-0000-000000000009" id="00000000-0000-0000-0000-000000000009">
<         <name>ovirtmgmt</name>
<         <description>Management Network</description>
<         <link href="/api/networks/00000000-0000-0000-0000-000000000009/permissions" rel="permissions"/>
<         <link href="/api/networks/00000000-0000-0000-0000-000000000009/vnicprofiles" rel="vnicprofiles"/>
<         <link href="/api/networks/00000000-0000-0000-0000-000000000009/labels" rel="labels"/>
<         <data_center href="/api/datacenters/00000001-0001-0001-0001-0000000003e1" id="00000001-0001-0001-0001-0000000003e1"/>
<         <stp>false</stp>
<         <mtu>0</mtu>
<         <usages>
<             <usage>vm</usage>
<         </usages>
<     </network>
< </networks>
* Closing connection #0
[1;31m  ====================================================================================================== ERROR ===================================================================================================
                                                                               Used query (name=ovirtmgmt) produces ambiguous results.
  ================================================================================================================================================================================================================

Version-Release number of selected component (if applicable):
rhevm-sdk-python-3.6.0.2-1.el6ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. two DCs, each with ovirtmgmt network
2. rhevm-shell
3. add label --parent-datacenter-name Default --parent-network-name ovirtmgmt --id mylabel

Actual results:
Used query (name=ovirtmgmt) produces ambiguous results.

Expected results:
imo command should work, there's "filter" which restricts the action to 'Default' DC only

Additional info:

Comment 1 Oved Ourfali 2015-10-14 06:26:21 UTC
Juan - why isn't it network?

Comment 2 Juan Hernández 2015-10-14 07:58:14 UTC
Because the only team that manages SDK issues is infra.

Comment 3 Oved Ourfali 2015-10-14 09:02:32 UTC
Doesn't it happen due to backend related issues?

Comment 4 Juan Hernández 2015-10-14 09:12:55 UTC
I don't think so, but I still have to study it.

Comment 5 Juan Hernández 2016-04-06 12:02:31 UTC
The reason for this error is that the only way that the CLI has to lookup a network by name is to use a query. But queries are only supported by top level collections like /networks, not by sub-collections like /datacenter/{dc:id}/networks. When running the query in the top level collections all the results are returned, because networks can have duplicate names. Fixing this would require important changes to the CLI, which we don't have capacity to do for version 4 of oVirt. We will revisit for 4.1.

Comment 6 Juan Hernández 2016-05-10 10:21:12 UTC
There aren't plans to update the CLI, so this won't be fixed.


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