Skip to content

PowerShell OVF Helper

OVF Template for VMware ESXi Virtual Appliance 8.0

The following PowerShell snippet can be used to deploy VMware ESXi Virtual Appliance 8.0 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-ESXi-8.0-Virtual-Appliance.ps1:
#Requires -Module  VMware.VimAutomation.Core

$ovf = '.\Nested_ESXi8.0_IA_Appliance_Template_v2.ova'
$ovfConfig = Get-OvfConfiguration $ovf
$ovfConfig.NetworkMapping.VM_Network.Value = ""        # Portgroup
$ovfConfig.common.guestinfo.hostname.Value = ""        # ESXi Hostname (Leave blank if DHCP)
$ovfConfig.common.guestinfo.ipaddress.Value = ""       # IP Address of vmk0 (Leave blank if DHCP)
$ovfConfig.common.guestinfo.netmask.Value = ""         # Netmask of vmk0 (Leave blank if DHCP)
$ovfConfig.common.guestinfo.gateway.Value = ""         # Gateway of vmk0 (Leave blank if DHCP)
$ovfConfig.common.guestinfo.vlan.Value = ""            # Optional: VLAN ID of vmk0
$ovfConfig.common.guestinfo.dns.Value = ""             # DNS Server (Leave blank if DHCP)
$ovfConfig.common.guestinfo.domain.Value = ""          # DNS Domain (Leave blank if DHCP)
$ovfConfig.common.guestinfo.ntp.Value = ""             # NTP Server
$ovfConfig.common.guestinfo.syslog.Value = ""          # Syslog Server
$ovfConfig.common.guestinfo.password.Value = ""        # ESXi Root Password (default VMware1!)
$ovfConfig.common.guestinfo.ssh_key.Value = ""         # SSH Public Key (Optional)
$ovfConfig.common.guestinfo.ssh.Value = $true          # Enable SSH ($true or $false)
$ovfConfig.common.guestinfo.createvmfs.Value = $false  # Create local VMFS Datastore ($true or $false)
$ovfConfig.common.guestinfo.followmac.Value = $false   # Enable to support cloning of Nested ESXi VM ($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:
Nested_ESXi8.0u1_Appliance_Template_v1.ova
Nested_ESXi8.0b_Appliance_Template_v1.ova
Nested_ESXi8.0a_Appliance_Template_v1.ova
Nested_ESXi8.0_IA_Appliance_Template_v2.ova

<-- Back to PowerShell OVF Helper