Bug 1922295

Summary: I'm not able to import a VM if its RAM is not configured exactly like in a predefined template that I cannot edit
Product: Container Native Virtualization (CNV) Reporter: Simone Tiraboschi <stirabos>
Component: V2VAssignee: Fabien Dupont <fdupont>
Status: CLOSED DUPLICATE QA Contact: Daniel Gur <dagur>
Severity: high Docs Contact:
Priority: high    
Version: 2.6.0CC: cnv-qe-bugs, istein, oyahud
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-04 16:41:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
custom amount of RAM
none
RAM as in the template none

Description Simone Tiraboschi 2021-01-29 15:34:55 UTC
Created attachment 1752100 [details]
custom amount of RAM

Description of problem:
Trying to import a VM from RHC with the wizard,
I'm not able to import a VM if the amount of ram on RHV doesn't match what is defined in a specific template.

See the attached screenshot.

Version-Release number of selected component (if applicable):
2.6.0

How reproducible:
100%

Steps to Reproduce:
1. try to import a VM with a custom amount of ram from RHV
2.
3.

Actual results:
the import process starts only if the VM is configured on RHV matching a specific template, the only workaround I found is editing the VM in RHV before the import to match template.

Expected results:
i'm able to import a VM with an arbitrary amount of ram.

Additional info:

Comment 1 Simone Tiraboschi 2021-01-29 15:35:43 UTC
Created attachment 1752101 [details]
RAM as in the template

Comment 2 Sandro Bonazzola 2021-02-01 07:45:09 UTC
This has a very high impact while transitioning from an oVirt / RHV datacenter toward a OpenShift Virtualization solution, especially if you have a huge number of VMs to import.

Comment 3 Ilanit Stein 2021-02-01 10:07:49 UTC
By the "custom amount of RAM" attachment, the VM import failed because the source VM had memory size smaller than the minimum required memory enforced by the picked template.

The source VM memory size must be equal or larger than the minimum required memory defined in the picked template.

We have this very recent fix - Bug 1894824 - that will pick the smallest template for the imported VM OS, and not always the Medium.

That should lower the VM minimum memory required. 

@Omer,
Can we improve the current error message from:
"Source VM memory <X> is lower than <Y> enforced by <Z> template."
into:
"Source VM memory <X> is lower than the minimum required memory <Y>, enforced by <Z> template."

This way it would be more clear to users that the source VM should have at least the template's min required memory or above.
and not interpret it wrongly, as reported in this bug, that VM memory need to be equal to the template's min required memory.

Comment 4 Omer Yahud 2021-02-02 12:53:20 UTC
Hi Ilanit,

The error message shown in the attachment is actually not from template-validator, it's probably vm-import-operator wrapping template-validator's error.
The error that tempalte-validator provides for this case is: ".spec.domain.resources.requests.memory: This VM requires more memory.: value 1073741824 is lower than minimum [1610612736]"

Comment 5 Ilanit Stein 2021-02-04 16:41:40 UTC
@Omer, thanks.

Apparently, Bug 1894824 (Moved to ON_QA on Jan 10 2021) also changed the behavior in such way that VM imports from RHV/VMware provider via vmio will no longer validate that the source VM minimum requirements (like memory) match the value mentioned in the picked template. and the error message on the minimum required memory will no longer appear too. 

Bug 1894824 actually fixes this bug.
Marking this bug as duplicate of bug 1894824.

*** This bug has been marked as a duplicate of bug 1894824 ***