Requirements
- An ESXi host attached to vCenter. I am using ESXi v6.7
- Clone https://github.com/amard33p/packer101/
Builder - vsphere-iso or vmware-iso?
Packer supports 2 builders to create VM from an ISO image on VMWare.
- vsphere-iso: ESXi host must be attached to a vCenter. Uses vSphere API.
- vmware-iso: ESXi host need not be attached to vCenter. However few configurations are needed in ESXi:
This example uses vsphere-iso.
Note: The latest packer versions support vsphere-iso natively. So the jetbrains plugin is no longer required.
Usage
- Setup Packer
cd /tmp wget https://releases.hashicorp.com/packer/1.5.5/packer_1.5.5_linux_amd64.zip unzip packer_1.5.5_linux_amd64.zip cp packer /usr/local/bin/ chmod u+x /usr/local/bin/packer
- Edit
ubuntu-18/variables.json
- Run
packer build -var-file variables.json ubuntu-18.json
- In case Ubuntu decides to drop floppy driver support, we can use packer’s inbuilt http-server feature to expose the preseed file.
References:
Comments