Bug 822631 - REST API: unable to set cluster network as display
REST API: unable to set cluster network as display
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi (Show other bugs)
3.1.0
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Mike Kolesnik
Yaniv Kaul
network
:
: 815855 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-17 12:23 EDT by Avi Tal
Modified: 2016-04-22 00:59 EDT (History)
9 users (show)

See Also:
Fixed In Version: si10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-04 15:00:18 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Network
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
engine log (39.18 KB, application/x-compressed-tar)
2012-05-17 12:23 EDT, Avi Tal
no flags Details

  None (edit)
Description Avi Tal 2012-05-17 12:23:23 EDT
Created attachment 585267 [details]
engine log

Unable to update clusters/id/networks/id <usages> collection.

existing: <usages><usage>DISPLAY</usage><usage>VM</usage></usages>
sending: <usages><usage>VM</usage></usages>
the purpose is to remove DISPLAY by not sending it in the collection 

using PUT /api/clusters/id/networks/id

received 200 but without removing the DISPLAY
<usages><usage>DISPLAY</usage><usage>VM</usage></usages>

the only way i can remove the DISPLAY usage is to update the old property 
<display>true</display> 
moving from true to false and send with PUT will return:
            <display>false</display>
            <usages>
                    <usage>VM</usage>
            </usages>
Comment 1 Avi Tal 2012-05-17 12:26:51 EDT
it is true also for adding DISPLAY. working only when using the old property <display>
Comment 2 Mike Kolesnik 2012-06-13 04:05:53 EDT
Seems related to this commit: 6c3a4563be178fe9ec178ff18f4b4730fde80349

By that logic, <display> tag takes precedence over the <usages> tag.

If you only use <usages> tag, is there still a bug?
Comment 4 Avi Tal 2012-06-13 05:21:15 EDT
Two scenarios:
1. unset Cluster Network display:

PUT http://<rhevm address>/api/clusters/<id>/networks/<id>
<network>
        <name>sw1</name>
        <usages>
                <usage>VM</usage>
        </usages>
</network>

Response: 200 PUT
    <network ...>
            <name>sw1</name>
            <data_center ...\>
            <cluster .../>
            <stp>false</stp>
            <status>
                    <state>non_operational</state>
            </status>
            <display>true</display>
            <mtu>0</mtu>
            <usages>
                    <usage>DISPLAY</usage>
                    <usage>VM</usage>
            </usages>
            <required>true</required>
    </network>
==========================
2. set  cluster as display:
PUT http://<rhevm address>/api/clusters/<id>/networks/<id>
<network>
        <name>sw1</name>
        <usages>
                <usage>VM</usage>
                <usage>DISPLAY</usage>
        </usages>
</network>

Response: 200 PUT
    <network ...>
            <name>sw1</name>
            <data_center ...\>
            <cluster .../>
            <stp>false</stp>
            <status>
                    <state>non_operational</state>
            </status>
            <display>false</display>
            <mtu>0</mtu>
            <usages>
                    <usage>VM</usage>
            </usages>
            <required>true</required>
    </network>



Note: the problem is that the old <display></display>  element takes over usages  collection settings and in order to configure display we must set the <display> element.
Comment 5 Mike Kolesnik 2012-07-09 03:19:47 EDT
http://gerrit.ovirt.org/#/c/5513
Comment 7 Avi Tal 2012-07-17 06:30:46 EDT
Verify on SI19 - PASS

i was able to set and unset display network only by using <usages> collection 

set display:
<network>
        <usages>
                <usage>DISPLAY</usage>
        </usages>
</network>

unset display:
<network>
        <usages>
                <usage>VM</usage>
        </usages>
</network>

BTW, is automatically configure <display> attribute which is great.
Comment 8 Avi Tal 2012-07-18 12:08:32 EDT
*** Bug 815855 has been marked as a duplicate of this bug. ***

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