Bug 1420905 - Installer fails when checking persistent_volume{s,_claims} | length > 0
Summary: Installer fails when checking persistent_volume{s,_claims} | length > 0
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.3.1
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Andrew Butcher
QA Contact: Junqi Zhao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-09 20:17 UTC by Steven Walter
Modified: 2018-09-26 14:31 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-26 14:31:13 UTC
Target Upstream Version:


Attachments (Terms of Use)
external nfs pv is attached and metrics works well (3.50 KB, text/plain)
2018-01-31 13:06 UTC, Junqi Zhao
no flags Details

Description Steven Walter 2017-02-09 20:17:57 UTC
Description of problem:
Installing with openshift_hosted_metrics_storage_host and openshift_hosted_metrics_storage_host but not with the [nfs] group leads to error.

Version-Release number of selected component (if applicable):
3.3



Actual results:
TASK [setup] *******************************************************************
ok: [labm590a.example.local]

TASK [openshift_facts : Detecting Operating System] ****************************
fatal: [labm590a.example.local]: FAILED! => {
    "failed": true
}

MSG:

The conditional check 'persistent_volumes | length > 0 or persistent_volume_claims | length > 0' failed. The error was: '{{ hostvars[groups.oo_first_master.0] | oo_persistent_volumes(groups) }}: kind'


Expected results:
Installer to recognize external NFS

Additional info:
This is also tracked at https://github.com/openshift/openshift-ansible/issues/2553

Seems to come from this line:
https://github.com/openshift/openshift-ansible/blob/41ff6013a19c77fdc35adcf58ad523069f20ee2f/playbooks/common/openshift-cluster/openshift_hosted.yml#L2-L11

Looks like the typing is wrong; the length function does not appear to return a number, causing a typing error. I assume this only happens if persistent_volumes is null which would happen when hostvars[groups.oo_first_master.0] is null, although I am not sure about this

Comment 1 Steven Walter 2017-02-09 20:18:37 UTC
Workaround according to the github issue is to define the first master in the [nfs] section and fix the dc's after install

Comment 4 Steven Walter 2017-02-10 18:59:54 UTC
Customer has tried the workaround (defining first master in the [nfs] group) but still receiving same error.

Comment 20 Andrew Butcher 2018-01-23 18:21:30 UTC
This PR removed hosted facts in many places and should resolve this BZ. Setting a hosted variable we don't manage like openshift_hosted_backup_storage_host (openshift.hosted.backup.storage.host) should now be safe as the fact will not be added to cached facts in /etc/ansible/facts.d/openshift.fact.

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

Comment 22 Junqi Zhao 2018-01-25 02:55:59 UTC
@abutcher,
What is the Target Release for this defect, the errata 32336 is for OCP 3.5, 3.6, 3.7, please set value for Target Release

Comment 24 Junqi Zhao 2018-01-31 13:05:22 UTC
Set the following parameter to deploy logging with external nfs pv, the deployment is successfull without error, and metrics works well.
  openshift_metrics_install_metrics: true
  openshift_metrics_image_prefix: ${IMAGE_PREFIX}
  openshift_metrics_image_version: v3.9
  openshift_metrics_storage_kind: nfs
  openshift_metrics_storage_host: ${EXTERNAL_NFS_HOST}
  openshift_metrics_storage_nfs_directory: ${NFS_DIRECTORY}
  openshift_metrics_storage_volume_name: ${VOLUME_NAME}
  openshift_metrics_storage_access_modes: ['ReadWriteOnce']
  openshift_metrics_storage_volume_size: 10Gi

openshift-ansible version
openshift-ansible-3.9.0-0.34.0.git.0.c7d9585.el7

Comment 25 Junqi Zhao 2018-01-31 13:06:51 UTC
Created attachment 1388947 [details]
external nfs pv is attached and metrics works well

Comment 26 Adam Yen 2018-03-20 15:23:29 UTC
I am still seeing this issue on my OCP 3.7. There is a github open issue as well.

https://github.com/openshift/openshift-ansible/issues/3855

I disable NFS for metrics but still doesn't work. What is the proper workaround?

My version and variables:
openshift-ansible-3.7.23-1.git.0.bc406aa.el7.noarch
openshift-ansible-docs-3.7.23-1.git.0.bc406aa.el7.noarch
openshift-ansible-roles-3.7.23-1.git.0.bc406aa.el7.noarch
openshift-ansible-playbooks-3.7.23-1.git.0.bc406aa.el7.noarch


openshift_hosted_metrics_storage_host=qa24
#openshift_metrics_storage_kind=nfs
#openshift_metrics_storage_access_modes=['ReadWriteOnce']
#openshift_metrics_storage_nfs_directory=/exports
#openshift_metrics_storage_nfs_options='*(rw,root_squash)'
openshift_metrics_storage_volume_name=metrics
openshift_metrics_storage_volume_size=2Gi
openshift_metrics_storage_labels={'storage': 'metrics'}


-Adam

Comment 27 Adam Yen 2018-03-21 05:28:31 UTC
Following up on my previous request, looks like the fix has been back ported to OCP 3.7. 

https://bugzilla.redhat.com/show_bug.cgi?id=1539101

Now I just have to wait for the latest RPMs update to propagate?


Note You need to log in before you can comment on or make changes to this bug.