In our lab environment we are fortunate to have an EMC NS-120. Unfortunately we do not have iSCSI modules for it. In order for our non-fibre channel VMware hosts to access these LUNs we are forced to share them though a Celerra NAS appliance.
As you can see I have several initiators that need their LUN Masks changed. In order to change them through the GUI I would have to click properties on each initiator, change the Grant LUNs field and click OK.
There must be a quicker way!
Browsing the EMC Powerlink support site I stumbled across this little gem of information. All of the commands run by the GUI are logged in this file: /nas/log/cmd_log
I changed the LUNs granted on one of the initiators and the log file showed me that the command is:
server_iscsi server_2 -mask -set EMC01 -initiator iqn.1998-01.com.vmware:ucs01 -grant 1-2
Unfortunately there is no Grant ALL command, but I found that using the command line was much faster than using the GUI! For further information here is the information provided by server_iscsi – help:
usage: server_iscsi { <movername> | ALL }
-target {
-alias <alias_name> [-Q <iscsi_name>]
-create [<pg_tag>:np=<np_list> [<pg_tag>:np=<np_list> …]]
| -delete <alias_name>
| -rename <old_alias_name> <new_alias_name>
| -bind <alias_name> <pg_tag>:np=<np_list>
| -unbind <alias_name> { <pg_tag> | np=<np_list> }
| -info { <alias_name> | -all }
| -stat { <alias_name> | -all }
| -list
}
| -lun {
-number <lun_number>
-create <target_alias_name> -size <size>[M|G|T] -fs <fs_name>
[ -vp {yes|no} ] [ -readonly {yes|no} ]
| -extend <lun_number> -target <target_alias_name> -size <size>[M|G|T]
| -delete <lun_number> -target <target_alias_name>
| -info { <lun_number> | -all } [-target <target_alias_name>]
| -stat { <lun_number> | -all } [-target <target_alias_name>]
| -modify <lun_number> -target <target_alias_name> -readonly {yes [-Force] | no}
| -list [-target <target_alias_name>]
}
| -mask {
-list [<target_alias_name>]
| -info <target_alias_name> {-initiator <initiator_name> | -all }
| -set <target_alias_name> -initiator <initiator_name>
{ -grant <access_list>
| -deny <access_list>
}
| -clear <target_alias_name> -initiator <initiator_name>
}
| -ns isns
{ -info
| -set { -server <IP>[:<port>] | -esiport <port> }
| -clear { -server | -esiport | -all }
}
| -service { -start | -stop | -status }
| -snap {
-list [ -target <target_alias> [ -lun <lun_number> ] ]
| -info <snap_name>
| -create -target <target_alias_name>
-lun <lun_number>
[ -data <app_data> ]
| -modify <snap_name> -data <app_data>
| -delete { <snap_name> | -target <target_alias_name> -lun <lun_number> }
[ -Force ] }
| -restore <snap_name>
| -promote <snap_name> -initiator <initiator_name>
| -Demote <snap_name> [ -Force ]
}
| -help