Unsolved
This post is more than 5 years old
1 Rookie
•
11 Posts
0
10554
March 24th, 2017 11:00
Unity CLI to add LUNs to Hosts
I am working with scripts to build out a Unity array in the same manner that you can do a VNX (bind LUNs, create/populate Storage Groups, name LUNs, etc.). One thing I have not found is a way to actually "add" a LUN to a host. The manual shows how to change the HLU or show the details, but actually adding a LUN to a host seems to be missing. Can someone point me at the propper syntax?
No Events found!



AndreD Dell
Moderator
•
239 Posts
0
March 27th, 2017 06:00
Forgot to add:
This can also be achieved with RestAPI.
AndreD Dell
Moderator
•
239 Posts
0
March 27th, 2017 06:00
Hi ramseyhere,
It's not how to add LUNs to hosts, but rather what hosts can access what LUNs.
Page 390 of new UEMCLI guide
https://support.emc.com/docu69330_Unity_Family_Unisphere_CLI_User_Guide.pdf?language=en_US
Change LUNs
Change the settings for a LUN.
Format
/stor/prov/luns/lun -id set [-async] [-name ] [-descr ] [-size ] [{-group | -standalone}][{-sched | -noSched}] [-schedPaused {yes | no}] [-spOwner {spa | spb}] [-fastvpPolicy {startHighThenAuto | auto |highest | lowest}] [-lunHosts ] [-snapHosts ] [-replDest {yes | no}] [-ioLimit | -noIoLimit] [-compression {yes | no}]
-lunHosts -> Specify a comma-separated list of hosts with access to the LUN.
Andre
maniemc
169 Posts
1
March 27th, 2017 15:00
Just to give examples of what @Andre said:
1) Identify the host ids from : uemcli /remote/host show (Example Host_2,Host_5)
2) During lun creation :
uemcli -u admin -p pass -d array /stor/prov/luns/lun create -name lun_for_mail -pool pool_2 -size 1G -thin yes -lunHosts Host_4,Host_5
or
to add for an existing lun - identify the lun id
uemcli -u admin -p pass -d array /stor/prov/luns/lun -id sv_12 set -lunHosts Host_4,Host_5
3) In case a specific HLU id is required instead of the auto hlu id assigned : uemcli /remote/host/hlu - can be used after adding a host to a lun
stevejpage
1 Message
0
May 25th, 2018 09:00
What about if the LUN already has hosts connected to it; do you need to include all the hosts connected plus the new host?
AndreD Dell
Moderator
•
239 Posts
1
May 30th, 2018 01:00
Hi stevejpage,
Please note that
If you are on old code (please upgrade) or need to use the LUN set command for some reason, then yes, if you use the LUN set command, you need to specify all the hosts that this LUN will be mapped to.
If you only specify the new host, all others are implicitly removed.
Thanks
Andre @ Dell EMC
jem3
6 Posts
0
August 16th, 2018 13:00
When using /remote/host set -addLuns with vmfs datastores do you use the lun names (as in sv_1, sv_2) or the friendly names you have named your vmfs? I'm guessing you use the names provided by /remote/host show -detail in the Accessible LUNs field which would be sv_x. The guide says to use friendly names but 1) I don't think that's correct and 2) I don't find sv_x very friendly.
zzTechOps
1 Message
0
May 1st, 2019 13:00
Use friendly names, at least for creating vmfs style LUNs, for instance I used the below command to create a VMFS LUN named DC1-Exch01_L1 and provision it to Host 19 & 20 (which are the CLI ID which you can get from the GUI or CLI, I did not try this with friendly host names). This has let me use Excel to concatenate a bunch of text to create commands to build and provision the 60 LUNs for our build, then repeat this in our second location. Much better than using the GUI (IMHO)