AIX

 View Only

Migrating to AIX 7.3 with nimadm and Ansible

By Chris Gibson posted Tue March 12, 2024 11:36 PM

  

Migrating to AIX 7.3 with nimadm and Ansible

If you’re familiar with my work, you’ll know that I’m a big fan of nimadm. Recently I used nimadm with Ansible to migrate to AIX 7.3. I migrated my LPAR from AIX 7.2 to AIX 7.3 using nimadm with Ansible.

Key to this functionality is the IBM AIX Ansible Galaxy collection, which includes the nim_alt_disk_migration Ansible role. See links below.

https://ibm.github.io/ansible-power-aix/roles/nim_alt_disk_migration.html

https://galaxy.ansible.com/ui/repo/published/ibm/power_aix/content/?showing=role

https://galaxy.ansible.com/ui/repo/published/ibm/power_aix/content/role/nim_alt_disk_migration/

https://community.ibm.com/community/user/power/discussion/share-your-thoughts-on-aix-automation-use-cases-of-high-value

The AIX collection can be installed on an Ansible controller, using the ansible-galaxy command. For example:

# ansible-galaxy collection install ibm.power_aix

Starting galaxy collection install process

Process install dependency map

Starting collection install process

Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ibm-power_aix-1.8.1.tar.gz to /.ansible/tmp/ansible-local-18940242l9h2dd6s/tmpquf013tl/ibm-power_aix-1.8.1-l3w6ehd7

Installing 'ibm.power_aix:1.8.1' to '/.ansible/collections/ansible_collections/ibm/power_aix'

ibm.power_aix:1.8.1 was installed successfully

In my lab, version 1.8.1 of the collection was installed:

# ansible-galaxy collection list ibm.power_aix

# /.ansible/collections/ansible_collections

Collection    Version

------------- -------

ibm.power_aix 1.8.1

This Ansible role, nim_alt_disk_migration, can be used for “migrating an alternate disk to a higher AIX level”.

Here’s the playbook I used, called nimadm.yml:

---

- name: NIMADM playbook

  hosts: aixmig

  gather_facts: no

  collections:

    ibm.power_aix

  tasks:

    - include_role:

        name: nim_alt_disk_migration

        apply:

          delegate_to: lpar1

      vars:

        nimadm_cache_vg: nimadmvg

        nim_client: aixmig

        target_disk:

          disk_name: hdisk0

        lpp_source: AIX73TL1SP1

        spot: spotAIX73TL1SP1

      register: nimadm_results

    - name: "Debug: nimadm_results"

      ansible.builtin.debug: var=nimadm_results

I ran this from my Ansible controller node. My NIM master was named lpar1 and my NIM client was named aixmig. On the NIM client, hdisk0 would be used to create the alternate rootvg for 7.3. I also chose to use a cache volume group with nimadm (nimadm_cache_vg: nimadmvg).

When I ran the playbook, after several checks, I eventually saw the nimadm command being called.

# ansible-playbook nimadm.yml

snip

TASK [ibm.power_aix.nim_alt_disk_migration : Display nimadm command] ******************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "/usr/sbin/nimadm -c aixmig -l AIX73TL1SP1 -s spotAIX73TL1SP1 -j nimadmvg -Y -d hdisk0"

}

TASK [ibm.power_aix.nim_alt_disk_migration : Migrate to alternate disk] ***************************************************************

changed: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": [

        "timeout = 14400 seconds or 4 hours ",

        "Maximum retries: 241 of 60 seconds"

    ]

}

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "results": {

        "ansible_job_id": "j575666317950.22741414",

        "changed": true,

        "failed": 0,

        "finished": 0,

        "results_file": "/.ansible_async/j575666317950.22741414",

        "started": 1

    }

}

TASK [ibm.power_aix.nim_alt_disk_migration : Polling until migration finishes (ignore FAILED RETRING messages)] ***********************

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (231 retries left).

...snip...

The migration completed as expected and was successful. I was able to monitor the nimadm operation from the NIM master, by tailing the migration log file (as usual):

# tail -f  /var/adm/ras/alt_mig/aixmig_alt_mig.log

MASTER DATE: Tue Mar 12 22:15:13 EDT 2024

CLIENT DATE: Tue Mar 12 21:16:49 EDT 2024

NIMADM PARAMETERS: -c aixmig -l AIX73TL1SP1 -s spotAIX73TL1SP1 -j nimadmvg -Y -d hdisk0

Starting Alternate Disk Migration.

+-----------------------------------------------------------------------------+

Executing nimadm phase 1.

+-----------------------------------------------------------------------------+

Cloning altinst_rootvg on client, Phase 1.

Client alt_disk_install command: alt_disk_copy -j -M 7.3 -P1 -d "hdisk0"

...snip...

# lsnim -l aixmig

aixmig:

   class          = machines

   type           = standalone

   locked         = 22544692

   connect        = shell

   platform       = chrp

   netboot_kernel = 64

   if1            = network0 aixmig EEEB78881F04 ent0

   cable_type1    = N/A

   mgmt_profile1  = hmc1 4 sys730

   Cstate         = alt_disk_mig operation is being performed

   prev_state     = ready for a NIM operation

   Mstate         = currently running

   lpp_source     = AIX73TL1SP1

   spot           = spotAIX73TL1SP1

   cpuid          = 00F943F93C00

   control        = master

   Cstate_result  = reset

The playbook displayed the following when the migration was completed successfully:

snip

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (207 retries left).

changed: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "retry = 241"

}

TASK [ibm.power_aix.nim_alt_disk_migration : Rebooting aixmig] ************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "'altinst_rootvg' successfully created in 'aixmig'. Reboot 'aixmig' to boot into the alterate disk.\n"

}

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "MIGRATION COMPLETE!!!"

}

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg1": "\" - Validation of resources: Completed! \\n- Migration of aixmig to 7300 Completed.\"\n"

}

TASK [Debug: nimadm_results] **********************************************************************************************************

ok: [aixmig] => {

    "nimadm_results": {

        "changed": false,

        "include_args": {

            "apply": {

                "delegate_to": "lpar1"

            },

            "name": "nim_alt_disk_migration"

        }

    }

}

PLAY RECAP ****************************************************************************************************************************

aixmig                     : ok=82   changed=2    unreachable=0    failed=0    skipped=33   rescued=0    ignored=0

I rebooted my NIM client to 7.3 (with another Ansible playbook) and verified the migration was OK (with another playbook):

# ansible-playbook aix_reboot.yml

PLAY [Reboot the machine] *************************************************************************************************************

TASK [reboot the machine] *************************************************************************************************************

changed: [aixmig]

TASK [debug] **************************************************************************************************************************

ok: [aixmig] => {

    "reboot_result": {

        "changed": true,

        "elapsed": "177 sec",

        "failed": false,

        "msg": "System has been rebooted SUCCESSFULLY",

        "rebooted": true

    }

}

PLAY RECAP ****************************************************************************************************************************

aixmig                     : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

# ansible-playbook aix_oslevel_check.yml

PLAY [AIX oslevel checking playbook] **************************************************************************************************

TASK [Gathering Facts] ****************************************************************************************************************

ok: [aixmig]

TASK [Gather LPP Facts] ***************************************************************************************************************

changed: [aixmig]

TASK [Print the oslevel] **************************************************************************************************************

ok: [aixmig] => {

    "msg": "aixmig has the AIX oslevel of 7300-01-01-2246"

}

PLAY RECAP ****************************************************************************************************************************

aixmig                     : ok=3    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Below is the complete output from the nimadm playbook session:

# ansible-playbook nimadm.yml

PLAY [NIMADM] *************************************************************************************************************************

TASK [include_role : nim_alt_disk_migration] ******************************************************************************************

TASK [ibm.power_aix.nim_alt_disk_migration : Validating arguments against arg spec 'main' - This role is used to migrate a client OS levels from AIX 7.1/7.2 to AIX 7.3.] ***

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : Fail if a NIM LPP resource is not specified] *********************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "LPP resource AIX73TL1SP1 specified for migration"

}

TASK [ibm.power_aix.nim_alt_disk_migration : Retrieve AIX73TL1SP1 AIX release level] **************************************************

included: /.ansible/collections/ansible_collections/ibm/power_aix/roles/nim_alt_disk_migration/tasks/retrieve_lpp_source_os_level.yml for aixmig

TASK [ibm.power_aix.nim_alt_disk_migration : Query bos.mp64.rte fileset AIX73TL1SP1] **************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : Check if 'bos.mp64 is in AIX73TL1SP1] ****************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "'AIX73TL1SP1 is at level '7.3.1.1'\n"

}

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : Save bos.mp version on file /var/adm/ras/ansible_nim_info_file_AIX73TL1SP1] **************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "nim_file_info": "VARIABLE IS NOT DEFINED!"

}

TASK [ibm.power_aix.nim_alt_disk_migration : Verify if alt_disk_install.rte fileset is present] ***************************************

included: /.ansible/collections/ansible_collections/ibm/power_aix/roles/nim_alt_disk_migration/tasks/validate_alt_disk_install_fileset.yml for aixmig

TASK [ibm.power_aix.nim_alt_disk_migration : Query bos.alt_disk_install.rte fileset in NIM master] ************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : Check if 'bos.alt_disk_install.rte is installed in NIM master] ***************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "'bos.alt_disk_install.rte' in NIM master is at level ['7.3.2.0']\n"

}

TASK [ibm.power_aix.nim_alt_disk_migration : Query bos.alt_disk_install.rte fileset AIX73TL1SP1] **************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : fail] ************************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "defined"

}

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "'bos.alt_disk_install.rte' in AIX73TL1SP1 is at level '7.3.1.0'\n"

}

TASK [ibm.power_aix.nim_alt_disk_migration : ibm.power_aix.nim_resource] **************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : include_tasks] ***************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : ibm.power_aix.nim_resource] **************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "'bos.alt_disk_install.rte' in spotAIX73TL1SP1 is at level '7.3.2.0'\n"

}

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : fail] ************************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : fail] ************************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : fail] ************************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "Fileset alt_disk_install.rte presence validation passed"

}

TASK [ibm.power_aix.nim_alt_disk_migration : Create SPOT resource if not specified] ***************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "SPOT resource spotAIX73TL1SP1 specified for migration"

}

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": " Resources spotAIX73TL1SP1 are valid and ready."

}

TASK [ibm.power_aix.nim_alt_disk_migration : Fail if a NIM client LPAR is not specified] **********************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "aixmig specified to be migrated"

}

TASK [ibm.power_aix.nim_alt_disk_migration : Assert if the user does not input at least one target_disk option.] **********************

ok: [aixmig -> lpar1] => {

    "changed": false,

    "msg": "All assertions passed"

}

TASK [ibm.power_aix.nim_alt_disk_migration : Fail if the user inputs the target_disk with both: disk_size_policy and disk_name] *******

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : Fail if both target_disk disk_size_policy and disk_name have no value] *******************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : Verify NIM master and client connection] *************************************************

included: /.ansible/collections/ansible_collections/ibm/power_aix/roles/nim_alt_disk_migration/tasks/validate_nim_connection.yml for aixmig

TASK [ibm.power_aix.nim_alt_disk_migration : check if client is defined on master] ****************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : get nimsh status on master] **************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : validate nimsh state] ********************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : check if c_rsh is up and running] ********************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : get tftp status on master] ***************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : validate tftp status] ********************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : get bootpd status on master] *************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : validate bootpd status] ******************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : get nimsh status on client] **************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : validate nimsh status on client] *********************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : get niminfo from client] *****************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : get nim master host name] ****************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : validate client master hostname from niminfo] ********************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "NIM master and clients connection validation complete"

}

TASK [ibm.power_aix.nim_alt_disk_migration : Fetch client oslevel] ********************************************************************

included: /.ansible/collections/ansible_collections/ibm/power_aix/roles/nim_alt_disk_migration/tasks/get_oslevel.yml for aixmig

TASK [ibm.power_aix.nim_alt_disk_migration : NIM check for client OS level] ***********************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "nim_check.nim_node.standalone[nim_client]": {

        "Cstate": "ready for a NIM operation",

        "Cstate_result": "reset",

        "Mstate": "currently running",

        "cable_type1": "N/A",

        "class": "machines",

        "connect": "shell",

        "cpuid": "00F943F94C00",

        "if1": "network0 aixmig EEEB78881F04 ent0",

        "ip": "aixmig",

        "mgmt_profile1": "pok-sse-hmc1 4 sys854",

        "netboot_kernel": "64",

        "oslevel": "7200-04-02-2028",

        "platform": "chrp",

        "prev_state": "not running",

        "type": "standalone"

    }

}

TASK [ibm.power_aix.nim_alt_disk_migration : Parse OS level] **************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : Determine if OS level was successfully fetched] ******************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : Determine if OS level is 7.1>] ***********************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "Client LPAR 'aixmig' is at AIX level '7200-04-02-2028'"

}

TASK [ibm.power_aix.nim_alt_disk_migration : Read bos.mp64 version from file /var/adm/ras/ansible_nim_info_file_AIX73TL1SP1] **********

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : Retrieve lpp_source bos.mp64 level] ******************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "lpp_source_fileset_level": "7300"

}

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : No need to migreate] *********************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : Verify that the client LPAR is at least a Power8 machine] ********************************

included: /.ansible/collections/ansible_collections/ibm/power_aix/roles/nim_alt_disk_migration/tasks/validate_min_power_level.yml for aixmig

TASK [ibm.power_aix.nim_alt_disk_migration : Fetch Processor Type of aixmig LPAR] *****************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : Validate Processor Type Level] ***********************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "aixmig has at least a PowerPC_Power8 processor"

}

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : ibm.power_aix.internal.nim_select_target_disk] *******************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : ibm.power_aix.internal.nim_select_target_disk] *******************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : fail] ************************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "hdisk0 of aixmig will be used to create an alternate disk copy"

}

TASK [ibm.power_aix.nim_alt_disk_migration : Clear nimadm_options variable when CacheVG and Bundle not defined] ***********************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : Add CacheVG to 'nimadm_options' when nimadm_cache_vg configured] *************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : Add eFix Bundle to 'nimadm_options' when nimadm_bundle configured] ***********************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : Display nimadm command] ******************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "/usr/sbin/nimadm -c aixmig -l AIX73TL1SP1 -s spotAIX73TL1SP1 -j nimadmvg -Y -d hdisk0"

}

TASK [ibm.power_aix.nim_alt_disk_migration : Migrate to alternate disk] ***************************************************************

changed: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": [

        "timeout = 14400 seconds or 4 hours ",

        "Maximum retries: 241 of 60 seconds"

    ]

}

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "results": {

        "ansible_job_id": "j575666317950.22741414",

        "changed": true,

        "failed": 0,

        "finished": 0,

        "results_file": "/.ansible_async/j575666317950.22741414",

        "started": 1

    }

}

TASK [ibm.power_aix.nim_alt_disk_migration : Polling until migration finishes (ignore FAILED RETRING messages)] ***********************

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (241 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (240 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (239 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (238 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (237 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (236 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (235 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (234 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (233 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (232 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (231 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (230 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (229 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (228 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (227 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (226 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (225 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (224 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (223 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (222 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (221 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (220 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (219 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (218 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (217 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (216 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (215 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (214 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (213 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (212 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (211 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (210 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (209 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (208 retries left).

FAILED - RETRYING: [aixmig -> lpar1]: Polling until migration finishes (ignore FAILED RETRING messages)  (207 retries left).

changed: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "retry = 241"

}

TASK [ibm.power_aix.nim_alt_disk_migration : Rebooting aixmig] ************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "'altinst_rootvg' successfully created in 'aixmig'. Reboot 'aixmig' to boot into the alterate disk.\n"

}

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg": "MIGRATION COMPLETE!!!"

}

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

ok: [aixmig -> lpar1]

TASK [ibm.power_aix.nim_alt_disk_migration : set_fact] ********************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

skipping: [aixmig]

TASK [ibm.power_aix.nim_alt_disk_migration : debug] ***********************************************************************************

ok: [aixmig -> lpar1] => {

    "msg1": "\" - Validation of resources: Completed! \\n- Migration of aixmig to 7300 Completed.\"\n"

}

TASK [Debug: nimadm_results] **********************************************************************************************************

ok: [aixmig] => {

    "nimadm_results": {

        "changed": false,

        "include_args": {

            "apply": {

                "delegate_to": "lpar1"

            },

            "name": "nim_alt_disk_migration"

        }

    }

}

PLAY RECAP ****************************************************************************************************************************

aixmig                     : ok=82   changed=2    unreachable=0    failed=0    skipped=33   rescued=0    ignored=0

From IBMer, Rich Jefferies, regarding new nimadm options:

https://community.ibm.com/community/user/power/discussion/share-your-thoughts-on-aix-automation-use-cases-of-high-value

Your "ask" is already included in the collection as part of the additions I made for a previous requirement, however it is probably currently undocumented.

There are three additional options:

- nimadm_cache_vg:  Name of VG on NIM Master to use for cacheVG

- nimadm_bundle:    Name of Bundle resource to install post upgrade

- nimadm_bidata:    Name of custom Bos Inst Data to use during upgrade

Below is an example of how to invoke the options. I'd added the "default('N/A')" to avoid errors if the variable was not defined, as the role is coded for "N/A", but should also work with "default(omit)"

   - name: Include nim_alt_disk_migration role

     include_role:

        name: nim_alt_disk_migration

        apply:

          delegate_to: "{{ NIM_Master }}"

          connection:  "{{ NIM_Conn }}"

      vars:

        nim_client:      "{{ NIM_Client }}"

        target_disk:

          disk_name:     "{{ Target_DISK.disk_name }}"

          force:         "{{ NIMADM_Force }}"

        lpp_source:      "{{ Target_LPPS }}"

        spot:            "{{ Target_SPOT }}"

        nim_mast_lpp:    "{{ NIM_Mast_LPP }}"

        nimadm_cache_vg: "{{ NIMADM_VG | default('N/A') }}"

        nimadm_bundle:   "{{ Target_eFix | default('N/A') }}"

        nimadm_bidata:   "{{ BOS_Inst_Data | default('N/A') }}"

        control_phases:

         validate_nim_resources: "{{ NIM_Res_Check }}"

         perform_migration:      "{{ NIM_Migration }}

2 comments
29 views

Permalink

Comments

Thu March 14, 2024 01:47 PM

I love that I come over here and Chris Gibson is making me smarter for free.  Need more of this in the world.

Thu March 14, 2024 05:25 AM

Very very NICE  Chris, love this I have to dive into this.

Greetings Christian Sonnemans