This directory contains the files referenced in the Deploy an Edge Cluster on VMware tutorial. Use the files in this directory with the tutorial. The following code block shows the list of files.
.
└── vmware
├── README.md
├── clone_vm_template
│ ├── delete-edge-host.sh # Deletes the VMs
│ ├── deploy-edge-host.sh # Provisions the VMs
│ └── setenv.sh # Defines the GOVC environment variables
└── packer
├── build.pkr.hcl # Packer build script
├── meta-data # Sample template
├── user-data # Sample template
└── vsphere.hcl # Contains the VM template name, VM configuration, and ISO file name
The vmware/packer/ folder contains the Packer code responsible for creating a VM template in VMWare vCenter from the Edge installer ISO image. Here is a brief description of files present in this folder:
-
build.pkr.hcl is the Packer build script.
-
vsphere.hcl defines the VM template name, VM configuration, and ISO file name to use. The VM configuration conforms to the minimum device requirements.
-
meta-data and user-data are sample template files. These file are optional for the build process.
The vmware/clone_vm_template folder contains the shell scripts containing GOVC command line instructions. Here is a brief description of the files present in this folder:
-
delete-edge-host.sh provisions the VMs
-
deploy-edge-host.sh deletes the VMs.
-
setenv.sh defines the GOVC environment variables, the number of VMs, a prefix string for the VM name, and the VM template name.
Your environment must have Packer and GOVC installed. The tutorials container comes with these dependencies pre-installed. If you are not using the tutorials container, you must install these dependencies on your machine. Here are the instructions to install these on a Linux machine.
To install Packer, refer to these official instructions.
To install GOVC, you must first install Go using the following instructions:
wget https://go.dev/dl/go1.20.5.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.20.5.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version
After installing Go, you can install GOVC CLI utility and xorriso
dependency as:
curl -L -o - "https://github.com/vmware/govmomi/releases/latest/download/govc_$(uname -s)_$(uname -m).tar.gz" | tar -C /usr/local/bin -xvzf - govc
sudo apt-get install -y xorriso
To use the Packer and GOVC files, you need the following VMWare permissions:
Datastore.AllocateSpace
Host.Config.AdvancedConfig
Host.Config.NetService
Host.Config.Network
Network.Assign
System.Anonymous
System.Read
System.View
VApp.Import
VirtualMachine.Config.AddNewDisk
VirtualMachine.Config.AdvancedConfig
You will need the VMWare vCenter server URL, login credentials, and names of the data center, destination datastore, resource pool, destination folder (not on Datastore, on the vSphere logical view), cluster, and DHCP enabled network to be assigned to the VM template.
Refer to the Deploy an Edge Cluster on VMware tutorial to learn how to use Packer and GOVC files present in this folder.