Bug 1330939

Summary: [ceph-installer] OSD configure API failing with a non-default cluster name
Product: Red Hat Storage Console Reporter: Tejas <tchandra>
Component: ceph-installerAssignee: Alfredo Deza <adeza>
Status: CLOSED CURRENTRELEASE QA Contact: ceph-qe-bugs <ceph-qe-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2CC: adeza, aschoen, ceph-eng-bugs, kdreyer, nthomas, sankarshan
Target Milestone: ---   
Target Release: 3   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-28 19:47:25 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 Tejas 2016-04-27 10:50:20 UTC
Description of problem:
the OSD configure api is failing.

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

How reproducible:
Always

Steps to Reproduce:
1. Setup the installer and api's
2. Install and configure the mons.
3. install of OSD works, but configure fails

Actual results:
OSD configure

Expected results:fails
OSD configure is expected to go through

Additional info:


[ceph-installer@magna052 ~]$ curl -d "{\"devices\": {\"/dev/sdb\" : \"/dev/sdc\"}, \"journal_size\": 1024, \"cluster_name\": \"my-ceph-cluster\", \"fsid\": \"762e1fa8-8ed9-49d3-b377-04e4d86b23e4\", \"host\": \"magna052.ceph.redhat.com\", \"public_network\": \"10.8.128.0/21\", \"monitors\": [{\"host\": \"magna009.ceph.redhat.com\", \"interface\": \"eno1\"}, {\"host\": \"magna031.ceph.redhat.com\", \"interface\": \"eno1\"}], \"redhat_storage\": true}" http://magna006.ceph.redhat.com:8181/api/osd/configure/
{"endpoint": "/api/osd/configure/", "succeeded": false, "stdout": null, "started": null, "exit_code": null, "ended": null, "command": null, "stderr": null, "identifier": "d00ecd54-f932-44ce-9a34-6a0abf5aa697"}[ceph-installer@magna052 ~]$ 
[ceph-installer@magna052 ~]$ 
[ceph-installer@magna052 ~]$ 
[ceph-installer@magna052 ~]$ curl -X GET http://magna006.ceph.redhat.com:8181/api/tasks/d00ecd54-f932-44ce-9a34-6a0abf5aa697/{"endpoint": "/api/osd/configure/", "succeeded": false, "stdout": "\nPLAY [mons] ******************************************************************* \n\nGATHERING FACTS *************************************************************** \nok: [magna031.ceph.redhat.com]\nok: [magna009.ceph.redhat.com]\n\nTASK: [ceph-fetch-keys | find ceph keys] ************************************** \nok: [magna031.ceph.redhat.com] => {\"changed\": false, \"cmd\": \"ls -1 /etc/ceph/*.keyring\", \"delta\": \"0:00:00.003618\", \"end\": \"2016-04-27 10:18:20.408601\", \"rc\": 0, \"start\": \"2016-04-27 10:18:20.404983\", \"stderr\": \"\", \"stdout\": \"/etc/ceph/my-ceph-cluster.client.admin.keyring\", \"stdout_lines\": [\"/etc/ceph/my-ceph-cluster.client.admin.keyring\"], \"warnings\": []}\nok: [magna009.ceph.redhat.com] => {\"changed\": false, \"cmd\": \"ls -1 /etc/ceph/*.keyring\", \"delta\": \"0:00:00.003461\", \"end\": \"2016-04-27 10:18:15.141741\", \"rc\": 0, \"start\": \"2016-04-27 10:18:15.138280\", \"stderr\": \"\", \"stdout\": \"/etc/ceph/my-ceph-cluster.client.admin.keyring\", \"stdout_lines\": [\"/etc/ceph/my-ceph-cluster.client.admin.keyring\"], \"warnings\": []}\n\nTASK: [ceph-fetch-keys | set keys permissions] ******************************** \nok: [magna031.ceph.redhat.com] => (item=/etc/ceph/my-ceph-cluster.client.admin.keyring) => {\"changed\": false, \"gid\": 0, \"group\": \"root\", \"item\": \"/etc/ceph/my-ceph-cluster.client.admin.keyring\", \"mode\": \"0600\", \"owner\": \"root\", \"path\": \"/etc/ceph/my-ceph-cluster.client.admin.keyring\", \"secontext\": \"system_u:object_r:etc_t:s0\", \"size\": 63, \"state\": \"file\", \"uid\": 0}\nok: [magna009.ceph.redhat.com] => (item=/etc/ceph/my-ceph-cluster.client.admin.keyring) => {\"changed\": false, \"gid\": 0, \"group\": \"root\", \"item\": \"/etc/ceph/my-ceph-cluster.client.admin.keyring\", \"mode\": \"0600\", \"owner\": \"root\", \"path\": \"/etc/ceph/my-ceph-cluster.client.admin.keyring\", \"secontext\": \"unconfined_u:object_r:etc_t:s0\", \"size\": 63, \"state\": \"file\", \"uid\": 0}\n\nTASK: [ceph-fetch-keys | copy keys to the ansible server] ********************* \nok: [magna009.ceph.redhat.com] => (item=/etc/ceph/my-ceph-cluster.client.admin.keyring) => {\"changed\": false, \"checksum\": \"d48c0eee1ba03e3dd846746ac68bc3c4cdab9c9c\", \"dest\": \"/var/lib/ceph-installer/fetch/762e1fa8-8ed9-49d3-b377-04e4d86b23e4/etc/ceph/my-ceph-cluster.client.admin.keyring\", \"file\": \"/etc/ceph/my-ceph-cluster.client.admin.keyring\", \"item\": \"/etc/ceph/my-ceph-cluster.client.admin.keyring\", \"md5sum\": \"b69f724418992fdca38ebfc7fe69233a\"}\nok: [magna009.ceph.redhat.com] => (item=/var/lib/ceph/bootstrap-osd/ceph.keyring) => {\"changed\": false, \"file\": \"/var/lib/ceph/bootstrap-osd/ceph.keyring\", \"item\": \"/var/lib/ceph/bootstrap-osd/ceph.keyring\", \"msg\": \"the remote file does not exist, not transferring, ignored\"}\nok: [magna009.ceph.redhat.com] => (item=/var/lib/ceph/bootstrap-rgw/ceph.keyring) => {\"changed\": false, \"file\": \"/var/lib/ceph/bootstrap-rgw/ceph.keyring\", \"item\": \"/var/lib/ceph/bootstrap-rgw/ceph.keyring\", \"msg\": \"the remote file does not exist, not transferring, ignored\"}\nok: [magna009.ceph.redhat.com] => (item=/var/lib/ceph/bootstrap-mds/ceph.keyring) => {\"changed\": false, \"file\": \"/var/lib/ceph/bootstrap-mds/ceph.keyring\", \"item\": \"/var/lib/ceph/bootstrap-mds/ceph.keyring\", \"msg\": \"the remote file does not exist, not transferring, ignored\"}\n\nPLAY [osds] ******************************************************************* \n\nGATHERING FACTS *************************************************************** \nok: [magna052.ceph.redhat.com]\n\nTASK: [ceph.ceph-common | fail on unsupported system] ************************* \nskipping: [magna052.ceph.redhat.com]\n\nTASK: [ceph.ceph-common | fail on unsupported architecture] ******************* \nskipping: [magna052.ceph.redhat.com]\n\nTASK: [ceph.ceph-common | fail on unsupported distribution] ******************* \nskipping: [magna052.ceph.redhat.com]\n\nTASK: [ceph.ceph-common | fail on unsupported distribution for red hat storage] *** \nskipping: [magna052.ceph.redhat.com]\n\nTASK: [ceph.ceph-common | fail on unsupported ansible version] **************** \nskipping: [magna052.ceph.redhat.com]\n\nTASK: [ceph.ceph-common | make sure journal_size configured] ****************** \nskipping: [magna052.ceph.redhat.com]\n\nTASK: [ceph.ceph-common | make sure monitor_interface or monitor_address is configured] *** \nskipping: [magna052.ceph.redhat.com]\n\nTASK: [ceph.ceph-common | make sure cluster_network configured] *************** \nskipping: [magna052.ceph.redhat.com]\n\nTASK: [ceph.ceph-common | make sure public_network configured] **************** \nskipping: [magna052.ceph.redhat.com]\n\nTASK: [ceph.ceph-common | make sure an osd scenario was chosen] *************** \nskipping: [magna052.ceph.redhat.com]\n\nTASK: [ceph.ceph-common | verify only one osd scenario was chosen] ************ \nfailed: [magna052.ceph.redhat.com] => {\"failed\": true}\nmsg: please select only one osd scenario\n\nFATAL: all hosts have already failed -- aborting\n\nPLAY RECAP ******************************************************************** \n           to retry, use: --limit @/var/lib/ceph-installer/osd-configure.retry\n\nmagna009.ceph.redhat.com   : ok=4    changed=0    unreachable=0    failed=0   \nmagna031.ceph.redhat.com   : ok=4    changed=0    unreachable=0    failed=0   \nmagna052.ceph.redhat.com   : ok=1    changed=0    unreachable=0    failed=1   \n\n", "started": "2016-04-27 10:18:12.351241", "exit_code": 2, "ended": "2016-04-27 10:18:18.591303", "command": "/bin/ansible-playbook -v -u ceph-installer /usr/share/ceph-ansible/osd-configure.yml -i /tmp/d00ecd54-f932-44ce-9a34-6a0abf5aa697_F_TKeX --extra-vars {\"raw_journal_devices\": [\"/dev/sdc\"], \"devices\": [\"/dev/sdb\"], \"cluster\": \"my-ceph-cluster\", \"ceph_stable_rh_storage_cdn_install\": true, \"public_network\": \"10.8.128.0/21\", \"fetch_directory\": \"/var/lib/ceph-installer/fetch\", \"journal_size\": 1024, \"raw_multi_journal\": true, \"fsid\": \"762e1fa8-8ed9-49d3-b377-04e4d86b23e4\", \"ceph_stable_rh_storage\": true} --skip-tags package-install", "stderr": "", "identifier": "d00ecd54-f932-44ce-9a34-6a0abf5aa697"}[ceph-installer@magna052 ~]$ 


[ceph-installer@magna031 ceph]$ sudo ls -lR /var/lib/ceph
/var/lib/ceph:
total 28
drwxr-x---. 2 ceph ceph 4096 Apr 27 07:09 bootstrap-mds
drwxr-x---. 2 ceph ceph 4096 Apr 27 07:09 bootstrap-osd
drwxr-x---. 2 ceph ceph 4096 Apr 27 07:09 bootstrap-rgw
drwxr-x---. 2 ceph ceph 4096 Apr 22 17:53 mds
drwxr-x---. 3 ceph ceph 4096 Apr 27 07:09 mon
drwxr-x---. 2 ceph ceph 4096 Apr 22 17:53 osd
drwxr-x---. 2 ceph ceph 4096 Apr 27 07:09 tmp

/var/lib/ceph/bootstrap-mds:
total 4
-rw-------. 1 ceph ceph 71 Apr 27 07:09 my-ceph-cluster.keyring

/var/lib/ceph/bootstrap-osd:
total 4
-rw-------. 1 ceph ceph 71 Apr 27 07:09 my-ceph-cluster.keyring

/var/lib/ceph/bootstrap-rgw:
total 4
-rw-------. 1 ceph ceph 71 Apr 27 07:09 my-ceph-cluster.keyring

/var/lib/ceph/mds:
total 0

/var/lib/ceph/mon:
total 4
drwxr-xr-x. 3 ceph ceph 4096 Apr 27 07:09 my-ceph-cluster-magna031

/var/lib/ceph/mon/my-ceph-cluster-magna031:
total 8
-rw-------. 1 ceph ceph   77 Apr 27 07:09 keyring
drwxr-xr-x. 2 ceph ceph 4096 Apr 27 09:23 store.db

/var/lib/ceph/mon/my-ceph-cluster-magna031/store.db:
total 26120
-rw-r--r--. 1 ceph ceph  374361 Apr 27 08:06 000101.sst
-rw-r--r--. 1 ceph ceph  151184 Apr 27 08:32 000152.sst
-rw-r--r--. 1 ceph ceph 1533604 Apr 27 08:44 000165.sst
-rw-r--r--. 1 ceph ceph   66692 Apr 27 08:58 000210.sst
-rw-r--r--. 1 ceph ceph 2114103 Apr 27 09:23 000259.sst
-rw-r--r--. 1 ceph ceph 2101661 Apr 27 09:23 000260.sst
-rw-r--r--. 1 ceph ceph 2099307 Apr 27 09:23 000261.sst
-rw-r--r--. 1 ceph ceph  373247 Apr 27 09:23 000262.sst
-rw-r--r--. 1 ceph ceph 2120912 Apr 27 09:23 000263.sst
-rw-r--r--. 1 ceph ceph 2142085 Apr 27 09:23 000264.sst
-rw-r--r--. 1 ceph ceph 2142085 Apr 27 09:23 000265.sst
-rw-r--r--. 1 ceph ceph 2107625 Apr 27 09:23 000266.sst
-rw-r--r--. 1 ceph ceph 2156860 Apr 27 09:23 000267.sst
-rw-r--r--. 1 ceph ceph 7274496 Apr 27 09:31 000268.log
-rw-r--r--. 1 ceph ceph      16 Apr 27 07:12 CURRENT
-rw-r--r--. 1 ceph ceph       0 Apr 27 07:09 LOCK
-rw-r--r--. 1 ceph ceph   65536 Apr 27 09:23 MANIFEST-000007

/var/lib/ceph/osd:
total 0

/var/lib/ceph/tmp:
total 4
-rw-------. 1 ceph ceph 77 Apr 27 07:09 keyring.mon.magna031


the setup is available as of now:
mons:
magna009
magna031
magna046

osd:
magna052
magna058
magna077
magna080

Selinux is permissive and firewalld has the required ports open.

Comment 2 Ken Dreyer (Red Hat) 2016-04-28 16:51:24 UTC
In the future, please provide the exact versions of the ceph-installer and ceph-ansible packages as well.

I've checked magna006 just now, and the packages there are:
$ rpm -qv ceph-installer ceph-ansible
ceph-installer-1.0.5-1.el7.noarch
ceph-ansible-1.0.5-4.el7.noarch

Comment 3 Alfredo Deza 2016-04-28 17:11:44 UTC
Although it might be possible to pass the cluster name it is something that is currently not supported.

Comment 6 Christina Meno 2016-05-16 09:17:52 UTC
Alfredo,

Can you say what the impact of this bug is?
Does it mean we cannot name clusters something else than "ceph" at all?
It is the dash "-"

Comment 7 Alfredo Deza 2016-06-06 11:38:08 UTC
There are still some issues with custom cluster names, in this case there was an issue upstream where it prevented dashes being properly parsed. This particular issue with dashes has been fixed.

Comment 9 Tejas 2016-08-06 16:27:53 UTC
This has been fixed in the more recent builds of ceph-ansible.
Moving this to Verified.

Comment 10 Ken Dreyer (Red Hat) 2017-06-28 19:47:25 UTC
Fix shipped in https://access.redhat.com/errata/RHBA-2017:1496