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:
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.
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.
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).
I wonder whether there is any relation to BZ 2035559, see https://bugzilla.redhat.com/show_bug.cgi?id=2035559#c6.
As discussed elsewhere, this may have already been fixed. Shmuel, please check and if it is indeed fixed, please set Fixed In Version here.
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.
(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.
(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?
(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.
Both the patches merged and AFAIK it was all what was needed so moving to MODIFIED.
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.
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>
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.