]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
shrink-osd: ability to shrink NVMe drives
authorSébastien Han <seb@redhat.com>
Fri, 20 Apr 2018 09:13:51 +0000 (11:13 +0200)
committerSébastien Han <seb@redhat.com>
Fri, 20 Apr 2018 15:04:26 +0000 (17:04 +0200)
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 <seb@redhat.com>
(cherry picked from commit 66c1ea8cd561fce6cfe5cdd1ecaa13411c824e3a)
Signed-off-by: Sébastien Han <seb@redhat.com>
infrastructure-playbooks/shrink-osd.yml

index 6e8b29c4f102b858e2423bc154f81cc4905403f0..e9c3ca947709b16982eda65740b104a9569b96f8 100644 (file)
       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: