Created attachment 1842531 [details] Added the request body Description of problem: When I create a template from a VM with TPM, RHEL 7 (The OS doesn't matter in this bug) is selected as the OS and UEFI using the REST API post request on the URL: {ENGINE_URL}/ovirt-engine/api/templates with the attached body, the created template doesn't have TPM enabled. Version-Release number of selected component (if applicable): - Engine instance with RHV 4.4.9-9 (ovirt-engine-4.4.9.5-0.1.el8ev) and RHEL 8.5 installed. - 3 hosts with RHV 4.4.9-9 and RHEL 8.5, 3 hosts with vdsm-4.40.90.4-1.el8ev How reproducible: 100% Steps to Reproduce: 1. Create a 4.6 data center and a 4.6 cluster. 2. Install the hosts and create a new NFS storage domain. 3. Create a VM with disk, bios type UEFI, and TPM enabled. 4. Create a template using the attached POST request. 5. Check that the template's TPM property (in GUI) is enabled. 6. Create a VM from that template. 7. Check that the TPM device appears in the VM's devices. Actual results: 1. The 4.6 data center and the 4.6 cluster were created. 2. The host was installed and the NFS storage domain was created. 3. The VM was created. 4. The template was created without TPM enabled. 5. The template's TPM property isn't checked. 6. The VM was created. 7. The TPM device doesn't appear in the VM's devices. Expected results: Steps 1-3 and 6 are as expected. In steps 4, 5, the TPM enabled property wasn't enabled. In step 7, the TPM device didn't appear in the VM devices. Additional info:
Verified on rhv-4.5.0.1-601.f26e9ea8cac5.3-DS-nightly. Env: - Engine instance with rhv-4.5.0.1-601.f26e9ea8cac5.3-DS-nightly (ovirt-engine-4.5.0.1-601.f26e9ea8cac5.3.el8ev) and RHEL 8.6 installed. - 3 hosts with rhv-4.5.0.1-601.f26e9ea8cac5.3-DS-nightly and RHEL 8.6 and with vdsm-4.50.0.10-1.el8ev Steps: In Admin Portal: 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 a RHEL 8.6 VM with Chipset/Firmware Type: Q35 Chipset with UEFI and with TPM enabled. 4. Create a template using a POST request to https://{{base_url}}/ovirt-engine/api/templates and in the body a template object with a name and a VM object specified (Like in the attached request). 5. Verify that the template has TPM enabled in the response. 6. Verify that the template has TPM enabled under Edit Template -> Resource Allocation. 7. Create a VM from the template. 8. Run the VM created from the template. 9. Enter the VM's details page (By clicking on its name) and navigate to the "Vm Devices" tab. 10. The TPM device is displayed in the VM devices tab. 11. Enter the VM's console. 12. Run the command "ls /dev/tpm*" and check that the TPM device is displayed in the command's results (tpm0 and tpmrm0). Results (As Expected): 1. The 4.7 data center and the 4.7 cluster were created. 2. The host was installed and the NFS storage domain was created. 3. The VM was created. 4. The template was created. 5. The response contained <tpm_enabled>true</tpm_enabled> in the template object. 6. The TPM checkbox was checked. 7. The VM was created. 8. The VM was running. 9. The VM's Devices tab is open. 10. The TPM device is displayed in the "Vm Devices" tab. 11. The VM's console has opened. 12. The TPM device is displayed in the command's results (tpm0 and tpmrm0).
This bugzilla is included in oVirt 4.5.0 release, published on April 20th 2022. Since the problem described in this bug report should be resolved in oVirt 4.5.0 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.