|
| 1 | +# Overview |
| 2 | +This directory contains the files referenced in the [Deploy an Edge Cluster on VMware](https://docs.spectrocloud.com/clusters/edge/deploy-cluster) tutorial. Use the files in this directory with the tutorial. The following code block shows the list of files. |
| 3 | + |
| 4 | + |
| 5 | +```bash |
| 6 | +. |
| 7 | +└── vmware |
| 8 | + ├── README.md |
| 9 | + ├── clone_vm_template |
| 10 | + │ ├── delete-edge-host.sh # Deletes the VMs |
| 11 | + │ ├── deploy-edge-host.sh # Provisions the VMs |
| 12 | + │ └── setenv.sh # Defines the GOVC environment variables |
| 13 | + └── packer |
| 14 | + ├── build.pkr.hcl # Packer build script |
| 15 | + ├── meta-data # Sample template |
| 16 | + ├── user-data # Sample template |
| 17 | + └── vsphere.hcl # Contains the VM template name, VM configuration, and ISO file name |
| 18 | +``` |
| 19 | + |
| 20 | + |
| 21 | +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: |
| 22 | + |
| 23 | +- **build.pkr.hcl** is the Packer build script. |
| 24 | + |
| 25 | +- **vsphere.hcl** defines the VM template name, VM configuration, and ISO file name to use. The VM configuration conforms to the [minimum device requirements](https://docs.spectrocloud.com/clusters/edge/architecture/#minimumdevicerequirements). |
| 26 | + |
| 27 | +- **meta-data** and **user-data** are sample template files. These file are optional for the build process. |
| 28 | + |
| 29 | + |
| 30 | +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: |
| 31 | + |
| 32 | +- **delete-edge-host.sh** provisions the VMs |
| 33 | + |
| 34 | +- **deploy-edge-host.sh** deletes the VMs. |
| 35 | + |
| 36 | +- **setenv.sh** defines the GOVC environment variables, the number of VMs, a prefix string for the VM name, and the VM template name. |
| 37 | + |
| 38 | +# Dependencies |
| 39 | +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. |
| 40 | + |
| 41 | +To install Packer, refer to these official [instructions](https://developer.hashicorp.com/packer/tutorials/docker-get-started/get-started-install-cli). |
| 42 | + |
| 43 | +To install GOVC, you must first install Go using the following instructions: |
| 44 | +```bash |
| 45 | +wget https://go.dev/dl/go1.20.5.linux-amd64.tar.gz |
| 46 | +sudo tar -C /usr/local -xzf go1.20.5.linux-amd64.tar.gz |
| 47 | +export PATH=$PATH:/usr/local/go/bin |
| 48 | +go version |
| 49 | +``` |
| 50 | +After installing Go, you can install [GOVC CLI utility](https://github.com/vmware/govmomi/tree/main/govc) and `xorriso` dependency as: |
| 51 | +```bash |
| 52 | +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 |
| 53 | +sudo apt-get install -y xorriso |
| 54 | +``` |
| 55 | + |
| 56 | + |
| 57 | +# Prerequisites |
| 58 | +To use the Packer and GOVC files, you need the following VMWare permissions: |
| 59 | + |
| 60 | +```bash |
| 61 | +Datastore.AllocateSpace |
| 62 | +Host.Config.AdvancedConfig |
| 63 | +Host.Config.NetService |
| 64 | +Host.Config.Network |
| 65 | +Network.Assign |
| 66 | +System.Anonymous |
| 67 | +System.Read |
| 68 | +System.View |
| 69 | +VApp.Import |
| 70 | +VirtualMachine.Config.AddNewDisk |
| 71 | +VirtualMachine.Config.AdvancedConfig |
| 72 | +``` |
| 73 | + |
| 74 | +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. |
| 75 | + |
| 76 | + |
| 77 | +Refer to the [Deploy an Edge Cluster on VMware](https://docs.spectrocloud.com/clusters/edge/deploy-cluster) tutorial to learn how to use Packer and GOVC files present in this folder. |
0 commit comments