Automation

 View Only
  • 1.  Export windows Drive Letter and vmware Hard Disk number to csv

    Posted Feb 10, 2011 06:08 PM

    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?



  • 2.  RE: Export windows Drive Letter and vmware Hard Disk number to csv

    Posted Feb 10, 2011 08:38 PM

    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:



  • 3.  RE: Export windows Drive Letter and vmware Hard Disk number to csv
    Best Answer

    Broadcom Employee
    Posted Feb 11, 2011 10:37 AM

    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"