Deactivate all Ceph OSDs on a node.Oct 24, 2021 2 minutes to read Wolf Noble Ceph Proxmox Tech Ceph Debian Howto Maintenance Proxmox Ubuntu WolfspyreLabsDisabling Ceph OSDs on a node for maintenanceOh wow this is a pain in the assSo, I needed to do some infra maintenance. and quickly discovered that the process of safely offlining the OSDs on a node was taking forever.Scriptification for the winThe steps we need to take are fairly simple.The Steps to automate:Set ceph to not freak out about offline OSDs ↕ ceph osd set noout Which gets us the response: noout is setEnumerate all the local OSDs ↕ 1 2 3 for osd in `ls -lA /var/lib/ceph/osd|awk '/ceph/{print $9}'|sed -e 's/ceph-//'`; do echo $osd; done Stop each OSD ↕ 1 service ceph-osd@OSD_NUMBER_HERE stop Clear to perform Maintenance ↕ Lets get to it, Shall we?shutdown -h nowDo the needful ↕ perform maintenanceBring it all back online ↕ press power buttonDisable Noout ↕ 1 ceph osd set noout Tie it all together1 2 3 4 5 6 7 8 9 for osd in `ls -lA /var/lib/ceph/osd|awk '/ceph/{print $9}'|sed -e 's/ceph-//'`; do echo $osd; service "ceph-osd@${osd}" stop >/dev/null 2>&1 & for i in `seq 1 3`; do echo -n '.' ; sleep 1; done; echo; done Do Maintenance hereStart node back upValidate ceph is healthy1 /usr/bin/watch /usr/bin/ceph status Disable Noout1 ceph osd set noout