Bug 1430626 - Metrics deployment with NFS volume failed
Summary: Metrics deployment with NFS volume failed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: ewolinet
QA Contact: Gaoyun Pei
URL:
Whiteboard:
Depends On:
Blocks: 1426536
TreeView+ depends on / blocked
 
Reported: 2017-03-09 07:18 UTC by Gaoyun Pei
Modified: 2017-07-24 14:11 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
New metrics role was missing using some defaults based on the previous hosted role
Clone Of:
Environment:
Last Closed: 2017-04-12 19:03:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0903 0 normal SHIPPED_LIVE OpenShift Container Platform atomic-openshift-utils bug fix and enhancement 2017-04-12 22:45:42 UTC

Description Gaoyun Pei 2017-03-09 07:18:31 UTC
Description of problem:
Enable metrics deployment with NFS storage volume, start installation playbook.
The installation job failed when "Check the value of openshift_metrics_cassandra_storage_type"


Version-Release number of selected component (if applicable):
openshift-ansible-3.5.28-1.git.0.103513e.el7.noarch.rpm


How reproducible:
Always

Steps to Reproduce:
1. Set the following options in ansible inventory, start installation playbook
openshift_hosted_metrics_deploy=true
openshift_hosted_metrics_storage_kind=nfs
openshift_hosted_metrics_storage_access_modes=['ReadWriteOnce']
openshift_hosted_metrics_storage_nfs_directory=/var/lib/exports
openshift_hosted_metrics_storage_nfs_options=*(rw,root_squash)
openshift_hosted_metrics_storage_volume_name=metrics
openshift_hosted_metrics_storage_volume_size=10Gi
openshift_hosted_metrics_deployer_prefix=x.openshift.com/openshift3/
openshift_hosted_metrics_deployer_version=3.5.0

ansible-playbook -i inventory_file /usr/share/ansible/openshift-ansible/playbooks/byo/config.yml


Actual results:
TASK [openshift_metrics : Check the value of openshift_metrics_cassandra_storage_type] ***
Thursday 09 March 2017  02:40:11 +0000 (0:00:00.101)       0:16:02.090 ******** 
fatal: [ec2-34-207-229-217.compute-1.amazonaws.com]: FAILED! => {
    "changed": false, 
    "failed": true
}

MSG:

openshift_metrics_cassandra_storage_type (nfs) is invalid, must be one of: emptydir, pv, dynamic



Expected results:


Additional info:

Comment 3 Gaoyun Pei 2017-03-14 06:27:14 UTC
Test this bug with openshift-ansible-3.5.32-1.git.0.42cf266.el7.noarch.rpm

Set the following options in ansible inventory, start installation playbook

openshift_hosted_metrics_deploy=true
openshift_hosted_metrics_storage_kind=nfs
openshift_hosted_metrics_storage_access_modes=['ReadWriteOnce']
openshift_hosted_metrics_storage_nfs_directory=/var/lib/exports
openshift_hosted_metrics_storage_nfs_options=*(rw,root_squash)
openshift_hosted_metrics_storage_volume_name=metrics
openshift_hosted_metrics_storage_volume_size=10Gi
openshift_metrics_image_prefix=x.com/openshift3/
openshift_metrics_image_version=3.5.0


Then installer failed as:

TASK [openshift_metrics : Applying /tmp/openshift-metrics-ansible-NUF3I0/templates/hawkular-cassandra-pvc1.yaml] ***
Tuesday 14 March 2017  02:52:25 +0000 (0:00:00.878)       0:27:30.399 ********* 
fatal: [ec2-54-83-151-158.compute-1.amazonaws.com]: FAILED! => {
    "changed": false, 
    "cmd": [
        "oc", 
        "--config=/tmp/openshift-metrics-ansible-NUF3I0/admin.kubeconfig", 
        "apply", 
        "-f", 
        "/tmp/openshift-metrics-ansible-NUF3I0/templates/hawkular-cassandra-pvc1.yaml", 
        "-n", 
        "openshift-infra"
    ], 
    "delta": "0:00:00.146661", 
    "end": "2017-03-13 22:52:25.768991", 
    "failed": true, 
    "failed_when_result": true, 
    "rc": 1, 
    "start": "2017-03-13 22:52:25.622330", 
    "warnings": []
}

STDERR:

error: unable to decode "/tmp/openshift-metrics-ansible-NUF3I0/templates/hawkular-cassandra-pvc1.yaml": [pos 154]: json: expect char '"' but got char '['


Log into the master, checked the pvc file
[root@ip-172-18-12-51 templates]# cat hawkular-cassandra-pvc1.yaml 
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: "metrics-1"
  labels:
    metrics-infra: hawkular-cassandra
spec:
  accessModes:
    - ['ReadWriteOnce']
  resources:
    requests:
      storage: 10Gi

Comment 4 ewolinet 2017-03-14 14:22:05 UTC
Looks like the access mode isn't being treated as a list...

Comment 6 Scott Dodson 2017-03-15 18:34:19 UTC
Additional changes merged in openshift-ansible-3.5.34-1.git.0.2f1700a

Comment 7 Gaoyun Pei 2017-03-16 05:07:15 UTC
Verify this bug with openshift-ansible-3.5.35-1.git.0.7aa4728.el7.noarch.rpm

Set the following options in ansible inventory, start installation playbook

openshift_hosted_metrics_deploy=true
openshift_hosted_metrics_storage_kind=nfs
openshift_hosted_metrics_storage_access_modes=['ReadWriteOnce']
openshift_hosted_metrics_storage_nfs_directory=/var/lib/exports
openshift_hosted_metrics_storage_nfs_options=*(rw,root_squash)
openshift_hosted_metrics_storage_volume_name=metrics
openshift_hosted_metrics_storage_volume_size=10Gi
openshift_metrics_image_prefix=x.openshift.com/openshift3/
openshift_metrics_image_version=3.5.0

After installation
[root@ip-172-18-12-187 ~]# oc get pod -n openshift-infra
NAME                         READY     STATUS    RESTARTS   AGE
hawkular-cassandra-1-3vd2f   1/1       Running   0          2h
hawkular-metrics-qrkrv       1/1       Running   0          2h
heapster-4x4kx               1/1       Running   0          2h

[root@ip-172-18-12-187 ~]# oc get pvc -n openshift-infra
NAME        STATUS    VOLUME           CAPACITY   ACCESSMODES   AGE
metrics-1   Bound     logging-volume   10Gi       RWO           2h

[root@ip-172-18-12-187 ~]# oc rsh -n openshift-infra hawkular-cassandra-1-3vd2f
sh-4.2$ df -h
Filesystem                                                                                         Size  Used Avail Use% Mounted on
/dev/mapper/docker-202:2-8688782-6b2eb8105ca7ae4ed01a1c6ecb3547a6e664673e21dc9d461f20d5ce2d8cc11e   10G  568M  9.5G   6% /
tmpfs                                                                                              7.7G     0  7.7G   0% /dev
tmpfs                                                                                              7.7G     0  7.7G   0% /sys/fs/cgroup
tmpfs                                                                                              7.7G   28K  7.7G   1% /secret
ec2-54-82-211-1.compute-1.amazonaws.com:/var/lib/exports/logging                                    25G  3.7G   22G  15% /cassandra_data
/dev/xvda2                                                                                          25G  7.7G   18G  31% /etc/hosts
shm                                                                                                 64M     0   64M   0% /dev/shm
tmpfs                                                                                              7.7G   16K  7.7G   1% /run/secrets/kubernetes.io/serviceaccount

Comment 9 errata-xmlrpc 2017-04-12 19:03:28 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-2017:0903


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