ansible-collections / ibm.spectrum_virtualize

IBM Spectrum Virtualize
GNU General Public License v3.0
21 stars 26 forks source link

V1.7 and V1.8 - Cannot create FC Mapping - ibm.spectrum_virtualize.ibm_svc_manage_flashcopy #62

Closed robinsg closed 2 years ago

robinsg commented 2 years ago

SUMMARY I'm trying to create a Flashcopy mapping using the ibm.spectrum_virtualize.ibm_svc_manage_flashcopy module.

I have tried this on collection version 1.7 and 1.8 but get the same results.

I specify a target volume, which has just been created but when I run ansible to create the mapping I get a message telling me that the target already exists.

ISSUE TYPE

ANSIBLE VERSION
ansible 2.9.15
  config file = /home/grobinso/ansible/dev/infra.ibm_ansible/ansible.cfg
  configured module search path = [u'/home/grobinso/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug 13 2020, 06:59:42) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
CONFIGURATION
ANSIBLE_PIPELINING(/home/grobinso/ansible/dev/infra.ibm_ansible/ansible.cfg) = True
COLLECTIONS_PATHS(/home/grobinso/ansible/dev/infra.ibm_ansible/ansible.cfg) = [u'/home/grobinso/ansible/dev/infra.ibm_ansible/collections', u'/home/grobinso/.ansible']
DEFAULT_HOST_LIST(/home/grobinso/ansible/dev/infra.ibm_ansible/ansible.cfg) = [u'/home/grobinso/ansible/dev/infra.ibm_ansible/inventory.yaml']
DEFAULT_ROLES_PATH(/home/grobinso/ansible/dev/infra.ibm_ansible/ansible.cfg) = [u'/home/grobinso/ansible/dev/infra.ibm_ansible/roles_path = roles_path = ../ansible.roles_ibm/roles/common', u'/home/grobinso/ansible/dev
DEFAULT_SCP_IF_SSH(/home/grobinso/ansible/dev/infra.ibm_ansible/ansible.cfg) = smart
HOST_KEY_CHECKING(/home/grobinso/ansible/dev/infra.ibm_ansible/ansible.cfg) = False
INTERPRETER_PYTHON(/home/grobinso/ansible/dev/infra.ibm_ansible/ansible.cfg) = /usr/bin/python3
OS / ENVIRONMENT

Red Hat Enterprise Linux Server release 7.9 (Maipo)

STEPS TO REPRODUCE
ansible localhost -m  ibm.spectrum_virtualize.ibm_svc_manage_flashcopy -a "clustername=myfs7200-mgt1 username=myuser password=mypwd name=testmap_01 copytype=snapshot state=present source=ansible_test_delete_me_l01 target=TEST_ansible_test_delete_me_l01 mdiskgrp=mypool consistgrp=TEST_ANSIBLE_TEST" -vvvv
EXPECTED RESULTS

I'm now expecting source volume (ansible_test_delete_me_l01) to be mapped to target volume (TEST_ansible_test_delete_me_l01) with a mapping name of testmap_01 and assigned to consistency group TEST_ANSIBLE_TEST.

ACTUAL RESULTS
ansible 2.9.15
  config file = /home/grobinso/ansible/dev/infra.ibm_ansible/ansible.cfg
  configured module search path = [u'/home/grobinso/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug 13 2020, 06:59:42) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
Using /home/grobinso/ansible/dev/infra.ibm_ansible/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /home/grobinso/ansible/dev/infra.ibm_ansible/inventory.yaml as it did not pass its verify_file() method
script declined parsing /home/grobinso/ansible/dev/infra.ibm_ansible/inventory.yaml as it did not pass its verify_file() method
Parsed /home/grobinso/ansible/dev/infra.ibm_ansible/inventory.yaml inventory source with yaml plugin
Loading callback plugin minimal of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/minimal.pyc
META: ran handlers
Using module file /home/grobinso/ansible/dev/infra.ibm_ansible/collections/ansible_collections/ibm/spectrum_virtualize/plugins/modules/ibm_svc_manage_flashcopy.py
Pipelining is enabled.
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: myuser
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python2 && sleep 0'
localhost | SUCCESS => {
    "changed": false,
    "invocation": {
        "module_args": {
            "clustername": "myfs7200-mgt1",
            "consistgrp": "TEST_ANSIBLE_TEST",
            "copyrate": null,
            "copytype": "snapshot",
            "domain": null,
            "force": null,
            "grainsize": null,
            "log_path": null,
            "mdiskgrp": "mypool",
            "name": "testmap_01",
            "noconsistgrp": null,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "source": "ansible_test_delete_me_l01",
            "state": "present",
            "target": "TEST_ansible_test_delete_me_l01",
            "token": null,
            "username": "myuser",
            "validate_certs": false
        }
    },
    "msg": "target [TEST_ansible_test_delete_me_l01] already exists, fcmap would not be created."
}
META: ran handlers
META: ran handlers

Prior to this I have used the SV modules to create the FC consistency group and thr target volume.

Shilpi-J commented 2 years ago

@robinsg we'll look into the issue and get back to you.

robinsg commented 2 years ago

Thank you.

I'm converting my playbook from the v1.3 collection which worked fine.

Shilpi-J commented 2 years ago

what change did you make in your playbook? ibm_svc_manage_flashcopy module was introduced in v1.4.0

robinsg commented 2 years ago

I changed the module name and then used the attributes as per my post above.

As I mentioned the other modules I changed to create the fcconsistgrp and target volumes work fine, it’s just this one module that appears to work but doesn’t.

If I go in the GUI and try to map the source and target volumes it works fine.

Glenn Robinson IBM Power Systems and Storage Specialist E: Glenn. @.*** M: +44 7930 946274

On 23 Jun 2022, at 16:03, Shilpi-J @.***> wrote:

 what change did you make in your playbook?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

sanjaikumaar commented 2 years ago

@robinsg You are facing problem because target volume that has been specified in the playbook TEST_ansible_test_delete_me_l01 already exists.

In Ansible module(AM) ibm_svc_manage_flashcopy, we have automated the target volume creation along with the FC mapping creation. So when you are creating FC map through ibm_svc_manage_flashcopy, target volume should not exist in your system. If exists, AM will return the message target [<target volume name>] already exists, fcmap would not be created..

In GUI, you did not face this problem because it takes two steps - creation of target volume and creation of FlashCopy mapping.

robinsg commented 2 years ago

Ah, I see. That's a change from the original collection action.

I will remove the previous step which creates the target volume and test this out.

robinsg commented 2 years ago

Ok, that all works now I understand that the module does not require a target volume which already exists.

I think a future update would be to have a target_exists attribute to allow us to use existing volumes.

Thanks for you help.

sanjaikumaar commented 2 years ago

The module was designed in this way to ease the flashcopy management.

But thanks for the suggestion, we can discuss this internally and if there seems to be a value addition in providing such attribute, we will definitely add it.

Having said that, we are bringing up FlashCopy 2.0 in Ansible in 2Q22.