Automation with Power

 View Only
Expand all | Collapse all

Input on Ansible for Power Use cases

  • 1.  Input on Ansible for Power Use cases

    Posted Thu October 10, 2024 11:48 AM

    Hi Everyone, 

           We need your input! As part of our ongoing efforts to improve automation capabilities for IBM Power systems, we're looking to identify any missing Ansible modules or functions in the current Power collection for AIX, IBM i, HMC, and VIOS.

    If you've encountered any gaps or if there are specific features you'd like to see added, let us know by replying to this post. Your feedback will help us enhance the Ansible collection and deliver the tools you need to streamline your operations.

    Thank you for contributing and making this community stronger!



    ------------------------------
    Hariganesh Muralidharan, Senior Technical Staff Member, IBM
    ------------------------------


  • 2.  RE: Input on Ansible for Power Use cases

    Posted Mon October 14, 2024 12:49 PM

    Hi Hari,  Good to see you @LUG!  We have some Power Systems tasks we would like to automate:

    SVC Freeze time monitoring for GlobalMirror Change Volume configuration - There is a CLI script around this but the core SVC code lacks this capability.   We use the POWER Automate bot to check freeze time every 15 minutes today and store results.   If freeze time for any system exceeds 45 minutes we are sent an alert every 15 minutes until freeze time falls below 45 minutes.

    Setup of Storage Insights FlashSystem storage alert policies - Ability to have a script that will set up our default storage alerting policies.  Today, the default supplied by IBM sends too many alerts for issues not relevant to a remote storage configuration (ie. storage is 99% at capacity).  100% of storage is allocated so this alert is useless.

    Power Systems (IBM i) Setup KPI health check playbook - A script that when run will use IBM Db2 for i health services SQL to pull common KPI indicators - CPU Utilization, Disk utilization, Disk average I/O response, Memory Utilization 

    These are the ones I can think of right now.



    ------------------------------
    Jim Olliges
    ------------------------------



  • 3.  RE: Input on Ansible for Power Use cases

    Posted Tue October 15, 2024 07:53 AM

    Hi Hari - regarding the HMC collection, I would like reduce the number of hmc_command module calls I make. For example I would like some i *_facts modules that for things like SRIOVs, WWPNs, general lssyscfg and lshwres output etc., a module or role for setting up call home, an idempotent SRIOV module, a role to remove a service partition (I can share what I have). That's off the top of my head but for provisioning there could be more content. Thanks for the query!



    ------------------------------
    Michael Quaranta
    ------------------------------



  • 4.  RE: Input on Ansible for Power Use cases

    Posted Tue October 15, 2024 10:04 AM

    Hi Hari,

    I've been using playbooks to automate a larger IBM i deployment, high level here's the workflow.

    1. Configure HMC's (one off and since they need to be somewhat configured for Ansible to work, so not much there so far)
    2. Create and install VIO server LPAR's
    3. Create a LPAR (capture WWPN's)
    4. Configure SAN switch zoning (using captured WWPN's)
    5. Configure DS8K Host and Pathing
    6. Add additional tape HBA's to the LPAR (capture WWPN's)
    7. Configure TAN switch zoning (using captured WWPN')
    8. (to be continued)

    So from this, according to steps, here are some notes. I'm by no means an Ansible SME, so if I did things incorrectly, please disregard.

    2a. Defining IO slots and virtual ethernet adapters is a bit painful. It works, but wondering if we couldn't make it more eye-readable than 21010010/none/0 and 2/0/1//2/1/ETHERNET0//all/none.

    2b. After creating the LPAR, there's no way, besides running a HMC command, to capture WWPN's. (powervm_lpar_instance state=facts doesn't show NPIV WWN's · Issue #129 · IBM/ansible-power-hmc (github.com)). I end up using the lsnports command to capture WWPN's. While that works, the command lacks the ability to filter, sort, etc. So would be really nice to have a way to capture WWPN's from an newly created and not yet booted LPAR.

    So far, what I've seen. The biggest miss so far is on the DS8K collection, but guessing that's not in your scope.



    ------------------------------
    Mark Steele
    ------------------------------



  • 5.  RE: Input on Ansible for Power Use cases

    Posted Sun October 20, 2024 05:22 AM
    Edited by Stephan Dietl Sun October 20, 2024 05:23 AM

    Hello @HARIGANESH MURALIDHARAN !

    I´ll post some more ideas when I have the time, but at the moment my biggest gripe (how the json output is structured..) is with using the ibm.power_aix.mpio Module, see (but not limited to) https://github.com/IBM/ansible-power-aix/issues/578 !

    Thanks,

    Ciao,

    Steve



    ------------------------------
    Stephan Dietl
    ------------------------------



  • 6.  RE: Input on Ansible for Power Use cases

    Posted Thu October 24, 2024 02:16 PM

    Hari,

    I do have one that would be helpful. A cron module.  The ansible.builtin.cron does not work on AIX.



    ------------------------------
    Mark Steele
    ------------------------------



  • 7.  RE: Input on Ansible for Power Use cases

    Posted Fri October 25, 2024 02:37 AM

    Hey Mark,

    we use the ansible.builtin.cron in different cases without problems. Can you share your problem, an example and the used ansible version with us?



    ------------------------------
    Niklas
    System Engineer UNIX and Linux on Power
    ------------------------------



  • 8.  RE: Input on Ansible for Power Use cases

    Posted Fri October 25, 2024 03:52 AM

    Hey @Niklas V. !

    I have worked around the linux specific behaviour (user is put into the crontab which doesn´t work on AIX) with this clunky playbook:

       - name: Add it to the crontab
         ansible.builtin.cron:
          name: "{{ CRONNAME }}"
          minute: "25"
          hour: "5"
          weekday: "1"
          job: "{{ CRONCMD }}"
          user: "{{ USER }}"
          cron_file: /var/spool/cron/crontabs/{{ USER }}
          backup: true
         register: cron_output
    
       - name: Copy the backup back to the original folder
         ansible.builtin.copy:
          remote_src: true
          src: "{{ cron_output.backup_file }}"
          dest: /var/spool/cron/crontabs/{{ USER }}.ansiorig
          owner: "{{ USER }}"
          group: cron
          mode: preserve
         when:
          - cron_output.backup_file is defined
    
    
       - name: Make another backup for sedding the different format of the cron module AIX vs. Linux
         ansible.builtin.copy:
          remote_src: true
          src: /var/spool/cron/crontabs/{{ USER }}
          dest: /var/spool/cron/crontabs/{{ USER }}.ansiedit
          owner: "{{ USER }}"
          group: cron
          mode: preserve
    
       - name: Edit the User out of the crontab because AIX works differently than Linux
         ansible.builtin.shell: |
                cat /var/spool/cron/crontabs/{{ USER }}.ansiedit | sed -e 's/{{ USER }} \/opt/\/opt/' > /var/spool/cron/crontabs/{{ USER }}
    


    With kind regards,



    ------------------------------
    Stephan Dietl
    ------------------------------



  • 9.  RE: Input on Ansible for Power Use cases

    Posted Fri October 25, 2024 12:49 PM