Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1354701

Summary: [ceph-ansible] : if osd_group name is different than default than installation fails with error ' please choose an osd scenario'
Product: Red Hat Storage Console Reporter: Rachana Patel <racpatel>
Component: documentationAssignee: Anjana Suparna Sriram <asriram>
Status: CLOSED NOTABUG QA Contact: sds-qe-bugs
Severity: high Docs Contact:
Priority: unspecified    
Version: 2CC: adeza, aschoen, ceph-eng-bugs, kdreyer, nthomas, sankarshan
Target Milestone: ---   
Target Release: 2   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-15 15:11:48 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 Rachana Patel 2016-07-12 00:55:17 UTC
Description of problem:
=======================
If osd_group name is changed(not default osds) than  installation fails in task '[ceph.ceph-common | make sure an osd scenario was chosen]' eventhough OSD scenario is given 



TASK: [ceph.ceph-common | make sure an osd scenario was chosen] *************** 
failed: [magna084] => {"failed": true}
msg: please choose an osd scenario
failed: [magna085] => {"failed": true}
msg: please choose an osd scenario
failed: [magna090] => {"failed": true}
msg: please choose an osd scenario


Version-Release number of selected component (if applicable):
==============================================================
ceph-ansible-1.0.5-23.el7scon.noarch
ceph-installer-1.0.12-3.el7scon.noarch
ceph-common-10.2.2-9.el7cp.x86_64

How reproducible:
==================
always


Steps to Reproduce:
===================
1. make change in group_vars/all and change group name
mon_group_name: monsmy
osd_group_name: osdsmy


make similar changes in inventory file

[root@magna044 ceph-ansible]# cat /etc/ansible/hosts
[monsmy]
magna078

[osdsmy]
magna084
magna085
magna090


and in site.yml
- hosts: monsmy
  become: True
  roles:
  - ceph-mon

- hosts: agents
  become: True
  roles:
  - ceph-agent

- hosts: osdsmy
  become: True
  roles:
  - ceph-osd


2. change group_vars/osd file as below
crush_location: false
osd_crush_location: "'root={{ ceph_crush_root }} rack={{ ceph_crush_rack }} host={{ ansible_hostname }}'"


devices:
  - /dev/sdb
  - /dev/sdc

journal_collocation: true

3. follow document and make necessary changes in group_vars/all and other config files

4. perform preflight operation on all node

5. create cluster using 
 ansible-playbook site.yml_ansible -vv -i  /etc/ansible/hosts


Actual results:
===============
TASK: [ceph.ceph-common | make sure an osd scenario was chosen] *************** 
failed: [magna084] => {"failed": true}
msg: please choose an osd scenario
failed: [magna085] => {"failed": true}
msg: please choose an osd scenario
failed: [magna090] => {"failed": true}
msg: please choose an osd scenario

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/root/site_ansible.retry

magna078                   : ok=91   changed=14   unreachable=0    failed=0   
magna084                   : ok=1    changed=0    unreachable=0    failed=1   
magna085                   : ok=1    changed=0    unreachable=0    failed=1   
magna090                   : ok=1    changed=0    unreachable=0    failed=1   



REASON:
=======
host name is chaned to 'osdsmy' so above run will not have access to value defined in 'osds' file. Hence it fails with above error

suggested solution 1:
=====================
make changes in doc and ask user to copy file as per osd_group_name 
- it should be  - cp group_vars/osds.sample group_vars/<osd_group_name>
not
cp group_vars/osds.sample group_vars/osds 



suggested solution 2:-
====================
make changes in code that it reads variable of 'group_vars/osds' regardless of group name

Additional info:

Comment 3 Andrew Schoen 2016-07-12 21:15:03 UTC
This is definitely a documentation issue. There would be no way to achieve the suggested solution 2, it is ansible behavior to map group names with the appropriately named file in group_vars.