Skip to content

PowerCLI 6.0 R2 – Announcing vROps Integration!

For those that have been requesting some vCOps and/or vROps integration into PowerCLI, as I have been, we finally have our solution! PowerCLI 6.0 R2 brings that to the table in the form of a new module: VMware.VimAutomation.vROps

The following functions are featured in the module:
Connect-OMServer
Disconnect-OMServer
Get-OMAlert
Get-OMAlertDefinition
Get-OMAlertSubType
Get-OMAlertType
Get-OMRecommendation
Get-OMResource
Get-OMStat
Get-OMStatKey
Set-OMAlert

Here’s a couple tips to get started using it:
To begin pulling stats you will need to authenticate to the vROps instance via Connect-OMServer:
Connect-OMServer

After getting connected, and being connected to an associated vCenter, check out the resources via Get-OMResource by piping it a VMHost, VM, or so forth:
get-omresource

As you can see, I pulled the resources for a VMHost. Some of the basic, higher level, information is in there such as Health status and value, whether or not vROps is receiving any data about it, and how far back data has been collecting for the resource.

The following is pulling the same information for the vROps VM in my lab environment:
get-omresource

If you want to go straight to the stats, I don’t blame you one bit. However just running the Get-OMStat command is going to fill your PoSh window with every single stat available for that resource at all the time points available. Overwhelming would be putting it lightly, so you’ll want to also familiarize yourself with Get-OMStatKey. This function allows you to see what all stats you can actually pull:
get-omstatkey

Couple things I feel the need to point out:

  • Include both the AdapterKind and ResourceKind objects when calling this function, it returns every possible stat key possible without it… All 17,646 of them.
  • Even when including the AdapterKind and ResourceKind, I would highly recommend filtering out what what you’re looking for. The HostSystem ResourceKind has 2225 stat keys alone.

Finally, lets select a stat key and pull some detailed stats by way of the Get-OMStat function. In this scenario, I’m pulling CPU Ready Summation values:
Get-OMStat

Some of the other functions included surround alerting.

The Get-OMAlert function pulls all of the vROps alerts:
get-omalert

Since there happens to be some alerts, let’s check out two abilities of the Set-OMAlert function. The first option being cancelling of an alert:
set-omalert -Cancel

If you notice in the example, the alert still exists but it’s status is changed to “Inactive”.

Next up, let’s check out the suspend function of the Set-OMAlert function:
Set-OMAlert -SuspendMinutes

Overall, the new module definitely gets my stamp of approval! Thanks to the Automation and PowerCLI team for listening to the users and getting this integrated!

Additional information is available at the following link: https://blogs.vmware.com/PowerCLI/2015/09/powercli-6-0-release-2-is-now-generally-available.html

Published inPowershellVMware

2 Comments

  1. Simon Wilmann Simon Wilmann

    I have been using this and it looks pretty cool.

    I\’m running this to try and automate VM resizing

    Get-OMStat -Resource $VMresource.name -Key \”cpu|numberToAdd\” -IntervalCount 30 -IntervalType Days -RollupType Avg -From ([datetime]::Now).adddays(-30) -To ([datetime]::Now) | ?{$_.Value -ge 1}

    but I keeps returning duplicate results

    Resource Key Value Time
    ——– — —– —-
    VDI00000000001 cpu|numberToAdd 1.96161023727006 7/04/2016 10:59:5…
    VDI00000000001 cpu|numberToAdd 1 8/04/2016 11:59:5…

    any ideas on what I am doing wrong?

  2. […] that you can leverage. I’d suggest perusing Mr. Kyle Ruddy’s post on this subject here. For the purposes of this very simple example I figured I’d use an average of the data […]

Leave a Reply