As there is already a KB referenced in the release notes, I won't go into the "supported" way to do an agent upgrade. Rather, in this blog post I wanted to show how I used Postman REST client to do the upgrades, as customers may wish to leverage something other than the provided Python script to perform the upgrades in bulk. Using Postman, you can generate a number of different code snippets to use your favorite automation tool (js, Ruby, shell script, etc).
The upgrades for the supported method use the same API call - which is an "internal" API call (meaning, it's available but may be changed or removed in the future).
POST /internal/agent/upgrade
The body of the POST includes a payload with three elements (JSON example shown below).
{
"agentId" : "1432528944061-6735281266450674401-1746278254068293921",
"fileLocation" : "bundles/6.2.1",
"agentBundleFile" : "agent-x86-64-win-6.2.1.zip"
}
Note that since this is an internal API endpoint, you need an additional header to permit the operation.
X-vRealizeOps-API-use-unsupported : True
Easy enough, and in the Postman collection I have created for you there are three REST operations that can be run together to perform an upgrade on a single agent. First, grab the collection from the link below to import into your Postman client (assuming you have Postman installed already).
Upgrade EP Ops Agent Collection
Also, grab the vR Ops environment I have created for the variables used in the collection.
vrops.postman_environment.json
Import that environment into your Postman client and edit the following keys:
{{user}} = vR Ops user name
{{pass}} = vR Ops password
{{vrops}} = vR Ops FDQN or IP address
I'll come back to the other keys in a moment, but I want to explain why they are required.
As you can see below, the collection includes a GET for the agentID based on search against the FQDN or the agent's host system, then performs the update for the agent based on that ID and then finally does a check on the status of the update of the agent.
/usr/lib/vmware-vcops/user/plugins/inbound/agent_adapter/conf/plugins/agent_plugins/
That location is where you will place the "agentBundleFile" for the upgrade (available from the vR Ops download page). By the way, if you have a cluster deployment then you must have the bundle files installed on each node in the cluster.
{{agentFQDN}} = agent's host FQDN (case sensitive)
{{fileLocation}} = truncated path for bundle files
{{agentBundleFile}} = complete filename of agent bundle to use for the upgrade (OS/arch specific).
Example vrops environment values - the value for agentID is updated by the Postman tests script |
This should give you a general understanding of how you can use the vR Ops REST API to upgrade EP Ops agents.
great article! followed
ReplyDeleteHey John, not sure why but Bluecoat Proxy seems to flag your site as malicious.
ReplyDeleteThanks, Justin. I've submitted for a review.
Delete