IBM / ansible-power-aix

Developer contributions for Ansible Automation on Power
https://ibm.github.io/ansible-power-aix/
GNU General Public License v3.0
81 stars 95 forks source link

alt_disk not working with mirrored rootvg #570

Open flynn1973 opened 1 week ago

flynn1973 commented 1 week ago

Describe the bug

alt disk copy with a mirrorred rootvg fails.

TASK [Create an alt_disk_copy for backup] ***************************************************************************************************************************************************************************************************
fatal: [AIXTEST01]: FAILED! => {"changed": false, "msg": "Not enough free disks available. At least 2            are required but only 0 are there.", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

To Reproduce Steps to reproduce the behavior:

run this play on an lpar with mirrored rootvg

- name: AIX Patching Playbook
  hosts: AIXTEST01
  vars:
    nim_lpp_source: 7300-02-01-2346-lpp_source
  collections:
    - ibm.power_aix
  tasks:

  - name: Cleanup any existing alt_disk_copy
    alt_disk:
      action: clean

  - name: Create an alt_disk_copy for backup
    alt_disk:
      action: copy
      targets: hdisk1

#  - name: Stop Application
#    shell: /usr/local/bin/stop.sh

  - name: Run AIX Update
    nim:
      action: update
      lpp_source: "{{ nim_lpp_source }}"
      targets: "{{ ansible_hostname }}"

  - name: Reboot
    reboot:
      post_reboot_delay: 180

#  - name: Start Application
#    shell: /usr/local/bin/start.sh

Expected behavior

i expect the rootvg gets automatically unmirrored and prepared in any possible way (chpv -c and so on), otherwise this function is of no real use

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context None

Rich-J-AIX commented 1 week ago

In my opinion expecting the alt_disk module to unmirror and then use the previous mirror disk as an alt_clone is a bit much & could lead to unintentionally risking system availibility if an incorrect hdisk entry is passed. If you wish to unmirror the VG, you should use the lvg module:

- name: Removing hdisk1 from rootvg
  ibm.power_aix.lvg:
    state: absent
    vg_name: rootvg
    pvs: hdisk1

After that (if successful) invoke the alt_disk module

schamola commented 1 week ago

I agree with @Rich-J-AIX It's better to have a separate task for accomplishing the unmirroring part rather than unmirroring through alt_disk module itself. @flynn1973 Can you please check if it works for you like this ?

flynn1973 commented 1 week ago

yeah..wll check it out and report back...