Hi,
I would like to modify the below script to know, total size of (Flats) Disks and and RDMs individually.
Get-VM | Get-HardDisk |
Select @{N='VM Name';E={$_.Parent.Name}},
@{N="IP Address";E={@($_.Parent.guest.IPAddress[0])}},
@{N="VM PowerState";E={@($_.Parent.PowerState)}},
@{N="CPU Count";E={@($_.Parent.NumCPU)}},
@{N="MemoryInGB";E={@($_.Parent.MemoryGB)}},
@{N="Capacity";;E={$_.CapacityGB}},
Example :
VMName IP Address VM PowerState CPU Memory Capacity RDM
TEST1 10.10.10.10 Powered On 2 4 80 100
Please help
I would say, use two different variables, $flatcapacity (to hold flat disk capacity) and $rdmcapacity (to hold the rdm disk capacity). Next use the following property to identify whether the disk if a flat or rdm disk
Get-VM | Get-HardDisk –DiskType 'RawPhysical'
This is the way we can achieve this. Please let me know if you need any help in the script. The points I can see that you need to keep in mind, create a loop and calculate the values, check whether there are multiple RDM disks and calculate them.
I would say, use two different variables, $flatcapacity (to hold flat disk capacity) and $rdmcapacity (to hold the rdm disk capacity). Next use the following property to identify whether the disk if a flat or rdm disk
Get-VM | Get-HardDisk –DiskType 'RawPhysical'
This is the way we can achieve this. Please let me know if you need any help in the script. The points I can see that you need to keep in mind, create a loop and calculate the values, check whether there are multiple RDM disks and calculate them.