Script For List VMs with RDM

The script will list the below details:

◾Virtual Machine Name.
◾Hard Disk Name.
◾Disk Type (Physical or Virtual compatibility).
◾LUN ID of the device.
◾VML ID of the device.
◾VMDK File name.
◾The size of the RDM LUN.

Before you run this command, kindly connect to the vCenter Server or the ESXi host using the Connect-VIServer cmdlet.

Get-VM | Get-HardDisk | Where-Object {$_.DiskType -like “Raw*”} | Select @{N=”VMName”;E={$_.Parent}},Name,DiskType,@{N=”LUN_ID”;E={$_.ScsiCanonicalName}},@{N=”VML_ID”;E={$_.DeviceName}},Filename,CapacityGB | Export-Csv C:\Users\Jason\Desktop\RDM-list.csv -NoTypeInformation

The output of the CSV file will look something like below.

Script For List VMs with RDM

猜你喜欢

转载自blog.51cto.com/549687/2139678
RDM
今日推荐