Hi
I do have 70+ VMs . how can i see their sizes through power cli or cli . Its not all the VMs .Its particular VMs list in Vcenter . is there way can run in power cli.ps file.sorry i am not femilier with powershell
Try like this then
Select-Object Name,
@{N="HardDiskSizeGB"; E={(Get-HardDisk -VM $_ | Measure-Object -Sum CapacityGB).Sum}}
---------------------------------------------------------------------------------------------------------
Was it helpful? Let us know by completing this short survey here.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
What do you mean by "their sizes"?
Memory, storage space...?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
their storage(size of vm)
Like this you mean?
Get-VM | Select Name,ProvisionedSpaceGB
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Get-VM | Select-Object Name,@{n="HardDiskSizeGB"; e={(Get-HardDisk -VM $_ | Measure-Object -Sum CapacityGB).Sum}}
this giving all the VMs in the vCenter. I dont want that. I have few VMs in the note pad. I just need size of them
Try like this then
Select-Object Name,
@{N="HardDiskSizeGB"; E={(Get-HardDisk -VM $_ | Measure-Object -Sum CapacityGB).Sum}}
---------------------------------------------------------------------------------------------------------
Was it helpful? Let us know by completing this short survey here.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
It worked .Thanks alot Lucd. u made my day.Thanks alot
Also could you please help me with this
i want to get the same script run for 5 vCenters(seperate,not linkedmode) at a time . how can i do that. till now i have run in each vcenter and took the info.but just wanna check if we can run all vCenters at a time and export at a time. Appreciate for your time .
You could run through the vCenters in a ForEach loop, and collect all the results in 1 file.
Is that feasible?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
got it and its collecting the data. But the complete VM name is not coming .In the text there is full name. In the output its xyx..... is coming.Its not coming full name of VM
That is most probably because the line doesn't fit on the screen.
Try piping the result to Format-List
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference