]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Add maintenance playbook 66/head
authorSébastien Han <sebastien.han@enovance.com>
Tue, 25 Mar 2014 16:53:15 +0000 (17:53 +0100)
committerSébastien Han <sebastien.han@enovance.com>
Wed, 9 Apr 2014 15:51:59 +0000 (17:51 +0200)
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 <sebastien.han@enovance.com>
hosts
maintenance.yml [new file with mode: 0644]

diff --git a/hosts b/hosts
index 36152b9b2c342784707f7938ee8129621e14591b..f4120603676828d19351bbeb96a09c8508da470d 100644 (file)
--- 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 (file)
index 0000000..9b115d1
--- /dev/null
@@ -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: <your_host>
+  gather_facts: False
+
+  tasks:
+
+  - name: Set the noout flag
+    command: ceph osd set noout
+    delegate_to: <your_monitor>
+
+  - name: Turn off the server
+    command: poweroff
+
+  - name: Wait for the server to go down
+    local_action: wait_for host=<your_host> port=22 state=stopped
+
+  - name: Wait for the server to come up
+    local_action: wait_for host=<your_host port=22 delay=10 timeout=3600
+
+  - name: Unset the noout flag
+    command: ceph osd unset noout
+    delegate_to: <your_monitor>