In many organizations automation is a key component that allow IT to spend cycles where the business need them – perhaps innovation. Many VMware products have their own API’s and SDK that help organizations to automate process. VMware View doesn’t have publically available API’s that can be used in the automation process. However, VMware View does expose PowerShell cmdlets that can be used in the construction of a automated process via PowerShell scripts or via the construction of vCenter Orchestrator Workflows.
This article focus on the second one; vCO Workflows.
Not many people know that vCO can talk PowerShell using a PS module and that it’s a free tool that is automatically installed with your vCenter Server. The vCO PS module has the ability to create custom workflows based on a single PS cmdlet using a pre-defined workflow called: Generate an action for a PowerShell cmdled. This workflow can be found under Library > PowerShell.
The diagram below demonstrate a workflow created using Generate an action for a PowerShell cmdled for the VMware View PowerShell cmdlet Add-AutomaticLinkedClonePool. This View PS cmdlet as the name says, create a pool with Linked Clone desktops.
A basic tutorial of how to start using vCO and View PowerShell cmdlets has been created and posted in the VMware Communities. However, the example that was given in the post will not work for all VMware View cmdlets. In the post the author utilizes the com. vmware.library.powershell.generated module, while using the com.vmware.basic module will probably cater for all VMware View PS cmdlets. This is very important because choosing the wrong module will make the workflow not work properly.
Below I demonstrate the Generate an action for a PowerShell cmdled wizard for the Remove-Pool cmdlet.
To start creating your workflows to the following:
- Enable WinRM on the VMware View Server, by following the instructions on the PowerShell plugin documentation page. You will find this under “Supported Communication Protocol”, “Configure WinRM to Use HTTP”.
- Add the View Manager host to the VCO.
In VCO, Library -> PowerShell ->Configuration->Add a PowerShell host
- Create a Folder off the root library, called “View 5”.
- Make sure Generate a workflow is set to Yes.
- Run the Generate an action for a PowerShell cmdled wizard using com.vmware.basic module.
When selecting the PS cmdlet expand VMware.View.Broker SnapIn and you will be able to select one of the cmdlets available (see picture below).
Moving forward you will need to get familiar with Orchestrator and how to interact and create workflows. The example below demonstrate a workflow that interact with Active Directory and Oracle objects before defining the pool name for the Pool creation.
vCO has plugins and sample workflows for many VMware and Non-VMware products including vCenter, vCloud Director, Chargeback, Active Directory, PowerShell, SSH, XML, JDBC amongst others.
Over the next few posts I will start to publish examples of vCO workflow automation for VMware View. However, if you have created any interesting workflows or is willing to create a vCO workflow library for VMware View, please share with the community.