Skip to main content

Overview of Backup Operations Demos

Overview

Backup Demos in the playbooks directory provide examples of how to perform backup operations on AIX systems using Ansible. These demos include tasks for creating volume groups, logical volumes, and filesystems, as well as mounting and unmounting filesystems. They also demonstrate how to create, view, and move backup images.

Backup Operations on rootvg

The playbooks/demo_backup_rootvg.yml playbook demonstrates how to back up the root volume group (rootvg) using the mksysb and alt_disk_mksysb commands. This playbook includes tasks for creating a mksysb image, viewing the image, and moving it to a different location.


The playbook playbooks/demo_backup_rootvg.yml starts by defining the hosts and remote user for the backup operations.

- name: "Backup operations on rootvg using mksysb and alt_disk_mksysb for AIX"
hosts: ansible-test1
remote_user: root

Backup Operations on datavg

The playbooks/demo_backup_datavg.yml playbook demonstrates backup operations on a data volume group (datavg) using the savevg and restvg commands. This playbook includes tasks for creating and removing volume groups, logical volumes, and filesystems, as well as mounting and unmounting filesystems. It also shows how to create a savevg backup image, view the image, and restore it using the restvg command.

Main Functions

There are several main functions in the backup demos, including creating volume groups, creating logical volumes, creating filesystems, mounting filesystems, creating backup images, viewing backup images, moving backup images, unmounting filesystems, deleting volume groups, and restoring backup images. Below, we will dive into creating, viewing, and restoring backup images.

Create Backup Images

The create backup images function is used to create a mksysb image of the root volume group (rootvg). This task uses the ibm.power_aix.backup module with the create action to generate the backup image at the specified location.


The task for creating a mksysb image of rootvg is defined in the playbooks/demo_backup_rootvg.yml playbook.

    - name: Create a mksysb image of rootvg
ibm.power_aix.backup:
action: create
type: "{{ type }}"
location: "{{ location_create }}"
exclude_files: "{{ exclude_files }}"
extend_fs: "{{ extend_fs }}"
exclude_packing_files: "{{ exclude_packing_files }}"
flags: "{{ mksysb_flags }}"
force: "{{ force }}"
register: result

View Backup Images

The view backup images function is used to view the details of the created mksysb image. This task uses the ibm.power_aix.backup module with the view action to display the backup image information.


The task for viewing the mksysb image is defined in the playbooks/demo_backup_rootvg.yml playbook.

    - name: View the mksysb image
ibm.power_aix.backup:
action: view
type: "{{ type }}"
location: "{{ location_create }}"
register: result
- ansible.builtin.debug:
var: result

Restore Backup Images

The restore backup images function is used to restore a savevg backup image of the data volume group (datavg). This task uses the ibm.power_aix.backup module with the restore action to restore the backup image to the specified disk.


The task for restoring a savevg backup image of datavg is defined in the playbooks/demo_backup_datavg.yml playbook.

    - name: Restvg to restore the backup image
ibm.power_aix.backup:
action: restore
type: "{{ type_v }}"
name: "{{ disk_name_v }}"
location: "{{ location_v }}"
data_file: "{{ data_file_v }}"
exclude_data: "{{ exclude_data_v }}"
minimize_lv_size: "{{ minimize_lv_size_v }}"
flags: "{{ restvg_flags_v }}"

 

This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human