Packer vpshere-iso Windows Repo

1 minute read

Introduction

HashiCorp Packer is an awesome tool that you can use to create templates on a variety of platforms including VMware vSphere.

This post is basically a placeholder to my GitHub Repo that has code that uses the vsphere-iso builder to create a variety of Templates.

You can access the Repo at cwestwater/packer-vsphere-iso.

HashiCorp Packer

I’m not going to re-hash plenty of great content out there about Packer. I will however give you some great resources to learn:

Build Details

The Packer build created the following Operating Systems:

  • Windows Server 2016 Datacenter
  • Windows Server 2016 Datacenter Core
  • Windows Server 2016 Standard
  • Windows Server 2016 Standard Core
  • Windows Server 2019 Datacenter
  • Windows Server 2019 Datacenter Core
  • Windows Server 2019 Standard
  • Windows Server 2019 Standard Core
  • Windows Server 2022 Datacenter
  • Windows Server 2022 Datacenter Core
  • Windows Server 2022 Standard
  • Windows Server 2022 Standard Core

I use the Evaluation ISOs from the Microsoft Evaluation Center for my lab.

The builds will create a VM that has the following specifications:

  • 2 vCPUS
  • 4GB RAM
  • 20GB HDD
  • HW version 17
  • vmxnet 3 NIC
  • PVSCSI Storage Controller
  • VMware Tools installed automatically

Of course the specifications are easily changed by modifying the variables passed to the build.

I also perform some VM customisation as I detailed in these posts:

Once the OS is built the following OS customisations are performed:

  • Disables TLS 1.0 and 1.1
  • Disables a lot of services that are not needed
  • Removes Features that are not required in a Server OS
  • Some general OS customisations

The build then uses the amazing plugin Packer Windows Update Provisioner to update Windows with all the latest patches.

At the end of the process it converts the VM to a template.

Wrap Up

Please go have a look at my repo cwestwater/packer-vsphere-iso on GitHub if you want to get an easy on ramp to Infrastructure as Code. Building Templates is an easy way to get started with IaC which could then be built on with tools such as Terraform to deploy those templates.

I will be keeping the repo up to date as Packer develops and I make changes to how I build my templates. I hope it helps someone get started with Packer.

Categories:

Updated: