Deploy appliances via PowerCLI

Needed to deploy some appliances. I could have done that via a client, but it some what cumbersome and requires you to sit a wait for every step. Why not deploy appliances via Powercli? It’s easy, fast and requires only a few lines of commands.

The PowerCli cmdlet is called “Import-VApp”. The cmdlet lets you specify fields like Source, Name and OvfConfiguration. The tricky part here is to know which OvfConfiguration parameters are needed. An OVA file is just a zip file with the vmdk and configuration files in it. It can simply be opened with a tool which supports to unzip, zip files. You don’t need to extract the zip OVA file. All that is needed is the ovf file within the OVA file. The ovf file contains the configuration parameters that is going to be used as part of the deployment of the appliance. Some of them are set in stone, if you will and some of them are user configurable. The user configurable is the once we need to have a look at.

User configurable parameters can be fund by searching to ‘ovf:userConfigurable=”true”‘ in the ovf file. It just not that easy! Because we have to define the correct string for the parameter in order for it to work. As the ovf file is XML, it is structured. Although a bit annoying to read. Again search is your friend.

There a two XML clauses to be aware of ‘ovf:instance=’ and ‘ovf:class=”vami”‘. The class and instance are used together with a ‘key’. It how it structured in XML that matters. In the example below on how to deploy a vRops appliance via PowerCli. There are two strings used. {‘class’.’instance’.’key’} and {‘key’}. Its the structure of the XML file which defines how to structure the strings for the OvfConfiguration.

Below is an example of how to deploy the vRops appliance via PowerCli

Import-VApp -Source "C:\Software\VMware\vRops\vRealize-Operations-Manager-Appliance-"`
-Datastore (Get-Datastore DSC01)`
-VMHost (Get-Cluster | Get-VMHost)[0]`
-OvfConfiguration @{


Leave a Reply

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