Hi,
is there a way to export to csv the windows drive letter (c:, d:, e:, etc) and vmware hard disk number ("Hard Disk 1", Hard Disk 2", etc) to a csv file?
Have a look at this document: http://communities.vmware.com/docs/DOC-12180
It's based on Hugo Peeters' Idea , but it uses the Invoke-VMScript cmdlet and hence doesn't require a working network connection between the VM and your PowerCLI station.
The export is sent to the Out-GridView cmdlet, but it can be easily redirected to a CSV file by replacing the line:
$DiskInfo | Out-GridView
with:
$DiskInfo | Export-Csv "C:\Script\VMDiskMapping.csv"
The link between the drive letter, which lives inside the OS running in your guest, and the virtual disk(s) attached to your guest are not obvious.
Hugo made, some time agao, a great script that makes the link based on SCSI IDs.
See Hugo's Get VMware Disk Usage with Powershell post.
In our soon to be released PowerCLI book, my co-author Arnim made an even more advanced script to do this.
But you will have to wait till the book is published :smileycool:
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Have a look at this document: http://communities.vmware.com/docs/DOC-12180
It's based on Hugo Peeters' Idea , but it uses the Invoke-VMScript cmdlet and hence doesn't require a working network connection between the VM and your PowerCLI station.
The export is sent to the Out-GridView cmdlet, but it can be easily redirected to a CSV file by replacing the line:
$DiskInfo | Out-GridView
with:
$DiskInfo | Export-Csv "C:\Script\VMDiskMapping.csv"