Skip to content

PowerShell OVF Helper

OVF Template for VMware Cloud Director 10.4

The following PowerShell snippet can be used to deploy VMware Cloud Director 10.4 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-Cloud-Director-10.4.ps1:
#Requires -Module  VMware.VimAutomation.Core

$ovf = '.\VMware_Cloud_Director-10.4.2.9540-21596272_OVF10.ova' # Path to OVA File
$ovfConfig = Get-OvfConfiguration $ovf
$ovfConfig.DeploymentOption.Value = "medium"              # Deployment Configuration (primary-small|primary-medium|primary-large|primary-extralarge|standby-small|standby-medium|standby-large|standby-extralarge|cell)
                                                          # Primary - For guidance on choosing the appropriate size for your production environment, see VMware Cloud Director Appliance Sizing Guidelines.
                                                          #  - small: Primary appliance, configured with 12 GB of RAM and 2 vCPUs. (Unsupported - Use for testing only)
                                                          #  - medium: Primary appliance, configured with 16 GB of RAM and 8 vCPUs.
                                                          #  - large: Primary appliance, configured with 24 GB of RAM and 16 vCPUs.
                                                          #  - extra large: Primary appliance, configured with 32 GB of RAM and 24 vCPUs.
                                                          # Standby - Note: A Primary must be deployed and running before a Standby appliance can be deployed.
                                                          #  - small: Standby appliance, configured with 12 GB of RAM and 2 vCPUs. (Unsupported - Use for testing only)
                                                          #  - medium: Standby appliance, configured with 16 GB of RAM and 8 vCPUs.
                                                          #  - large: Standby appliance, configured with 24 GB of RAM and 16 vCPUs.
                                                          #  - extra large: Standby appliance, configured with 32 GB of RAM and 24 vCPUs.
                                                          # vCD Cell: Deploy a vCD Cell Application appliance, configured with 8 GB of RAM and 8 vCPUs. Note: A Primary must be deployed and running before a vCD Cell Application appliance can be deployed.

$ovfConfig.NetworkMapping.eth0_Network.Value = ""         # Network for vCloud Director UI and API access.
$ovfConfig.NetworkMapping.eth1_Network.Value = ""         # Network for accessing internal services, including the embedded PostgreSQL DB service.

$ovfConfig.vcloudapp.VMware_vCloud_Director.ntp_server.Value = ""               # NTP Server
$ovfConfig.vcloudapp.VMware_vCloud_Director.varoot_password.Value = ""          # This will be used as an initial password for the root user account. Password must be changed to a more secure one after first login.
                                                                                # Requirements: Minimum 8 characters in length / Minimum 1 uppercase character / Minimum 1 lowercase character / Minimum 1 numeric digit / Minimum 1 special character
$ovfConfig.vcloudapp.VMware_vCloud_Director.expire_root_password.Value = $true  # Expire Root Password Upon First Login. The OVF deployment wizard can not validate the root password criteria. If you are sure the password meets the stated criteria, uncheck this to skip expiring the password on upon first boot. ($true or $false)
$ovfConfig.vcloudapp.VMware_vCloud_Director.enable_ssh.Value = $false           # Enable SSH root login ($true or $false)
$ovfConfig.vcloudnet.VMware_vCloud_Director.routes0.Value = ""                  # Optional: eth0 Network Routes
$ovfConfig.vcloudnet.VMware_vCloud_Director.routes1.Value = ""                  # Optional: eth1 Network Routes
                                                                                # You may need to provide static routes in case you want to reach hosts over a non-default gateway route. In most situations this setting can remain empty.
                                                                                # Contents should be a comma-separated list of route specifications consisting of Gateway IP (required) followed optionally by a CIDR network specification (Prefix/Bits).
                                                                                # Ex: 172.16.100.253 172.16.96.0/19, 172.16.100.253 192.168.100.0/24
$ovfConfig.vami.VMware_vCloud_Director.gateway.Value = ""                       # Default Gateway - The default gateway address for this VM. Leave blank if DHCP is desired.
$ovfConfig.vami.VMware_vCloud_Director.domain.Value = ""                        # Domain Name - The domain name of this VM. Leave blank if DHCP is desired.
$ovfConfig.vami.VMware_vCloud_Director.searchpath.Value = ""                    # Domain Search Path - The domain search path (comma or space separated domain names) for this VM. Leave blank if DHCP is desired.
$ovfConfig.vami.VMware_vCloud_Director.DNS.Value = ""                           # Domain Name Servers - The domain name server IP Addresses for this VM (comma separated). Leave blank if DHCP is desired.
$ovfConfig.vami.VMware_vCloud_Director.ip0.Value = ""                           # eth0 Network IP Address - The IP address for this interface. Leave blank if DHCP is desired.
$ovfConfig.vami.VMware_vCloud_Director.netmask0.Value = ""                      # eth0 Network Netmask - The netmask or prefix for this interface. Leave blank if DHCP is desired.
$ovfConfig.vami.VMware_vCloud_Director.ip1.Value = ""                           # eth1 Network IP Address - The IP address for this interface. Leave blank if DHCP is desired.
$ovfConfig.vami.VMware_vCloud_Director.netmask1.Value = ""                      # eth1 Network Netmask - The netmask or prefix for this interface. Leave blank if DHCP is desired.

$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:
VMware_Cloud_Director-10.4.2.9540-21596272_OVF10.ova
VMware_Cloud_Director-10.4.1.9360-21373231_OVF10.ova
VMware_Cloud_Director-10.4.1.9057-20912720_OVF10.ova
VMware_Cloud_Director-10.4.0.8214-20079248_OVF10.ova

<-- Back to PowerShell OVF Helper