6 - name: stop ceph-osd@2 daemon
11 - name: stop ceph-osd@0 daemon
22 command: "ceph --cluster {{ cluster }} osd destroy osd.2 --yes-i-really-mean-it"
25 command: "ceph --cluster {{ cluster }} osd destroy osd.0 --yes-i-really-mean-it"
34 command: "ceph-volume --cluster {{ cluster }} lvm zap /dev/sdd1 --destroy"
40 command: "ceph-volume --cluster {{ cluster }} lvm zap /dev/sdd2 --destroy"
44 # partitions have been completely removed, so re-create them again
45 - name: re-create partition /dev/sdd for lvm data usage
55 - name: re-create partition /dev/sdd lvm journals
65 - name: redeploy osd.2 using /dev/sdd1
66 command: "ceph-volume --cluster {{ cluster }} lvm create --filestore --data /dev/sdd1 --journal /dev/sdd2 --osd-id 2"
71 # note: we don't use --destroy here to test this works without that flag.
72 # --destroy is used in the bluestore tests
73 - name: zap test_group/data-lv1
74 command: "ceph-volume --cluster {{ cluster }} lvm zap test_group/data-lv1"
78 # osd.0 journal device (zap without --destroy that removes the LV)
80 command: "ceph-volume --cluster {{ cluster }} lvm zap /dev/sdc1"
84 - name: prepare osd.0 again using test_group/data-lv1
85 command: "ceph-volume --cluster {{ cluster }} lvm prepare --filestore --data test_group/data-lv1 --journal /dev/sdc1 --osd-id 0"
89 - name: find all OSD paths
91 paths: /var/lib/ceph/osd
96 # set all OSD paths to root:rootto ensure that the OSD will be able to
98 - name: mangle permissions to root
100 path: "{{ item.path }}"
105 - "{{ osd_paths.files }}"
107 - name: stop ceph-osd@2 daemon
112 - name: stop ceph-osd@1 daemon
117 - name: activate all to start the previously prepared osd.0
118 command: "ceph-volume lvm activate --filestore --all"
122 - name: list all OSDs
123 command: "ceph-volume lvm list"
127 - name: create temporary directory
133 - name: create a 5GB sparse file
134 command: fallocate -l 5G {{ tmpdir.path }}/sparse.file
136 - name: find an empty loop device
138 register: losetup_list
140 - name: setup loop device with sparse file
141 command: losetup {{ losetup_list.stdout }} {{ tmpdir.path }}/sparse.file
143 - name: create volume group
144 command: vgcreate test_zap {{ losetup_list.stdout }}
147 - name: create logical volume 1
148 command: lvcreate --yes -l 50%FREE -n data-lv1 test_zap
151 - name: create logical volume 2
152 command: lvcreate --yes -l 50%FREE -n data-lv2 test_zap
155 # zapping the first lv shouldn't remove the vg, allowing the second zap to succeed
156 - name: zap test_zap/data-lv1
157 command: "ceph-volume --cluster {{ cluster }} lvm zap --destroy test_zap/data-lv1"
161 - name: zap test_zap/data-lv2
162 command: "ceph-volume --cluster {{ cluster }} lvm zap --destroy test_zap/data-lv2"