diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-08-31 09:15:19 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-08-31 09:15:19 +0000 |
| commit | 76f94f8d189d39746471a2ee599fc7e2a1344061 (patch) | |
| tree | 0762d5f9732ebaddd1c3488cd648f27d348c2b2d /ansible | |
| parent | b17027564cd690dfb449e61b9fd9cbcbf510309f (diff) | |
| parent | ec40ed3cbb4ab0bb2b1dd229b6de5d206bbca5b1 (diff) | |
| download | kolla-76f94f8d189d39746471a2ee599fc7e2a1344061.tar.gz kolla-76f94f8d189d39746471a2ee599fc7e2a1344061.zip | |
Merge "Add a check before wiping Ceph disks in bootstrap"
Diffstat (limited to 'ansible')
| -rw-r--r-- | ansible/group_vars/all.yml | 4 | ||||
| -rw-r--r-- | ansible/roles/ceph/tasks/bootstrap_osds.yml | 30 |
2 files changed, 34 insertions, 0 deletions
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 36137461a..dad752d54 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -324,6 +324,10 @@ ceph_cache_mode: "writeback" # Valid options are [ ext4, btrfs, xfs ] ceph_osd_filesystem: "xfs" +# Set to 'yes-i-really-really-mean-it' to force wipe disks with existing partitions for OSDs. Only +# set if you understand the consequences! +ceph_osd_wipe_disk: "" + # These are /etc/fstab options. Comma separated, no spaces (see fstab(8)) ceph_osd_mount_options: "defaults,noatime" diff --git a/ansible/roles/ceph/tasks/bootstrap_osds.yml b/ansible/roles/ceph/tasks/bootstrap_osds.yml index 014d2dcd4..e5d0ab8b0 100644 --- a/ansible/roles/ceph/tasks/bootstrap_osds.yml +++ b/ansible/roles/ceph/tasks/bootstrap_osds.yml @@ -23,6 +23,21 @@ set_fact: osds_cache_bootstrap: "{{ (osd_cache_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).disks|from_json }}" +- pause: + prompt: | + WARNING: It seems {{ item.device }} is marked to be wiped and partitioned for Ceph data and + a co-located journal, but appears to contain other existing partitions (>1). + + If you are sure you want this disk to be *wiped* for use with Ceph, press enter. + + Otherwise, press Ctrl-C, then 'A'. (You can disable this check by setting + ceph_osd_wipe_disk: 'yes-i-really-really-mean-it' within globals.yml) + with_items: "{{ osds_bootstrap|default([]) }}" + when: + - item.external_journal | bool == False + - ansible_devices[item.device.split('/')[2]].partitions|count > 1 + - ceph_osd_wipe_disk != "yes-i-really-really-mean-it" + - name: Bootstrapping Ceph OSDs kolla_docker: action: "start_container" @@ -54,6 +69,21 @@ - "kolla_logs:/var/log/kolla/" with_indexed_items: "{{ osds_bootstrap|default([]) }}" +- pause: + prompt: | + WARNING: It seems {{ item.device }} is marked to be wiped and partitioned for Ceph data and + a co-located journal, but appears to contain other existing partitions (>1). + + If you are sure you want this disk to be *wiped* for use with Ceph, press enter. + + Otherwise, press Ctrl-C, then 'A'. (You can disable this check by setting + ceph_osd_wipe_disk: 'yes-i-really-really-mean-it' within globals.yml) + with_items: "{{ osds_cache_bootstrap|default([]) }}" + when: + - item.external_journal | bool == False + - ansible_devices[item.device.split('/')[2]].partitions|count > 1 + - ceph_osd_wipe_disk != "yes-i-really-really-mean-it" + - name: Bootstrapping Ceph Cache OSDs kolla_docker: action: "start_container" |
