Skip to content

Commit

Permalink
remove lvm_snapshots_use_boom var and change lvm_snapshots_boot_backu…
Browse files Browse the repository at this point in the history
…p default to false
  • Loading branch information
swapdisk committed Oct 5, 2023
1 parent 46ff64e commit 7a1a33f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/minor-var-changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
minor_changes:
- Changed the lvm_snapshots_boot_backup var default to false
- Removed unimplemented lvm_snapshots_use_boom var from the docs
21 changes: 7 additions & 14 deletions roles/lvm_snapshots/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# lvm_snapshots role


The `lvm_snapshots` role is used to control the creation and rollback for a defined set of LVM snapshot volumes. In addition, it can optionally save the Grub configuration and image files under /boot, create a snapshot boom entry, and configure settings to enable the LVM snapshot autoextend capability.
The `lvm_snapshots` role is used to control the creation and rollback for a defined set of LVM snapshot volumes. In addition, it can optionally save the Grub configuration and image files under /boot and configure settings to enable the LVM snapshot autoextend capability.

The role is designed to support the automation of RHEL in-place upgrades, but can also be used to reduce the risk of more mundane system maintenance activities.

Expand Down Expand Up @@ -30,16 +30,12 @@ The `revert` action will verify that all snapshots in the set are still active s

### `lvm_snapshots_boot_backup`

Boolean to specify that the `create` action should preserve the Grub configuration and image files under /boot required for booting the default kernel. The preserved files will be restored with a `revert` action and they will be deleted with a `remove` action. The files are preserved in a compressed tar archive at `/root/boot-backup-<lvm_snapshots_set_name>.tgz`. Default is true.
Boolean to specify that the `create` action should preserve the Grub configuration and image files under /boot required for booting the default kernel. The preserved files will be restored with a `revert` action and they will be deleted with a `remove` action. The files are preserved in a compressed tar archive at `/root/boot-backup-<lvm_snapshots_set_name>.tgz`. Default is false.

> **Warning**
>
> When automating RHEL in-place upgrades, do not perform a Grub to Grub2 migration as part of your upgrade playbook. It will invalidate your boot backup and cause a subsequent `revert` action to fail. For example, if you are using the [`upgrade`](https://github.com/redhat-cop/infra.leapp/tree/main/roles/upgrade#readme) role from the [`infra.leapp`](https://github.com/redhat-cop/infra.leapp) collection, do not set `update_grub_to_grub_2` to `true`. Grub to Grub2 migration should only be performed after the `remove` action has been performed to delete the snapshots and boot backup.
### `lvm_snapshots_use_boom`

Boolean to specify that a boom profile will be created to add a Grub boot entry for the snapshot set. Default is true.

### `lvm_snapshots_snapshot_autoextend_threshold`

Configure the given `snapshot_autoextend_threshold` setting in lvm.conf before creating snapshots.
Expand Down Expand Up @@ -72,7 +68,7 @@ To create thin provisioned snapshot of a thin provisioned volume, omit the `size

### Create snapshots

Perform space check and fail of there will not be enough space for all the snapshots in the set. If there is sufficient space, proceed to create snapshots for the listed logical volumes. Each snapshot will be sized to 20% of the origin volume size. Snapshot autoextend settings are configured to enable free space in the volume group to be allocated to any snapshot that may exceed 70% usage in the future. A boom profile will be created for the snapshot and required images files under /boot will be preserved.
Perform space check and fail of there will not be enough space for all the snapshots in the set. If there is sufficient space, proceed to create snapshots for the listed logical volumes. Each snapshot will be sized to 20% of the origin volume size. Snapshot autoextend settings are configured to enable free space in the volume group to be allocated to any snapshot that may exceed 70% usage in the future. Files under /boot will be preserved.

```yaml
- hosts: all
Expand All @@ -83,19 +79,18 @@ Perform space check and fail of there will not be enough space for all the snaps
lvm_snapshots_snapshot_autoextend_threshold: 70
lvm_snapshots_snapshot_autoextend_percent: 20
lvm_snapshots_boot_backup: true
lvm_snapshots_use_boom: true
lvm_snapshots_volumes:
- vg: rootvg
lv: root
size: 20%ORIGIN
size: 2G
- vg: rootvg
lv: var
size: 20%ORIGIN
size: 2G
```
### Rollback
This playbook rolls back the host using the snapshots created above. After verifying that all snapshots are still valid, each logical volume in the snapshot set is merged. The image files under /boot will be restored and the boom profile will be deleted. Then the host will be rebooted.
This playbook rolls back the host using the snapshots created above. After verifying that all snapshots are still valid, each logical volume in the snapshot set is merged. The image files under /boot will be restored and then the host will be rebooted.
```yaml
- hosts: all
Expand All @@ -104,12 +99,11 @@ This playbook rolls back the host using the snapshots created above. After verif
lvm_snapshots_set_name: ripu
lvm_snapshots_action: revert
lvm_snapshots_boot_backup: true
lvm_snapshots_use_boom: true
```
### Commit
A commit playbook is used when users are comfortable the snapshots are not needed any longer. Each snapshot in the snapshot set is removed, the preserved image files under /boot are unlinked and the boom profile is deleted.
A commit playbook is used when users are comfortable the snapshots are not needed any longer. Each snapshot in the snapshot set is removed and the backed up image files from /boot are deleted.
```yaml
- hosts: all
Expand All @@ -118,5 +112,4 @@ A commit playbook is used when users are comfortable the snapshots are not neede
lvm_snapshots_set_name: ripu
lvm_snapshots_action: remove
lvm_snapshots_boot_backup: true
lvm_snapshots_use_boom: true
```
3 changes: 1 addition & 2 deletions roles/lvm_snapshots/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
lvm_snapshots_volumes: []
lvm_snapshots_use_boom: true
lvm_snapshots_boot_backup: true
lvm_snapshots_boot_backup: false

0 comments on commit 7a1a33f

Please sign in to comment.