B&R: Recover Ceph data on standard with controller storage
Differences between an all-in-one B&R are: o we have two monitors as the minimum requirement for a ceph monitor cluster. Yet restore needs to form a cluster with a single monitor. For this to work we add a line in /etc/ceph/ceph.conf to enable ceph to work with one monitor. Then we remove this line at the end of the restore to return the system to a minimum of 2 monitors in the cluster. o OSD data on controller-1 has to be kept intact at installation. This is done by kickstarts through a sysinv-api call. We just need to create a flag file to tell sysinv that, when asked, it should reply to the kickstarts that OSDs should not be wiped. Change-Id: Icaa58b110e41a47ed5bd4477399ad340d4bb26e4 Depends-On: I28dd4a4858dfb12c1f0dc2486bb25bf77cfffb0a Depends-On: I96c1c749dfa5a2ce92bce12469ac6ec5e6051e9a Story: 2004761 Task: 36593 Signed-off-by: Ovidiu Poncea <ovidiu.poncea@windriver.com>
This commit is contained in:
@@ -9,6 +9,12 @@
|
||||
|
||||
- name: Restore CEPH Monitor data
|
||||
block:
|
||||
- name: Create flag file in /etc/platform to skip wiping OSDs
|
||||
file:
|
||||
path: "{{ skip_ceph_osds_wipe_flag }}"
|
||||
state: touch
|
||||
when: system_mode != 'simplex'
|
||||
|
||||
- name: Restore ceph.conf file
|
||||
command: >-
|
||||
tar -C / -xpf {{ target_backup_dir }}/{{ backup_filename }}
|
||||
@@ -16,6 +22,14 @@
|
||||
args:
|
||||
warn: false
|
||||
|
||||
- name: Allow Ceph to start with a single monitor on a Standard deployment
|
||||
ini_file:
|
||||
path: "/etc/ceph/ceph.conf"
|
||||
section: global
|
||||
option: mon_initial_members
|
||||
value: controller-0
|
||||
when: system_type == 'Standard'
|
||||
|
||||
- name: Check if ceph-mon processes are running
|
||||
command: pgrep ceph-mon
|
||||
register: ceph_mons
|
||||
@@ -89,5 +103,13 @@
|
||||
- name: Restart ceph one more time to pick latest changes
|
||||
command: /etc/init.d/ceph restart
|
||||
|
||||
- name: Remove Ceph option to start with a single monitor on a Standard deployment
|
||||
ini_file:
|
||||
path: "/etc/ceph/ceph.conf"
|
||||
section: global
|
||||
option: mon_initial_members
|
||||
state: absent
|
||||
when: system_type == 'Standard'
|
||||
|
||||
become: yes
|
||||
become_user: root
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
---
|
||||
skip_ceph_osds_wipe_flag: /etc/platform/.skip_ceph_osds_wipe
|
||||
@@ -24,11 +24,24 @@
|
||||
msg: "Mandatory configuration parameter backup_filename is not defined or set."
|
||||
when: backup_filename is not defined or backup_filename is none
|
||||
|
||||
# Put the backup tarball in /scratch
|
||||
- name: Set staging and target backup dirs
|
||||
set_fact:
|
||||
staging_dir: /scratch
|
||||
target_backup_dir: /scratch
|
||||
|
||||
# Get system_type
|
||||
- name: Retrieve system type
|
||||
shell: source /etc/platform/platform.conf; echo $system_type
|
||||
register: system_type_result
|
||||
|
||||
- name: Fail if system type is not defined
|
||||
fail:
|
||||
msg: "system_type is missing in /etc/platform/platform.conf"
|
||||
when: system_type_result.stdout_lines|length == 0
|
||||
|
||||
- name: Set system type config path fact
|
||||
set_fact:
|
||||
system_type: "{{ system_type_result.stdout_lines[0] }}"
|
||||
|
||||
roles:
|
||||
- { role: recover-ceph-data, become: yes }
|
||||
|
||||
Reference in New Issue
Block a user