...
The following table includes global vss-cli
options related to account
and ` username and password, API endpoint and MFA TOTP token.
Name | Option | Environment Variable | Description |
---|
Username | --username
| VSS_USER
| User to interact with the VSS API. |
Password | --password
| VSS_USER_PASS
| User password. |
MFA TOTP Token | --totp
| VSS_USER_OTP
| If MFA enabled, will be prompted. |
Configuration Path | --config
| VSS_CONFIG
| Alternative configuration path. |
Request Timeout | --timeout
| VSS_TIMEOUT
| Request timeout in seconds. |
API endpoint | --endpoint
| VSS_ENDPOINT
| ITS Private Cloud endpoint instance. |
Global options (format)
The following table includes the global vss-cli
options to customize output format.
Name | Option | Environment Variable | Description |
---|
Table format to use | --table-format
| VSS_TABLE
| csv, fancy_grid, github, grid, html, jira...
|
Custom columns | --columns
| - | Any VM attribute: moref,name,cpu_count,ip_address,folder.path,power_state,networks[*].name
|
Truncates column values | --columns-width
| VSS_COL_WIDTH
| 0: auto, -1: disable |
Don't use headers | --no-headers
| - | When printing tables |
Sort output | --sort-by
| - | Sort table by the jsonpath expression. |
Output | --output
| VSS_OUTPUT
| json|yaml|table|auto|ndjson
|
...
Action | Description | Command |
---|
CPU | Update VM CPU count. | Code Block |
---|
vss-cli compute vm set {id} cpu count {n} |
|
CPU hot-add | Update VM cpu hot-add settings. | Code Block |
---|
vss-cli compute vm set {id} cpu hot-add {on|off} |
|
Memory | Update VM memory size. | Code Block |
---|
vss-cli compute vm set {id} memory size {nGiB} |
|
Memory hot-add | Update VM memory hot-add settings. | Code Block |
---|
vss-cli compute vm set {id} memory hot-add {on|off} |
|
Disk New (basic) | Create single or multiple disks. | Code Block |
---|
vss-cli compute vm set {id} disk mk \
-i {nGiB} -i {nGiB} |
|
Power State: | Turn off, on, reset. Shutdown and reboot (VMware Tools required) | Code Block |
---|
vss-cli compute vm set {id} state \
{on|off|reboot|reset|shutdown|suspend} |
|
Disk New (adv.) | Create single or multiple disks using specific SCSI controller | Code Block |
---|
vss-cli compute vm set {id} disk mk \
-i '{"capacity_gb": 100, "scsi": 1}' |
|
Disk Copy (adv.) | Copy and attach disks to VM from vskey-stor user space. | Code Block |
---|
vss-cli compute vm set {id} disk cp -i \
'{"capacity_gb": 100, "backing_vmdk": "[XXNN] VM/vmdk"}' |
|
Disk Update | Update VM disk N capacity in GB. | Code Block |
---|
vss-cli compute vm set {id} disk up \
{diskN} --capacity {nGiB} |
|
Disk Update (adv.) | Update VM disk N capacity in GB, SCSI bus N and add metadata notes to the disk. | Code Block |
---|
vss-cli compute vm set {id} disk up \
{diskN} --capacity {nGiB} --scsi {busN} \
--notes "data disk e:/" |
|
Disk Delete | Delete VM disk(s). Confirmation will be prompted. | Code Block |
---|
vss-cli compute vm set {id} disk rm {diskN} {diskN} |
|
NIC New | Create new network interface specifying Network name. | Code Block |
---|
vss-cli compute vm set {id} nic mk --net {network} |
|
NIC new (adv.) | Create new network interface specifying Network name and Type. | Code Block |
---|
vss-cli compute vm set {id} nic mk --net {NetName}={NICType} |
|
NIC Update Network: | Update network interface network. | Code Block |
---|
vss-cli compute vm set {id} nic up {nicN} --network {netName} |
|
NIC Update State | Update network interface state to either connect or disconnect | Code Block |
---|
vss-cli compute vm set {id} nic up {nicN} --state {connect|disconnect} |
|
NIC Update Type | Update network interface adapter type. defaults to vmxnet3 . | Code Block |
---|
vss-cli compute vm set {id} nic up {nicN} --adapter {type} |
|
NIC Delete | Delete network interface adapter(s) | Code Block |
---|
vss-cli compute vm set {id} nic rm {nicN} {nicN} |
|
CD/ISO Create | Create CD drive with attached ISO image from Content Library or client. | Code Block |
---|
vss-cli compute vm set {id} cd mk --backing {iso}
vss-cli compute vm set {id} cd mk cd mk --backing client |
|
CD/ISO Update | Update CD drive to connect to a different ISO or disconnect. | Code Block |
---|
vss-cli compute vm set {id} cd up {cdN} --backing {iso}
vss-cli compute vm set {id} cd up {cdN} --backing client |
|
Floppy Drive Create | Create virtual floppy drive with given image or client. | Code Block |
---|
vss-cli compute vm set {id} floppy mk --backing {image}
vss-cli compute vm set {id} floppy mk --backing client |
|
Floppy Drive Update | Update virtual floppy backing with a different image or client. | Code Block |
---|
vss-cli compute vm set {id} floppy up {flpN} --backing {image}
vss-cli compute vm set {id} floppy up {flpN} --backing client |
|
Floppy Drive Remove | Remove virtual floppy | Code Block |
---|
vss-cli compute vm set {id} floppy rm {flpN} |
|
Storage Type | Update VM storage type to either ssd or hdd . This action will perform storage vMotion within the Compute Domain. | Code Block |
---|
vss-cli compute vm set {id} storage-type {ssd|hdd} |
|
Domain | Update VM compute domain. This action will perform vMotion and storage vMotion. | Code Block |
---|
vss-cli compute vm set {id} domain {name-or-id} |
|
Operating System | Update VM operating system settings. This setting is responsible to present the right virtual hardware to the guest OS. | Code Block |
---|
vss-cli compute vm set {id} os {name-or-id} |
|
Add vTPM | Add virtual Trusted Platform Module to VM. Virtualization Based Security, EFI and secure boot will be also en | Code Block |
---|
tpm mkvss-cli compute vm set {id} tpm mk |
|
Add vGPU | Add GPU to VM based on given profile. | Code Block |
---|
vss-cli compute vm set {id} gpu mk --profile {gpu-profile} |
|
Enable|Disable VBS | Enable or disable Virtualization Based Security. | Code Block |
---|
vss-cli compute vm set {id} vbs on|off |
|
Enable|Disable Secure Boot | Enable or Disable secure boot. | Code Block |
---|
vss-cli compute vm set {id} secure-boot --on/--off |
|
FIrmware | Update VM firmware to bios or EFI. | Code Block |
---|
vss-cli compute vm set {id} firmware bios|efi |
|
Convert to|from template | Mark VM as template or template as VM. | Code Block |
---|
vss-cli compute vm set {id} template –-{on|off} |
|
Administrator | Update VM admin metadata. | Code Block |
---|
vss-cli compute vm set {id} admin "Admin Name" admin.email@utoronto.ca 416-666-6666 |
|
Informational Contacts | Add Informational Contacts in VM metadata. | Code Block |
---|
vss-cli compute vm set {id} inform {email-1} {email-n} |
|
Virtual Machine (
...
deployment)
Restore Deploy virtual machine from ZFS snapshots. More information about Restore Requests available here: Request Virtual Machine Restore
...
machines from content library, clone, template, shell, file specification and more.
Get Restore Points | List available restore points filtered by timestampContent Library | Deploy a virtual machine from an OVA image with pre-installed operating system from our Content Library. | Code Block |
---|
vss-cli compute vm |
|
getidrestorepoint ls -f timestamp=2023-11Submit Restore | Submit a restore request. | Code Block |
vss-cli compute vm res {id-description="Ubuntu OS VM deployment" \
--client={client} -- |
|
timestamp=2023-11-11 \
--reason 'OS corrupted'Virtual Machine (deployment)
Deploy virtual mahc
Create virtual machine snapshot nowType | Description | Command |
---|
Content Library | Deploy a virtual machine from an OVA image with pre-installed operating system from our Content Library. Code Block |
---|
vss-cli compute vm mk from-clib --source {image} \
--description="Ubuntu OS VM deployment"usage=Prod \
--os="ubuntu64Guest" --folder=VSS-CLI-VMs \
--memory={nGiB} --cpu={n} \
--net={netName} \
--clientdisk={clientnGiB} --usage=Proddisk='{"capacity_gb": 100}' \
--extra-os="ubuntu64Guest"config disk.EnableUUID=TRUE \
--folder=VSS-CLI-VMspower-on \
--memory={nGiBuser-data {cloud-init.yaml} --network-cpu={nconfig {network-config.yaml} \
--net={netName} \
--disk={nGiB} --disk='{"capacity_gb": 100}' \
--extra-config disk.EnableUUID=TRUEubuntu-2004-vm |
Note. --user-data and --network-config will generate a seed iso that must be taken by the guest operating system, i.e. Ubuntu. |
Shell VM | Deploy an empty virtual machine to be manually installed by the mounted iso. | Code Block |
---|
vss-cli compute vm mk shell \
-- |
| power-ondescription="Ubuntu OS VM deployment" \
-- |
| user-data {cloud-init.yaml | network-config {network-config.yaml} \ | ubuntu | 2004-vmNote. --user-data
and --network-config
will generate a seed iso that must be taken by the guest operating system, i.e. Ubuntu.
Shell VM | Deploy an empty virtual machine to be manually installed by the mounted iso. | Code Block |
---|
vss-cli compute vm mk shell-os="ubuntu64Guest" --folder=VSS-CLI-VMs \
--memory={nGiB} --cpu={n} \
--description="Ubuntu OS VM deployment" net={netName} \
--clientdisk={clientnGiB} --usage=Prod \
--os="ubuntu64Guest" --folder=VSS-CLI-VMsdisk='{"capacity_gb": 100}' \
--memory={nGiB} --cpu={niso {isoName} \
---net={netName} \
--disk={nGiB} --disk='{"capacity_gb": 100}' \
--iso {isoName} \
--extra-extra-config disk.EnableUUID=TRUE \
--power-on \
--firmware efi \
ubuntu-2004-vm |
|
Clone VM Virtual Machine or Deploy from Template | Clone virtual machine from another VM, template. | Code Block |
---|
vss-cli compute vm mk {from-clone|from-template} \
--description={description} \
--source {sourceVM} \
--custom-spec '{"hostname": "ubuntu-clone", "domain": "local", "interfaces": [{"dhcp": true}]}' \
--power-on |
| Clone VM (from snapshot) | Clone virtual machine from another VM snapshot id
Deploy multiple Virtual Machine in batch | Deploy multiple virtual machines in a single command. | Code Block |
---|
vss-cli compute vm mk from- |
| clone | snapshot {snapId} \
--description={description} \
|
| | | custom | spec vm-clone-spec.yaml \ | power-on CLI Spec (existing) | Deploy a virtual machine from existing vss-cli specificationinstances {numberOfInstances} |
|
Clone Virtual machine from snapshot | Clone virtual machine from another VM snapshot id. | Code Block |
---|
vss-cli compute vm mk from- |
| file {cli-spec}.{json|yaml}
CLI Spec (new) | Deploy a virtual machine from new vss-cli specification. | Code Block |
---|
vss-cli compute vm mk from-file \
--edit --save --spec-template {shell|clib|template|clone} |
|
From Image | Note: Upload OVF and VMDK or OVA to VSKEY-STOR and run vss-cli compute image personal sync ahead of the following command: Code Block |
---|
vss-cli compute vm mk from-image \
--source {image-name} --client={client} --usage=Prod \
--os="ubuntu64Guest" --folder=VSS-CLI-VMs \
--memory={nGiB} --cpu={n} \
--net={netName} \
--disk={nGiB} \
ubuntu-2004-vm |
|
Retirement requests can be added to shell
, from-clone
, from-template
, from-clib
as follows: --retire-type {timedelta|datetime}
: Retirement request type. --retire-warning {n}
: Days before retirement date to notify. --retire-value {hours},{days},{months}
: Value for given retirement type.
Virtual Machine Snapshot
Virtual Machine Snapshot management:
clone \
--snapshot {snapId} \
--description={description} \
--source {sourceVM} \
--custom-spec vm-clone-spec.yaml \
--power-on |
|
CLI Spec (existing) | Deploy a virtual machine from existing vss-cli specification. | Code Block |
---|
vss-cli compute vm mk from-file {cli-spec}.{json|yaml} |
|
CLI Spec (new) | Deploy a virtual machine from new vss-cli specification. | Code Block |
---|
vss-cli compute vm mk from-file \
--edit --save --spec-template {shell|clib|template|clone} |
|
From Image | | Note: Upload OVF and VMDK or OVA to VSKEY-STOR and run vss-cli compute image personal sync ahead of the following command: Code Block |
---|
vss-cli compute vm mk from-image \
--source {image-name} --client={client} --usage=Prod \
--os="ubuntu64Guest" --folder=VSS-CLI-VMs \
--memory={nGiB} --cpu={n} \
--net={netName} \
--disk={nGiB} \
ubuntu-2004-vm |
|
Retirement requests can be added to shell
, from-clone
, from-template
, from-clib
as follows: --retire-type {timedelta|datetime}
: Retirement request type. --retire-warning {n}
: Days before retirement date to notify. --retire-value {hours},{days},{months}
: Value for given retirement type.
Virtual Machine Snapshot
Virtual Machine Snapshot management:
Create virtual machine snapshot now |
Code Block |
---|
vss-cli compute vm set {id-or-name} snapshot mk \
--description {description} --lifetime {n<72} --memory |
|
Create virtual machine snapshot later |
Code Block |
---|
vss-cli compute vm set {id-or-name} snapshot mk \
--description {description} --lifetime {n<72} --memory \
--timestamp={YYYY-MM-DD HH:MM} |
|
List existing virtual machine snapshots |
Code Block |
---|
vss-cli compute vm setget {id-or-name} snapshot mk \
--description {description} --lifetime {n<72} --memory |
| Create virtual machine snapshot later |
Revert to existing virtual machine snapshots |
Code Block |
---|
vss-cli compute vm set {id-or-name} snapshot re {snapId} |
|
Remove existing virtual machine snapshot | mk \
--description {description} --lifetime {n<72} --memory \
--timestamp={YYYY-MM-DD HH:MM}List existing virtual machine snapshots |
Code Block |
---|
vss-cli compute vm set {id-or-name} snapshot rm {snapId} |
|
Extend virtual machine snapshot lifetime |
Code Block |
---|
vss-cli computerequest vmsnapshot getset {idrequestId} duration -or-name} snapshot |
| Revert to existing virtual machine snapshots |
Remember that every change, new vm submission and snapshot request create a unique ID.
Virtual Machine Folders
Manage virtual machine vSphere folders.
Create Folder |
Code Block |
---|
vss-cli compute |
|
vmset{idornamesnapshot re snapIdRemove existing virtual machine snapshotRename Folder |
Code Block |
---|
vss-cli compute |
|
vmid-or-namesnapshot rmsnapIdExtend virtual machine snapshot lifetimeMove Folder with its contents |
|
requestsnapshotrequestIdduration --lifetime 72Remember that every change, new vm submission and snapshot request create a unique ID.
Virtual Machine Folders
Manage virtual machine vSphere folders.
Virtual Machine Inventory
Generate virtual machine inventory files.
Create Inventory File | Code Block |
---|
vss-cli compute |
|
folderparent={folder}folder}Rename Folder |
Download Inventory File | Code Block |
---|
vss-cli compute |
|
foldersetfolder} name {new-name}Move Folder with its contents |
Code Block |
---|
vss-cli compute folder set {folder} parent {nparent} |
|
Virtual Machine Inventory
Generate virtual machine inventory files.
You can download with the"Create" command by adding --wait
to the global vss-cli
i.e. vss-cli --wait compute inventory mk --fmt csv --all
Virtual Machine (restore)
Restore virtual machine from ZFS snapshots. More information about Restore Requests available here: How-to Request Virtual Machine Restore
Action | Description | Command |
---|
Get Restore Points | List available restore points filtered by timestamp. | Code Block |
---|
vss-cli compute |
|
inventorymk--fmt {json|csv--allDownload Inventory File | Code Block |
---|
vss-cli compute inventory dl {id} |
|
...
restore-point ls -f timestamp=2023-11 |
|
Submit Restore | Submit a restore request. | Code Block |
---|
vss-cli compute vm res {id} --timestamp=2023-11-11 \
--reason 'OS corrupted' |
|
Virtual Machine query
Action | Description | Command |
---|
List | List all virtual machines | Code Block |
---|
vss-cli compute vm ls |
|
Search | Search for vm by attribute | Code Block |
---|
vss-cli compute vm ls -f name={vm-name}
vss-cli compute vm ls -f ip_address={ipAddress}
vss-cli compute vm ls -f folder.path='Public > Path' |
|
Attributes | Get additional info for specific attribute | Code Block |
---|
vss-cli compute vm get {id} \
{cpu|memory|disk|state|nic|storage-type...}
vss-cli compute vm get --help |
|
...
Code Block |
---|
vss-cli raw GET /status |
Downloadable Cheat Sheet
...