ansible-collections / ibm_zos_core

Red Hat Ansible Certified Content for IBM Z
77 stars 44 forks source link

[Bug] [zos_copy] Investigate if an alias of a LOADLIB can be a 'src' #1013

Open ketankelkar opened 12 months ago

ketankelkar commented 12 months ago

Is there an existing issue for this?

Are the dependencies a supported version?

IBM Z Open Automation Utilities

v1.2.4

IBM Enterprise Python

v3.9.x

IBM z/OS Ansible core Version

v1.8.0-beta.1

ansible-version

latest

z/OS version

v2.5

Ansible module

zos_copy

Bug description

See internal slack thread - CSLEJ8VGV/p1696613056253019 - from the ansible z collections guild channel.

The user is trying to copy a PDS IMSBLD.I15STSMM.SDFSRESL to a PDS. The user reported it did not make a different whether or not the destination data set existed prior.

The src appears to be an alias: image

dls seems to be unable to find that particular data set name.

bash-4.3# dls IMSBLD.I15STSMM.SDFSRESL
bash-4.3# dls -a IMSBLD.I15STSMM.SDFSRES
BGYSC1103E No datasets match pattern: IMSBLD.I15STSMM.SDFSRES.

However, dcp with an existing target at least begins copying over members. I terminated the copy when it looked like it had hung because it was taking a long time. Aliases seem to be preserved in the destination loadlib.

bash-4.3# dtouch -tpdse -rU -l0 user.test.loadlib
bash-4.3# dcp -IX IMSBLD.I15STSMM.SDFSRESL user.test.loadlib
bash-4.3#
bash-4.3# mls user.test.loadlib
BPEAQHT0
BPEAWCR0
BPEAWI00
...
DBFDAX10
DBFDBAC0 ALIAS(DBFDBAC1 DBFDBAC2 DBFDBAC3 DBFDBAC4)
DBFDBAC5
...

Playbook verbosity output.

No response

Ansible configuration.

No response

Contents of the inventory

No response

Contents of group_vars or host_vars

No response

richp405 commented 11 months ago

Jira id 9996 with Joel

richp405 commented 11 months ago

Tick #10141 merged into 1.3 pre build

ketankelkar commented 6 months ago

Internal JIRA tracker- #10141

The fix may or may not be back-ported into ZOAU 1.2.X.

The internal jira ticket #9996 mentioned above is not related to this git issue. #9996 has to do with the call to dls -al producing incorrect output. That is not a concern here.

#10141 has been re-opened. The fix that was delivered seemed not to address the use case where the src data set itself is an alias. Details on recreating a data set library that is an alias can be found in the jira.

Below is a playbook with ZOAU 1.3.x to recreate this issue. Note- only a change in environment_vars will be needed to test with ZOAU 1.2.x. NoteNote- in it's current state, the playbook MUST be run on one of the dev ECs (z/VMs) because the relevant data set (IMSBLD.I15STSMM.SDFSRESL) is only present there.


  environment:
    _BPXK_AUTOCVT: "ON"
    _CEE_RUNOPTS: "FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
    _TAG_REDIR_ERR: "txt"
    _TAG_REDIR_IN: "txt"
    _TAG_REDIR_OUT: "txt"
    LANG: "C"

    LIBPATH: "{{ ZOAU }}/lib/:{{ PYZ }}/lib:/lib:/usr/lib:."
    PYTHONPATH: "{{ ZOAU }}/lib/{{ PYZ_VERSION }}"
    PATH: "{{ ZOAU }}/bin:{{ PYZ }}/bin:/bin:/usr/sbin:/var/bin:/usr/lpp/java/java180/J8.0_64/bin"

    PYTHONSTDINENCODING: "cp1047"

  tasks:

  - name: set facts
    ansible.builtin.set_fact:
      DEFAULT_DATA_SET_NAME: "KETAN.ANSIBLE.TESTDS"

  - name: do some stuff
    block:
      zos_copy:
        src: "IMSBLD.I15STSMM.SDFSRESL"
        dest: "{{ DEFAULT_DATA_SET_NAME }}"
        aliases: yes
        remote_src: yes

Note- the following command may be used to create an alias $dsn based off of data set CEE.SCEERUN2. This can be useful in creating a data set like IMSBLD.I15STSMM.SDFSRESL, which is an alias of a load library.

printf  "\tDEFINE ALIAS -\n\t\t(NAME(%s) -\n\t\tRELATE(CEE.SCEERUN2) )\n" $dsn  | mvscmdauth --pgm=idcams --sysprint=* --sysin=stdin
ketankelkar commented 6 months ago

The points count of this issue will be split between 2024-Q1 and 2024-Q2. The above investigation/recreate and follow up with the ZOAU team (and updating jira) will represent 3pts. The remaining work i.e. re-running the above playbook and confirming the fix will represent 2pts.

As such, the points for q1 will be recorded, and the size of this item will be reduced to small (2 pts)

ddimatos commented 2 days ago

Jira 10141 - has been canceled with notes that it will be solved by automatically adding an -l option to dls, while dls -a is called but makes no mention which jira that is done in. I think we should bring this back soon to evaluate if its still. an issue