VMware VAMI PowerCLi module


At the beginning of this year famous VMware guru William Lam wrote excellent series of articles “Exploring new VCSA VAMI API w/PowerCLI”. Together with that he released his VAMI PowerCLi module.

Excellent technology (thanks to VMware), good job (thanks to William) and great start point for community members like me.

I have released my version of VAMI (Virtual Appliance Management Interface) PowerCLi module.


There were two reasons for the module writing: overall module improvements and new functions.

Overall module improvements

  • All functions support simultaneous connections to multiple vSphere Automation SDK servers within the same PowerCLi session. All returned objects contain Server property.
Connect-CisServer VCSA, PSC1, PSC2
  • Some functions have been converted to advanced functions to support -Verbose and -Confirm parameters.
Start-VAMIService -Name vsphere-client –Verbose
Remove-VAMIUser lamw -Verbose -Confirm:$false
  • All functions return objects only (no more Write-Host). This allows to format or export an output from any function.
Get-VAMIStorageUsed | Format-Table –AutoSize
Get-VAMIHealth | Export-Csv -NoTypeInformation .\Health.csv
  • Pipeline supported for paired functions.
Get-VAMIService vsphere-client | Stop-VAMIService
Get-Help Get-VAMITime -Online
  • Some minor changes in Param () sections. For example, Get-VAMIService now can accept multiple services in the -Name parameter.
Get-VAMIService rbd,vsphere-client
  • Added some properties to returned objects in some functions. For example, Usage% property in the Get-VAMIStorageUsed and Description in the Get-VAMIService (like you see in the Web Client).
Get-VAMIStorageUsed | Get-Member
Get-VAMIService | Get-Member -MemberType NoteProperty

New functions

  • The Restart-VAMIService function. Well, it was simple Emoj, but if we have Get-VAMIService/Start-VAMIService/Stop-VAMIService – why could not we have Restart-VAMIService? Now we have.
Get-VAMIService rbd,vsphere-client | Restart-VAMIService
  • The Get-VAMIPerformance (CPU and Memory in VAMI UI). I will consider this function in more detail.



Connect-CisServer VCSA

By default, the function returns CPU and Memory metrics for the last day and takes the samples every two hours.


This can be controlled by -Period and -Interval parameters. The parameters are positional and Intellisense is supported as well.

Get-VAMIPerformance –Period Week –Interval DAY1
Get-VAMIPerformance Day HOURS6


Sometimes you will get zero metrics. There two reasons for this: either appliance was powered off awhile or a period, specified by -Period parameter overlaps with a period before the appliance was deployed. The -ExcludeZero switch will filter these metrics out from the report.

Get-VAMIPerformance –Period Quarter -ExcludeZero


And finally you can export a long period (three month) frequent report (get samples every five minutes) and analyze it in Excel later.

Get-VAMIPerformance Quarter MINUTES5 –ExcludeZero | Export-Csv –notype .\Perf.csv

If you are familiar with the Excel, there is no problem to build some graphs.


Your manager will like it Emoj.

You may also like:

VMware VSAN PowerCLi module

5 thoughts on “VMware VAMI PowerCLi module

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s