Module Overhaul: tds-vRops

In the automation world, we have a tendency to touch on a particular product or technology then move on to something else. I did a bit of work on vRops a while back now, and having circled back around to it recently it was time to update the module and add some new functions relating to what I was doing. Read on to see what’s new.

PowerShell is Dead, Long Live PowerShell

I have been scripting nearly exclusively in PowerShell 7 for a while now and rarely use PowerShell for Windows. If you are still hanging on to 5.1 and ISE, then I urge you to take a closer look at PowerShell 7. As such, I’ve dropped support for 5.1 in this module as it allowed for a lot of code simplification around the handling of self signed certificates.

Often when scripting for RESTful API’s, we need to factor in how certificates are handled, because as we know, out in the real world, people will use self signed certificates all over the place. This is handled a lot more neatly using PowerShell 7’s -SkipCertificateCheck allowing me to rip out the hacky looking .net code used in 5.1.

Of course, you really should be using valid certificates πŸ˜‰

vRops 8.1 Removes Basic Auth

In a previous version of this module, I simply passed a credential object into each function and used basic authentication with each API call. As of vRops 8.1, basic authentication is no longer enabled by default. See here on how to enable it if you must use it for some reason.

The updated module now uses a PowerShell class to create a vRops connection object. This is a lot neater, and token based authentication is also a lot faster in scenarios where a lot of calls are made to the API.

Current List of Functions

This list will be out of date very quickly, but as of writing here are the functions contained in tds-vRops.

  • Connect-vROPs – Create a connection object to the specified instance. This is then passed to subsequent functions.
  • Deploy-vROPS – This is a new deployment function to deploy an 8.x appliance from OVA.
  • Export-VROPsPolicy – This function exports the specified policy to an XML file.
  • Get-NodeThumbprint – Get the SSL thumbprint of a node, required for certain operations such as forming a cluster.
  • Get-vROPsGroupPolicy – Get the policy applied to a vRops custom group.
  • Get-vROPsInventory – Get a list of objects managed by the vRops instance, virtual machines, hosts or datastores.
  • Get-vROPsPolicyReport – Report on what alerts are associated with what policies. This can be useful if you have custom alerts that you want to make a change to but perhaps unclear what policies are consuming it, or for finding custom alerts that are no longer used.
  • Import-VROPsPolicy – Import a policy file from XML file (as is exported by Export-vRopsPolicy). This function has an example of multipart form upload in PowerShell and was discussed in this previous blog post.
  • New-vRopsCluster – New in this update, this function creates a new cluster consisting of a Master node and a single Replica. This may be updated in the future to include multiple Replicas or other node types.
  • Set-vROPsGroupPolicy – Apply a vRops policy to a custom group.
  • Wait-Casa – A challenge when automating the deployment of new appliances is to know when the API is available and we can move to the next step of automation. This function will wait on the CaSa API becoming available.
  • Wait-Cluster – Another wait function, this time we are waiting for the vRops cluster to complete initialisation and allow the next step of automation to take place safely.

So a few functions building up in this vRops toolkit now πŸ™‚ There will no doubt be more functions in the future as I work through a deployment piece, but in the meantime, shout out if you have any suggestions or ideas. Happy automating πŸ‘

Get the tds-vrops module on Github.

Leave a Reply

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

You are commenting using your 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 )

Connecting to %s

%d bloggers like this: