If an existing PVC used by an Elasticsearch DC is not labeled with logging-infra=support a new PVC is created. If we start with existing PVCs: [root@engint-master-39a9e ~]# oc get pvc --show-labels NAME STATUS VOLUME CAPACITY ACCESSMODES STORAGECLASS AGE LABELS logging-es-ek5tsdfc Bound pvc-618dd908-0da6-11e7-9c90-126ee6b1d97f 187Gi RWO ebs 225d <none> logging-es-tdxh1mh5 Bound pvc-623b50a4-0da6-11e7-afc1-123dee44c1c5 187Gi RWO ebs 225d <none> After running the logging playbook on an existing cluster, the old PVCs are no longer used, and new PVCs are created: [root@engint-master-39a9e ~]# oc get pvc --show-labels NAME STATUS VOLUME CAPACITY ACCESSMODES STORAGECLASS AGE LABELS logging-es-0 Bound pvc-746e794c-bb4b-11e7-b58e-126ee6b1d97f 200Gi RWO gp2 4d logging-infra=support logging-es-1 Bound pvc-7d3d6054-bb4b-11e7-a660-123dee44c1c5 200Gi RWO gp2 4d logging-infra=support logging-es-ek5tsdfc Bound pvc-618dd908-0da6-11e7-9c90-126ee6b1d97f 187Gi RWO ebs 225d <none> logging-es-tdxh1mh5 Bound pvc-623b50a4-0da6-11e7-afc1-123dee44c1c5 187Gi RWO ebs 225d <none>
Using openshift-ansible v3.6.173.0.59.
This is stemming from the fact that in 3.5 we pulled this information from the DC to populate the PVC name, in 3.6 we try to abstract that using logging_facts which requires a label instead of walking the DC to get the PVC name.
https://github.com/openshift/openshift-ansible/pull/5980
@peter, How could we create a pvc named like logging-es-ek5tsdfc? What are the openshift-ansible version and inventory variables?
Verified and pass with openshift-ansible-3.7.9-1.git.4.d445616.el7.noarch 1. Deploy logging 2. Create pvc named oc get pvc -o name persistentvolumeclaims/logging-es-ek5tsdfc persistentvolumeclaims/logging-es-tdxh1mh5 3. Attached the pvc to ES pods oc set volume dc/logging-es-data-master-stfcyny3 --add --overwrite --type=pvc --name=elasticsearch-storage --claim-name=logging-es-ek5tsdfc oc set volume dc/logging-es-ops-data-master-gfy26cki --add --overwrite --type=pvc --name=elasticsearch-storage --claim-name=logging-es-tdxh1mh5 4. Redeployed logging by playbook openshift_logging_es_pvc_dynamic=True openshift_logging_es_pvc_prefix=logging-es openshift_logging_es_ops_pvc_prefix=logging-es-ops 5. Check the pvc and dc The playbook wasn't create new pvc, the playbook is using the existing pvc. #oc get pvc -o name persistentvolumeclaims/logging-es-ek5tsdfc persistentvolumeclaims/logging-es-tdxh1mh5 ## oc get dc --selector logging-infra=elasticsearch -o yaml |grep -A 1 persistentVolumeClaim persistentVolumeClaim: claimName: logging-es-ek5tsdfc -- persistentVolumeClaim: claimName: logging-es-tdxh1mh5
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-2017:3438