I'm trying to retrieve a list of LUNs attached to hosts on my Unitys and I need to know the host LUN ids, but I'm getting a lot of information (name, wwn, size), but no host LUN id. Does anyone know how to retrieve this from a Unity system using Powershell?
If we cannot find the right Powershell command, I'll be forced to embed uemcli commands into powershell, which is not what I prefer, because I'm dependent on the installed uemcli version as well.
If you then go to the RestAPI reference guides under https:///apidocs/index.html, you can get all the info you need by just using normal RestAPI calls.
An example here would be:
- Get your hosts with: Get-UnityHost
- Get your LUNs with: Get-UnityLUN
- Get or extrapolate the hostLUN ID:
Extrapolate:
The hostLUN ID is a value in the format of "Host_X_sv_xxx_prod" (Host ID combined with the LUN ID). So for example for Hots16 and LUN sv_506, the hostLUN ID would be: Host_16_sv_506_prod
It's not straight forward, and there is probably a better way of doing this. You have to go through the docs, and have a word with the module devs to see if this can be added (this seems easy to script).
Andre @ Dell EMC
If this answered your question, please remember to mark this thread as resolved/answered, so it can help other users.
we're still working on figuring out how to combine the various outputs we're getting so that I can see a list of LUNs that belong to a host including the HLU of each LUN. And the other way around too: a list of hosts with their HLU that have access to a LUN. I'll update this thread when I have a working solution.
AndreD Dell
Moderator
•
239 Posts
11733
1
Posted December 21st, 2018 03:00
Hi RRR,
By powershell do you mean UEMCLI?
The command you are looking for might be:
uemcli -no /stor/prov/luns/lun show -detail
Check the line that reads "Host LUN IDs" and the line above that.
You can filter also for what you need only. Example:
uemcli -no /stor/prov/luns/lun show -filter "ID,Name,LUN access hosts,Host LUN IDs"
Sample output:
ID = sv_xx
Name = Test_LUN
LUN access hosts = Host_13, Host_14, Host_9, Host_10
Host LUN IDs = 7, 7, 7, 7
So from here you get what hosts can see a LUN, along with the Host LUN ID they are mapped with.
If you need to see it the other way around (from the host side, not LUN), then try the host command:
uemcli -no /remote/host show -detail
The filter option can also be used here.
All these outputs are based on Unity OE 4.4.1, so if you are running dated versions, you may not have some options.
Hope this helps.
Andre @ Dell EMC
If this answered your question, please remember to mark this thread as resolved/answered, so it can help other users.