Installing the Pure Storage vSphere Plugin with vRealize Orchestrator

A few months back I published a new PowerShell cmdlet for installing the Pure Storage vSphere Client Plugin. Get-PfavSpherePlugin and Install-PfavSpherePlugin. This works quite well and we’ve had a fair amount of use of it so far, but another place we are certainly investing in right now is vRealize Orchestrator and continuing to enhance our plugin. Filling in any gaps around workflows and actions, especially on initializing an environment is important.

One of those gaps was installing the vSphere Plugin. One common use case we have seen around vRO is day 0 config, but day 2 stuff is done in vCenter (deploying VMs, datastores, etc). So the vSphere Plugin comes in handy here. So how do I install it from vRO?

Well just run the workflow I wrote! You can find it here:

Import the .workflow file and run it. There are no pre-requisities (you don’t even need our vRO plugin installed). The only need here is that your vCenter needs HTTPS (port 443 TCP) access to the internet. The plugin itself is available for GET access on an S3 bucket. Post-registration vCenter needs to download the plugin from there. Let me know if you’d like to use this for vCenter environments that cannot route out. My PowerShell method supports that (and so does the original FlashArray GUI method, but it is a bit trickier with vRO so this first release doesn’t offer it).

Once imported, go ahead and run it. The only input is one or more vCenter systems that you want to install it to.

The workflow will:

  • Check to make sure it is vCenter 6.5 or later. If it is not, then that vCenter will be skipped.
  • Check to make sure the plugin is not installed. If it is it must be an older version. If it is newer (or the same version) that vCenter will be skipped.
  • It will then register the plugin. vCenter will then subsequently download the plugin and make it available in the vSphere Client.
  • This will only work with the new HTML-5 plugin, it will not install the flash one.

Run the workflow and then choose one or more vCenters:

It will then iterate through the vCenters:

You will then see the plugin deploy!

Gory Details

The below stuff should not matter if you just want to install it like above. But if you want to know how I did it (for whatever reason) or you want to do it for another vendor, follow along.

If you are writing you own, DO NOT test on a production vCenter. Also, this is just my experience installing the Pure plugin, so experiences, requirements, and specifics might vary for others. Also if it is a remote vSphere plugin, things are a bit different there too. Though there are not a lot of those out there…yet.

Do you want to do this yourself or use my logic for another vendor plugin? Go for it of course! The key part is just filling out the extension data correctly, which can vary. So making sure you do that right is likely fairly important.

To access the extension manager, you can pull it from the vCenter connection (object type of sdkConnection):

var extensionMgr = vcenterSystem.extensionManager;

Then start populating the extension data. The way a plugin is installed into vCenter is by first registering an extension. This extension registration then will tell vCenter to download the plugin files from some HTTP(s) location if it has not done so yet. The best way to find out what you should put in here is by installing it in the typical way you install the plugin, then navigating to the vCenter Managed Object Browser and looking under the extension manager.

Find you extension and click on it:

There are a couple of important points here:

There are a few important parts:

  • Key. This is the unique identifier of the plugin. This must be accurate.
  • lastHeartbeatTime. This will get updated automatically. It seems to be important to set this though upon registration. Even something arbitrary. I found in some cases having this set to a null (or zeroed) date actually can kill the vCenter service immediately and fatally. So yeah set this.
  • Version. What version is the plugin?
  • Description, the name and the summary of the plugin.
  • Client and server. More on that in a bit.

So the description is simple:

var myVcDescription = new VcDescription() ;
myVcDescription.label = "Pure Storage Plugin";
myVcDescription.summary = "Pure Storage vSphere Plugin for Managing FlashArray";

The client property is fairly straight forward:

var myVcExtensionClientInfo = new VcExtensionClientInfo() ;
myVcExtensionClientInfo.Company = "Pure Storage, Inc.";
myVcExtensionClientInfo.Description = myVcDescription;
myVcExtensionClientInfo.Type = 	"vsphere-client-serenity";
myVcExtensionClientInfo.Url = url + "/vsphere/HTML5vRO/";
myVcExtensionClientInfo.Version = pluginVersion;

You can see these values in the MoB by clicking on the “client” property.

In the above I am storing some of these values in variables in vRO, like version and the URL root. What about the URL portion? Let’s discuss that in the next section as it is relevant there too.

Server is a bit trickier. The zip file needs to be hosted somewhere. Where is it hosted? Well the default location is on S3 for our plugin, but it is also on your FlashArray (it hosts a web server for the file). In short the zip file needs to be hosted at some HTTP or ideally HTTPS location.

var myVcExtensionServerInfo = new VcExtensionServerInfo() ;
myVcExtensionServerInfo.AdminEmail = ["[email protected]"];
myVcExtensionServerInfo.Company = "Pure Storage, Inc.";
myVcExtensionServerInfo.Description = myVcDescription;
myVcExtensionServerInfo.Url = url + "/vsphere/HTML5vRO/";
myVcExtensionServerInfo.ServerThumbprint = shaOne;
myVcExtensionServerInfo.Type = "https"

If you specify HTTPS, you need to also specify the server fingerprint (thumbprint) in SHA1 format. This allows for verifying the server authenticity when vCenter downloads the zip file.

Lastly put it all together. Note that I grab the current date and put that in for the lastHearbeat.

var myVcExtension = new VcExtension() ;
myVcExtension.key = "com.purestorage.purestoragehtml";
myVcExtension.version = pluginVersion;
myVcExtension.Description = myVcDescription;
myVcExtension.Client = [myVcExtensionClientInfo];
myVcExtension.Server = [myVcExtensionServerInfo];
timerDate = new Date();
timerDate.setTime( timerDate.getTime());
myVcExtension.LastHeartbeatTime = timerDate;

They key thing here: if it is populated in the MoB you should make sure to do the same when manually installed. Especially if there are custom privileges etc. Talk to your plugin vendor if you are unsure.

The last step is to install. If you are upgrading or installing new the call is different (updateExtension or registerExtension).




One Reply to “Installing the Pure Storage vSphere Plugin with vRealize Orchestrator”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.