Creating a VM on VMware vCenter/vSphere with cot deploy esxi


cot deploy PACKAGE esxi --help
cot <opts> deploy PACKAGE esxi LOCATOR [-u USERNAME] [-p PASSWORD]
                               [-c CONFIGURATION] [-n VM_NAME] [-P]
                               [-N OVF1=HOST1 [-N OVF2=HOST2 ...]]
                               [-S KIND1:VAL1[,OPTS1]
                               [-S KIND2:VAL2[,OPTS2] ...]]
                               [-d DATASTORE] [-o=OVFTOOL_ARGS]


Deploy OVF/OVA to ESXi/vCenter/vSphere hypervisor


vSphere target locator. Examples: "" (deploy directly to ESXi server), "" (deploy via vCenter server)
-h, --help show this help message and exit
-u USERNAME, --username USERNAME
 Server login username
-p PASSWORD, --password PASSWORD
 Server login password
 Use the specified configuration profile defined in the OVF. If unspecified and the OVF has multiple profiles, the user will be prompted or the default configuration will be used.
-n VM_NAME, --vm-name VM_NAME
 Name to use for the VM (if applicable) and any files created. If unspecified, the name of the OVF will be used.
-P, --power-on Power on the created VM to begin booting immediately.
-N <OVF_NET1=HOST_NET1...>, --network-map <OVF_NET1=HOST_NET1...>
 Map networks named in the OVF to networks (bridges, vSwitches, etc.) in the hypervisor environment. This argument may be repeated as needed to specify multiple mappings.
-S <K1:V1[,O1]...>, --serial-connection <K1:V1[,O1]...>
 Set connectivity for a serial port defined in the OVF. This argument may be repeated to specify more port connections. Each entry should be structured as 'kind:value' or 'kind:value,options'.
 ESXi datastore to use for the new VM
-o OVFTOOL_ARGS, --ovftool-args OVFTOOL_ARGS
 Quoted string describing additional CLI parameters to pass through to "ovftool". Examples: -o="--foo", --ovftool-args="--foo --bar"


Deploy to vSphere/ESXi server with credentials admin/admin, creating a VM named 'test_vm' from foo.ova.

cot deploy foo.ova esxi -u admin -p admin \
    -n test_vm

Deploy to vSphere/ESXi server, with username admin (prompting the user to input a password at runtime), creating a VM based on profile '1CPU-2.5GB' in foo.ova, and creating the serial port as a telnet server listening on port 10022 of the host

cot deploy foo.ova esxi -u admin -c 1CPU-2.5GB \
    -S telnet://:10022,server

Deploy to vSphere server which belongs to datacenter 'mydc' on vCenter server, and map the two NIC networks to vSwitches. Note that in this case -u specifies the vCenter login username.

cot deploy foo.ova esxi "" \
    -u administrator -N "GigabitEthernet1=VM Network" \
    -N "GigabitEthernet2=myvswitch"

Deploy with passthrough arguments to ovftool.

cot deploy foo.ova esxi -u admin -p password \
    --ovftool-args="--overwrite --acceptAllEulas"