Bug 2106349 - VM pool creation with SPICE display type from a template with VNC display type sets the pool's display type to VNC
Summary: VM pool creation with SPICE display type from a template with VNC display typ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.5.1.2
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ovirt-4.5.2
: 4.5.2
Assignee: Shmuel Melamud
QA Contact: Tamir
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-12 12:23 UTC by Tamir
Modified: 2022-08-30 08:47 UTC (History)
4 users (show)

Fixed In Version: ovirt-engine-4.5.2
Clone Of:
Environment:
Last Closed: 2022-08-30 08:47:42 UTC
oVirt Team: Virt
Embargoed:
sbonazzo: ovirt-4.5+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-engine-api-model pull 81 0 None open Deprecate VmPool.display attribute 2022-07-24 20:38:06 UTC
Github oVirt ovirt-engine pull 544 0 None open restapi: Pass display type from VmPool.vm to AddVmPoolParameters 2022-07-20 23:05:52 UTC
Red Hat Issue Tracker RHV-47562 0 None None None 2022-07-12 12:31:45 UTC

Description Tamir 2022-07-12 12:23:58 UTC
Description of problem:

A POST request to the URL: https://{{base_url}}/ovirt-engine/api/vmpools with the body:

<vm_pool>
    <name>VMPool</name>
    <cluster>
        <name>cluster</name>
    </cluster>
    <template>
        <name>template</name>
    </template>
    <size>1</size>
    <display>
        <type>spice</type>
    </display>
</vm_pool>

where the template is set with the VNC display type creates a VM pool and VMs with VNC display type instead of SPICE as requested in the VM pool request.

Version-Release number of selected component (if applicable):
    - Engine instance with RHV 4.5.1-5 (ovirt-engine-4.5.1.3-0.28.el8ev) and RHEL 8.6 installed.
    - 3 hosts with RHV 4.5.1-5 and RHEL 8.6 and with vdsm-4.50.1.4-1.el8ev.

How reproducible:
100%

Steps to Reproduce:
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 display type set to VNC and Video Type set to Bochs.
4. Create a template from the VM.

In the REST API:

5. Create a VM pool from the latest version of the template with size: 1 and display type SPICE using the POST request to the URL: https://{{base_url}}/ovirt-engine/api/vmpools with the body:

<vm_pool>
    <name>VMPool</name>
    <cluster>
        <name>cluster</name>
    </cluster>
    <template>
        <name>template</name>
    </template>
    <size>1</size>
    <display>
        <type>spice</type>
    </display>
</vm_pool>

6. Check that the VM pool and its VMs display type are set to SPICE.

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 with display type set to VNC and Video Type set to Bochs.
4. The template was created.
5. The VM pool and the VM were created.
6. The VM pool and the VM display type were VNC.

Expected results:
Steps 1-5 results are as expected. 
In step 6, the created VM pool and the created VM display type should be set to spice.


Additional info:

Comment 2 Milan Zamazal 2022-07-14 12:41:42 UTC
As discussed offline, Bochs supports only VGA, but when doing similar changes in the webadmin, Bochs is changed to QXL if SPICE is requested.

Shmuel, Tamir, please clarify what should be the right behavior.

Comment 3 Tamir 2022-07-14 13:02:44 UTC
Hi Milan,

I wasn't clear during the discussion.
When I create a regular VM with a display type set to SPICE from the same template which is set with VGA display type and Bochs Video Type through the REST API with the POST request to the URL:
https://{{base_url}}/ovirt-engine/api/vms

and body:
<vm>
    <name>VMSpice</name>
    <cluster>
        <name>cluster</name>
    </cluster>
    <template>
        <name>template</name>
    </template>
    <display>
        <type>spice</type>
    </display>
</vm>

the VM is created with the display type set to SPICE and the Video Type set to QXL. I believe the same behavior should occur when creating a new VM pool from such a template with display type SPICE.

Comment 4 Milan Zamazal 2022-07-14 13:34:27 UTC
I see, I misunderstood it, thank you for clarification. Indeed, then the behavior should be consistent in both the cases, whatever it would be (switching to QXL, keeping VNC, or returning an error).

Comment 5 Milan Zamazal 2022-07-15 18:59:18 UTC
I wonder whether there is any relation to BZ 2035559, see https://bugzilla.redhat.com/show_bug.cgi?id=2035559#c6.

Comment 6 Milan Zamazal 2022-07-18 12:55:01 UTC
As discussed elsewhere, this may have already been fixed. Shmuel, please check and if it is indeed fixed, please set Fixed In Version here.

Comment 7 Shmuel Melamud 2022-07-20 23:05:53 UTC
The correct way to define display type for a VM Pool is in Vm structure:

<vm_pool>
    <name>VMPool</name>
    <cluster>
        <name>cluster</name>
    </cluster>
    <template>
        <name>template</name>
    </template>
    <size>1</size>
    <vm>
        <display>
            <type>spice</type>
        </display>
    </vm>
</vm_pool>

My patch fills the gap in handling VmPool.vm.display.type and now it should work properly.

VmPool.display field is not used by the backend code. From my point of view, this field was added by mistake and should be deprecated to avoid confusion.

Comment 8 Shmuel Melamud 2022-07-20 23:06:55 UTC
(In reply to Milan Zamazal from comment #5)
> I wonder whether there is any relation to BZ 2035559, see
> https://bugzilla.redhat.com/show_bug.cgi?id=2035559#c6.

No, it is not related, as far as I can see.

Comment 9 Milan Zamazal 2022-07-22 13:46:42 UTC
(In reply to Shmuel Melamud from comment #7)

> VmPool.display field is not used by the backend code. From my point of view,
> this field was added by mistake and should be deprecated to avoid confusion.

Yes.  I wonder whether it should be removed completely if it never worked at all?  Is there any possible scenario where it would be used and the user shouldn't get an error?

Comment 10 Shmuel Melamud 2022-07-24 20:32:38 UTC
(In reply to Milan Zamazal from comment #9)
> Yes.  I wonder whether it should be removed completely if it never worked at
> all?  Is there any possible scenario where it would be used and the user
> shouldn't get an error?

If there is a script that sets this field, it will run without errors, although the display type will not be affected. But after removing the field the script will fail. IMHO we shouldn't break things without a serious reason, even in the case they didn't work completely correctly.

Comment 11 Milan Zamazal 2022-07-27 10:23:34 UTC
Both the patches merged and AFAIK it was all what was needed so moving to MODIFIED.

Comment 14 Tamir 2022-08-07 10:56:53 UTC
Verified on RHV 4.5.2-4.

Env:
    - Engine instance with RHV 4.5.2-4 (ovirt-engine-4.5.2.1-0.1.el8ev) and RHEL 8.6 installed.
    - 2 hosts with RHV 4.5.2-4 and RHEL 8.6 and with vdsm-4.50.2.2-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 display type set to VNC and Video Type set to Bochs.
4. Create a template from the VM.

In the REST API:

5. Create a VM pool from the latest version of the template with size: 1 and display type SPICE using the POST request to the URL: https://{{base_url}}/ovirt-engine/api/vmpools with the body:

<vm_pool>
    <name>VMPool</name>
    <cluster>
        <name>cluster</name>
    </cluster>
    <template>
        <name>template</name>
    </template>
    <size>1</size>
    <display>
        <type>spice</type>
    </display>
</vm_pool>

6. Check that the VM pool and its VMs display type are set to SPICE.

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 with display type set to VNC and Video Type set to Bochs.
4. The template was created.
5. The VM pool and the VM were created.
6. The VM pool display type and the VM display type are set to spice.

Comment 15 Tamir 2022-08-07 10:59:33 UTC
I had a mistake in the last comment.
I sent the request with the following body:
<vm_pool>
    <name>VMPool</name>
    <cluster>
        <name>cluster</name>
    </cluster>
    <template>
        <name>template</name>
    </template>
    <size>1</size>
    <vm>
        <display>
            <type>spice</type>
        </display>
    </vm>
</vm_pool>

Comment 16 Sandro Bonazzola 2022-08-30 08:47:42 UTC
This bugzilla is included in oVirt 4.5.2 release, published on August 10th 2022.
Since the problem described in this bug report should be resolved in oVirt 4.5.2 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.