Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 201745

Re: Reporting resource usage per VMfolder

$
0
0

This will give you the list per vCenter, provided you are not running in multiple mode, with the full folderpath (which can be handy in case of duplciate names).

And it uses only 1 Get-VM call

 

Get-VM|Group-Object-Property {$_.Folder.Id} |
Select@{N="Folder";E={
 
$folder=$_.Group[0].Folder
 
$path=$folder.Name
 
while($folder.Parent){
   
$folder=$folder.Parent
   
$path=$folder.Name+"/"+$path
  }
 
$path
  }}
,
 
@{N="NumCPU";E={$_.Group|Measure-Object-PropertyNumCpu-Sum|Select-ExpandPropertySum}},
 
@{N="MemoryGB";E={$_.Group|Measure-Object-PropertyMemoryGB-Sum|Select-ExpandPropertySum}}

Viewing all articles
Browse latest Browse all 201745

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>