Bug 1753252

Summary: [SSP] Common templates - missing cross-validation between values in 'validation' section and actual requested resources
Product: Container Native Virtualization (CNV) Reporter: Ruth Netser <rnetser>
Component: Guest SupportAssignee: Martin Sivák <msivak>
Status: CLOSED UPSTREAM QA Contact: Ruth Netser <rnetser>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.1.0CC: cnv-qe-bugs, ipinto
Target Milestone: ---Flags: ipinto: needinfo?
Target Release: 2.2.0   
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: 2019-11-19 15:03:46 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 Ruth Netser 2019-09-18 13:36:07 UTC
Description of problem:
Common templates - missing cross-validation between values in 'validation' section and actual requested resources.
The templates verify that requested resources meet the OS minimum requirements.
However, in the resources part of the template, the actual requested resource may violate the requirement.
For now it is relevant for memory.


Version-Release number of selected component (if applicable):
CNV 2.1.0, OCP 4.2.0


How reproducible:
100%

Steps to Reproduce:
1. Open RHEL8 template
oc get templates -n openshift rhel8-server-tiny-v0.6.2 -o yaml

2. Check the value of 'min' under validations --> minimal-required-memory
3. Check the requested memory size under resources.requests.memory

Actual results:
"min": 2147483648 whereas memory: 1G

Expected results:
memory should be equal to min

Additional info:

oc get templates -n openshift rhel8-server-tiny-v0.6.2 -o yaml
================================================================
    validations: |
      [
        {
          "name": "minimal-required-memory",
          "path": "jsonpath::.spec.domain.resources.requests.memory",
          "rule": "integer",
          "message": "This VM requires more memory.",
          "min": 2147483648
        },
      ]

...
...
...
          resources:
            requests:
              memory: 1G
================================================================

Comment 1 Martin Sivák 2019-11-11 08:40:28 UTC
This is more an RFE for our CI system. We should catch issues like this early. The bug here was caused by #1753243 which is fixed now. The minimal requirement for memory should be 1G, which matches the tiny spec.