github.com/vmware/govmomi@v0.43.0/scripts/vcsa/README.md (about) 1 # vCenter cluster testbed automation 2 3 ## Overview 4 5 This directory contains scripts to automate VCSA/ESXi install and cluster configuration for developing and testing. 6 7 ## Dependencies 8 9 ### govc 10 11 Install the latest release via https://github.com/vmware/govmomi/releases 12 13 ### jq 14 15 Used here to derive static VCSA networking from its parent ESXi host. 16 But, you should already be using and loving jq for other tasks: http://stedolan.github.io/jq/ 17 18 ## Scripts 19 20 ### create-esxi-vm.sh 21 22 This script creates a VM running stateless ESXi, booted via cdrom/iso. 23 It will create 2 disks by default: 24 25 * vSAN cache disk (Virtual SSD) 26 27 * vSAN store disk 28 29 The two vSAN disks will be unformatted, leaving them to be autoclaimed 30 by a vSAN enabled cluster. 31 32 Note that for a cluster to use vSAN, it will need at least 3 of these 33 ESXi VMs. 34 35 To create an ESXi VM for standalone use, use the `-s` flag and optionally increase the default disk size with the `-d` 36 flag: 37 38 ``` 39 ./create-esxi-vm.sh -s -d 56 $GOVC_URL my-esxi-vm 40 ``` 41 42 The script can also be used directly against Workstation. Without a username in the url, govc will use local ticket 43 authentication. No password is used in this case, but the script will still use this value to set the password for 44 `root` in the ESX vm. You may also want to decrease the default disk `-d` and memory `-m` sizes. Example: 45 46 ``` 47 GOVC_NETWORK=NAT ./create-esxi-vm.sh -d 16 -m 4 -s :password-for-esx60@localhost $USER-esxbox 48 ``` 49 50 For use against Fusion, use `.` as the hostname: 51 52 ``` 53 ./create-esxi-vm.sh -d 16 -m 4 -s root:password-for-esx60@. $USER-esxbox 54 ``` 55 56 ### create-vcsa-vm.sh 57 58 This script creates a VM with VCSA (Virtual Center Server Appliance) installed. 59 60 ### create-cluster.sh 61 62 The first argument to the script is the IP address of VCSA. 63 There must be at least three arguments that follow, IP addresses of ESXi hosts, to form the cluster. 64 65 The script then creates the following managed objects: 66 67 * Datacenter (dc1) 68 69 * ClusterComputeResource (cluster1) 70 71 * DistributedVirtualSwitch (DSwitch) 72 73 * DistributedVirtualPortgroup (PublicNetwork) 74 75 * DistributedVirtualPortgroup (InternalNetwork) 76 77 All of the given host systems are: 78 79 * Added to the ClusterComputeResource (cluster1) 80 81 * Added to the DistributedVirtualSwitch (DSwitch) 82 83 * Enabled for vSAN traffic (vmk0) 84 85 * Firewall configured to enable the remoteSerialPort rule 86 87 Cluster configuration includes: 88 89 * DRS enabled 90 91 * vSAN autoclaim of host system disks (results in shared Datastore "vsanDatastore") 92 93 ## vSAN Datastore Example 94 95 This example will install VCSA, 3 ESXi VMs and create a cluster with vSAN enabled. 96 97 ``` 98 export GOVC_URL="root:password@some-esx-host" 99 100 ./create-vcsa-vm.sh -n "${USER}-vcsa" $GOVC_URL 101 102 printf "${USER}-esxi-%03d\n" {1..3} | xargs -P3 -n1 ./create-esxi-vm.sh $GOVC_URL 103 104 govc vm.ip -k "${USER}-vcsa" "${USER}-esxi-*" | xargs ./create-cluster.sh 105 ``` 106 107 ## Standalone host Example 108 109 This example will install VCSA, create a datacenter and connect the underlying ESXi host to the vCenter VM. 110 111 ``` 112 export GOVC_URL="root:password@some-esx-host" 113 114 ./create-vcsa-vm.sh -n "${USER}-vcsa" $GOVC_URL 115 116 ./create-standalone.sh $(govc vm.ip -k "${USER}-vcsa") 117 118 ``` 119 120 ## Licenses 121 122 Optional, if you want to assign licenses to VCSA or ESXi hosts. 123 124 Where "ESX_LICENSE" should be that of "vSphere 6 per CPU, Enterprise Plus". 125 126 And "VCSA_LICENSE" should be that of "vCenter Server 6, Standard". 127 128 ``` 129 ESX_LICENSE=... VCSA_LICENSE=... ./assign-licenses.sh 130 ```