Hi
Does someone know how to write a script to list the datastore namse that each disk reside on?
Thanks
Hi
See below 3 links
To list VM, cluster, hosts, folders, vmdk file path
Virtual Machine VMDK file report with PowerCLI | vNiklas Virtualization blog
PowerCLI List all VMDK disks and what datastore they are on | Virtual Me
Thanks,
Bayu
hi try this,
$vm = Get-vm <vmname>
$vhdds = $vm | get-harddisk
foreach($vhdd in $vhdds)
{
$hddlabel = $vhdd.extensionData.DeviceInfo.Label
$hddSize = $vhdd.CapacityGB;
$hddFilePath = $vhdd.FileName
}
this is same as in the links but simpler version, you can print or export the variables as you need.
for FilePath if you only need Datastore,
do
$hddFilePath = $hddFilePath.Split(" ")[0]
hope this helps
Can you add naa.id on this script? Thanks
You rather get RVtools export .It has all this info in nice excel file ![]()
You can get it from here RVTools - Home
