Bug 1321582

Summary: Docs: document RESTAPI support for VM "Enable VirtIO serial console"
Product: [oVirt] ovirt-engine Reporter: Ilanit Stein <istein>
Component: DocumentationAssignee: bugs <bugs>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 3.6.4CC: adahms, bugs, fromani, istein, juan.hernandez, mavital, mgoldboi, michal.skrivanek, mtessun, rbeyel, sgratch, tjelinek, ylavi
Target Milestone: ovirt-4.0.6Keywords: Reopened
Target Release: ---Flags: ylavi: ovirt-4.0.z?
istein: planning_ack?
istein: devel_ack?
istein: testing_ack?
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
The way how to enable/disable the VirtIO Serial Console using REST API PUT http://localhost:8080/ovirt-engine/api/vms/<vm-id> Content-type: application/xml <vm> <console> <enabled>true/false</enabled> </console> </vm> To retrieve this information from the REST API the following header has to be specified: All-Content=true
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-18 07:28:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Docs RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1148393, 1388807    

Description Ilanit Stein 2016-03-28 13:33:52 UTC
Description of problem:
In order to allow guest serial console to work, via RESTAPI, the control of the VM "VirtIO serial console", [Enable/Disable] is missing.
This flag can currently be changed, only via the webadmin, and it's default is Disabled.

Having that said, this blocks running a QE automatic test, for this feature, since it is RESTAPI based.
 
Version-Release number of selected component (if applicable):
rhevm 3.6.4.1-0.1 

See also:
Bug 601863 - "(guest_serial_console) [RFE] Provide interface to access guest serial console"

Comment 1 meital avital 2016-04-05 11:05:40 UTC
Without this flag we can't implement the automation test for serial console, this fix is needed for 3.6.z in order to support automated test.

Comment 2 Michal Skrivanek 2016-04-06 07:22:31 UTC
I'm ok living without that till 4.0 which is behind the corner anyway.
If PM wants to prioritize please let me know

Comment 3 Moran Goldboim 2016-04-24 11:14:17 UTC
(In reply to Michal Skrivanek from comment #2)
> I'm ok living without that till 4.0 which is behind the corner anyway.
> If PM wants to prioritize please let me know

Sounds like missing API call which we need to complete. adding 3.6.z flag.

Comment 4 Sharon Gratch 2016-05-05 19:39:34 UTC
The control of the "VirtIO serial console" for a vm [Enable/Disable] exists via the RESTAPI and therefore it's not a bug.

The api format for enabling/disabling the "VirtIO serial console" for a vm is: 

PUT http://localhost:8080/ovirt-engine/api/vms/<vm-id>  
Content-type: application/xml

<vm>
  <console>
      <enabled>true/false</enabled>
  </console>
</vm>. 



(true/false - means writing "true" for enabling or "false" for disabling).

I therefore close this bug. Please confirm that it is supported also for 3.6.z.

Comment 5 Tomas Jelinek 2016-05-06 08:55:45 UTC
Just adding that in order to retrieve this information from the api the 

All-Content=true

header has to be specified.

Comment 6 Ilanit Stein 2016-05-08 15:34:14 UTC
Sharon/Tomas,

1. Seems there is missing documentation for that (looked for it at all relevant guides)
2. The UI support for this "VirtIO serial console" enable/disable is missing

Comment 7 Tomas Jelinek 2016-05-09 08:07:39 UTC
(In reply to Ilanit Stein from comment #6)
> Sharon/Tomas,
> 
> 1. Seems there is missing documentation for that (looked for it at all
> relevant guides)

When clarified the next point I will move this to documentation to make this documented.

> 2. The UI support for this "VirtIO serial console" enable/disable is missing

Not sure what you mean by ui support. It is in webadmin in VM dialog in console side tab a checkbox under label "Enable VirtIO serial console". Or did you mean something else?

Comment 8 Ilanit Stein 2016-05-09 08:41:41 UTC
(In reply to comment #7)
My bad, I had a confusion. Then please just add documentation for comment #4,

thanks.

Comment 9 Tomas Jelinek 2016-05-09 08:46:03 UTC
This turned out to be a missing documentation.

Comment 10 Yaniv Lavi 2016-05-23 13:23:17 UTC
oVirt 4.0 beta has been released, moving to RC milestone.

Comment 11 Yaniv Lavi 2016-05-23 13:25:30 UTC
oVirt 4.0 beta has been released, moving to RC milestone.

Comment 12 Martin Tessun 2016-10-18 13:27:53 UTC
Just some additions to C#4 and C#5:

In a v3 API, if you specify this header you see the following for console:

    <console enabled="true"/>

In a v4 API this is different:

    <console>
        <enabled>true</enabled>
    </console>

This said, the PUT statement of course is also different for a v3 (RHEV 3.6)and a v4 (RHV 4) API:

v3:
<vm>
  <console enabled="true" />
</vm>

v4:
<vm>
  <console>
    <enabled>true</enabled>
  </console>
</vm>


In both APIs for getting the content the header as mentioned in C#5 needs to be set, e.g.:

curl -X GET -H "Accept: application/xml" -H "Content-Type: application/xml" -H "All-Content: true" -u 'admin@internal:password' -k https://rhev.example.com/vms/3a80d598-d318-4e3b-aba7-ea0c051ae86e

Just to complete the information, and to avoid confusion.
I think both behaviours and settings should be documented for each version of the API.

Comment 13 Martin Tessun 2016-10-18 13:30:21 UTC
(In reply to Martin Tessun from comment #12)

> curl -X GET -H "Accept: application/xml" -H "Content-Type: application/xml"
> -H "All-Content: true" -u 'admin@internal:password' -k
> https://rhev.example.com/vms/3a80d598-d318-4e3b-aba7-ea0c051ae86e


Needs to be 

curl -X GET -H "Accept: application/xml" -H "Content-Type: application/xml" -H "All-Content: true" -u 'admin@internal:password' -k https://rhev.example.com/api/vms/3a80d598-d318-4e3b-aba7-ea0c051ae86e

of course (for RHEV 3.x).

RHV 4 and API version 4 it would be:
curl -X GET -H "Accept: application/xml" -H "Content-Type: application/xml" -H "All-Content: true" -u 'admin@internal:password' -k https://rhev.example.com/ovirt-engine/api/vms/3a80d598-d318-4e3b-aba7-ea0c051ae86e

RHV 4 and API version 3 it would be:
curl -X GET -H "Accept: application/xml" -H "Content-Type: application/xml" -H "All-Content: true" -u 'admin@internal:password' -k https://rhev.example.com/ovirt-engine/api/v3/vms/3a80d598-d318-4e3b-aba7-ea0c051ae86e

Comment 14 Juan Hernández 2016-11-08 13:56:42 UTC
As far as I know this hasn't been addressed in the specification of the API for 4.0.5, so I am re-targeting to 4.0.6.