2018-07-24 21:33:09 +08:00
|
|
|
- name: creates logical volumes for the bucket index or fs journals on a single device and prepares for use of osd_scenario=lvm.
|
2018-08-09 05:48:42 +08:00
|
|
|
become: true
|
2018-07-24 21:33:09 +08:00
|
|
|
hosts:
|
|
|
|
- osds
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- name: include vars of lv_vars.yaml
|
|
|
|
include_vars:
|
|
|
|
file: lv_vars.yaml
|
2018-08-09 05:49:34 +08:00
|
|
|
failed_when: false
|
2018-07-24 21:33:09 +08:00
|
|
|
|
|
|
|
# need to check if lvm2 is installed
|
|
|
|
- name: install lvm2
|
|
|
|
package:
|
|
|
|
name: lvm2
|
|
|
|
state: present
|
|
|
|
|
|
|
|
# Make entire nvme device a VG
|
|
|
|
- name: add nvme device as lvm pv
|
|
|
|
lvg:
|
|
|
|
force: yes
|
2018-08-04 04:08:31 +08:00
|
|
|
pvs: "{{ nvme_device }}"
|
2018-07-24 21:33:09 +08:00
|
|
|
pesize: 4
|
|
|
|
state: present
|
2018-08-04 04:08:31 +08:00
|
|
|
vg: "{{ nvme_vg_name }}"
|
2018-07-24 21:33:09 +08:00
|
|
|
|
|
|
|
- name: create lvs for fs journals for the bucket index on the nvme device
|
|
|
|
lvol:
|
2018-08-04 04:08:31 +08:00
|
|
|
lv: "{{ item.journal_name }}"
|
|
|
|
vg: "{{ nvme_vg_name }}"
|
|
|
|
size: "{{ journal_size }}"
|
|
|
|
pvs: "{{ nvme_device }}"
|
2018-07-24 21:33:09 +08:00
|
|
|
with_items:
|
|
|
|
- "{{ nvme_device_lvs }}"
|
|
|
|
|
|
|
|
- name: create lvs for fs journals for hdd devices
|
|
|
|
lvol:
|
|
|
|
lv: "{{ hdd_journal_prefix }}-{{ item.split('/')[-1] }}"
|
2018-08-04 04:08:31 +08:00
|
|
|
vg: "{{ nvme_vg_name }}"
|
|
|
|
size: "{{ journal_size }}"
|
2018-07-24 21:33:09 +08:00
|
|
|
with_items:
|
|
|
|
- "{{ hdd_devices }}"
|
|
|
|
|
|
|
|
- name: create the lv for data portion of the bucket index on the nvme device
|
|
|
|
lvol:
|
2018-08-04 04:08:31 +08:00
|
|
|
lv: "{{ item.lv_name }}"
|
|
|
|
vg: "{{ nvme_vg_name }}"
|
|
|
|
size: "{{ item.size }}"
|
|
|
|
pvs: "{{ nvme_device }}"
|
2018-07-24 21:33:09 +08:00
|
|
|
with_items:
|
|
|
|
- "{{ nvme_device_lvs }}"
|
|
|
|
|
|
|
|
# Make sure all hdd devices have a unique volume group
|
|
|
|
- name: create vgs for all hdd devices
|
|
|
|
lvg:
|
|
|
|
force: yes
|
2018-08-04 04:08:31 +08:00
|
|
|
pvs: "{{ item }}"
|
2018-07-24 21:33:09 +08:00
|
|
|
pesize: 4
|
|
|
|
state: present
|
|
|
|
vg: "{{ hdd_vg_prefix }}-{{ item.split('/')[-1] }}"
|
|
|
|
with_items:
|
|
|
|
- "{{ hdd_devices }}"
|
|
|
|
|
|
|
|
- name: create lvs for the data portion on hdd devices
|
|
|
|
lvol:
|
|
|
|
lv: "{{ hdd_lv_prefix }}-{{ item.split('/')[-1] }}"
|
2018-08-04 04:08:31 +08:00
|
|
|
vg: "{{ hdd_vg_prefix }}-{{ item.split('/')[-1] }}"
|
|
|
|
size: "{{ hdd_lv_size }}"
|
2018-07-24 21:33:09 +08:00
|
|
|
pvs: "{{ item }}"
|
|
|
|
with_items:
|
|
|
|
- "{{ hdd_devices }}"
|
|
|
|
|
2018-08-09 05:43:55 +08:00
|
|
|
- name: "write output for osds.yml to {{ logfile_path }}"
|
|
|
|
become: false
|
|
|
|
template:
|
|
|
|
src: "templates/lv-create-log.j2"
|
|
|
|
dest: "{{ logfile_path }}"
|
2018-07-24 21:33:09 +08:00
|
|
|
delegate_to: localhost
|