From 9a60f122efb66854786d2efb371faac8001a970d Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Tue, 25 Mar 2014 17:53:15 +0100 Subject: [PATCH] Add maintenance playbook MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- hosts | 22 +++++++++++----------- maintenance.yml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 11 deletions(-) create mode 100644 maintenance.yml 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= -- 2.39.5