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
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.
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.
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.
moving 825499 to TestBlocker and open discussion on upstream
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).