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

Bug 1267678

Summary: Network names leak between datacenters / Used query (name=ovirtmgmt) produces ambiguous results
Product: [oVirt] ovirt-engine-cli Reporter: Jiri Belka <jbelka>
Component: GeneralAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED WONTFIX QA Contact: Pavel Stehlik <pstehlik>
Severity: low Docs Contact:
Priority: low    
Version: 3.6.0.2CC: bugs, juan.hernandez, oourfali
Target Milestone: ---Flags: sbonazzo: ovirt-4.1-
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-10 10:21:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.