Skip to content

Instantly share code, notes, and snippets.

@travisn
Created May 13, 2020 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save travisn/782cf2ef9f4956d7799d658fca12942c to your computer and use it in GitHub Desktop.
Save travisn/782cf2ef9f4956d7799d658fca12942c to your computer and use it in GitHub Desktop.
osd_status=$(ceph osd tree | grep "osd.${FAILED_OSD_ID} " | awk '{print $5}')
if [[ "$osd_status" == "up" ]]; then
echo "OSD ${FAILED_OSD_ID} is up and running. Please check if you entered correct ID of failed osd!"
else
echo "OSD ${FAILED_OSD_ID} is down. Proceeding to mark out and purge."
ceph osd out osd.${FAILED_OSD_ID}
ceph osd purge osd.${FAILED_OSD_ID} --force --yes-i-really-mean-it
fi
@travisn
Copy link
Author

travisn commented May 13, 2020

When we're targeting octopus, the ceph osd info osd.0 command will be much better than ceph osd tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment