Free Capacity Management Tools

I have a lot of clients asking me what tools they can use to get an in depth view into their vSphere infrastructure. Of course as a VMware employee I always recommend vRealize Operations Manager, but sometimes the client is a small shop with a tight budget.

For me there are 3 choices, my own quick and dirty script that outputs everything to .csv (code is below), RVTools or a new tool I recently discovered; SexiLogs (please work on the title guys/gals, it raises eyebrows with some people).

I’ll start with sexilog:

Sexilog is deployed via a virtual appliance, you then point your ESXi syslogs to the appliance, couldn’t be simpler. It then uses a Kibana web interface to present you pretty graphs like this:

sexilog_dashboard-home

Team SexiLog up with Sexigraf and you got yourself a pretty powerful tool (keep in mind it’s informational, not an automated tool like vRealize Operations Manager can be).

Next up is RVTools, which most Administrators/Engineers/Architects have probably heard of before. It’s a .NET 2.0 program that can pull information from vCenter/ESXi Hosts and present it in an excel style display:

rvtools_info

It’s fairly straight-forward and doesn’t require an appliance to run like Sexilog does.

Finally is my script, which isn’t pretty but there are some clients that just want me to run something quick and dirty without downloading something else, installing an appliance, etc. This assumes you have at least read-only privledges into vCenter and that you have a D: drive on your system (change $folder to C:\VM_Reports if you don’t have a D: drive). It outputs CPU/RAM to one .csv and datastore information to another. Then it’s up to you to make it pretty for someone else to read.

# Take in vCenter name input
$VIServer = read-host "Please enter vCenter Server:"</code>

# Initialize array
$ReportData = @()

# Create VM reports folder **EDIT PATH**
$folder = 'D:\VM_Reports'
if (!(Test-Path $folder)) {
[void](new-item $folder -itemType directory)
}

# Connect to Virtual Center
Connect-VIserver $VIserver

# Get info on all datastores
foreach ($cluster in Get-Cluster){

Get-VMHost -Location $cluster | Get-Datastore | Sort-Object Cluster | %{
$DB = {} | Select Cluster, Name, CapacityGB, UsedGB, FreeGB, PercUsed
$DB.Cluster = $cluster.Name
$DB.Name = $_.name
$DB.CapacityGB = [math]::Round($_.capacityMB/1024,2)
$DB.UsedGB = [math]::Round(($_.CapacityMB - $_.FreeSpaceMB)/1024,2)
$DB.FreeGB = [math]::Round($_.FreeSpaceMB/1024,2)
$DB.PercUsed = [math]::Round(100*($_.CapacityMB - $_.FreeSpaceMB)/$_.CapacityMB,2)
$ReportData += $DB
}
}
# Output DB Report
$ReportData | Sort Cluster,Name | Export-Csv $folder\DBReport_$VIServer.csv -NoTypeInformation

# Get info on host performance
Get-VMHost |
Select @{N='Cluster';E={Get-Cluster -VMHost $_}},
@{N='Name';E={$_.Name}},
@{N='NumVM';E={($_ |Get-VM).Count}},
@{N='NumLUNs';E={($_ |Get-Datastore).Count}},
@{N='MemTotalGB';E={[math]::Round($_.MemoryTotalMB/1024,2)}},
@{N='MemUsageGB';E={[math]::Round($_.MemoryUsageMB/1024,2)}},
@{N='MemPercUsed';E={[math]::Round(100*$_.MemoryUsageMB/$_.MemoryTotalMB,2)}},
@{N='CPUTotalGhz';E={[math]::Round($_.CpuTotalMhz/1000,2)}},
@{N='CPUUsageGhz';E={[math]::Round($_.CpuUsageMhz/1000,2)}},
@{N='CPUPercUsed';E={[math]::Round(100*$_.CpuUsageMhz/$_.CpuTotalMhz,2)}} |

# Output Usage Report
Sort Cluster,Name |Export-Csv $folder\HostPerf_$VIServer.csv -NoTypeInformation

# Disconnect from Virtual Center
Disconnect-VIServer $VIServer -Confirm:$False

# Clear VIServer parameter for multiple script runs
$VIServer = ''

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *