vios_maintenance – Manage the vios backup

Synopsis

Create a VIOS backup file

List VIOS backup file details

Modify the name of the VIOS backup file

Remove a VIOS backup file

Restore a VIOS backup

Parameters

hmc_host (True, str, None)

The IP address or hostname of the HMC.

hmc_auth (True, dict, None)

Username and Password credential of the HMC.

username (True, str, None)

Username of the HMC to login.

password (optional, str, None)

Password of the HMC.

attributes (True, dict, None)

Configuration parameters required for VIOS backup and restore.

types (True, str, None)

The type of VIOS backup to create.

Valid values are viosioconfigfor a VIOS I/O configuration backup, vios for a full VIOS backup, ssp for a Shared Storage Pool configuration backup.

system (optional, str, None)

The name of the managed system which has the VIOS to backup.

vios_id (optional, str, None)

The ID of the VIOS to backup. vios_id, vios_uuid, vios_name are mutually exclusive.

vios_uuid (optional, str, None)

The UUID of the VIOS to backup. vios_id, vios_uuid, vios_name are mutually exclusive.

vios_name (optional, str, None)

The name of the VIOS to backup. vios_id, vios_uuid, vios_name are mutually exclusive.

backup_name (optional, str, None)

The name of the file where the backup will be saved.

file_list (optional, list, None)

The list of the backup files that needs to be removed. This option is for remove state only. Add backup file name as comma seperated values.

nimol_resource (optional, int, None)

Option to include the NIMOL resources. 1 to include and 0 to not include the NIMOL resources. This option is only valid when creating a full VIOS backup.

media_repository (optional, int, None)

Option to include the contents of the media repository. 1 to include and 0 to not include the media resources. This option is only valid when creating a full VIOS backup.

volume_group_structure (optional, int, None)

Option to include the volume groups structure of user. 1 to include and 0 to not include the volume groups structure of user. This option is only valid when creating a full VIOS backup.

restart (optional, bool, None)

Specify this option to restart the VIOS if required. True to restart the VIOS and False not to restart the VIOS. Valid for restore state only.

new_name (optional, str, None)

The attributes to change the name of the backup file. Valid for modify state only.

state (optional, str, None)

facts does not change anything on the HMC and returns list of backup files of a VIOS.

present ensures the new backup file is created for the specified VIOS.

absent ensures the specified backup file/s is removed from the HMC.

restore ensures the backup file is restored.

modify ensures that the name of the backup file is changed in HMC.

Notes

Note

  • All Operations support passwordless authentication.

Examples

- name: Create a viosioconfig backup file
  vios_maintenance:
    hmc_host: "{{ inventory_hostname }}"
    hmc_auth:
         username: '{{ ansible_user }}'
         password: '{{ hmc_password }}'
    attributes:
        vios_name: <vios name>
        backup_name: test
        system: <sys>
        types: viosioconfig
    state: present

- name: Restore a vios from test backup file
  vios_maintenance:
    hmc_host: "{{ inventory_hostname }}"
    hmc_auth:
         username: '{{ ansible_user }}'
         password: '{{ hmc_password }}'
    attributes:
        vios_name: <vios name>
        backup_name: test.tar.gz
        system: <sys>
        types: viosioconfig
    state: restore

- name: Remove a backup file
  vios_maintenance:
    hmc_host: "{{ inventory_hostname }}"
    hmc_auth:
         username: '{{ ansible_user }}'
         password: '{{ hmc_password }}'
    attributes:
        vios_name: <vios name>
        backup_name: test.tar.gz
        system: <sys>
        types: viosioconfig
    state: absent

- name: Rename the backup file
  vios_maintenance:
    hmc_host: "{{ inventory_hostname }}"
    hmc_auth:
         username: '{{ ansible_user }}'
         password: '{{ hmc_password }}'
    attributes:
        vios_name: <vios name>
        backup_name: test.tar.gz
        new_name: new.tar.gz
        system: <sys>
        types: viosioconfig
    state: modify

Return Values

Command_output (on success of all states except C(absent), dict, )

Respective user configuration

Status

  • This module is not guaranteed to have a backwards compatible interface. [preview]

  • This module is maintained by community.

Authors

  • Sreenidhi S(@SreenidhiS1)