--- modeline: | vim: set ft=pandoc: description: | This VMware Packer builder starts from an ISO and creates a vm using the vSphere API to build on a remote VMWare machine. layout: docs page_title: 'VSphere ISO - Builders' sidebar_current: 'docs-builders-vsphere-iso' --- # Packer Builder for VMware vSphere Type: `vsphere-iso` This builder uses the vSphere API, and creates virtual machines remotely. It starts from an ISO file and creates new VMs from scratch. - VMware Player is not required. - It uses the official vCenter API, and does not require ESXi host [modification](https://www.packer.io/docs/builders/vmware-iso.html#building-on-a-remote-vsphere-hypervisor) ## Examples See complete Ubuntu, Windows, and macOS templates in the [examples folder](https://github.com/hashicorp/packer/tree/master/builder/vsphere/examples/). # Configuration Reference There are many configuration options available for this builder. In addition to the items listed here, you will want to look at the general configuration references for [HTTP](#http-directory-configuration), [Floppy](#floppy-configuration), [Boot](#boot-configuration), [Driver](#driver-configuration), [Hardware](#hardware-configuration), [Output](#output-configuration), [Run](#run-configuration), [Shutdown](#shutdown-configuration), [Communicator](#communicator-configuration), [Tools](#tools-configuration), [vmx](#vmx-configuration), [Export](#export-configuration), configuration references, which are necessary for this build to succeed and can be found further down the page. <%= partial "partials/builder/vsphere/iso/Config-not-required" %> ### Connection Configuration <%= partial "partials/builder/vsphere/common/ConnectConfig-not-required" %> ### Hardware Configuration <%= partial "partials/builder/vsphere/common/HardwareConfig-not-required" %> ### Location Configuration <%= partial "partials/builder/vsphere/common/LocationConfig-not-required" %> ### Run Configuration <%= partial "partials/builder/vsphere/common/RunConfig-not-required" %> ### Shutdown Configuration <%= partial "partials/builder/vsphere/common/ShutdownConfig-not-required" %> ### Wait Configuration <%= partial "partials/builder/vsphere/common/WaitIpConfig-not-required" %> ### ISO Configuration <%= partial "partials/common/ISOConfig" %> #### Required: <%= partial "partials/common/ISOConfig-required" %> #### Optional: <%= partial "partials/common/ISOConfig-not-required" %> ### CDRom Configuration Each iso defined in the CDRom Configuration adds a new drive. If the "iso_url" is defined in addition to the "iso_paths", the "iso_url" is added to the VM first. This keeps the "iso_url" first in the boot order by default allowing the boot iso being defined by the iso_url and the vmware tools iso added from the datastore. Example: ```json "iso_urls": [ "win10.iso", "http://example.org/isos/win10.iso" ], "iso_paths": [ "[] /usr/lib/vmware/isoimages/windows.iso" ], ``` <%= partial "partials/builder/vsphere/iso/CDRomConfig-not-required" %> ### Create Configuration <%= partial "partials/builder/vsphere/iso/CreateConfig-not-required" %> ### Network Adapter Configuration <%= partial "partials/builder/vsphere/iso/NIC-required" %> ### Storage Configuration <%= partial "partials/builder/vsphere/iso/DiskConfig-required" %> <%= partial "partials/builder/vsphere/iso/DiskConfig-not-required" %> ### Floppy Configuration <%= partial "partials/builder/vsphere/iso/FloppyConfig-not-required" %> ### Export Configuration <%= partial "partials/builder/vsphere/common/ExportConfig" %> ### Optional: <%= partial "partials/builder/vsphere/common/ExportConfig-not-required" %> #### Output Configuration: <%= partial "partials/builder/vsphere/common/OutputConfig-not-required" %> ### Extra Configuration Parameters <%= partial "partials/builder/vsphere/common/ConfigParamsConfig-not-required" %> ### Communicator configuration #### Optional common fields: <%= partial "partials/helper/communicator/Config-not-required" %> #### Optional Network Adapter fields: <%= partial "partials/builder/vsphere/iso/NIC-not-required" %> #### Optional SSH fields: <%= partial "partials/helper/communicator/SSH-not-required" %> #### Optional WinRM fields: <%= partial "partials/helper/communicator/WinRM-not-required" %> ## Working with Clusters #### Standalone Hosts Only use the `host` option. Optionally specify a `resource_pool`: ``` "host": "esxi-1.vsphere65.test", "resource_pool": "pool1", ``` #### Clusters Without DRS Use the `cluster` and `host `parameters: ``` "cluster": "cluster1", "host": "esxi-2.vsphere65.test", ``` #### Clusters With DRS Only use the `cluster` option. Optionally specify a `resource_pool`: ``` "cluster": "cluster2", "resource_pool": "pool1", ``` ## Required vSphere Permissions * VM folder (this object and children): ``` Virtual machine -> Inventory Virtual machine -> Configuration Virtual machine -> Interaction Virtual machine -> Snapshot management Virtual machine -> Provisioning ``` Individual privileges are listed in https://github.com/jetbrains-infra/packer-builder-vsphere/issues/97#issuecomment-436063235. * Resource pool, host, or cluster (this object): ``` Resource -> Assign virtual machine to resource pool ``` * Host in clusters without DRS (this object): ``` Read-only ``` * Datastore (this object): ``` Datastore -> Allocate space Datastore -> Browse datastore Datastore -> Low level file operations ``` * Network (this object): ``` Network -> Assign network ``` * Distributed switch (this object): ``` Read-only ``` For floppy image upload: * Datacenter (this object): ``` Datastore -> Low level file operations ``` * Host (this object): ``` Host -> Configuration -> System Management ```