Bug 1321582
| Summary: | Docs: document RESTAPI support for VM "Enable VirtIO serial console" | ||
|---|---|---|---|
| Product: | [oVirt] ovirt-engine | Reporter: | Ilanit Stein <istein> |
| Component: | Documentation | Assignee: | bugs <bugs> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 3.6.4 | CC: | adahms, bugs, fromani, istein, juan.hernandez, mavital, mgoldboi, michal.skrivanek, mtessun, rbeyel, sgratch, tjelinek, ylavi |
| Target Milestone: | ovirt-4.0.6 | Keywords: | 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
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. I'm ok living without that till 4.0 which is behind the corner anyway. If PM wants to prioritize please let me know (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. 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. Just adding that in order to retrieve this information from the api the All-Content=true header has to be specified. 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 (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? (In reply to comment #7) My bad, I had a confusion. Then please just add documentation for comment #4, thanks. This turned out to be a missing documentation. oVirt 4.0 beta has been released, moving to RC milestone. oVirt 4.0 beta has been released, moving to RC milestone. 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.
(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 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. |