Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1580256

Summary: Failed to build AMI because clusterid is not set
Product: OpenShift Container Platform Reporter: Wenkai Shi <weshi>
Component: InstallerAssignee: Chris Callegari <ccallega>
Status: CLOSED ERRATA QA Contact: sheng.lao <shlao>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.10.0CC: aos-bugs, bleanhar, jokerman, mmccomas
Target Milestone: ---   
Target Release: 3.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Release Note
Doc Text:
Added openshift_clusterid override to example inventory in AWS README
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-11 07:20:00 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 Wenkai Shi 2018-05-21 06:02:19 UTC
Description of problem:
Failed to build AMI because clusterid is not set

Version-Release number of the following components:
openshift-ansible-3.10.0-0.46.0.git.0.85c3afd.el7

How reproducible:
100%

Steps to Reproduce:
1. Follow document(https://github.com/openshift/openshift-ansible/tree/master/playbooks/aws) to build an AMI.
2. Set openshift_cloudprovider_kind to aws in inventory.yml as example(https://github.com/openshift/openshift-ansible/blob/master/playbooks/aws/provisioning-inventory.example.ini)
3. Execute build_ami playbook as step 1(https://github.com/openshift/openshift-ansible/tree/master/playbooks/aws#step-1):
# ansible-playbook -i inventory.yml build_ami.yml -e @provisioning_vars.yml

cat inventory.yml
...
openshift_cloudprovider_kind=aws
...

Actual results:
# ansible-playbook -i inventory.yml /usr/share/ansible/openshift-ansible/playbooks/aws/openshift-cluster/build_ami.yml -e @provisioning_vars.yml -vvv
...
TASK [openshift_sanitize_inventory : Ensure clusterid is set along with the cloudprovider] ***************************************************************************************************
task path: /usr/share/ansible/openshift-ansible/roles/openshift_sanitize_inventory/tasks/main.yml:35
Monday 21 May 2018  01:49:24 -0400 (0:00:00.019)       0:01:14.638 ************ 
fatal: [ec2-xx-xx-xx-xx.compute-1.amazonaws.com]: FAILED! => {
    "changed": false, 
    "failed": true, 
    "msg": "Ensure that the openshift_clusterid is set and that all infrastructure has the required tags.\nFor dynamic provisioning when using multiple clusters in different zones, tag each node with Key=kubernetes.io/cluster/xxxx,Value=clusterid where xxxx and clusterid are unique per cluster. In versions prior to 3.6, this was Key=KubernetesCluster,Value=clusterid.\nhttps://github.com/openshift/openshift-docs/blob/master/install_config/persistent_storage/dynamically_provisioning_pvs.adoc#available-dynamically-provisioned-plug-ins\n"
}

PLAY RECAP ***********************************************************************************************************************************************************************************
ec2-xx-xx-xx-xx.compute-1.amazonaws.com : ok=13   changed=0    unreachable=0    failed=1   
localhost                  : ok=14   changed=2    unreachable=0    failed=0   

Expected results:
AWS provisioning related playbook should ensure that the openshift_clusterid is set and that all infrastructure has the required tags.

Additional info:

Comment 2 sheng.lao 2018-08-09 10:13:03 UTC
1. Test result: Failed 

2. Environment:
#git describe
openshift-ansible-3.11.0-0.11.0-106-gc01e5ef

3. Analysis: 
1) find all references from the repo, with command:
  # grep -r openshift_clusterid

2) I can't find any code to define the variable of openshift_clusterid

3) but, when i reading this tip from the error message,I think this variable, openshift_clusterid, must be set with the cloudprovider. But we don't have a document to declare it, then will lead the customers to the wrong place.

https://github.com/openshift/openshift-ansible/blob/master/roles/openshift_sanitize_inventory/tasks/main.yml#L35

Comment 4 Chris Callegari 2018-08-09 12:59:50 UTC
The correct key is called openshift_aws_clusterid.

Please make sure the key and value exist in your extra_vars file.

Comment 5 sheng.lao 2018-08-10 02:55:20 UTC
I ask my companion,he says that the 'clusterid', in title, it comes from the output message of ansible play-book:
   TASK [openshift_sanitize_inventory : Ensure clusterid is set along with the cloudprovider] 

So it's clear now. 

He filed this bug, because the word 'clusterid', in that ansible message, is confusing, and there is no sentence to declare: what is 'clusterid', in this document: 
https://github.com/openshift/openshift-ansible/tree/master/playbooks/aws

So, please, update the document to clarify the openshift_clusterid.

Thanks!

Comment 6 Chris Callegari 2018-08-16 19:40:18 UTC
openshift_clusterid added to README example

https://github.com/openshift/openshift-ansible/pull/9635

Comment 7 sheng.lao 2018-08-20 13:58:22 UTC
fixed at: openshift-ansible-3.11.0-0.19.0-2-g0e60053

Comment 9 errata-xmlrpc 2018-10-11 07:20:00 UTC
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, 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/RHBA-2018:2652