Create the snapshots backed with the lv_thinpool pool

Due to the RFE: https://bugzilla.redhat.com/show_bug.cgi?id=2066349, the pool lv_thinpool has been added to the image to create the snapshots backed with this pool. Thus it is not needed to maintain free space in the volume group for the snapshot and revert functionality, and the condition of the 8GB of space is not required.

Delete references to lv_snapshot since it is no longer present.

Change-Id: I6c6341a1d27c9964af7460886789564bdea4066d
(cherry picked from commit d834934152)
This commit is contained in:
Fernando Diaz 2023-03-15 10:31:52 +01:00 committed by Fernando Díaz Bravo
parent ed92975ca7
commit b6f960a50d
2 changed files with 26 additions and 52 deletions

View File

@ -17,13 +17,6 @@
tripleo_controller_group_name: "{{ controller_group_name | default('Controller') }}"
tripleo_compute_group_name: "{{ compute_group_name | default('Compute') }}"
tripleo_snapshot_revert_audit_size: 512M
tripleo_snapshot_revert_home_size: 512M
tripleo_snapshot_revert_log_size: 1G
tripleo_snapshot_revert_root_size: 2G
tripleo_snapshot_revert_srv_size: 512M
tripleo_snapshot_revert_var_size: 3G
# These parameters ensure that nodes are taken out from Pacemaker cluster
# before taking a snapshot, one node at a time to not cause any downtimes.
tripleo_snapshot_revert_snapshot_inactive_nodes: "{{ snapshot_inactive_nodes | default('true') }}"

View File

@ -47,19 +47,6 @@
tags:
- revert_snapshots
- name: Delete the lv_snapshot volume if it exists
command: lvremove -f /dev/vg/lv_snapshot
when:
- ansible_facts.lvm is defined
- ansible_facts.lvm.lvs is defined
- ansible_facts.lvm.vgs is defined
- ansible_facts.lvm.vgs.vg is defined
- ansible_facts.lvm.lvs.lv_snapshot is defined
- ansible_facts.lvm.lvs.lv_snapshot.size_g|float >= 8.00
tags:
- create_snapshots
- remove_lv_snapshot
- name: Remove LVM snapshots
when:
- ansible_facts.lvm is defined
@ -93,22 +80,6 @@
tags:
- remove_snapshots
- name: Check existing snapshots
block:
- name: Find snapshot files
find:
path: /dev/vg
patterns: ['ss_home','ss_log','ss_root','ss_srv','ss_var','ss_audit']
file_type: "link"
register: snapshots_found
- name: Evaluate result
fail: msg="Snapshot {{ item['path'] }} already exist in the filesystem"
loop: "{{ snapshots_found.files }}"
when: snapshots_found.matched > 0
tags:
- create_snapshots
- name: Read Services running on the host
command: puppet lookup --explain 'service_names'
when: tripleo_snapshot_revert_snapshot_inactive_nodes|bool
@ -127,37 +98,47 @@
tags:
- create_snapshots
- name: Create lvm snapshot if there are at least 8GB of free space in the vg volumegroup
- name: Create lvm snapshot using the lv_thinpool
when:
- ansible_facts.lvm is defined
- ansible_facts.lvm.lvs is defined
- ansible_facts.lvm.vgs is defined
- ansible_facts.lvm.vgs.vg is defined
- ansible_facts.lvm.vgs.vg.free_g|float >= 8.00
- ansible_facts.lvm.lvs.lv_thinpool is defined
block:
- name: Create audit snapshot volume
command: lvcreate -s -n ss_audit -L {{ tripleo_snapshot_revert_audit_size }} /dev/vg/lv_audit
when: ansible_facts.lvm.lvs.lv_audit is defined
command: lvcreate -s -n ss_audit --thinpool lv_thinpool /dev/vg/lv_audit
when:
- ansible_facts.lvm.lvs.lv_audit is defined
- ansible_facts.lvm.lvs.ss_audit is not defined
- name: Create home snapshot volume
command: lvcreate -s -n ss_home -L {{ tripleo_snapshot_revert_home_size }} /dev/vg/lv_home
when: ansible_facts.lvm.lvs.lv_home is defined
command: lvcreate -s -n ss_home --thinpool lv_thinpool /dev/vg/lv_home
when:
- ansible_facts.lvm.lvs.lv_home is defined
- ansible_facts.lvm.lvs.ss_home is not defined
- name: Create log snapshot volume
command: lvcreate -s -n ss_log -L {{ tripleo_snapshot_revert_log_size }} /dev/vg/lv_log
when: ansible_facts.lvm.lvs.lv_log is defined
command: lvcreate -s -n ss_log --thinpool lv_thinpool /dev/vg/lv_log
when:
- ansible_facts.lvm.lvs.lv_log is defined
- ansible_facts.lvm.lvs.ss_log is not defined
- name: Create root snapshot volume
command: lvcreate -s -n ss_root -L {{ tripleo_snapshot_revert_root_size }} /dev/vg/lv_root
when: ansible_facts.lvm.lvs.lv_root is defined
command: lvcreate -s -n ss_root --thinpool lv_thinpool /dev/vg/lv_root
when:
- ansible_facts.lvm.lvs.lv_root is defined
- ansible_facts.lvm.lvs.ss_root is not defined
- name: Create srv snapshot volume
command: lvcreate -s -n ss_srv -L {{ tripleo_snapshot_revert_srv_size }} /dev/vg/lv_srv
when: ansible_facts.lvm.lvs.lv_srv is defined
command: lvcreate -s -n ss_srv --thinpool lv_thinpool /dev/vg/lv_srv
when:
- ansible_facts.lvm.lvs.lv_srv is defined
- ansible_facts.lvm.lvs.ss_srv is not defined
- name: Create var snapshot volume
command: lvcreate -s -n ss_var -L {{ tripleo_snapshot_revert_var_size }} /dev/vg/lv_var
when: ansible_facts.lvm.lvs.lv_var is defined
command: lvcreate -s -n ss_var --thinpool lv_thinpool /dev/vg/lv_var
when:
- ansible_facts.lvm.lvs.lv_var is defined
- ansible_facts.lvm.lvs.ss_var is not defined
tags:
- create_snapshots