ansible-collections / ibm.storage_virtualize

GNU General Public License v3.0
3 stars 9 forks source link

ibm_svc_info subset vdiskhostmap returns 'null' #30

Closed mainline-automation closed 11 months ago

mainline-automation commented 1 year ago
SUMMARY

Using ibm_svc_info with the vdiskhostmap subset returns null as the only response

ISSUE TYPE
COMPONENT NAME

ibm_svc_info.py

ANSIBLE VERSION
ansible [core 2.15.4]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /home/ansible/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.9.16 (main, Sep 12 2023, 00:00:00) [GCC 11.3.1 20221121 (Red Hat 11.3.1-4)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
Collection             Version
---------------------- -------
ibm.storage_virtualize 2.1.0  
CONFIGURATION
CONFIG_FILE() = /etc/ansible/ansible.cfg
DEFAULT_REMOTE_USER(/etc/ansible/ansible.cfg) = ansible
GALAXY_SERVER_LIST(/etc/ansible/ansible.cfg) = ['validated', 'rh-certified', 'community']
OS / ENVIRONMENT

RHEL 9.2 IBM Storwize V7000 model 724, version 8.5.0.9 Ansible Automation Platform 2.4

STEPS TO REPRODUCE

Run ibm_svc_info using vdiskhostmap as the subset

---
- name: scratch playbook
  hosts: localhost
  gather_facts: false
  become: false
  vars_files:
    - vars/authentication.yml
  #vars:

  tasks:
  - name: gather facts using ibm_svc_info
    ibm.storage_virtualize.ibm_svc_info:
      clustername: "{{ clustername }}"
      gather_subset: vdiskhostmap
      username: xxxxx
      password: xxxxxxx
      # token: "{{ api_token }}"
    register: svc_results
#    no_log: true
EXPECTED RESULTS

I would expect to get something other than null about vdisks host mappings

ACTUAL RESULTS
{
    "plays": [
        {
            "___progress": "100%",
            "__changed": 0,
            "__failed": 0,
            "__ignored": 0,
            "__in progress": 0,
            "__ok": 1,
            "__percent_complete": 100,
            "__play_name": "Create or validate hosts",
            "__progress": "Complete",
            "__skipped": 0,
            "__task_count": 1,
            "__unreachable": 0,
            "name": "Create or validate hosts",
            "pattern": "localhost",
            "play": "Create or validate hosts",
            "play_pattern": "localhost",
            "play_uuid": "2e6b9ae2-9dbb-3d72-cbce-000000000008",
            "playbook": "/home/ansible/playbooks/flashsystem_setup/scratch.yml",
            "playbook_uuid": "a038211a-335f-4722-a571-0bf851566bbe",
            "tasks": [
                {
                    "__changed": false,
                    "__duration": "1s",
                    "__host": "localhost",
                    "__number": 0,
                    "__result": "Ok",
                    "__task": "gather facts using ibm_svc_info",
                    "__task_action": "ibm.storage_virtualize.ibm_svc_info",
                    "duration": 0.94564,
                    "end": "2023-10-18T13:11:40.281589",
                    "event_loop": null,
                    "host": "localhost",
                    "play": "Create or validate hosts",
                    "play_pattern": "localhost",
                    "play_uuid": "2e6b9ae2-9dbb-3d72-cbce-000000000008",
                    "playbook": "/home/ansible/playbooks/flashsystem_setup/scratch.yml",
                    "playbook_uuid": "a038211a-335f-4722-a571-0bf851566bbe",
                    "remote_addr": "localhost",
                    "res": {
                        "Array": [],
                        "CallHome": [],
                        "CloudAccount": [],
                        "CloudAccountUsage": [],
                        "CloudBackup": [],
                        "CloudBackupGeneration": [],
                        "CloudImportCandidate": [],
                        "DnsServer": [],
                        "Drive": [],
                        "DriveClass": [],
                        "EmailServer": [],
                        "EmailUser": [],
                        "EventLog": [],
                        "FCConnectivitie": [],
                        "FCConsistgrp": [],
                        "FCMap": [],
                        "FCPort": [],
                        "Host": [],
                        "HostCluster": [],
                        "HostVdiskMap": [],
                        "IOGroup": [],
                        "IP": [],
                        "LdapServer": [],
                        "Mdisk": [],
                        "Node": [],
                        "Ownershipgroup": [],
                        "Partnership": [],
                        "Pool": [],
                        "Portset": [],
                        "ProvisioningPolicy": [],
                        "RCConsistgrp": [],
                        "RemoteCopy": [],
                        "ReplicationPolicy": [],
                        "SafeguardedPolicy": [],
                        "SafeguardedSchedule": [],
                        "Security": [],
                        "SnapshotPolicy": [],
                        "SnapshotSchedule": [],
                        "Sra": [],
                        "SysLogServer": [],
                        "System": [],
                        "SystemCert": [],
                        "TargetPortFC": [],
                        "TrustStore": [],
                        "User": [],
                        "UserGrp": [],
                        "VdiskCopy": [],
                        "VdiskHostMap": null,
                        "Volume": [],
                        "VolumeGroup": [],
                        "VolumeGroupSnapshot": [],
                        "VolumeGroupSnapshotPolicy": [],
                        "VolumeSnapshot": [],
                        "_ansible_no_log": null,
                        "ansible_facts": {
                            "discovered_interpreter_python": "/usr/libexec/platform-python"
                        },
                        "changed": false,
                        "iSCSIPort": [],
                        "invocation": {
                            "module_args": {
                                "clustername": "10.137.0.30",
                                "domain": null,
                                "gather_subset": [
                                    "vdiskhostmap"
                                ],
                                "log_path": null,
                                "objectname": null,
                                "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                                "token": null,
                                "username": "xxxxxxx",
                                "validate_certs": false
                            }
                        }
                    },
                    "resolved_action": "ibm.storage_virtualize.ibm_svc_info",
                    "start": "2023-10-18T13:11:39.335949",
                    "task": "gather facts using ibm_svc_info",
                    "task_action": "ibm.storage_virtualize.ibm_svc_info",
                    "task_args": "",
                    "task_path": "/home/ansible/playbooks/flashsystem_setup/scratch.yml:12",
                    "task_uuid": "2e6b9ae2-9dbb-3d72-cbce-00000000000a",
                    "uuid": "b9155f3b-b254-4c94-a970-2aef251f41c4"
                }
            ],
            "uuid": "2e6b9ae2-9dbb-3d72-cbce-000000000008"
        }
    ],
    "settings_entries": {
        "ansible-navigator": {
            "ansible": {
                "config": {
                    "help": false,
                    "path": "/etc/ansible/ansible.cfg"
                },
                "doc": {
                    "help": false,
                    "plugin": {
                        "type": "module"
                    }
                },
                "inventory": {
                    "entries": [
                        "/home/ansible/playbooks/flashsystem_setup/inventory"
                    ],
                    "help": true
                },
                "playbook": {
                    "help": false,
                    "path": "/home/ansible/playbooks/flashsystem_setup/scratch.yml"
                }
            },
            "ansible-builder": {
                "help": false,
                "workdir": "/home/ansible/playbooks/flashsystem_setup"
            },
            "ansible-runner": {
                "job-events": false
            },
            "app": "run",
            "collection-doc-cache-path": "/home/ansible/.cache/ansible-navigator/collection_doc_cache.db",
            "color": {
                "enable": true,
                "osc4": true
            },
            "editor": {
                "command": "vi +{line_number} {filename}",
                "console": true
            },
            "enable-prompts": false,
            "exec": {
                "command": "/bin/bash",
                "shell": true
            },
            "execution-environment": {
                "container-engine": "podman",
                "enabled": true,
                "image": "localhost/ee-ibm-flashsystem:latest",
                "pull": {
                    "arguments": [
                        "--tls-verify=false"
                    ],
                    "policy": "tag"
                }
            },
            "format": "yaml",
            "images": {
                "details": [
                    "everything"
                ]
            },
            "logging": {
                "append": false,
                "file": "/home/ansible/playbooks/flashsystem_setup/ansible-navigator.log",
                "level": "debug"
            },
            "mode": "interactive",
            "playbook-artifact": {
                "enable": true,
                "save-as": "{playbook_dir}/{playbook_name}-artifact-{time_stamp}.json"
            },
            "settings": {
                "effective": false,
                "sample": false,
                "schema": "json",
                "sources": false
            },
            "time-zone": "UTC"
        }
    },
    "settings_sources": {
        "ansible-navigator.ansible-builder.help": "Defaults",
        "ansible-navigator.ansible-builder.workdir": "Defaults",
        "ansible-navigator.ansible-lint.config": "Not set",
        "ansible-navigator.ansible-lint.lintables": "Not set",
        "ansible-navigator.ansible-runner.artifact-dir": "Not set",
        "ansible-navigator.ansible-runner.job-events": "Defaults",
        "ansible-navigator.ansible-runner.rotate-artifacts-count": "Not set",
        "ansible-navigator.ansible-runner.timeout": "Not set",
        "ansible-navigator.ansible.cmdline": "Not set",
        "ansible-navigator.ansible.config.help": "Settings file",
        "ansible-navigator.ansible.config.path": "Settings file",
        "ansible-navigator.ansible.doc.help": "Defaults",
        "ansible-navigator.ansible.doc.plugin.name": "Not set",
        "ansible-navigator.ansible.doc.plugin.type": "Defaults",
        "ansible-navigator.ansible.inventory.entries": "Settings file",
        "ansible-navigator.ansible.inventory.help": "Settings file",
        "ansible-navigator.ansible.playbook.help": "Defaults",
        "ansible-navigator.ansible.playbook.path": "Previous cli command",
        "ansible-navigator.app": "Command line",
        "ansible-navigator.collection-doc-cache-path": "Defaults",
        "ansible-navigator.color.enable": "Defaults",
        "ansible-navigator.color.osc4": "Defaults",
        "ansible-navigator.editor.command": "Defaults",
        "ansible-navigator.editor.console": "Defaults",
        "ansible-navigator.enable-prompts": "Defaults",
        "ansible-navigator.exec.command": "Defaults",
        "ansible-navigator.exec.shell": "Defaults",
        "ansible-navigator.execution-environment.container-engine": "Settings file",
        "ansible-navigator.execution-environment.container-options": "Not set",
        "ansible-navigator.execution-environment.enabled": "Settings file",
        "ansible-navigator.execution-environment.environment-variables.pass": "Not set",
        "ansible-navigator.execution-environment.environment-variables.set": "Not set",
        "ansible-navigator.execution-environment.image": "Previous cli command",
        "ansible-navigator.execution-environment.pull.arguments": "Settings file",
        "ansible-navigator.execution-environment.pull.policy": "Defaults",
        "ansible-navigator.execution-environment.volume-mounts": "Not set",
        "ansible-navigator.format": "Defaults",
        "ansible-navigator.images.details": "Defaults",
        "ansible-navigator.inventory-columns": "Not set",
        "ansible-navigator.logging.append": "Settings file",
        "ansible-navigator.logging.file": "Defaults",
        "ansible-navigator.logging.level": "Settings file",
        "ansible-navigator.mode": "Defaults",
        "ansible-navigator.playbook-artifact.enable": "Defaults",
        "ansible-navigator.playbook-artifact.replay": "Not set",
        "ansible-navigator.playbook-artifact.save-as": "Defaults",
        "ansible-navigator.settings.effective": "Defaults",
        "ansible-navigator.settings.sample": "Defaults",
        "ansible-navigator.settings.schema": "Defaults",
        "ansible-navigator.settings.sources": "Defaults",
        "ansible-navigator.time-zone": "Defaults",
        "settings_file_path": "/home/ansible/playbooks/flashsystem_setup/ansible-navigator.yml",
        "settings_file_source": "Search path"
    },
    "status": "successful",
    "status_color": 10,
    "stdout": [
        "\u001b[1;35m[WARNING]: Invalid characters were found in group names but not replaced, use\u001b[0m",
        "\u001b[1;35m-vvvv to see details\u001b[0m",
        "\u001b[0;35m[DEPRECATION WARNING]: Specifying a list of dictionaries for vars is deprecated\u001b[0m",
        "\u001b[0;35m in favor of specifying a dictionary. This feature will be removed in version \u001b[0m",
        "\u001b[0;35m2.18. Deprecation warnings can be disabled by setting \u001b[0m",
        "\u001b[0;35mdeprecation_warnings=False in ansible.cfg.\u001b[0m",
        "",
        "PLAY [Create or validate hosts] ************************************************",
        "",
        "TASK [gather facts using ibm_svc_info] *****************************************",
        "\u001b[0;32mok: [localhost]\u001b[0m",
        "",
        "PLAY RECAP *********************************************************************",
        "\u001b[0;32mlocalhost\u001b[0m                  : \u001b[0;32mok=1   \u001b[0m changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   "
    ],
    "version": "2.0.0"
}
sumitguptaibm commented 11 months ago

You'll need to mention another parameter as below (where volumename is actual volume's name for which you want hosts) because objectname is mandatory for vdiskhostmap.

So, playbook task would like below:

  - name: Collect information for specific vdiskhostmap
    ibm.storage_virtualize.ibm_svc_info:
      clustername: "{{ clustername }}"
      gather_subset: vdiskhostmap
      objectname: volume0
      username: xxxxx
      password: xxxxxxx

Definitely, an improvement area is, to declare task as failed and show failure message when objectname is required but not provided. We'll work on that.

sumitguptaibm commented 11 months ago

@mainline-automation , I hope this resolves your issues. Please let us know if this there is anything else required, otherwise this issue will be closed by Friday 22nd December, 2023.

mainline-automation commented 11 months ago

Thank you. Would be good to have an error message beyond null but that resolves it.

sumitguptaibm commented 11 months ago

@mainline-automation, the fix (to enforce mandatory parameter) is identified. It will be available in the next release (i.e. ibm.storage_virtualize 2.3.0) in March 2024.