Bug 2076072 - Improve error message for screenshot on headless VM
Summary: Improve error message for screenshot on headless VM
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt
Version: 4.5.0.2
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ovirt-4.5.1
: ---
Assignee: Shmuel Melamud
QA Contact: Tamir
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-04-17 15:54 UTC by Tamir
Modified: 2022-06-23 05:54 UTC (History)
3 users (show)

Fixed In Version: ovirt-engine-4.5.1
Clone Of:
Environment:
Last Closed: 2022-06-23 05:54:58 UTC
oVirt Team: Virt
Embargoed:
pm-rhel: ovirt-4.5?


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-engine pull 404 0 None open core: Improve error message for screenshot on headless VM 2022-05-31 23:01:13 UTC
Red Hat Issue Tracker RHV-45788 0 None None None 2022-04-17 15:58:57 UTC

Description Tamir 2022-04-17 15:54:59 UTC
Description of problem:
When screenshotting a headless VM, the returned error message is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <detail>[General Exception]</detail>
    <reason>Operation Failed</reason>
</fault>

and the following error messages were shown in the events tab:
VDSM host_mixed_2 command ScreenshotVmVDS failed: General Exception: ('this function is not supported by the connection driver: virStreamFinish',)

and

Failed to capture screenshot of VM golden_env_mixed_virtio_3 (Host: host_mixed_2). 

The user should get a more informative response. The response should inform the user that they cannot screenshot a headless VM.


Version-Release number of selected component (if applicable):
    - Engine instance with RHV 4.5.0-6 (ovirt-engine-4.5.0.2-0.7.el8ev) and RHEL 8.6 installed.
    - 3 hosts with RHV 4.5.0-6 and RHEL 8.6 and with vdsm-4.50.0.12-1.el8ev.

How reproducible:
100%

Steps to Reproduce:

From WebAdmin:

1. Create a 4.7 data center and a 4.7 cluster.
2. Install the hosts and create a new NFS storage domain.
3. Create an RHEL VM with the headless mode checked in the console tab.
4. Run the VM.

From the REST API:

5. Screenshot the VM using the following POST request to the URL https://{{base_url}}/ovirt-engine/api/vms/{VM_ID}/screenshot with the body:
</action>

Actual results:
1. The 4.7 data center and the 4.7 cluster were created.
2. The hosts were installed and the NFS storage domain was created.
3. The VM was created.
4. The VM was running.
5. The screenshot response was the following error message:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <detail>[General Exception]</detail>
    <reason>Operation Failed</reason>
</fault>

and the following error messages were shown in the events tab:
VDSM host_mixed_2 command ScreenshotVmVDS failed: General Exception: ('this function is not supported by the connection driver: virStreamFinish',)

and

Failed to capture screenshot of VM golden_env_mixed_virtio_3 (Host: host_mixed_2). 

Expected results:
Steps 1-4 results are as expected. 
In step 5, I expect better error messages that inform the user that they cannot screenshot a headless VM.

Comment 1 Tamir 2022-06-07 15:00:46 UTC
Verified on RHV 4.5.1-1.

Env:
    - Engine instance with RHV 4.5.1-1 (ovirt-engine-4.5.1-0.62.el8ev) and RHEL 8.6 installed.
    - 2 hosts with RHV 4.5.1-1 and RHEL 8.6 and with vdsm-4.50.1.1-1.el8ev.

Steps:

From WebAdmin:

1. Create a 4.7 data center and a 4.7 cluster.
2. Install the hosts and create a new NFS storage domain.
3. Create an RHEL VM with the headless mode checked in the console tab.
4. Run the VM.

From the REST API:

5. Screenshot the VM using the following POST request to the URL https://{{base_url}}/ovirt-engine/api/vms/{VM_ID}/screenshot with the body:
</action>

Results (As Expected):
1. The 4.7 data center and the 4.7 cluster were created.
2. The hosts were installed and the NFS storage domain was created.
3. The VM was created.
4. The VM was running.
5. The screenshot response was the following error message:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <detail>[Cannot screenshot VM. Cannot make a screenshot of a headless VM.]</detail>
    <reason>Operation Failed</reason>
</fault>

Note:

The following message was displayed in /var/log/ovirt-engine/engine.log:

2022-06-07 17:55:15,668+03 WARN  [org.ovirt.engine.core.bll.ScreenshotVmCommand] (default task-19) [cb9dc603-5bcd-4023-9571-561b58b8249a] Validation of action 'ScreenshotVm' failed for user admin@internal-authz. Reasons: VAR__ACTION__SCREENSHOT,VAR__TYPE__VM,ACTION_TYPE_FAILED_CANNOT_SCREENSHOT_HEADLESS_VM
2022-06-07 17:55:15,674+03 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-19) [] Operation Failed: [Cannot screenshot VM. Cannot make a screenshot of a headless VM.]

Comment 2 Sandro Bonazzola 2022-06-23 05:54:58 UTC
This bugzilla is included in oVirt 4.5.1 release, published on June 22nd 2022.
Since the problem described in this bug report should be resolved in oVirt 4.5.1 release, it has been closed with a resolution of CURRENT RELEASE.
If the solution does not work for you, please open a new bug report.


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