Bug 2024529 - Creating a template from a VM with TPM in the REST API without specifying the TPM property results in a template without TPM
Summary: Creating a template from a VM with TPM in the REST API without specifying the...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt
Version: 4.4.9.5
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ovirt-4.5.0
: 4.5.0
Assignee: Milan Zamazal
QA Contact: Tamir
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-18 09:27 UTC by Tamir
Modified: 2022-04-20 06:33 UTC (History)
2 users (show)

Fixed In Version: ovirt-engine-4.5.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-04-20 06:33:59 UTC
oVirt Team: Virt
Embargoed:
ahadas: ovirt-4.5?


Attachments (Terms of Use)
Added the request body (8.43 KB, text/plain)
2021-11-18 09:27 UTC, Tamir
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHV-44050 0 None None None 2021-11-18 09:29:58 UTC
oVirt gerrit 118108 0 master MERGED restapi: Base default template TPM flag on TPM device presence 2022-01-18 20:12:58 UTC

Description Tamir 2021-11-18 09:27:21 UTC
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:

Comment 1 Tamir 2022-03-20 15:04:20 UTC
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).

Comment 2 Sandro Bonazzola 2022-04-20 06:33:59 UTC
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.


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