]> git.proxmox.com Git - ceph.git/blob - ceph/src/ceph-volume/ceph_volume/tests/functional/lvm/playbooks/test_bluestore.yml
update sources to 12.2.10
[ceph.git] / ceph / src / ceph-volume / ceph_volume / tests / functional / lvm / playbooks / test_bluestore.yml
1
2 - hosts: osds
3 become: yes
4 tasks:
5
6 - name: stop ceph-osd@2 daemon
7 service:
8 name: ceph-osd@2
9 state: stopped
10
11 - name: stop ceph-osd@0 daemon
12 service:
13 name: ceph-osd@0
14 state: stopped
15
16
17 - hosts: mons
18 become: yes
19 tasks:
20
21 - name: destroy osd.2
22 command: "ceph --cluster {{ cluster }} osd destroy osd.2 --yes-i-really-mean-it"
23
24 - name: destroy osd.0
25 command: "ceph --cluster {{ cluster }} osd destroy osd.0 --yes-i-really-mean-it"
26
27
28 - hosts: osds
29 become: yes
30 tasks:
31
32 # osd.2 device
33 - name: zap /dev/sdd1
34 command: "ceph-volume --cluster {{ cluster }} lvm zap /dev/sdd1 --destroy"
35 environment:
36 CEPH_VOLUME_DEBUG: 1
37
38 - name: redeploy osd.2 using /dev/sdd1
39 command: "ceph-volume --cluster {{ cluster }} lvm create --bluestore --data /dev/sdd1 --osd-id 2"
40 environment:
41 CEPH_VOLUME_DEBUG: 1
42
43 # osd.0 device (zap without --destroy that removes the LV)
44 - name: zap test_group/data-lv1
45 command: "ceph-volume --cluster {{ cluster }} lvm zap test_group/data-lv1"
46 environment:
47 CEPH_VOLUME_DEBUG: 1
48
49 - name: prepare osd.0 again using test_group/data-lv1
50 command: "ceph-volume --cluster {{ cluster }} lvm prepare --bluestore --data test_group/data-lv1 --osd-id 0"
51 environment:
52 CEPH_VOLUME_DEBUG: 1
53
54 - name: activate all to start the previously prepared osd.0
55 command: "ceph-volume lvm activate --all"
56 environment:
57 CEPH_VOLUME_DEBUG: 1
58
59 - name: list all OSDs
60 command: "ceph-volume lvm list"
61 environment:
62 CEPH_VOLUME_DEBUG: 1
63
64 - name: create temporary directory
65 tempfile:
66 state: directory
67 suffix: sparse
68 register: tmpdir
69
70 - name: create a 5GB sparse file
71 command: fallocate -l 5G {{ tmpdir.path }}/sparse.file
72
73 - name: find an empty loop device
74 command: losetup -f
75 register: losetup_list
76
77 - name: setup loop device with sparse file
78 command: losetup {{ losetup_list.stdout }} {{ tmpdir.path }}/sparse.file
79
80 - name: create volume group
81 command: vgcreate test_zap {{ losetup_list.stdout }}
82 failed_when: false
83
84 - name: create logical volume 1
85 command: lvcreate --yes -l 50%FREE -n data-lv1 test_zap
86 failed_when: false
87
88 - name: create logical volume 2
89 command: lvcreate --yes -l 50%FREE -n data-lv2 test_zap
90 failed_when: false
91
92 # zapping the first lv shouldn't remove the vg, allowing the second zap to succeed
93 - name: zap test_zap/data-lv1
94 command: "ceph-volume --cluster {{ cluster }} lvm zap --destroy test_zap/data-lv1"
95 environment:
96 CEPH_VOLUME_DEBUG: 1
97
98 - name: zap test_zap/data-lv2
99 command: "ceph-volume --cluster {{ cluster }} lvm zap --destroy test_zap/data-lv2"
100 environment:
101 CEPH_VOLUME_DEBUG: 1