Bug 1871433
Summary: | [v2v] [VM import RHV to CNV] Fail the import on memory limit validation | ||||||
---|---|---|---|---|---|---|---|
Product: | Container Native Virtualization (CNV) | Reporter: | Amos Mastbaum <amastbau> | ||||
Component: | V2V | Assignee: | Piotr Kliczewski <pkliczew> | ||||
Status: | CLOSED ERRATA | QA Contact: | Nandini Chandra <nachandr> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 2.4.1 | CC: | bthurber, cnv-qe-bugs, dagur, fdupont, istein, mguetta, nachandr, oyahud, pkliczew, pvauter, sgott | ||||
Target Milestone: | --- | Flags: | istein:
needinfo+
|
||||
Target Release: | 2.5.0 | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | 2.5.0 | Doc Type: | If docs needed, set a value | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2020-12-07 09:51:49 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
Amos Mastbaum
2020-08-23 14:08:29 UTC
I think this issue would happen in 2.4 unless there were some changes in common templates. @Omer are you aware of any changes in medium flavour templates? @Piotr, This bug might have raised now (on CNV-2.4.1) since the source VMs memory settings has probably changed to 1024 M. I happen to have a record of the rhel8 medium template, on CNV-2.4.0: # check the minimum supported memory under 'validation' annotation of the template: oc get templates -n openshift rhel8-desktop-medium-v0.10.0 -o yaml |less validations: | [ { "name": "minimal-required-memory", "path": "jsonpath::.spec.domain.resources.requests.memory", "rule": "integer", "message": "This VM requires more memory.", "min": 1610612736 } ] The minimum required memory has not changed. No changes were made to the memory requirements in templates lately To the points Amos mentioned: 1. In a case of an import, template-validator always refers to the destination VM 2. I assume this is a vm-import issue, as it refers to RHV VM configurations 3. When N/A appears in an iterval it means either 0 or infinity depends on the context. For example [1610612736, N/A] means memory between 1610612736 and infinity and [N/A, 1610612736] means memory between 0 and 1610612736. I suppose we can try and improve the messaging around that. @Omer we are using medium flavour and server workload and you confirmed this is not specific to 2.4.1. I see 2 improvements on our side: 1. fail the import on validation 2. bump target vm memory requirements with a warning in the CR @Amos, @Ilanit which solution would be better from your point of view? @Piotr, As 2. is not noticeable, I prefer 1. Is there a way to block the VM import, on Source VM memory smaller than the Minimum required by the template? If possible, I think it's a better user experience, then failing the import. This bug will handle fail the import on memory limit validation. Error message can be something like: "VM can't be imported. CNV template requires minimum X memory. Please increase source VM's memory, max memory & Physical Memory Guaranteed." For point 3 in the bug description, opened SSP bug 1873771. This issue looks like it's related to templates. Changing component to SSP for proper triage. Why is it using medium template by default? IIUC, the CPU and memory are overridden during the import, so using the smallest possible template wouldn't block really small VMs. @Fabian, In the past not all OSes had small templates. It would require from us to understand whether there is small template or not. medium templates are for all of them. This implies that we still need the memory check validation rule. Based on agreement we have from comment #6 we need add one validation rule. This will be done in vm-import. @Piotr, thanks for the explanation. Then, why not provide the number of vCPUs and the memory size to templateProvider.Find() method, instead of the flavor? This would allow to look at the template validation rules and pick the best fit, rather than always looking for the medium flavor. In that case, the error would be "No template matches the vCPU and memory allocation for the VM". Then, we could revisit the provided templates to be sure that there is a tiny flavor for each operating system that actually implements the minimum requirements for the given operating system. We can improve template selection process but we would still need to have logic discussed here since not for all OSes small templates are provided. I suggest to handle template selection as enhancement and fix the this bug. I created this enhancement to track template selection improvement: https://github.com/kubevirt/vm-import-operator/issues/403 Moving this issue back to ASSIGNED It was tested with OCP 4.6.0-fc.8 / CNV 2.5.0 By Omer Yahud: "The validation section is the requirement, the spec.domain.resources.requests.memory is the recommendation by us. The 'min' field in the validation rule specifies the minimum amount of memory in bytes that is required for a VM of this type" Thanks Moving this issue back to ASSIGNED It was tested with OCP 4.6.0-fc.8 / CNV 2.5.0 By Omer Yahud: "The validation section is the requirement, the spec.domain.resources.requests.memory is the recommendation by us. The 'min' field in the validation rule specifies the minimum amount of memory in bytes that is required for a VM of this type" Thanks *** Bug 1884173 has been marked as a duplicate of this bug. *** Verified on CNV 2.5 1)RHEL 7 template on CNV [nachandr@localhost cfme_tests]$ oc get templates -n openshift rhel7-server-medium-v0.11.3 -oyaml validations: | [ { "name": "minimal-required-memory", "path": "jsonpath::.spec.domain.resources.requests.memory", "rule": "integer", "message": "This VM requires more memory.", "min": 1073741824 } ] 2)I then tried importing a RHEL 7 VM from RHV with Defined Memory: 512 MB 3)With the fix , the VM import failed with this error message: MappingRulesVerificationFailed: Source VM memory 536870912 is lower than 1073741824 enforced by rhel7-server-medium-v0.11.3 template. |