OndrejHome.ha-cluster-lvm
HA-Cluster-LVM
=========
This role is designed to set up Highly Available LVM (HA-LVM) in a Pacemaker cluster. It can create Logical Volumes (LVs) and Volume Groups (VGs) for both tagging and clustered LVM (clvm). Check the examples to see how it works.
Code specific to rgmanager has been removed and moved to a separate role - ondrejhome.ha_cluster_lvm_rgmanager.
Requirements
For RHEL, the machines should be registered and subscribed to access the 'High Availability' or 'Resilient storage' channels.
Role Variables
Type of HA-LVM:
- For EL6 and EL7, choose either 'tagging' or 'clvm'.
- For EL8 and EL9, choose either 'systemid' or 'lvmlockd'.
- Default option is 'tagging'.
HALVMtype: 'tagging'
(Optional) - This setting is only for 'tagging' mode. List other VGs to include in 'volume_list' apart from the one containing the root filesystem. The default is an empty list. Example:
local_vg_list: [ 'vg1', 'vg2' ]
(RHEL only) - Enable the required repositories:
- RHEL6:
rhel-rs-for-rhel-6-server-rpms
- RHEL7:
rhel-rs-for-rhel-7-server-rpms
- RHEL8:
rhel-8-for-x86_64-resilientstorage-rpms
- RHEL9:
rhel-9-for-x86_64-resilientstorage-rpms
enable_repos: true
- RHEL6:
(RHEL only) - Enable extended update (EUS) repositories for required packages:
- RHEL6:
rhel-rs-for-rhel-6-server-eus-rpms
- RHEL7:
rhel-rs-for-rhel-7-server-eus-rpms
- RHEL8:
rhel-8-for-x86_64-resilientstorage-eus-rpms
- RHEL9:
rhel-9-for-x86_64-resilientstorage-eus-rpms
enable_eus_repos: false
- RHEL6:
Example Playbooks
For tagging HA-LVM:
- hosts: servers roles: - { role: 'ondrejhome.ha-cluster-lvm' }
For tagging HA-LVM with extra local VG names 'vg_local':
- hosts: servers roles: - { role: 'ondrejhome.ha-cluster-lvm', local_vg_list: [ 'vg_local' ] }
For clvm variant of HA-LVM:
- hosts: servers roles: - { role: 'ondrejhome.ha-cluster-lvm', HALVMtype: 'clvm' }
For systemid variant of HA-LVM:
- hosts: servers roles: - { role: 'ondrejhome.ha-cluster-lvm', HALVMtype: 'systemid' }
For lvmlockd variant of HA-LVM:
- hosts: servers roles: - { role: 'ondrejhome.ha-cluster-lvm', HALVMtype: 'lvmlockd' }
For tagged variant with one VG and one LV covering the whole VG:
- hosts: servers vars: tagging_vgs: - name: 'vg_shared' pvs: '/dev/sdb' lvs: - name: 'lv_name5' size: '200M' roles: - { role: 'ondrejhome.ha-cluster-lvm' }
For clvm variant combined with tagging and creating VGs/LVs:
- hosts: servers vars: local_vg_list: - 'vg_clvm' clvm_vgs: - name: 'vg_clvm' pvs: '/dev/sdb2' lvs: - name: 'lv_name1' size: '200M' - name: 'lv_name2' size: '100M' tagging_vgs: - name: 'vg_shared' pvs: '/dev/sdb1' lvs: - name: 'lv_name3' size: '200M' - name: 'lv_name4' size: '100M' roles: - { role: 'ondrejhome.ha-cluster-lvm', HALVMtype: 'clvm' }
For systemid variant with one VG and one LV covering the entire VG:
- hosts: servers vars: systemid_vgs: - name: 'vg_systemid' pvs: '/dev/sdb' lvs: - name: 'lv_name5' size: '200M' roles: - { role: 'ondrejhome.ha-cluster-lvm', HALVMtype: 'systemid' }
For lvmlockd variant with one VG and one LV covering the entire VG:
- hosts: servers vars: lvmlockd_vgs: - name: 'vg_lvmlockd' pvs: '/dev/sdb' lvs: - name: 'lv_name6' size: '200M' roles: - { role: 'ondrejhome.ha-cluster-lvm', HALVMtype: 'lvmlockd' }
License
GPLv3
Author Information
This role has been manually tested on a limited number of platforms and might not cover all scenarios.
- 2022-09 tested on: RHEL 8.2/8.6/9.0, AlmaLinux 8.6/9.0 using the systemid approach
- 2022-10 tested on: CentOS 6.10, RHEL 6.10 using tagging and clvm
For any inquiries, you can email the author at ondrej-xa2iel8u@famera.cz or create an issue on GitHub for feature requests.
Setup HA-LVM (tagging/clvmd/systemid/lvmlockd) on pacemaker cluster on EL6/7/8/9
ansible-galaxy install OndrejHome.ha-cluster-lvm