Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1521218 - [RFE] Allow deploy logging with no-default storageclass
[RFE] Allow deploy logging with no-default storageclass
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Logging (Show other bugs)
3.7.1
Unspecified Unspecified
unspecified Severity medium
: ---
: 3.7.z
Assigned To: ewolinet
Anping Li
:
: 1561799 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-12-05 21:42 EST by Anping Li
Modified: 2018-04-19 17:54 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-04-05 05:33:10 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0636 None None None 2018-04-05 05:33 EDT

  None (edit)
Description Anping Li 2017-12-05 21:42:29 EST
Description of problem:

By default, when openshift_logging_es_pvc_dynamic=true, the logging will use the default storageclass. if there are multiple storageclass. there is no way to deploy logging with non-default storage class.

For example: 
For glusterfs, there are two storageclass, the default storageclass is for glusterfs, the other storageclass is glusterblock.  the logging want to deploy with glusterblock while the admin want the other applications use glusterfs. 
The openshift admin must set glusterblock as default storageclass at first, and change the storageclass back  once the deploy complete. If the other applications is deploying same time, it will use the glusterblock wrongly.
 
It is better to use an inventory variable to deploy logging using glusterblock. in this way the cluster admin needn't to change the default storageclass. the candiate variables are openshift_logging_storage_classs, openshift_logging_es_storage_classs, or openshift_logging_es_ops_storage_classs. 


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

How reproducible:
always

Steps to Reproduce:
1)  create multiple storageclass, try to deploy logging with non-default storageclass.


Actual results:
The openshift-admin must change the default storageclass before deploy logging. 

Expected results:
There are some variables to specify the storageclass name
Comment 2 Anping Li 2017-12-06 20:41:17 EST
Jeff, the variable looks good.
Comment 3 Jeff Cantrill 2017-12-07 17:19:13 EST
Does the use of this variable resolve this issue?  Can we close it?
Comment 4 Anping Li 2017-12-07 19:43:34 EST
Jeff,  Yes, It works.
Comment 5 Anping Li 2017-12-08 03:48:15 EST
Jeff, We should fix the error when openshift_logging_es_pvc_storage_class_name is undefined.

TASK [openshift_logging_elasticsearch : Creating ES storage template - static] ************************************************************************************************************************************
task path: /root/openshift-ansible/roles/openshift_logging_elasticsearch/tasks/main.yaml:304
fatal: [ec2-35-153-101-95.compute-1.amazonaws.com]: FAILED! => {"failed": true, "msg": "The field 'vars' has an invalid value, which includes an undefined variable. The error was: {{ openshift_logging_es_pvc_storage_class_name }}: 'openshift_logging_es_pvc_storage_class_name' is undefined\n\nThe error appears to have been in '/root/openshift-ansible/roles/openshift_logging_elasticsearch/tasks/main.yaml': line 304, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n    # storageclasses with the storageClassName set to \"\" in pvc.j2\n    - name: Creating ES storage template - static\n      ^ here\n\nexception type: <class 'ansible.errors.AnsibleUndefinedVariable'>\nexception: {{ openshift_logging_es_pvc_storage_class_name }}: 'openshift_logging_es_pvc_storage_class_name' is undefined"}
	to retry, use: --limit @/root/openshift-ansible/playbooks/openshift-logging/config.retry
Comment 10 Anping Li 2018-01-16 06:33:46 EST
if we deploy logging using dynamical provision without openshift_logging_es_pvc_storage_class_name, the following message pop up. 

ASK [openshift_logging_elasticsearch : Creating ES storage template - static] ************************************************************************************************************************************
fatal: [host-8-241-51.host.centralci.eng.rdu2.redhat.com]: FAILED! => {"failed": true, "msg": "The field 'vars' has an invalid value, which includes an undefined variable. The error was: {{ openshift_logging_es_pvc_storage_class_name }}: 'openshift_logging_es_pvc_storage_class_name' is undefined\n\nThe error appears to have been in '/usr/share/ansible/openshift-ansible/roles/openshift_logging_elasticsearch/tasks/main.yaml': line 330, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n    # storageclasses with the storageClassName set to \"\" in pvc.j2\n    - name: Creating ES storage template - static\n      ^ here\n\nexception type: <class 'ansible.errors.AnsibleUndefinedVariable'>\nexception: {{ openshift_logging_es_pvc_storage_class_name }}: 'openshift_logging_es_pvc_storage_class_name' is undefined"}
Comment 15 Anping Li 2018-02-28 17:47:59 EST
Pass with openshift3/ose-ansible/images/v3.7.35-1
Comment 19 errata-xmlrpc 2018-04-05 05:33:10 EDT
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:0636
Comment 20 Anping Li 2018-04-18 22:10:48 EDT
*** Bug 1561799 has been marked as a duplicate of this bug. ***
Comment 21 Mark McKinstry 2018-04-19 16:49:54 EDT
AFAICT you still can't specify a storage class for dynamic elasticsearch volume. The output pasted in the BZ report shows this was tested using the static one: """Creating ES storage template - static"""

Compare the dynamic one at https://github.com/openshift/openshift-ansible/blob/master/roles/openshift_logging_elasticsearch/tasks/main.yaml#L430-L441 to the static one at https://github.com/openshift/openshift-ansible/blob/master/roles/openshift_logging_elasticsearch/tasks/main.yaml#L417-L428 . Notice the line defining 'storage_class_name' is missing in dynamic. Since the variable isn't there, it can't be passed to the template and you'll get the default storage class.

I've submitted two PRs to fix this:

https://github.com/openshift/openshift-ansible/pull/8013 - for 3.7
https://github.com/openshift/openshift-ansible/pull/8054 - for master branch
Comment 22 ewolinet 2018-04-19 17:54:54 EDT
The reason that we don't pass the 'storage_class_name' to the dynamic task is that in order for a PVC to be considered dynamic, it needs to not have a storageClassName field specified.

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