Bug 1278244

Summary: Incorrect node information gathered by atomic-openshift-installer
Product: OpenShift Container Platform Reporter: Gaoyun Pei <gpei>
Component: InstallerAssignee: Samuel Munilla <smunilla>
Status: CLOSED CURRENTRELEASE QA Contact: Gaoyun Pei <gpei>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.1.0CC: aos-bugs, bleanhar, jokerman, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: atomic-openshift-utils-3.0.7-1.git.76.c73ec7b.el7aos.noarch.rpm Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-20 15:42:39 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 Gaoyun Pei 2015-11-05 03:52:23 UTC
Description of problem:
Input the hosts of existing env and the node host to be installed in atomic-openshift-installer, the installer could detect the installed environment, but it failed to recognize the node to be installed.

Version-Release number of selected component (if applicable):
atomic-openshift-utils-3.0.7-1.git.48.75d357c.el7aos.noarch

How reproducible:
Always

Steps to Reproduce:

10.x.x.111 is the master host
10.x.x.122 is the node host
10.x.x.145 is a clean rhel-72 system

1.[root@openshift-v3 ~]# atomic-openshift-installer install
...

Enter hostname or IP address: []: 10.x.x.111
Will this host be an OpenShift Master? [y/N]: y
Will this host be RPM or Container based (rpm/container)? [rpm]:
Do you want to add additional hosts? [y/N]: y
Enter hostname or IP address: []: 10.x.x.122
Will this host be an OpenShift Master? [y/N]: N
Will this host be RPM or Container based (rpm/container)? [rpm]:
Do you want to add additional hosts? [y/N]: y
Enter hostname or IP address: []: 10.x.x.145
Will this host be an OpenShift Master? [y/N]: N
Will this host be RPM or Container based (rpm/container)? [rpm]:
Do you want to add additional hosts? [y/N]: N

Which variant would you like to install?


(1) OpenShift Enterprise 3.0
(2) OpenShift Enterprise 3.1
(3) Atomic Enterprise Platform 3.1
Choose a variant from above:  [1]: 2
Gathering information from hosts...
10.x.x.111 is already an OpenShift Master
10.x.x.122 is already an OpenShift Node
Installed environment detected and no additional nodes specified.
Do you want to (1) add more nodes or (2) perform a clean install?:
Actual results:


Expected results:
Should detect the new node to be added and gather the information about the node

Additional info:

Comment 1 Brenton Leanhardt 2015-11-05 21:35:18 UTC
The output will now look like:

192.168.133.2 is already an OpenShift Master
192.168.133.3 is already an OpenShift Node
192.168.133.4 is currently uninstalled

In fixing this I hit a number of other bugs.  The general idea is that this tool should by default not re-run ansible on an installed environment.  Only by using --force or answering an interactive question will it do so.

There are quite a few edge cases to test here.  Tomorrow I plan to add unit tests since manually testing this is extremely time consuming.

In all cases the interactive install should simply do what is says it's going to do:
- interactive with no config file
- interactive with config file and all installed hosts
- interactive with config file and no installed hosts
- interactive with config file and some installed some uninstalled hosts

For unattended mode a little more explaination is needed:

this will abort with an error message about needing to use --force:
- unattended with config file and all installed hosts 

this will re-install:
- unattended with config file and all installed hosts with --force 

in both cases this will install the environment:
- unattended with config file and no installed hosts with and without --force 

this will only add new nodes:
- unattended with config file and some installed some uninstalled hosts

this will perform a reinstall and add new nodes
- unattended with config file and some installed some uninstalled hosts with --force

Comment 3 Gaoyun Pei 2015-11-06 06:22:48 UTC
Verify the original issue with package openshift-ansible-3.0.7-1.git.76.c73ec7b.el7aos.noarch

Input hosts including installed hosts and uninstalled host in interactive install

[root@openshift-v3 ~]# atomic-openshift-installer install
...

Enter hostname or IP address: []: 192.168.1.233
Will this host be an OpenShift Master? [y/N]: y
Will this host be RPM or Container based (rpm/container)? [rpm]:
Do you want to add additional hosts? [y/N]: y
Enter hostname or IP address: []: 192.168.1.234
Will this host be an OpenShift Master? [y/N]: N
Will this host be RPM or Container based (rpm/container)? [rpm]:
Do you want to add additional hosts? [y/N]: y
Enter hostname or IP address: []: 192.168.1.24
Will this host be an OpenShift Master? [y/N]: N
Will this host be RPM or Container based (rpm/container)? [rpm]:
Do you want to add additional hosts? [y/N]: N

Gathering information from hosts...
Installed environment detected.
By default the installer only adds new nodes to an installed environment.
Do you want to (1) only add additional nodes or (2) perform a clean install?: 1
192.168.1.233 is already an OpenShift Master
192.168.1.234 is already an OpenShift Node
192.168.1.24 is currently uninstalled
Adding additional nodes...
Writing config to: /root/.config/openshift/installer.cfg.yml

Comment 4 Gaoyun Pei 2015-11-06 06:55:00 UTC
The above case could be summarized as
- interactive without config file and input some installed some uninstalled hosts

Also test on the following cases:
- interactive without config file and input all installed hosts 
- interactive without config file and input no installed hosts 
- interactive with config file and all installed hosts
- interactive with config file and no installed hosts
- interactive with config file and some installed some uninstalled hosts
- unattended without config file
- unattended with config file and all installed hosts 
- unattended with config file and all installed hosts with --force 
- unattended with config file and no installed hosts  
- unattended with config file and no installed hosts with --force 
- unattended with config file and some installed some uninstalled hosts
- unattended with config file and some installed some uninstalled hosts with --force

I didn't let the installer finish the whole installation during testing, just make sure it could give correct guidance, the logic is clear and the actions conform with what we expect. And it's great that the installer tool works well against all the cases.

Thanks Brenton, I'll also update my test case according to this test suit.