Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 199442

Re: list disks rdm with powershell

$
0
0

Hello Chad,

Its good script. But I am looking a script to get the selected VM or all the VMs who has DiskType -eq “RawPhysical”, details with Properties (Host, VM, DiskNumber, Identifier, Policy, VirtualDeviceNode, Capacity )

Can you assist ?

I tried this as below --

 

Function Get-RAWDiskInfo {

$RDisks = Get-VM $VM | Get-HardDisk | Where {$_.DiskType -eq “RawPhysical”}

Foreach ($RDisk in $RDisks) {

$Lun = Get-VMHost -name (Get-VM $VM).VMHost | Get-SCSILun $RDisk.SCSICanonicalName

 

$Props = @{ 'VM Name' = $RDisk.Parent;

            'DiskType' = $RDisk.DiskType;

            'Name' = $RDisk.Name;

            'Filename' = $RDisk.Filename;

            'Scsi Name' = $RDisk.ScsiCanonicalName;

            'LUN ID' = $Lun.RuntimeName.Substring($Lun.RuntimeName.LastIndexof(“L”)+1)

         

            }

New-Object -TypeName PSObject -Property $props

}

}


Viewing all articles
Browse latest Browse all 199442


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>