Find-EmcHostDisk

Finds the ESI Host Disk associated with an ESI LUN, host LUN identifier, or VM disk configuration on a host or cluster system.

 

Syntax

 

Description

This cmdlet finds the ESI host disk associated with the specified LUN or HostLunIdentifier or VmDiskConfiguration on a specified host system or cluster system by updating or refreshing the host disks.

 

Parameters

-HostSystem <IHostSystem>

Attributes: Required, Position: named

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

 

-HostLunIdentifier <HostLunIdentifier>

Attributes: Required, Position: named

Specifies the ESI HostLunIdentifier object, which you can get from the ESI host disk object, the ESI cluster disk object, or by using the Get-EmcHostLunIdentifier cmdlet.

 

-RescanCount <UInt32>

Attributes: Optional, Position: named

Specifies the rescan count number for the LUN.

 

-Silent <SwitchParameter>

Attributes: Optional, Position: named

An optional parameter to turn off all the informational and verbose messages. However, it still displays errors.

 

-Lun <Lun>

Attributes: Required, Position: named

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

 

-ClusterSystem <IClusterSystem>

Attributes: Required, Position: named

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

 

-VirtualMachine <IHostSystem>

Attributes: Required, Position: named

Specifies the ESI virtual machine host system object. The ESI virtual machine is derived from the host system. You can add a virtual machine to ESI by using the Get-EmcHostSystemCredential and Connect-EmcSystem cmdlets, the same as the host system. You can get a virtual machine host system object by using the Get-EmcHostSystem cmdlet.

 

-VmDiskConfig <VmDiskConfiguration>

Attributes: Required, Position: named

Specifies the ESI VmDiskConfiguration object, which encapsulates the attached file-based disk or pass-through disk configuration information such as the SCSI controller ID, index, and attached LUN number. The object can be used to find the disk in the virtual machine if a file-based or pass-through disk is attached to a virtual machine from a hypervisor. The Add-EmcFilebasedDiskToVirtualMachine and Add-EmcPassthroughDiskToVirtualMachine cmdlets return the VmDiskConfiguration object.

 

<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&gt;$l = New-EmcLun -Pool $p -Name mylun_test_1 -Capacity 2GB -Silent

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

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

TaskStatus: Started

 10% : Unmasking the LUN to the specified host(s)...

100% : The specified LUN has been unmasked to the specified initiators...

TaskStatus: Completed

 

C:\PS>$hd = Find-EmcHostDisk -HostSystem $h -Lun $l -Silent

C:\PS>$hd.HostDiskIdentifier

\\?\PhysicalDrive7

This example creates a LUN, unmasks the LUN to a host system, and finds the corresponding disk.

 

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

C:\PS&gt;$l = New-EmcLun -Pool $p -Name mylun_test_1 -Capacity 2GB -Silent

C:\PS>$h = Get-EmcClusterSystem myclus*

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

 

C:\PS>$hd = Find-EmcHostDisk -ClusterSystem $h -Lun $l -Silent

C:\PS>$hd.HostDiskIdentifier

\\?\PhysicalDrive5

This example creates a LUN, unmasks the LUN to a cluster system, and finds the corresponding disk.

 

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

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

C:\PS>$h.Model

Hyper-V, PowerEdge R710

C:\PS>$vm = Get-EmcHostSystem *.148

C:\PS>$vm.Model

Virtual Machine

C:\PS>$h | Update-EmcSystem -Silent

C:\PS>$vmconfig = $vm | Get-EmcVirtualMachineConfiguration

C:\PS>$locations =Get-EmcAvailableScsiControllerLocation -VirtualMachineConfiguration $vmconfig -ScsiControllerIndex 0

C:\PS>$passthroughDisks = $h | Get-EmcAvailableEmcPassthroughDiskCandidate

C:\PS>$diskConfig = Add-EmcPassthroughDiskToVirtualMachine -VirtualMachineConfiguration $vmconfig -HostDisk $passthroughDisks[0] -Location $locations[0]

C:\PS>$hd = Find-EmcHostDisk -VirtualMachine $vm -VmDiskConfig $diskConfig

C:\PS>Remove-EmcVirtualDiskFromVm -VirtualMachineConfiguration $vmconfig -Location $locations[0] -force

This example attaches a pass-through disk to a virtual machine with the VmDiskConfiguration cmdlet. The Find-EmcHostDisk cmdlet finds the corresponding disk in the virtual machine.

 

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

C:\PS>$l = New-EmcLun -Pool $p -Name mylun_test_1 -Capacity 2GB -Silent

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

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

TaskStatus: Started

 10% : Unmasking the LUN to the specified host(s)...

100% : The specified LUN has been unmasked to the specified initiators...

TaskStatus: Completed

C:\PS>$lunIdentifier = Get-EmcHostLunIdentifier -Lun $l

 

C:\PS>$hd = Find-EmcHostDisk -HostSystem $h -HostLunIdentifier $lunIdentifier -RecanCount 10 -Silent

C:\PS>$hd.HostDiskIdentifier

\\?\PhysicalDrive7

This example creates a LUN, un-masks the LUN to the specified host system, and finds the corresponding disk for the LUN identifier.