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 Vosskoetter !

    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

    Niklas, 
    I stand corrected, the ansible.builtin.cron worked on AIX when I just tested it. Not sure what I did the first time. 

    Thanks! 



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



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

    Posted Fri October 25, 2024 02:41 AM
    Edited by Niklas Vosskoetter Fri October 25, 2024 02:42 AM

    Hey Hari,

    from my point of view, we have a double view of the points with this thread, as many ideas are already noted in the Github issues.

    I would be glad if we could also create more transparency at the issues.
    - What is IBM's view of one of the ideas submitted?
    - When can we expect them to be implemented?
    - How can the creator of the issue provide support?
    - Regular updates in the issues (no waiting times longer than 2 years for a response would be nice ;-) )
     
    From my point of view, all these points would create a culture in which people are happy to work together and then further ideas will surely come of their own accord - this is how open source should work.


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



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

    Posted Mon October 28, 2024 04:29 AM

    Hi Hariganesh,

    It would be great to implement the AIX chdef command (Define default attributes values for devices).

    Regards.



    ------------------------------
    Damien LEMAGNEN
    AIX System Engineer/Architect
    NETIXWARE
    ------------------------------



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

    Posted Wed November 13, 2024 01:25 PM

    Hi,

    For the Ansible Power collection modules for IBM i, I would rather see that the existing modules gets a refresh before adding new modules/functions.

    What I feel is lacking for the existing modules:
    Many of the ibm.power_ibmi.ibmi_* modules is not idempotent, they will fail if the state is already the prefered state. The goal for Ansible modules is to have desired state and 'idempotency': https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_intro.html
    As of now you have to check the state before you make the action or use ignore_errors: true

    Some of the modules does not provide any added value than using the native CL command with the ibm.power_ibmi.ibmi_cl_command module, for example:
    ibm.power_ibmi.ibmi_start_subsystem
    ibm.power_ibmi.ibmi_end_subsystem
    ibm.power_ibmi.ibmi_tcp_server_service


    ibm.power_ibmi.ibmi_start_subsystem and ibm.power_ibmi.ibmi_end_subsystem: There is no reason to have two separate modules, they should be migrated to a common ibm.power_ibmi.ibmi_subsystem module and use idempotency and also have the option to monitor for when all jobs and the subsystem are ended. Restart option would also be nice.

    ibm.power_ibmi.ibmi_tcp_server_service: You can't specify instances for *HTTP, *IAS. This module should also have a restart option, so you could specify that a service should be restarted. 

    ibm.power_ibmi.ibmi_sql_execute is lacking an option to set SQL options, it will fail if I try to change a non journaled file/table. There should be a parameter where you can set SQL options.

    ibm.power_ibmi.ibmi_cl_command needs a parameter to set the same thing as you can do with the CHGJOB command, you may want to set a different library list or current library etc, before you execute the command.

    This is just a few suggestions.



    ------------------------------
    Krister Karlsson
    ------------------------------



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

    Posted Tue November 19, 2024 11:12 AM
    Edited by Mark Steele Tue November 19, 2024 11:12 AM

    I concur, that would be an important step to make the modules behave as expected. I've seen that same issue, not being idempotent, on the ibm.power_hmc.powervm_dlpar module when adding specific NPIV adapters, for example. 



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