Skip to content

PowerShell OVF Helper

OVF Template for VMware NSX Advanced Load Balancer

The following PowerShell snippet can be used to deploy VMware NSX Advanced Load Balancer using PowerShell. The VMware.PowerCLI module is required to use the script.

  1. Copy the snippet to your favorite editor
  2. Change the path to your local OVA file
  3. Fill out the variables
  4. Connect to a vCenter Server using the Connect-VIServer command
  5. Run the script
ovf-VMware-NSX-Advanced-Load-Balancer.ps1:
$ovf = '.\controller-21.1.1-9045.ova'
$ovfConfig = Get-OvfConfiguration $ovf

$ovfConfig.NetworkMapping.Management.Value = ""           # Portgroup for Management Network
$ovfConfig.avi.CONTROLLER.mgmt_ip.Value = ""              # IP address for the Management Interface. Leave blank if using DHCP. 
$ovfConfig.avi.CONTROLLER.mgmt_mask.Value = ""            # Subnet mask for the Management Interface. Leave blank if using DHCP. 
$ovfConfig.avi.CONTROLLER.default_gw.Value = ""           # Default gateway for the Management Network. Leave blank if using DHCP.
$ovfConfig.avi.CONTROLLER.sysadmin_public_key.Value = ""  # Sysadmin login authentication key (SSH Key - eg. "ssh-rsa KEY comment")

$VMName = ""                  # Virtual Machine Display Name
$vmhost = ""                  # ESXi Host to deploy the VM
$datastore = ""               # Datastore to deploy the VM
$diskStorageFormat = "Thick"  # Thin or Thick provisionig of virtual disks

$vm = Import-VApp -Source $ovf -OvfConfiguration $ovfconfig -Name $VMName -VMHost (Get-VMHost -Name $VMHost) -Datastore $datastore -DiskStorageFormat $diskStorageFormat
#$vm | Start-VM   # Uncomment to power on the VM after creation.

Please leave a comment when you have issues with the deployment. Additional feature requests are also welcome.

Confirmed Images:
controller-21.1.1-9045.ova
controller-20.1.4-9087.ova

<-- Back to PowerShell OVF Helper