Description of problem: Currently VM import from RHv/VMware using VM import operator are both picking Medium common template for the created VM. Please change it so that the smallest common template will be picked. Version-Release number of selected component (if applicable): CNV-2.5
The idea is not to pick the smallest common template, but the smallest template for the given OS / Machine type. The reason is that we always override the CPU and memory of the template, so if the source VM is smaller than the Medium template, it will fail validation, even though a template with less resources exists.
https://github.com/kubevirt/vm-import-operator/pull/447
@Sam, 1. For VM import from RHV, it seems medium template is still statically picked. Is this fix planned to include RHV too, or just VMware? (For VMware, indeed a SMALL template is picked in case memory is 1G or less, and not MEDIUM template). 2. For both VMware & RHV, the validation failure on minimum required memory enforced by the template no longer appear, and VM is imported successfully, and stars OK, regardless to it's memory size being lower than the required memory. For example, a RHV VM RHEL7.7 with memory 500MB has rhel7-server-medium template picked, that has min 1GB required: $ oc get template rhel7-server-medium -n openshift -oyaml ... vm.kubevirt.io/validations: | [ { "name": "minimal-required-memory", "path": "jsonpath::.spec.domain.resources.requests.memory", "rule": "integer", "message": "This VM requires more memory.", "min": 1073741824 } ] ... Is this a regression bug?
*** Bug 1922295 has been marked as a duplicate of this bug. ***
1. I was under the impression that this fix was only necessary for VMware, so the patch only impacts the VMware provider. I see that the initial comment includes RHV/oVirt, so that's my mistake. 2. VMware has never had a validation on the template's minimum required memory. It's my understanding that the validation was added to the oVirt provider to catch a VM that would be rejected by kubevirt. So yes, it technically appears to be a regression in the oVirt provider that the validation isn't occurring, but if the VM was able to boot successfully then it wasn't rejected by kubevirt. This means that the problem the validation is intended to catch isn't occurring either for some reason. In any case that would be a topic for a new BZ.
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