The govc
utility uses required and optional environment variables to communicate with the vCenter host.
-
Required govc environment variables
If you use an untrusted security certificate, you must set GOVC_INSECURE as shown below.
export GOVC_INSECURE=1
You must set GOVC_URL. The easiest setting is shown below. (An alternative is shown in the next section.)
export GOVC_URL='https://<username>:<password>@<vspherehost>/sdk'
-
Optional govc environment variables
You can also set GOVC_URL as follows, using optional environment variables to set the user, password, and url separately.
export GOVC_URL=vcenter.company.com
export GOVC_USERNAME=root
export GOVC_PASSWORD=vmware123
export GOVC_DATASTORE=vsanDatastore
export GOVC_NETWORK="VM Network"
export GOVC_RESOURCE_POOL='*/Resources'