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:
Juan - why isn't it network?
Because the only team that manages SDK issues is infra.
Doesn't it happen due to backend related issues?
I don't think so, but I still have to study it.
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.
There aren't plans to update the CLI, so this won't be fixed.