Quick overview on how to prepare Ubuntu VM Template with cloud-init for vSphere.
Create Ubuntu VM Template with cloud-init for vSphere
To download Ubuntu OVA template, you can click here.
wget https://cloud-images.ubuntu.com/releases/18.04/release/ubuntu-18.04-server-cloudimg-amd64.ova -O ubuntu-18.04-cloud-init.ova
# or
curl -L https://cloud-images.ubuntu.com/releases/18.04/release/ubuntu-18.04-server-cloudimg-amd64.ova --output ubuntu-18.04-cloud-init.ova
export GOVC_URL="vcenter.example.com"
export GOVC_USERNAME="username@example.com"
export GOVC_PASSWORD='password'
export GOVC_INSECURE="true"
export GOVC_DATACENTER="DC1"
export GOVC_DATASTORE="/DC1/datastore/data_store1"
export GOVC_RESOURCE_POOL="/DC1/host/192.168.3.2/Resources"
export GOVC_FOLDER="/DC1/vm/templates"
# useful commands
# show available pools
govc find / -type p
# show available folders
govc find / -type f
# show available datastores
govc find / -type s
govc import.ova --name="ubuntu-18.04-cloud-init" ubuntu-18.04-cloud-init.ova
Open vSphere WebUI
Convert VM to VM Template.
govc vm.markastemplate ubuntu-18.04-cloud-init