Bug 824962 - REST API: hotPlugNic - update vms/id/nics/id <active></ctive> doesn't work
REST API: hotPlugNic - update vms/id/nics/id <active></ctive> doesn't work
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi (Show other bugs)
3.1.0
x86_64 Linux
high Severity high
: ---
: ---
Assigned To: Mike Kolesnik
Yaniv Kaul
network
: TestBlocker
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-24 13:22 EDT by Avi Tal
Modified: 2016-04-22 00:59 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-14 03:38:46 EDT
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 (33.08 KB, application/x-compressed-tar)
2012-05-24 13:22 EDT, Avi Tal
no flags Details

  None (edit)
Description Avi Tal 2012-05-24 13:22:04 EDT
Created attachment 586674 [details]
engine log

Description of problem:
Using PUT command to update vm nic active state doesn't work.

Try to move active False to True
Sending :
<nic>
 <name>nic3</name>
 <network id='6806a25c-532d-4bf2-a298-8a6ecfc43319'/>
 <interface>virtio</interface>
 <mac address='00:1a:4a:23:61:05'/>
 <vm id='84f4d03b-5a4e-4558-9fc6-c9a06cdd7426'/>
 <active>true</active>
</nic>

Receive 200
    <nic id="64143029-dc74-4b74-8387-6baa122c3575">
            <name>nic3</name>
            <vm href="/api/vms/84f4d03b-5a4e-4558-9fc6-c9a06cdd7426" id="84f4d03b-5a4e-4558-9fc6-c9a06cdd7426"/>
            <network href="/api/networks/6806a25c-532d-4bf2-a298-8a6ecfc43319" id="6806a25c-532d-4bf2-a298-8a6ecfc43319"/>
            <interface>virtio</interface>
            <mac address="00:1a:4a:23:61:05"/>
            <active>false</active>
    </nic>




engine.log:
2012-05-24 20:12:52,582 INFO  [org.ovirt.engine.core.bll.UpdateVmInterfaceCommand] (ajp--0.0.0.0-8009-1) [2172616] Running command: UpdateVmInterfaceCommand internal: false. Entities affected :  ID: 84f4d03b-5a4e-4558-9fc6-c9a06cdd7426 Type: VM
Comment 2 Mike Kolesnik 2012-06-13 03:39:33 EDT
REST API behavior is not to change the resource state by updating the status field, but rather by actions.
This is true for all other areas, so it is also what happens here.

There are actions to activate/deactivate the vNIC, so that's the correct way to do it.
Comment 3 Avi Tal 2012-06-13 04:50:32 EDT
It is no clear if you don't have <action> element inside <nic>!

As for the "state", it is true that rest doesn't allow to update state but in this case it doesn't represent as a "state" field.
Please go to <host> or any other element that holds state filed and see the it displayed as followed:
<status>
 <state>active</state>
</status>

So please decide if you like to add actions to hotplugnic and if so, add an <action> element. other then that, decide if you'd like to display the state and if so, follow the REST API behavior.
Comment 4 Mike Kolesnik 2012-06-13 08:19:05 EDT
I understand that bug 825499 is just about the actions elements.

Regarding the state, it is only a boolean value so it cannot be anything other than true or false. It is the same modelling which is used for other devices (Please look at Disk) so if you think this should change then it should change across the API.
Comment 5 Avi Tal 2012-06-13 09:34:56 EDT
moving 825499 to TestBlocker and open discussion on upstream
Comment 6 Mike Kolesnik 2012-06-14 03:38:46 EDT
Colsing since the other bug is the real issue.

If the active field needs to be changed then it should be a new bug which also covers disks (since this field is on the VM device level).

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