Start a Conversation

Solved!

Go to Solution

877

February 10th, 2021 16:00

Get volume information from dellemc_unity_host Module

Hello,
I am trying to get the volumes mapped to a host but the module only shows the volume hash.
is it possible to get the volume name and id from dellemc_unity_host.py or dellemc_unity_gatherfacts.py?

    - name: Get Host details using host_name
      dellemc_unity_host:
        unispherehost: "{ {array_name}}"
        username: "{ {username}}"
        password: "{ {password}}"
        verifycert: "{ {verifycert}}"
        host_name: "{ {host_name}}"
        state: "present"
      register: result1

OUTPUT:

    "result1": {
        "changed": false,
        "failed": false,
        "host_details": {
            "auto_manage_type": "HostManageEnum.UNKNOWN",
            "datastores": null,
            "description": "Ansible testing Host",
            "existed": true,
            "fc_host_initiators": [
                "20:00:00:10:00:00:00:01:10:00:00:10:00:00:00:01",
                "20:00:00:10:00:00:00:05:10:00:00:10:00:00:00:05"
            ],
            "hash": 8769389780145,
            "health": {
                "UnityHealth": {
                    "hash": 8769390374225
                }
            },
            "host_container": null,
            "host_ip_ports": null,
            "host_luns": {
                "UnityHostLunList": [
                    {
                        "UnityHostLun": {
                            "hash": 8769389780161
                        }
                    },
                    {
                        "UnityHostLun": {
                            "hash": 8769389780209
                        }
                    },
                    {
                        "UnityHostLun": {
                            "hash": 8769389780189
                        }
                    },
                    {
                        "UnityHostLun": {
                            "hash": 8769389780221
                        }
                    },
                    {
                        "UnityHostLun": {
                            "hash": 8769389780153
                        }
                    }
                ]
            },
            "host_polled_uuid": null,
            "host_pushed_uuid": null,
            "host_uuid": null,
            "host_v_vol_datastore": null,
            "id": "Host_96",
            "iscsi_host_initiators": null,
            "last_poll_time": null,
            "name": "Server_Test",
            "os_type": "Windows Server",
            "registration_type": null,
            "storage_resources": null,
            "tenant": null,
            "type": "HostTypeEnum.HOST_MANUAL",
            "vms": null
        }
    }

72 Posts

February 11th, 2021 12:00

Hi Resnik066,

The lun list for host details returned by the host module has not been implemented yet.  Unfortunately the only valid information returned for a host is in these fields:

      id: The system ID given to the host
      name: The name of the host.
      description: Description about the host.
      fc_host_initiators: Details of the FC initiators associated with the host
      iscsi_host_initiators: Details of the ISCSI initiators associated with the host
      os_type: Operating system running on the host.
      type: HostTypeEnum of the host.

The extra fields with the hash value are being returned based on the mechanism used to get information from the underlying Python SDK.

As a possible workaround here are a couple of options that I found…

  1. You could use the gather facts and volumes modules to get a list of volumes and then interrogate each for the list of attached hosts.  
  2. Another option is the use the Unity Python SDK directly (storops).  This is the same SDK used by the ansible modules.  Using it directly would let you traverse the model it contains one more level further down compared to the Ansible host module and then you would have the LUN name and other data.

I have discussed this with our product manager and we will hopefully see the additional functionality included in a release soon.

thanks
Bryan

 

9 Posts

February 16th, 2021 09:00

Thanks for the clarification, I hope this funtionality is added on new releases.

No Events found!

Top