Bug 1564170

Summary: Persistent volumes are created before storage class
Product: OpenShift Container Platform Reporter: davis phillips <dphillip>
Component: InstallerAssignee: Michael Gugino <mgugino>
Status: CLOSED CURRENTRELEASE QA Contact: Johnny Liu <jialiu>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.9.0CC: aos-bugs, jokerman, mmccomas, xtian
Target Milestone: ---   
Target Release: 3.10.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-03 14:40: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:

Description davis phillips 2018-04-05 14:30:15 UTC
Description of problem:
Persistent volumes are created before storage classes. This causes playbooks to be run twice. 

Version-Release number of the following components:
rpm -q openshift-ansible

rpm -q ansible

ansible --version
  config file = /root/git/openshift-ansible-contrib-stretch/reference-architecture/vmware-ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, May  3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]

How reproducible:

Steps to Reproduce:
1. Try to provision logging or metrics via storage class during first install run

Actual results:
Please include the entire output from the last TASK line through the end of output if an error is generated.

Is not configured properly until storage class is created. 

Expected results:
Idompotency on playbook runs.

Additional info:
Please attach logs from ansible-playbook with the -vvv flag

Comment 1 davis phillips 2018-04-05 14:31:03 UTC
Resolved via: 


Comment 3 Johnny Liu 2018-06-05 17:09:17 UTC
Verified this bug with openshift-ansible-3.10.0-0.58.0.git.0.d8f6377.el7.noarch, and PASS.

Persistent volumes are created after storage classes.

PLAY [Create Hosted Resources - openshift_default_storage_class] ***************

TASK [Gathering Facts] *********************************************************
Tuesday 05 June 2018  01:55:15 -0400 (0:00:00.062)       0:13:17.978 ********** 
ok: [qe-jialiu3101-master-etcd-1.0605-t1h.qe.rhcloud.com]

TASK [openshift_default_storage_class : Ensure storageclass object] ************
Tuesday 05 June 2018  01:55:16 -0400 (0:00:01.049)       0:13:19.028 ********** 
changed: [qe-jialiu3101-master-etcd-1.0605-t1h.qe.rhcloud.com] => {"changed": true, "failed": false, "results": {"cmd": "/usr/bin/oc get storageclass standard -o json", "results": [{"apiVersion": "storage.k8s.io/v1", "kind": "StorageClass", "metadata": {"annotations": {"storageclass.beta.kubernetes.io/is-default-class": "true"}, "creationTimestamp": "2018-06-05T05:57:54Z", "name": "standard", "resourceVersion": "1792", "selfLink": "/apis/storage.k8s.io/v1/storageclasses/standard", "uid": "63af7f9c-6885-11e8-8d56-42010af0003c"}, "parameters": {"type": "pd-standard"}, "provisioner": "kubernetes.io/gce-pd", "reclaimPolicy": "Delete", "volumeBindingMode": "Immediate"}], "returncode": 0}, "state": "present"}

PLAY [Create Hosted Resources - persistent volumes] ****************************

TASK [Gathering Facts] *********************************************************
Tuesday 05 June 2018  01:55:17 -0400 (0:00:01.477)       0:13:20.505 ********** 
ok: [qe-jialiu3101-master-etcd-1.0605-t1h.qe.rhcloud.com]

TASK [openshift_persistent_volumes : Create temp directory for volume definitions] ***
Tuesday 05 June 2018  01:55:18 -0400 (0:00:00.930)       0:13:21.436 ********** 
ok: [qe-jialiu3101-master-etcd-1.0605-t1h.qe.rhcloud.com] => {"changed": false, "cmd": ["mktemp", "-d", "/tmp/openshift-ansible-XXXXXXX"], "delta": "0:00:00.011931", "end": "2018-06-05 01:57:56.319571", "failed": false, "rc": 0, "start": "2018-06-05 01:57:56.307640", "stderr": "", "stderr_lines": [], "stdout": "/tmp/openshift-ansible-T71C8pn", "stdout_lines": ["/tmp/openshift-ansible-T71C8pn"]}