Ceph commands

Get status of monitors ceph quorum_status --format json-pretty Set the weight of a disk lower so it gets less IO, or use it to scale a disk in\out of a cluster ceph osd reweight osd.30 .01 --cluster mycluster Move an OSD to a node in the cursh map, usefull if your OSD comes up not attached to a node ceph osd crush move osd.27 host=adleast-node04 --cluster myclustercode> Ensure this OSD is never a primary - Requires a setting on the mon ceph osd primary-affinity osd.27 0 --cluster myclustercode> How many PG's on OSD x are primary? ceph pg dump | grep active+clean | egrep "\\[0," | wc -lcode Activate an existing bluestore disk

1ceph-volume lvm activate --bluestore 42c9b2862-1db6-4863-935d-32b7289fee7d

Find all bluestore disk ID's and UUID's

(Used to generate the above command)

1lvs -o lv_tags | awk -vFS=, /ceph.osd_fsid/'{ OSD_ID=gensub(".*ceph.osd_id=([0-9]+),.*", "\\\\1", ""); OSD_FSID=gensub(".*ceph.osd_fsid=([a-z0-9-]+),.*", "\\\\1", ""); print OSD_ID,OSD_FSID }' | sort -n | uniqcode