
Member-only story
How to use Packer to Build an Ubuntu 18.04 Template for VMware vSphere
Packer is an open-source tool used to create virtual machine templates from a .json file.
To automatize the creation of templates in VMware vSphere ESX, there are two major approaches:
- Use the VMware-iso provider. This provider creates VMware VMs from an ISO file as a source. It currently supports building virtual machines on hosts running VMware Fusion for OS X, VMware Workstation for Linux & Windows, and VMware Player on Linux. It can also build machines directly on VMware vSphere Hypervisor using SSH as opposed to the vSphere API.
- Use the vSphere-iso provider. This provider, created originally by JetBrains, merged into the official Packer repository and released with Packer since version 1.5.2, builds VMs on VMware vSphere directly using vSphere API.
In this story, we will use vsphere-iso to create a Ubuntu 18.04.4 LTS (Bionic Beaver) template using Packer.
If you want to learn more about the process of building Windows Templates for vSphere with Packer, check this post → How to use Packer to build a Windows Server template for VMware vSphere
If you want to learn more about the process of building CentOS/RedHat Templates for vSphere with Packer, check this post → How to use Packer to build a CentOS template for VMware vSphere
If you want to learn more about the process of building Debian 10 Templates for vSphere with Packer, check this post → How to use Packer to Build a Debian 10 Template for VMware vSphere
1. Requirements:
1. Packer → Available for free at https://www.packer.io
2.Ubuntu 18.04 ISO → Ubuntu introduced the subiquity server installer in Ubuntu 18.04. The following code will not work on Ubuntu 18.04 Live or Daily Build versions. See point 6 to learn how to choose the right image.
3. VMware vSphere with vCenter → This example requires a VMware vCenter and will not work on the free VMware ESXi.