Deploying VMware vSphere Virtual Machines with Packer & Terraform

Guillermo Musumeci
14 min readJan 7, 2020

This story is compatible with Packer v1.5.x or previous versions and Terraform v12.x

Today, we will take a look at how to deploy Windows and Linux virtual machines in VMware vSphere using HashiCorp Packer and HashiCorp Terraform.

1. What is Packer?

  • A free open-source tool to create images or VMs in multiple platforms (Azure, AWS, Google Cloud, VMware, OpenShift, etc.), created by HashiCorp
  • It runs on Windows, Unix, Linux & macOS
  • Perfect to create templates, build the same image in multiple environments or demos

To automatize the creation of templates in VMware vSphere, there are two major approaches:

  1. 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.
  2. Use the vSphere-iso provider. This provider created by JetBrains builds VMs on VMware vSphere directly using vSphere API. This plugin was merged into the official Packer repository and released with

--

--

Guillermo Musumeci

Certified AWS, Azure & GCP Architect | HashiCorp Ambassador | Terraform SME | KopiCloud Founder | ex-AWS | Entrepreneur | Book Author | Husband & Dad of ✌