PowerShell OVF Helper

<-- Back to PowerShell OVF Helper

OVF Template for VMware NSX for vSphere 6.x

The following PowerShell snippet can be used to deploy VMware NSX for vSphere 6.x 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 = 'Z:\images\VMware\vSphere 7.0\VMware-NSX-Manager-6.4.8-16724220.ova' # Path to OVA File
$ovfConfig = Get-OvfConfiguration $ovf
$ovfConfig.NetworkMapping.Management_Network.Value = ""  # Destination network (Portgroup)
$ovfConfig.Common.vsm_cli_passwd_0.Value = ""            # CLI "admin" User Password
$ovfConfig.Common.vsm_cli_en_passwd_0.Value = ""         # CLI Privilege Mode Password
$ovfConfig.Common.vsm_hostname.Value = ""                # The hostname for this VM.
$ovfConfig.Common.vsm_ip_0.Value = ""                    # The IPv4 Address for this interface.
$ovfConfig.Common.vsm_netmask_0.Value = ""               # The IPv4 netmask for this interface.
$ovfConfig.Common.vsm_gateway_0.Value = ""               # The IPv4 default gateway for this VM.
$ovfConfig.Common.vsm_ipv6_0.Value = ""                  # The IPv6 Address for this interface.
$ovfConfig.Common.vsm_prefix_ipv6_0.Value = ""           # The IPv6 Prefix for this interface.
$ovfConfig.Common.vsm_gateway_ipv6_0.Value = ""          # The default IPv6 gateway for this VM.
$ovfConfig.Common.vsm_dns1_0.Value = ""                  # Comma separated DNS server list.
$ovfConfig.Common.vsm_domain_0.Value = ""                # Comma separated Domain Search list.
$ovfConfig.Common.vsm_ntp_0.Value = ""                   # The NTP server list(comma separated) for this VM.
$ovfConfig.Common.vsm_isSSHEnabled.Value = $false        # Enable SSH ($true or $false)
$ovfConfig.Common.vsm_isCEIPEnabled.Value = $true        # Join the VMware Customer Experience Improvement Program ($true or $false)

$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: