Bug 1823808

Summary: [ovirt] Problems with custom template provided in OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE var
Product: OpenShift Container Platform Reporter: Michal Skrivanek <michal.skrivanek>
Component: InstallerAssignee: Roy Golan <rgolan>
Installer sub component: OpenShift on RHV QA Contact: Jan Zmeskal <jzmeskal>
Status: CLOSED DUPLICATE Docs Contact:
Severity: medium    
Priority: medium CC: dmoessne, jzmeskal, mrhodes, pelauter, rgolan
Version: 4.4   
Target Milestone: ---   
Target Release: 4.4.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1821215 Environment:
Last Closed: 2020-05-26 09:37:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1820300, 1821215    
Bug Blocks:    

Description Michal Skrivanek 2020-04-14 14:32:24 UTC
+++ This bug was initially created as a clone of Bug #1821215 +++

Description of problem:
When you provide custom template using this variable, you start running into issue when you increase custom template's Memory size and Guaranteed memory above the default values. Please inspect all of the following scenarios carefully.

1. 
Memory Size of template in engine: 32768 MB
Physical Memory Guaranteed of template in engine: 32768 MB
Total Virtual CPUs of template in engine: 8
Exported variables on installer machine:
[root@he-1 ~]# env | egrep "TF_VAR|OPENSHIFT"
OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE=rhcos_custom
Outcome: Installation fails on creating masters & bootstrap: https://pastebin.com/Gqfb7hL2

2.
Memory Size of template in engine: 32768 MB
Physical Memory Guaranteed of template in engine: 32768 MB
Total Virtual CPUs of template in engine: 8
Exported variables on installer machine:
[root@he-1 ~]# env | egrep "TF_VAR|OPENSHIFT"
TF_VAR_ovirt_template_mem=32768
TF_VAR_ovirt_master_cpu=8
OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE=rhcos_custom
TF_VAR_ovirt_template_cpu=8
TF_VAR_ovirt_master_mem=32768
Outcome: Installation fails on creating bootstrap, masters are created: https://pastebin.com/xJSejpKT

3. 
Memory Size of template in engine: 32768 MB
Physical Memory Guaranteed of template in engine: 8192 MB
Total Virtual CPUs of template in engine: 8
Exported variables on installer machine:
[root@he-1 ~]# env | egrep "TF_VAR|OPENSHIFT"
OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE=rhcos_custom
Outcome: masters and bootstrap are successfully created. Bootstrap machine has Defined Memory 8192 MB and Physical Memory Guaranteed 8192 MB. Number of CPU Cores is 4. The same goes for master machines.

4.
Memory Size of template in engine: 16384 MB
Physical Memory Guaranteed of template in engine: 8192 MB
Total Virtual CPUs of template in engine: 8
Exported variables on installer machine:
[root@he-1 ~]# env | egrep "TF_VAR|OPENSHIFT"
TF_VAR_ovirt_template_mem=16384
TF_VAR_ovirt_master_cpu=8
OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE=rhcos_custom
TF_VAR_ovirt_template_cpu=8
TF_VAR_ovirt_master_mem=16384
Outcome: Masters and bootstrap are created successfully. Bootstrap machine has Defined Memory 8192 MB and Physical Memory Guaranteed 8192 MB. Number of CPU Cores is 4. HOWEVER, master VMs indeed do have Defined Memory 16384 MB and Physical Memory Guaranteed 8192 MB as expected (in opposition to scenario 3). They also have Number of CPU Cores 8. 

As you can see, the installer's behaviour is quite unpredictable when using custom template and it seems that no matter what I do, I'm not able to assure that the resulting VMs will have Physical Memory Guaranteed > 8129 MB which is a problem.
Another problem that I see with this is that when I don't export TF_VAR_ovirt_master_mem varialbe, the Memory Size defined in custom template is not used (32GB) and the resulting master machines have only the default Memory Size (8GB), see scenario 3. 

Version-Release number of the following components:
openshift-install-linux-4.4.0-0.nightly-2020-04-04-025830

How reproducible:
100 %

Steps to Reproduce:
See scenarios 1 through 4

Actual results:
See scenarios 1 through 4

Expected results:
The best result would be if the user could just create a custom template in RHV engine and then, when they provide OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE variable to the installer, their custom template is used as it is. With all attributes as they are defined in the engine. In the current state, it's completely non-transparent what the relationship between template's attributes and resulting VMs' attributes is.

Comment 2 Roy Golan 2020-05-26 09:37:29 UTC

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