From: Sébastien Han Date: Tue, 25 Mar 2014 16:53:15 +0000 (+0100) Subject: Add maintenance playbook X-Git-Tag: v1.0.0~364^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9a60f122efb66854786d2efb371faac8001a970d;p=ceph-ansible.git Add maintenance playbook This playbook was made to automate Ceph servers maintenance Typical use case: hardware change By running this playbook you will set the 'noout' flag on your cluster, which means that OSD **can't** be marked as out of the CRUSH map, but they will be marked as down. Basically we tell the cluster to don't move any data since the operation won't last for too long. Signed-off-by: Sébastien Han --- diff --git a/hosts b/hosts index 36152b9b2..f41206036 100644 --- a/hosts +++ b/hosts @@ -5,19 +5,19 @@ ## Common setup example # [mons] -ceph-mon0:2222 -ceph-mon1:2200 -ceph-mon2:2201 +ceph-mon0:2200 +ceph-mon1:2201 +ceph-mon2:2202 [osds] -ceph-osd0:2202 -ceph-osd1:2203 -ceph-osd2:2204 +ceph-osd0:2203 +ceph-osd1:2204 +ceph-osd2:2205 [mdss] -ceph-osd0:2202 -ceph-osd1:2203 -ceph-osd2:2204 -[rgws] -ceph-rgw:2205 +ceph-osd0:2203 +ceph-osd1:2204 +ceph-osd2:2205 +#[rgws] +#ceph-rgw:2200 # Colocation setup example #[mons] diff --git a/maintenance.yml b/maintenance.yml new file mode 100644 index 000000000..9b115d116 --- /dev/null +++ b/maintenance.yml @@ -0,0 +1,30 @@ +--- +# This playbook was made to automate Ceph servers maintenance +# Typical use case: hardware change +# By running this playbook you will set the 'noout' flag on your +# cluster, which means that OSD **can't** be marked as out +# of the CRUSH map, but they will be marked as down. +# Basically we tell the cluster to don't move any data since +# the operation won't last for too long. + +- hosts: + gather_facts: False + + tasks: + + - name: Set the noout flag + command: ceph osd set noout + delegate_to: + + - name: Turn off the server + command: poweroff + + - name: Wait for the server to go down + local_action: wait_for host= port=22 state=stopped + + - name: Wait for the server to come up + local_action: wait_for host=