How can we get same Ceph osd name after repairing a failed disk ?
Environment
- Inktank Ceph Enterprise 1.1
- Inktank Ceph Enterprise 1.2
Issue
- How can we get same Ceph osd name after repairing a failed disk ?
- Ceph osd system had failed disk and after repairing the failed disk , not able to add the osd with same name as failed disk was having.
- The failed disk name was
/dev/sdhand osd name wasosd.3and we had executed following commands:
# ceph osd crush remove osd.3
# ceph auth del osd.3
# ceph osd rm osd.3
# ceph osd create
3
# ceph-deploy --overwrite-conf osd prepare osd02:/dev/sdh
Resolution
-
We should note that you can safely use
osd.96as the name of your new osd, this will not cause any problems within Ceph. If this is fine you can simply removeosd.3from thecrushmapby following the instructions here: -
Several of those commands will fail because there is no running
osd.3process but the end result will remove the osd from thecrushmapand make itself available for use by the next disk. -
The problem here originally happened due to a flaw in the procedure you followed. Since you are using
ceph-deploythere is no need to run theceph osd createcommand,ceph-deployexecutes that internally. -
If you do wish to reuse the
osd.3name, instead of the newly createdosd.96, then go through the removal steps for bothosd.3andosd.96. -
After removing the osds successfully run the following command :
# ceph-deploy --overwrite-conf osd prepare osd02:/dev/sdh --zap-disk -
It will give you the name of osd.3 for that disk.
Root Cause
- The problem here originally happened due to a flaw in the procedure which was followed. Since
ceph-deploywas used here then there is no need to run theceph osd createcommand,ceph-deployexecutes that internally.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.