Get-ScsiLun Command | Vmware PowerCLI Reference

Get-ScsiLun

This cmdlet retrieves the SCSI devices available on the vCenter Server system. 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. When retrieving ScsiLun objects by Datastore, the cmdlet returns a ScsiLun object for each host connected to the specified datastore. ScsiLun objects can be differed by their VMHost property.

Syntax

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

Parameters

Required Parameter Name Type Position Features Description
required
Datastore Datastore[] 1
  • pipeline
  • wildcards
Specifies the datastores for which you want to retrieve the SCSI devices. This parameter is supported only for VMFS volumes.
optional CanonicalName String[] named
  • wildcards
Specifies 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".
optional Key String[] named
  • wildcards
Specifies the linkable identifiers of the SCSI devices you want to retrieve.
optional LunType String[] named
  • wildcards
Specifies 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
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Get-ScsiLun
[ -Hba ] < Hba[] >
[-CanonicalName < String[] > ]
[-Key < String[] > ]
[-LunType < String[] > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Hba Hba[] 1
  • pipeline
  • wildcards
Specifies the storage adapters for which you want to retrieve the SCSI devices.
optional CanonicalName String[] named
  • wildcards
Specifies 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".
optional Key String[] named
  • wildcards
Specifies the linkable identifiers of the SCSI devices you want to retrieve.
optional LunType String[] named
  • wildcards
Specifies 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
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Get-ScsiLun
[ -VmHost ] < VMHost[] >
[-CanonicalName < String[] > ]
[-Key < String[] > ]
[-LunType < String[] > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
VmHost VMHost[] 1
  • pipeline
  • wildcards
Specifies the hosts from which you want to retrieve the virtual SCSI devices.
optional CanonicalName String[] named
  • wildcards
Specifies 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".
optional Key String[] named
  • wildcards
Specifies the linkable identifiers of the SCSI devices you want to retrieve.
optional LunType String[] named
  • wildcards
Specifies 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
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Get-ScsiLun
-Id < String[] >
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Id String[] named
Specifies the IDs of the SCSI devices that you want to retrieve. Note: When a list of values is specified for the Id parameter, the returned objects would have an ID that matches exactly one of the string values in that list.
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.

Output

VMware.VimAutomation.ViCore.Types.V1.Host.Storage.Scsi.ScsiLun

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.

Related Commands

ScsiController

This cmdlet retrieves the virtual SCSI controllers assigned to the specified HardDisk, VirtualMachine, Template, and Snapshot objects.

This cmdlet creates a new SCSI controller.

This cmdlet modifies the specified SCSI controllers.

ScsiLun

This cmdlet retrieves the SCSI devices available on the vCenter Server system.

This cmdlet modifies the configuration of a SCSI device.

ScsiLunPath

This cmdlet retrieves the list of vmhba paths to a specified SCSI device.

This cmdlet configures a vmhba path to a SCSI device.