Packer Plugin for VMware Cloud Director
The Packer Plugin for VMware Cloud Director is a plugin that can be used to create virtual machine
images on VMware Cloud Director (VCD).
The plugin includes one builder:
vcd-iso - This builder creates a virtual machine, uploads an ISO to a VCD catalog, installs an
operating system using boot commands, provisions software within the operating system, and then
exports the virtual machine as a vApp template. This is best for those who want to create images
from scratch using ISO files.
Features
- ISO-based VM creation - Upload ISOs to VCD catalogs and create VMs from scratch
- Boot command support - Send keystrokes to VM console via WebMKS protocol for automated OS installation
- HTTP server - Serve kickstart/preseed files during installation
- SSH/WinRM communicator - Connect to VMs for provisioning (Linux and Windows)
- Export to catalog - Export finished VMs as vApp templates
Requirements
- Packer >= 1.10.0
- VMware Cloud Director 10.4+ (API version 38.0+)
[!NOTE]
The plugin has been tested with VMware Cloud Director 10.6.
Usage
For examples on how to use this plugin with Packer refer to the example directory of
the repository.
Installation
Using Pre-built Releases
Automatic Installation
Packer v1.7.0 and later supports the packer init command which enables the automatic installation
of Packer plugins. For more information, see the Packer documentation.
To install this plugin, copy and paste this code (HCL2) into your Packer configuration and run
packer init.
packer {
required_version = ">= 1.7.0"
required_plugins {
vcd = {
version = ">= 0.0.1"
source = "github.com/juanfont/vcd"
}
}
}
Manual Installation
You can download the plugin from the GitHub releases. Once you have
downloaded the latest release archive for your target operating system and architecture, extract the
release archive to retrieve the plugin binary file for your platform.
To install the downloaded plugin, please follow the Packer documentation on
installing a plugin.
From Source
If you prefer to build the plugin from sources, clone the GitHub repository locally and run the
command go build from the repository root directory. Upon successful compilation, a
packer-plugin-vcd plugin binary file can be found in the root directory.
git clone https://github.com/juanfont/packer-plugin-vcd.git
cd packer-plugin-vcd
go build
To install the compiled plugin, please follow the Packer documentation on
installing a plugin.
Configuration
For more information on how to configure the plugin, please see the plugin documentation.
Network Considerations
For ISO-based builds with preseed/kickstart, the VM needs network connectivity to fetch the preseed
file from the Packer HTTP server during OS installation.
- DHCP networks: The installer will automatically obtain an IP address.
- Static IP networks: If your VCD network uses IP pools without DHCP, you must provide static
network configuration via boot command parameters using the
vm_ip configuration option.
Contributing
If you discover a bug or would like to suggest a feature or an enhancement, please use the GitHub
issues.
License
BSD-3-Clause