From 66c1ea8cd561fce6cfe5cdd1ecaa13411c824e3a Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Fri, 20 Apr 2018 11:13:51 +0200 Subject: [PATCH] shrink-osd: ability to shrink NVMe drives MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Now if the service name contains nvme we know we need to remove the last 2 character instead of 1. If nvme then osd_to_kill_disks is nvme0n1, we need nvme0 If ssd or hdd then osd_to_kill_disks is sda1, we need sda Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1561456 Signed-off-by: Sébastien Han --- infrastructure-playbooks/shrink-osd.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/infrastructure-playbooks/shrink-osd.yml b/infrastructure-playbooks/shrink-osd.yml index 6e8b29c4f..e9c3ca947 100644 --- a/infrastructure-playbooks/shrink-osd.yml +++ b/infrastructure-playbooks/shrink-osd.yml @@ -116,9 +116,11 @@ when: - containerized_deployment + # if nvme then osd_to_kill_disks is nvme0n1, we need nvme0 + # if ssd or hdd then osd_to_kill_disks is sda1, we need sda - name: stop osd services (container) service: - name: "ceph-osd@{{ item.0.stdout[:-1] | regex_replace('/dev/', '') }}" + name: "ceph-osd@{{ item.0.stdout[:-2] | regex_replace('/dev/', '') if 'nvme' in item.0.stdout else item.0.stdout[:-1] | regex_replace('/dev/', '') }}" state: stopped enabled: no with_together: -- 2.39.5