vSphere PowerCLI Cmdlets Reference

Get-ScsiLun

Synopsis

Retrieves the SCSI devices available on the vSphere server.

Syntax

Get-ScsiLun [[-CanonicalName] <String[]>] [-VmHost] <VMHost[]> [-Key <String[]>] [-LunType <String[]>] [-Server <VIServer[]>] [<CommonParameters>]
Get-ScsiLun [[-CanonicalName] <String[]>] [-Hba] <Hba[]> [-Key <String[]>] [-LunType <String[]>] [-Server <VIServer[]>] [<CommonParameters>]
Get-ScsiLun [[-CanonicalName] <String[]>] [-Datastore] <Datastore[]> [-Key <String[]>] [-LunType <String[]>] [-Server <VIServer[]>] [<CommonParameters>]

Related Commands

Online version
Get-ScsiLunPath
Set-ScsiLun
Set-ScsiLunPath

Detailed Description

Retrieves the SCSI devices available on the the vSphere server. Examples of SCSI logical unit objects include disks which may contain file system volumes or parts of volumes for the host or might serve as raw disks to a virtual machine. Other examples include SCSI passthrough devices that can be used by virtual machines.

Parameters

NameDescriptionRequired?Pipeline InputDefault Value
CanonicalNameSpecify the canonical name of the SCSI devices you want to retrieve. An example of a SCSI canonical name for Windows is "vmhba0:0:0:0".falsefalse
VmHostSpecify the hosts from which you want to retrieve the virtual SCSI devices.truetrue (ByValue)
KeySpecify the linkable identifiers of the SCSI devices you want to retrieve.falsefalse
LunTypeSpecify the type of the SCSI devices you want to retrieve. The following types are valid:

cdrom
communications
disk
enclosure
mediaChanger
opticalDevice
printer
processor
scanner
storageArrayController
tape
unknown
worm
falsefalse
ServerSpecify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falsefalse
HbaSpecify the storage adapters for which you want to retrieve the SCSI devices.falsetrue (ByValue)
DatastoreSpecify the datastores for which you want to retrieve the SCSI devices. This parameter is supported only for VMFS volumes.falsetrue (ByValue)

Return Type

ScsiLun

Notes

Examples

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

Get-ScsiLun -VMHost 10.23.123.100 -LunType disk

Retrieves the SCSI devices of "disk" type for the virtual machine host with an IP address 10.23.123.100.

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

Get-VMHost | Get-ScsiLun -CanonicalName "naa.*"

Retrieves the SCSI devices with canonical names that starts with "naa." on the provided host.

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

$hba = Get-VMHost | Get-VMHostHba -Type ParallelScsi

Get-ScsiLun -Hba $hba -LunType disk

Retrieves the SCSI devices of "disk" type for the specified HBA devices.

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

Get-ScsiLun -Datastore Datastore -Key "key-vim.host.ScsiDisk-*"

For the Datastore datastore, retrieves the SCSI devices that have the specified linkable identifiers.


Copyright © 1998 - 2010 VMware, Inc. All rights reserved.