From 24360443693fa0e0715e2d79b7b12af33516717f Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Mon, 16 Dec 2019 16:41:20 -0500 Subject: [PATCH] switch_to_containers: set GUID on lockbox part The ceph lockbox partition (part number 5) used with non lvm scenarios and in non containerized deployment don't have a valid PARTUUID. The value is set to 00000000-0000-0000-0000-000000000000 for each OSD devices. $ blkid -t PARTLABEL="ceph lockbox" -o value -s PARTUUID 00000000-0000-0000-0000-000000000000 00000000-0000-0000-0000-000000000000 00000000-0000-0000-0000-000000000000 00000000-0000-0000-0000-000000000000 00000000-0000-0000-0000-000000000000 When switching to containerized deployment we manually mount the lockbox partition by using the PARTUUID. Unfortunately because we have most of the time multiple OSD on the same node we can't have the right symlink in /dev/disk/by-partuuid because it will point to only one partition. /dev/disk/by-partuuid/00000000-0000-0000-0000-000000000000 -> ../../sdb5 After the switch_to_containers playbook then only one OSD will restart correctly and the other will try to access to the wrong device causing error like 'xxxx is still in use'. When deploying with containers and dmcrypt OSDs we force a PARTUUID value during the ceph-disk prepare task. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1616159 Signed-off-by: Dimitri Savineau --- ...inerized-to-containerized-ceph-daemons.yml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index 350a4dd11..b49e93946 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -224,6 +224,33 @@ - /usr/lib/systemd/system/ceph-volume@.service - /etc/systemd/system/ceph.target.wants + - name: dmcrypt extra operations + when: + - osd_scenario != 'lvm' + - dmcrypt | bool + block: + - name: remove zero(s) partuuid symlink + file: + path: /dev/disk/by-partuuid/00000000-0000-0000-0000-000000000000 + state: absent + + - name: get lockbox partitions + command: blkid -t PARTLABEL="ceph lockbox" -o device + changed_when: false + failed_when: false + register: lockbox_partitions + + - name: get lockbox devices without partuuid + command: "blkid -t PARTUUID=00000000-0000-0000-0000-000000000000 -o device {{ item }}" + changed_when: false + failed_when: false + register: lockbox_devices + with_items: '{{ lockbox_partitions.stdout_lines }}' + + - name: set guid on lockbox partition + shell: 'sgdisk --partition-guid=5:$(uuidgen) {{ item.stdout[:-2] if item.stdout is match("^/dev/(cciss|nvme|loop).*") else item.stdout[:-1] }}' + with_items: '{{ lockbox_devices.results }}' + - set_fact: ceph_uid: 64045 when: ceph_docker_image_tag | string is match("latest") or ceph_docker_image_tag | string is search("ubuntu") -- 2.39.5