Bug 1873771

Summary: Improve the VMCreationFailed error message caused by VM low memory
Product: Container Native Virtualization (CNV) Reporter: Ilanit Stein <istein>
Component: SSPAssignee: Karel Šimon <ksimon>
Status: CLOSED ERRATA QA Contact: Ilanit Stein <istein>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.4.0CC: bthurber, cnv-qe-bugs, oyahud, pkliczew
Target Milestone: ---   
Target Release: 2.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kubevirt-template-validator-container-v2.6.0-4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-10 11:18:00 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:

Description Ilanit Stein 2020-08-30 04:25:58 UTC
Description of problem:

Import a VM from RHV to CNV, that has a lower memory than the minimum defined in the vm-template, results with this error message:

"The virtual machine could not be imported.
VMCreationFailed: Error while creating virtual machine default/v2v-cirros-vm-for-tests: admission webhook "virt-template-admission.kubevirt.io" denied the request: This VM requires more memory.: Some of values [1073741824] are not in interval [1610612736, N/A]"


Please change this error message, so that it won't include N/A, and would be more clear:
  
"The virtual machine could not be imported.
VMCreationFailed: Error while creating virtual machine default/v2v-cirros-vm-for-tests: admission webhook "virt-template-admission.kubevirt.io" denied the request: This VM requires more memory.: VM memory: [1073741824], while minimum required memory is [1610612736]"


In addition,
please fix the case of "[N/A, 1610612736]", which means memory between 0 and 1610612736, into: 
"value should be within this interval [0, 1610612736]" 

Version-Release number of selected component (if applicable):
OCP-4.5.5/CNV-2.4.1

Comment 1 Ilanit Stein 2020-08-30 04:28:27 UTC
This bug is originated from Bug 1871433

Comment 4 Ilanit Stein 2021-01-07 16:23:56 UTC
Verified on cnv-2.6.0 iib-34076 hco-v2.6.0-400

Now the error message is improved:

"Import error (RHV)
v2v-cirros-vm-for-tests could not be imported.
MappingRulesVerificationFailed: Source VM memory 1073741824 is lower than 1610612736 enforced by rhel8-desktop-medium-v0.11.3 template."

Comment 7 errata-xmlrpc 2021-03-10 11:18:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Virtualization 2.6.0 security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:0799