powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Get-ScsiLun



NAME
Get-ScsiLun

SYNOPSIS
Retrieves the SCSI devices available on the vSphere server.

SYNTAX
Get-ScsiLun [[-CanonicalName] ] [-VmHost] [-Key ] [-LunType ] [-Server Server[]>] []

Get-ScsiLun [[-CanonicalName] ] [-Hba] [-Key ] [-LunType ] [-Server []>] []

Get-ScsiLun [[-CanonicalName] ] [-Datastore] [-Key ] [-LunType ] [-Serv
er ] []


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 ma
chine. Other examples include SCSI passthrough devices that can be used by virtual machines. When retrieving ScsiLu
n objects by Datastore, the cmdlet returns a ScsiLun object for each host connected to the specified datastore. Scs
iLun objects can be differed by their VMHost property.


PARAMETERS
-CanonicalName
Specify the canonical name of the SCSI devices you want to retrieve. An example of a SCSI canonical name for Wi
ndows is "vmhba0:0:0:0".

Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? true

-VmHost
Specify the hosts from which you want to retrieve the virtual SCSI devices.

Required? true
Position? 2
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true

-Key
Specify the linkable identifiers of the SCSI devices you want to retrieve.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

-LunType
Specify 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

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

-Server
Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the co
mmand runs on the default servers. For more information about default servers, see the description of Connect-V
IServer.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

-Hba
Specify the storage adapters for which you want to retrieve the SCSI devices.

Required? false
Position? 2
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true

-Datastore
Specify the datastores for which you want to retrieve the SCSI devices. This parameter is supported only for VM
FS volumes.

Required? false
Position? 2
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
ScsiLun


NOTES




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

C:\PS>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 --------------

C:\PS>Get-VMHost | Get-ScsiLun -CanonicalName "naa.*"


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





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

C:\PS>$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 --------------

C:\PS>Get-ScsiLun -Datastore Datastore -Key "key-vim.host.ScsiDisk-*"


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






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Get-ScsiLun.html
Get-ScsiLunPath
Set-ScsiLun
Set-ScsiLunPath