preloader
6 December 2013 / #Powercli

vCenter resources’ ASCII ART inventory

In order to prepare a presentation about our infrastructure, it has been asked to us to retrieve virtual machine configuration types, meaning CPU count, memory size and disk size. Basically, we needed to provide a list with all CPU count, memory size and disk size information.

jeu_boulier

Rather than storing data in some boring classic csv file, we thought that we could reuse the graph function using ASCII Art that have been made for VM/Host/Cluster load in PowerCLI.

It will be possible to display some graphic representation for all virtual machine configuration:

get-ressourcemap_000

This script will display several map for your inventory. You’ll be able to display the map for CPU configuration:

C:\foo>.\Get-ResourceMap.ps1 -CPU

get-ressourcemap_001

With -MEM parameter, memory resource map will be displayed:

C:\foo>.\Get-ResourceMap.ps1 -MEM

get-ressourcemap_002

And with -Disk parameter, disk resource map will be displayed (size shown will be the sum of all disk size, result can be verbose ^^) :

C:\foo>.\Get-ResourceMap.ps1 -Disk

get-ressourcemap_003-118x300

You also run this script without any parameter, the result will display resource map for all component (CPU, MEM and disk):

C:\foo>.\Get-ResourceMap.ps1

The parameter -ExportData is also available to export retrieved data into csv file:

C:\foo>.\Get-ResourceMap.ps1 -CPU -ExportData

PS: parameters order is not important, you can call them wherever you want (i.e. you can run the following command line):

C:\foo>.\Get-ResourceMap.ps1 -CPU -ExportData
C:\foo>.\Get-ResourceMap.ps1 -CPU -MEM -ExportData
C:\foo>.\Get-ResourceMap.ps1 -MEM -CPU -ExportData

The Get-ResourceMap.ps1 script is available for download in our GitHub page: https://github.com/v-team/powercli-toolbox


> Frederic MARTIN