Application Integration
cancel
Showing results for 
Search instead for 
Did you mean: 

Powershell to get lun IDs used in igroup?

 
Highlighted
pahpahpah
Occasional Contributor

Powershell to get lun IDs used in igroup?

Hi, 

I'm trying to get the lun IDs used in an igroup.  I can get a list of the volumes and the lun ids, but not really the IDs and the group.  The different commands also change ID values, Get-NSInitiatorGroup looks to be using an ID for the igroup, but if you put that in a variable and pop it out by volume name it uses the vol id.  I can see why these would be different just feel like i'm missing someting.  I'd like to check if a lun id is in use before assigning it rather than picking one and having it error out or having to have someone select one.  

I guess i could use a random number generator in a range, and if it errors out on a used lun id, have it regen and try again.  

Thank you,
Pah

1 REPLY 1

Re: Powershell to get lun IDs used in igroup?

Hello,

 

The place to look for lun IDs presented to the host I think would be the access map.... Get-NSAccessMap.

The command that will return the host seen LUN ID is called "Get-NSAccessControlRecord. It will map a Initiator Group to a Volume and assign a lun and the New-NSAccessControlRecord command offers the parameter to set the LUN any number you want.


i.e. New-NSAccessControlRecord -vol_name MyVol -initiator_group_id $ID -lun 3 the default is to use the next free LUN for that host.



I am a HPE Employee