Set Environment Variables for Common vic-machine
Options
If you deploy multiple virtual container hosts (VCHs) to the same vCenter Server instance or ESXi host, you can simplify vic-machine
commands by setting environment variables for certain key vic-machine
options.
You can set environment variables for the following vic-machine
options.
Option | Variable | Description |
---|---|---|
--target |
VIC_MACHINE_TARGET |
The address of the vCenter Server instance or ESXi host on which you are deploying VCHs. |
--user |
VIC_MACHINE_USER |
The user name for the vSphere account that you use when running vic-machine commands. Use an account with administrator privileges. |
--password |
VIC_MACHINE_PASSWORD |
The password for the vSphere user account. |
--thumbprint |
VIC_MACHINE_THUMBPRINT |
The thumbprint of the vCenter Server or ESXi host certificate. |
NOTE: You cannot include the vSphere user name and password in the VIC_MACHINE_TARGET
environment variable. You must either specify the user name and password in the VIC_MACHINE_USER
and VIC_MACHINE_PASSWORD
environment variables, or use the --user
and --password
options when you run vic-machine
.
For information about how to obtain the vCenter Server certificate thumbprint, see Obtain vSphere Certificate Thumbprints.
When you run any of the different vic-machine
commands, vic-machine
checks whether environment variables are present in the system. If you have set any or all of the environment variables, vic-machine
automatically uses the values from those environment variables. You only need to specify the additional vic-machine
options.
The following examples show some simplified vic-machine
commands that you can run if you set all four environment variables.
- Create a basic VCH:
vic-machine-operating_system create --bridge-network vic-bridge --no-tls --name vch-no-tls
- List VCHs:
vic-machine-operating_system ls
- Inspect a VCH:
vic-machine-operating_system inspect --id vm-123
- Upgrade a VCH:
vic-machine-operating_system upgrade --id vm-123
- Configure a VCH, for example to add a new volume store:
vic-machine-operating_system configure --id vm-123 --volume-store datastore_name/datastore_path:default
- Delete a VCH:
vic-machine-operating_system delete --id vm-123
For more information about the vic-machine ls
, inspect
, upgrade
, configure
, and delete
commands, see Virtual Container Host Administration with vic-machine
.