From fecf719e59a41262220e1d7b9a1dddf7c3184350 Mon Sep 17 00:00:00 2001 From: Paul Bourke Date: Wed, 16 Nov 2016 14:14:13 +0000 Subject: [PATCH] Allow operators to use 'fallback mode' for Ceph disks This change adds a variable to the Ceph role "kolla_ceph_use_udev", which is True by default meaning no change to the current behaviour. If set to False, it will fallback to tools such as sgdisk/blkid to parse the disk info it needs, instead of using udev. Change-Id: I88d7b73efe27f04bb1ba16d61e101fa14a9f0d81 Depends-On: I6ad7825cdb164498f3d02f2ae064c7c1c38e10d5 Closes-Bug: #1631949 --- ansible/roles/ceph/defaults/main.yml | 5 +++++ ansible/roles/ceph/tasks/bootstrap_osds.yml | 4 ++-- ansible/roles/ceph/tasks/reconfigure.yml | 2 +- ansible/roles/ceph/tasks/start_osds.yml | 2 +- .../notes/allow-ceph-toggle-udev-2d2b04c08c895820.yaml | 7 +++++++ 5 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/allow-ceph-toggle-udev-2d2b04c08c895820.yaml diff --git a/ansible/roles/ceph/defaults/main.yml b/ansible/roles/ceph/defaults/main.yml index af39ac0a31..a4b9ab47b4 100644 --- a/ansible/roles/ceph/defaults/main.yml +++ b/ansible/roles/ceph/defaults/main.yml @@ -30,3 +30,8 @@ swift_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ swift_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ rgw_port }}/swift/v1" openstack_swift_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}','domain_name':'default'}" + +#################### +# Kolla +#################### +kolla_ceph_use_udev: True diff --git a/ansible/roles/ceph/tasks/bootstrap_osds.yml b/ansible/roles/ceph/tasks/bootstrap_osds.yml index e5d0ab8b08..1ede1aafe6 100644 --- a/ansible/roles/ceph/tasks/bootstrap_osds.yml +++ b/ansible/roles/ceph/tasks/bootstrap_osds.yml @@ -2,7 +2,7 @@ - name: Looking up disks to bootstrap for Ceph OSDs command: docker exec -t kolla_toolbox sudo -E /usr/bin/ansible localhost -m find_disks - -a "partition_name='KOLLA_CEPH_OSD_BOOTSTRAP' match_mode='prefix'" + -a "partition_name='KOLLA_CEPH_OSD_BOOTSTRAP' match_mode='prefix' use_udev={{ kolla_ceph_use_udev }}" register: osd_lookup changed_when: "{{ osd_lookup.stdout.find('localhost | SUCCESS => ') != -1 and (osd_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" failed_when: osd_lookup.stdout.split()[2] != 'SUCCESS' @@ -14,7 +14,7 @@ - name: Looking up disks to bootstrap for Ceph Cache OSDs command: docker exec -t kolla_toolbox sudo -E /usr/bin/ansible localhost -m find_disks - -a "partition_name='KOLLA_CEPH_OSD_CACHE_BOOTSTRAP' match_mode='prefix'" + -a "partition_name='KOLLA_CEPH_OSD_CACHE_BOOTSTRAP' match_mode='prefix' use_udev={{ kolla_ceph_use_udev }}" register: osd_cache_lookup changed_when: "{{ osd_cache_lookup.stdout.find('localhost | SUCCESS => ') != -1 and (osd_cache_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" failed_when: osd_cache_lookup.stdout.split()[2] != 'SUCCESS' diff --git a/ansible/roles/ceph/tasks/reconfigure.yml b/ansible/roles/ceph/tasks/reconfigure.yml index b2c6092df1..9ac2540ab7 100644 --- a/ansible/roles/ceph/tasks/reconfigure.yml +++ b/ansible/roles/ceph/tasks/reconfigure.yml @@ -12,7 +12,7 @@ - name: Looking up OSDs for Ceph command: docker exec -t kolla_toolbox sudo -E /usr/bin/ansible localhost -m find_disks - -a "partition_name='KOLLA_CEPH_DATA' match_mode='prefix'" + -a "partition_name='KOLLA_CEPH_DATA' match_mode='prefix' use_udev={{ kolla_ceph_use_udev }}" register: osd_lookup changed_when: "{{ osd_lookup.stdout.find('localhost | SUCCESS => ') != -1 and (osd_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" failed_when: osd_lookup.stdout.split()[2] != 'SUCCESS' diff --git a/ansible/roles/ceph/tasks/start_osds.yml b/ansible/roles/ceph/tasks/start_osds.yml index b5d6429874..643d121b0d 100644 --- a/ansible/roles/ceph/tasks/start_osds.yml +++ b/ansible/roles/ceph/tasks/start_osds.yml @@ -2,7 +2,7 @@ - name: Looking up OSDs for Ceph command: docker exec -t kolla_toolbox sudo -E /usr/bin/ansible localhost -m find_disks - -a "partition_name='KOLLA_CEPH_DATA' match_mode='prefix'" + -a "partition_name='KOLLA_CEPH_DATA' match_mode='prefix' use_udev={{ kolla_ceph_use_udev }}" register: osd_lookup changed_when: "{{ osd_lookup.stdout.find('localhost | SUCCESS => ') != -1 and (osd_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" failed_when: osd_lookup.stdout.split()[2] != 'SUCCESS' diff --git a/releasenotes/notes/allow-ceph-toggle-udev-2d2b04c08c895820.yaml b/releasenotes/notes/allow-ceph-toggle-udev-2d2b04c08c895820.yaml new file mode 100644 index 0000000000..268371abc7 --- /dev/null +++ b/releasenotes/notes/allow-ceph-toggle-udev-2d2b04c08c895820.yaml @@ -0,0 +1,7 @@ +--- +features: + - Add a new variable for the Ceph role, 'kolla_ceph_use_udev', + which when set to 'False' relies on system tools such as + sgdisk/blkid to read the necessary disk info required + to bootstrap Ceph disks on older systems. Most operators + should not need to change this.