Ansible Role: nim_alt_disk_migration

The IBM Power Systems AIX collection provides an Ansible role, referred to as nim_alt_disk_migration, which assists in automating in migration in migration of AIX 7.1/7.2 to AIX 7.3.

For guides and reference, see the Docs Site.

Requirements

None.

Role Variables

Available variables are listed below, along with default values:

Role Variables
Variable Options Required Default Choices Comments
nim_alt_disk_migration_nim_client true Specifies a NIM object name that is associated to the NIM client machine to be migrated.
nim_alt_disk_migration_target_disk true
disk_name Specifies the physical volume by name where the alternate disk will be created.
disk_size_policy minimize, upper, lower, nearest Specifies the disk size policy to automatically determine a valid physical volume that fits the policy where the alternate disk will be created. If an alternate disk named 'altinst_rootvg' or 'old_rootvg' exists, the role will fail unless force option is used.
force false If physical volume specified by nim_alt_disk_migration_target_disk.disk_name belongs to 'altinst_rootvg', 'old_rootvg', or a varied on volume group then that physical volume will be cleaned up. If nim_alt_disk_migration_target_disk.disk_size_policy is specified and an alternate disk named 'altinst_rootvg' or 'old_rootvg' already exists, then it will clean up the physical volume it occupies.
nim_alt_disk_migration_lpp_source true Specifies a NIM object name associated to a LPP resource for the desired level of migration.
nim_alt_disk_migration_spot false Specifies a NIM object name associated to a SPOT resource.
nim_alt_disk_migration_nimadm_cache_vg false Specifies the volume group(on the NIM master) on which file systems are created and streams are used to cache all of the data from the client to these file systems
nim_alt_disk_migration_nimadm_bundle false Specifies the installp_bundle NIM resource.
nim_alt_disk_migration_nimadm_premig_script false Specifies the pre-migration NIM script resource.
nim_alt_disk_migration_nimadm_postmig_script false Specifies the post-migration NIM script resource.
nim_alt_disk_migration_nimadm_phases_to_run false Specifies the phase to execute during the invocation of the nimadm command.
nim_alt_disk_migration_reboot_client false false Specifies if the NIM client LPAR will be automatically rebooted after successfully creating the alternate disk.
nim_alt_disk_migration_control_phases false
validate_nim_resources true If set to false, then it will skip validation of NIM resources.
perform_migration true If set to false, then it will skip the actual migration task

NOTES:

  • minimize disk size policy chooses smallest disk that can be selected.

  • upper disk size policy chooses the first disk found bigger than the rootvg disk.

  • lower disk size policy chooses a disk that is less than rootvg disk size but big enough to contain the used PPs.

  • nearest disk size policy chooses a disk closest to the rootvg disk in terms of size.

  • if upper or lower cannot be satisfied, it will default to minimize.

  • if you are using the role to ONLY validate the NIM resources then the nim_alt_disk_migration_nim_client variable is not required.

  • if a nim_alt_disk_migration_spot is not specified, one will be automatically created using the specified nim_alt_disk_migration_lpp_source.

Dependencies

None.

Example Playbook

- name: Perfrom an alternate disk migration using hdisk1. Let the role build the SPOT.
    hosts: aix
    gather_facts: no
    tasks:
      - include_role:
          name: nim_alt_disk_migration
        vars:
          nim_alt_disk_migration_nim_client: p9zpa-ansible-test1
          nim_alt_disk_migration_target_disk:
            disk_name: hdisk1
          nim_alt_disk_migration_lpp_source: lpp_2134A_730
- name: Perform an alternate disk migration and let the role choose the disk.
  hosts: aix
  gather_facts: no
  tasks:
    - include_role:
        name: nim_alt_disk_migration
      vars:
        nim_alt_disk_migration_nim_client: p9zpa-ansible-test1
        nim_alt_disk_migration_target_disk:
          disk_size_policy: minimize
        nim_alt_disk_migration_lpp_source: lpp_2134A_730
        nim_alt_disk_migration_spot: spot_2134A_730
# Useful when migrating multiple nodes concurrently. Use first the role to perform the
# validation of the resources only once. Then you can migrate the nodes without doing verifications.

- name: Validate the nim lpp and spot resources and exit the playbook.
  hosts: aix
  gather_facts: no
  tasks:
    - include_role:
        name: nim_alt_disk_migration
      vars:
        nim_alt_disk_migration_lpp_source: lpp_2134A_730
        nim_alt_disk_migration_spot: spot_2134A_730
        nim_alt_disk_migration_control_phases:
          validate_nim_resources: true
          perform_nim_migration: false
# Useful when migrating multiple nodes concurrently. The role will prevent the validation
# of the resources and just perform the migration. The role still will perform specific 
# validations for the nim client such as connectity, OS level and valid hardware platform
# for the OS.

- name: Perform an alternate disk without the lpp or spot resources validation.
  hosts: aix
  gather_facts: no
  tasks:
    - include_role:
        name: nim_alt_disk_migration
      vars:
        nim_alt_disk_migration_nim_client: p9zpa-ansible-test1
        nim_alt_disk_migration_target_disk:
          disk_size_policy: minimize
        nim_alt_disk_migration_lpp_source: lpp_2134A_730
        nim_alt_disk_migration_spot: spot_2134A_730
        nim_alt_disk_migration_control_phases:
          validate_nim_resources: false
          perform_nim_migration: true
# For debugging purposes: nim_alt_disk_migration_debug_skip_nimadm: true
# Similar to modules "check_mode". Useful to execute all the validations and just exit before
# performing the migration. 

- name: Preview an alternate disk migration. Exit before running nimadm
  hosts: aix
  gather_facts: no
  tasks:
    - include_role:
        name: nim_alt_disk_migration
      vars:
        nim_alt_disk_migration_nim_client: p9zpa-ansible-test1
        nim_alt_disk_migration_target_disk:
          disk_size_policy: minimize
        nim_alt_disk_migration_lpp_source: lpp_2134A_730
        nim_alt_disk_migration_spot: spot_2134A_730
        nim_alt_disk_migration_control_phases:
          validate_nim_resources: true
          perform_nim_migration: true
        nim_alt_disk_migration_debug_skip_nimadm: true