Hi Everyone,
I wanted to find out the vRAM assigned for the sum of all the vms on the host through powercli script and output in csv format.Any help on this will much appreciated.
thanks
vmguy
Take a look at Luc's Query vRAM blogpost. I hope it does all that you need.
To write the output to a .csv file you can pipe the result of Luc's Get-vRAMInfo function to the Export-Csv cmdlet.
Regards, Robert
Take a look at Luc's Query vRAM blogpost. I hope it does all that you need.
To write the output to a .csv file you can pipe the result of Luc's Get-vRAMInfo function to the Export-Csv cmdlet.
Regards, Robert
Hi Rob,
Will this Script give total Assigned Memory for all the VMs on the Host ?Waiting for your reply
Thanks
vmguy
The script gives the configured, used and entitled vRAM per license type per vCenter server. Not exactly the same as per host.
I made a new script exactly what you asked for:
Get-VMHost | Sort-Object -Property Name | ForEach-Object { if ($_) { $VMHost = $_ $vRamAssigned = 0 $VMHost | Get-VM | Where-Object {$_.PowerState -eq "PoweredOn"} | ForEach-Object { if ($_) { $VM = $_ $vRamAssigned += if ($VM.MemoryMB -gt 96GB/1MB) {96GB} else {$VM.MemoryMB} } } New-Object -TypeName PSObject -Property @{ VMHost = $VMHost.Name vRamAssignedGB = [Math]::Round($vRamAssigned/1KB,2) } } } | Select-Object -Property VMHost,vRamAssignedGB | Export-Csv -Path vRamInfo.csv -NoTypeInformation -UseCulture
Thanks for your prompt reponse.I will get back to you after testing.
thanks
vmguy