Set-EmcLunAccess

Masks or unmasks a LUN to a host, a cluster, an FC or iSCSI initiator.

 

Syntax

 

Parameters

-Lun <Lun>

Attributes: Required, Position: named

Specifies the ESI LUN object, which you can get with the ESI storage system object or the Get-EmcLun cmdlet.

 

-Hlu <UInt32>

Attributes: Optional, Position: named

Specifies the host logical unit for a LUN.

 

-HostSystem <IHostSystem>

Attributes: Required, Position: named

Specifies the ESI host system object. You can add a host system object to ESI with the Get-EmcHostSystemCredential and Connect-EmcSystem cmdlets. You can get a host system object with the Get-EmcHostSystem cmdlet. The object can be a stand-alone host system, a virtual machine, or a hypervisor.

 

-Available <SwitchParameter>

Attributes: Required, Position: named

Unmasks the LUN to the specified host, cluster systems, or FC or iSCSI initiators.

 

-iSCSI <SwitchParameter>

Attributes: Optional, Position: named

Specifies an optional parameter through which the iSCSI HBA type filter can be filtered out.

 

-FC <SwitchParameter>

Attributes: Optional, Position: named

Specifies an optional parameter through which the FC HBA type filter can be filtered out.

 

-Silent <SwitchParameter>

Attributes: Optional, Position: named

Turns off all the informational and verbose messages. However, it still displays errors.

 

-InitiatorId <String[]>

Attributes: Required, Position: named

Specifies the iSCSI or FC initiator ID.

 

-HostName <String>

Attributes: Required, Position: named

Specifies the host name.

 

-HostIpAddress <String>

Attributes: Required, Position: named

Specifies the host IP address.

 

-ClusterSystem <IClusterSystem>

Attributes: Required, Position: named

Specifies the ESI cluster system object. You can add the cluster system object to ESI by using the Get-EmcClusterSystemCredential and Connect-EmcSystem cmdlets. You can get the cluster system object by using the Get-EmcClusterSystem cmdlet.

 

-Unavailable <SwitchParameter>

Attributes: Required, Position: named

Masks the LUN for the specified host, cluster systems, or FC or iSCSI initiators.

 

-HostBusAdapters <HostBusAdapter>

Attributes: Required, Position: named

Specifies the host bus adapters and the HBA filter type can be specified optionally.

 

<CommonParameters>

This cmdlet supports these common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, and OutVariable. Type get-help about_commonparameters for more details.

 

Examples

-------------- Example 1 --------------

C:\PS>$l = Get-EmcLun mylun*

C:\PS>$h = Get-EmcHostSystem myhost*

C:\PS>$l | select ArrayLunId, name

C:\PS>$h | select name, IP address

C:\PS>Set-EmcLunAccess -Lun $l -HostSystem $h -Available

This example unmasks the LUN on the host system.

 

-------------- Example 2 --------------

C:\PS>$l | select ArrayLunId, name

C:\PS>$h | select name, IP address

C:\PS>Set-EmcLunAccess -Lun $l -HostSystem $h -UnAvailable

This example masks the LUN on the host system.

 

-------------- Example 3 --------------

C:\PS>$l | select ArrayLunId, name

C:\PS>$c | select name, IP address

C:\PS>Set-EmcLunAccess -Lun $l -ClusterSystem $c -Available

This example unmasks the LUN on the cluster system.

 

-------------- Example 4 --------------

C:\PS>$l | select ArrayLunId, name

C:\PS>$c | select name, IP address

C:\PS>Set-EmcLunAccess -Lun $l -ClusterSystem $c -Unavailable

This example masks the LUN on the cluster system.

 

-------------- Example 5 --------------

C:\PS>$lun = Get-EmcLun mylun*

C:\PS>$h= Get-EmcHostSystem myHost*

C:\PS>Get-EmcHostBusAdapter -HostSystem $h | select GlobalId

    GlobalId

    --------

    20:00:00:24:FF:31:C6:BA:21:00:00:24:FF:31:C6:BA

    20:00:00:24:FF:31:C6:BB:21:00:00:24:FF:31:C6:BB

    iqn.1991-05.com.microsoft:vmTest.sr5dom.eng.emc.com

 

C:\PS>Set-EmcLunAccess -Lun $lun -InitiatorId iqn.1991-05.com.microsoft:vmTest.sr5dom.eng.emc.com -HostName $h.Name -HostIpAddress $h.IpAddress -Available

This example unmasks the specified LUN on the specified iSCSI or FC initiator.

 

-------------- Example 6 --------------

C:\PS>$lun = Get-EmcLun mylun*

C:\PS>$h= Get-EmcHostSystem myHost*

C:\PS>Get-EmcHostBusAdapter -HostSystem $h | select GlobalId

    GlobalId

    --------

    20:00:00:24:FF:31:C6:BA:21:00:00:24:FF:31:C6:BA

    20:00:00:24:FF:31:C6:BB:21:00:00:24:FF:31:C6:BB

    iqn.1991-05.com.microsoft:vmTest.sr5dom.eng.emc.com$ip= $h | select ipaddress

 

C:\PS>Set-EmcLunAccess -Lun $lun -InitiatorId iqn.1991-05.com.microsoft:vmTest.sr5dom.eng.emc.com -HostName $h.Name -HostIpAddress $h.IpAddress -Unavailable

This example masks the specified LUN to the specified iSCSI or FC initiator.

 

-------------- Example 7 --------------

C:\PS>$l = Get-EmcLun mylun*

C:\PS>$hba = Get-EmcHostBusAdapter -HostSystem myhost*

C:\PS>Set-EmcLunAccess -Lun $l -HostBusAdapters $hba  -FC -Available

This example unmasks the LUN from the specified HBAs with the FC type.