Get Supported Hardware Versions from Cluster
Quite some time ago I had the need to retrieve the supported HW versions for an environment.. I don’t remember what the project was, but it wasn’t terribly important so I didn’t bother digging deeper to figure things out - I just worked around the issue. Last month William Lam posted an article on how to do this with PERL.
In this article Which Virtual Hardware Versions (VM Compatibility) Are Supported In vSphere?, William gave a simple example using a PERL script to retrieve the desired information for a given Cluster. I just came across this today, viewed the source of the .pl file and thought - hey that looks easy enough, I should be able to replicate the results in vCenter Orchestrator (vCO).
Prerequisites
vCenter Orchestrator should have the vCenter plug-in correctly configured.
Test/Dev
- Create a new workflow named “Get Supported Virtual Hardware Version” and add a single Scriptable Task to it.
- Add a single input named “cluster” of type “VC:ClusterComputeResource” to the workflow and bind it to the scriptable task
- Add the following code to the scriptable task:
|
|
- (Optional) - Go to the Presentation tab of the workflow, select the input and add a new property: Show in Inventory – this will allow you to right-click a Cluster in the vCO Inventory and run this workflow.
- Save and Close the workflow
- Run the workflow
- Select the desired cluster you wish to run the workflow against, then hit Submit
Upon submitting the workflow, the logs tab should display something along these lines (Your results will vary depending on your environment):
|
|
Attached is the solution workflow (Right Click and Choose Save As): Get Supported Virtual Hardware Version.workflow
Next Step for you
Take the code from this script and add it to an action. Action should take the same single input, but return an array of strings containing the vmx-## values. You would then be able to use this action as a source for future workflows that need the Hardware Version as an input. The action can be specified as the source for a “Predefined List of elements” property for the input.