Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1968183

Summary: Running an imported VM with TPM which wasn't running while exporting fails
Product: [oVirt] ovirt-engine Reporter: Tamir <tamir>
Component: BLL.VirtAssignee: Shmuel Melamud <smelamud>
Status: CLOSED CURRENTRELEASE QA Contact: Tamir <tamir>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.4.7CC: ahadas, bugs
Target Milestone: ovirt-4.4.7Flags: ahadas: ovirt-4.4+
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ovirt-engine-4.4.7.3 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-06 07:27:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1932484    

Description Tamir 2021-06-06 15:36:02 UTC
Created attachment 1789124 [details]
Added logs

Description of problem:

Running an imported VM with TPM that was exported while it wasn't running and it was ran before (Step 3) fails with the error:

"VDSM host_mixed_1 command CreateBrokerVDS failed: Failed to handle external VM data: {'exception_class': <class 'binascii.Error'>, 'exception_arg_1': 'Incorrect padding', 'reason': 'Failed to decode base64 data'}"


Version-Release number of selected component (if applicable):
  - Engine instance with RHV 4.4.7-1 (ovirt-engine-4.4.7-0.23.el8ev) and RHEL 8.4 installed.
  - 3 hosts with RHV 4.4.7-1 and RHEL 8.4, vdsm-4.40.70.1-1.el8ev, qemu 15:5.2.0-16.module+el8.4.0+10806+b7d97207

How reproducible:
100%

Steps to Reproduce:

In Admin Portal:

1. Create a 4.5 data center and a 4.5 cluster.
2. Install the host and create a new NFS storage domain.
3. Create a VM with disk and bios type UEFI and with TPM enabled.
4. Run the VM.
5. Add a file and encrypt it using TPM. (Add data to the TPM)
6. Stop the VM.
7. Export the VM to OVA.
8. Remove the VM.
9. Import the VM from the OVA.
10. Run the VM.

Actual results:
1. The 4.5 data center and the 4.5 cluster were created.
2. The host was installed and the NFS storage domain was created.
3. The VM was created.
4. The VM is running.
5. Added data to the TPM.
6. The VM has been stopped.
7. The VM has been exported to OVA file.
8. The VM has been removed.
9. The VM has been imported back using the OVA.
10. The VM couldn't run with the following error from the events tab:
"VDSM host_mixed_1 command CreateBrokerVDS failed: Failed to handle external VM data: {'exception_class': <class 'binascii.Error'>, 'exception_arg_1': 'Incorrect padding', 'reason': 'Failed to decode base64 data'}"


Expected results:
1-9 steps are as expected.
10. The VM should be running at this point.

Comment 1 Arik 2021-06-07 11:40:35 UTC
Interesting to see what the volume actually contains, if it's empty or not

Comment 2 Tamir 2021-06-17 14:20:52 UTC
Verified on RHV 4.4.7-3. All looks good to me.

Env:
  - Engine instance with RHV 4.4.7-3 (ovirt-engine-4.4.7.3-0.3.el8ev) and RHEL 8.4 installed.
  - 3 hosts with RHV 4.4.7-3 and RHEL 8.4, vdsm-4.40.70.3-1.el8ev

I ran all the tests in the [RFE] Export/import VMs/templates with TPM polarion requirement and those tests passed.

I also ran the bug steps again and it worked fine.

In Admin Portal:

1. Create a 4.5 data center and a 4.5 cluster.
2. Install the host and create a new NFS storage domain.
3. Create a VM with disk and bios type UEFI and with TPM enabled.
4. Run the VM.
5. Add a file and encrypt it using TPM. (Add data to the TPM)
6. Stop the VM.
7. Export the VM to OVA.
8. Remove the VM.
9. Import the VM from the OVA.
10. Run the VM.

Actual results as expected:
1. The 4.5 data center and the 4.5 cluster were created.
2. The host was installed and the NFS storage domain was created.
3. The VM was created.
4. The VM is running.
5. Added data to the TPM.
6. The VM has been stopped.
7. The VM has been exported to OVA file.
8. The VM has been removed.
9. The VM has been imported back using the OVA.
10. The VM is running fine.

Comment 3 Sandro Bonazzola 2021-07-06 07:27:59 UTC
This bugzilla is included in oVirt 4.4.7 release, published on July 6th 2021.

Since the problem described in this bug report should be resolved in oVirt 4.4.7 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.