Global options (account)vss-cli
Username |
|
|
Password |
|
|
MFA TOTP Token |
| If MFA enabled, will be prompted. |
Configuration Path |
| Alternative configuration path. |
Global options (format) vss-cli
Table format to use |
|
|
Custom columns |
| Any VM attribute:
|
Truncates column values |
| 0: auto, -1: disable |
Don't use headers |
| When printing tables |
Sort output |
| Sort table by the jsonpath expression. |
Output |
|
|
Virtual Machine (update): compute vm set {id}
CPU | cpu count {n} |
Memory | memory size {nGiB} |
Disk New (basic) | disk mk -i {nGiB} -i {nGiB} |
Power State | state {on|off|reboot|reset|shutdown|suspend} |
Disk New (adv.) | disk mk -i '{"capacity_gb": 100, "scsi": 1}' |
Disk Copy (adv.) | disk cp -i \ '{"capacity_gb": 100, "backing_vmdk": "[XXNN] VM/vmdk"}' |
Disk Update | disk up {diskN} --capacity {nGiB} |
Disk Update (adv.) | disk up {diskN} --capacity {nGiB} --scsi {busN} \ --notes "data disk e:/" |
Disk Delete | disk rm {diskN} {diskN} |
NIC New | nic mk --net {network} |
NIC new (adv.) | nic mk --net {NetName}={NICType} |
NIC Update Net | nic up {nicN} --network {netName} |
NIC Update State | nic up {nicN} --state {connect|disconnect} |
NIC Update Type | nic up {nicN} --adapter {type} |
NIC Delete | nic rm {nicN} {nicN} |
Storage Type | storage-type {ssd|hdd} |
Domain | domain {name-or-id} |
Operating System | os {name-or-id} |
Add vTPM | tpm mk |
Add vGPU | gpu mk --profile {gpu-profile} |
Enable|Disable VBS | vbs on|off |
Enable|Disable Secure Boot | secure-boot --on/--off |
FIrmware | firmware bios|efi |
Convert to|from template | template –-{on|off} |
Administrator | admin "Admin Name" admin.email@utoronto.ca 416-666-6666 |
Informational Contacts | inform {email-1} {email-n} |
Add --wait
to global vss-cli
and get immediate change request results.
Virtual Machine (restore) compute vm res
More information about Restore Requests available here: Request Virtual Machine Restore
Fetch VM restore Points | compute vm get {id} restore-point ls -f timestamp=2023-11 |
---|---|
Submit Restore | vss-cli compute vm res {id} --timestamp=2023-11-11 \ --reason 'OS corrupted' |
Virtual Machine (deployment) compute vm mk
Shell VM | shell \ --description="Ubuntu OS VM deployment" \ --client={client} --usage=Prod \ --os="ubuntu64Guest" --folder=VSS-CLI-VMs \ --memory={nGiB} --cpu={n} \ --net={netName} \ --disk={nGiB} --disk='{"capacity_gb": 100}' \ --iso {isoName} \ --extra-config disk.EnableUUID=TRUE \ --power-on \ --firmware efi \ ubuntu-2004-vm |
Clone VM or Template | {from-clone|from-template} \ --description={description} \ --source {sourceVM} \ --custom-spec '{"hostname": "ubuntu-clone", "domain": "local", "interfaces": [{"dhcp": true}]}' \ --power-on |
Clone VM (from snapshot) | from-clone \ --snapshot {snapId} \ --description={description} \ --source {sourceVM} \ --custom-spec vm-clone-spec.yaml \ --power-on |
CLI Spec (existing) | from-file {cli-spec}.{json|yaml} |
CLI Spec (new) | from-file --edit --save --spec-template {shell|clib|template|clone} |
From Image | Note: Upload 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
Create now |
compute vm set {id-or-name} snapshot mk \ --description {description} --lifetime {n<72} --memory |
Create later |
compute vm set {id-or-name} snapshot mk \ --description {description} --lifetime {n<72} --memory \ --timestamp={YYYY-MM-DD HH:MM} |
List |
compute vm get {id-or-name} snapshot |
Revert |
compute vm set {id-or-name} snapshot re {snapId} |
Remove |
compute vm set {id-or-name} snapshot rm {snapId} |
Extend snapshot lifetime |
request snapshot set {requestId} duration --lifetime 72 |
Remember that every change, new vm submission and snapshot request create a unique ID.
Virtual Machine Folders
Create |
compute folder mk --parent={folder} {folder} |
Rename |
compute folder set {folder} name {new-name} |
Move |
compute folder set {folder} parent {nparent} |
Virtual Machine Inventory
Create | compute inventory mk --fmt {json|csv} --all |
Download | compute inventory dl {id} |
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 query: vss-cli {ls|get {id}}
Search for a vm | vss-cli compute vm ls |
Search for vm by name | vss-cli compute vm ls -f name={vm-name} |
Get a vm attribute | vss-cli compute vm get {id} {cpu|memory|disk|state|nic|storage-type} |
Virtual Machine query (advanced): The power of --columns
with vss-cli
Look for a VM by IP address |
--columns moref,name,folder.path,'disks[*].capacity_gib',cpu_count,memory_gb,ip_address,power_state \ compute vm ls -f ip_address={ip} |
List including storage type and preferences |
--columns moref,name,folder.path,storage_type,preferences compute vm ls |
To show all vm attributes that can be used in the --columns
option, use:
vss-cli --output yaml compute vm ls -c 1
Decommission Virtual Machine
Show VM info before decommissioning |
compute vm rm --show-info {id} ... {idN} |
Configure
Initialize | configure mk |
List | conifgure ls |
Set | configure set {attr} {name} |
Default configuration file is available at
~/.vss-cli/config.yaml
Account MFA
Enable MFA | account set mfa mk {EMAIL|AUTHENTICATOR|SMS} |
Disable MFA | account set mfa rm |
Verify | account set mfa verify |
Account Notifications
Format | account set notification format {html|text} |
Filter | account set notification request {all|none|error|completion|submission} |
Method | account set notification method {mail|message} |
OVF/OVA parsing
Get Deployment Option parameters | ovf get {filePath} deployment-params |
Generate additional-params spec | ovf get {filePath} params-spec |
Get Property parameters | ovf get {filePath} property-params |
Raw requests
vss-cli raw {GET|POST|PUT|DELETE|PATCH} {resource} |
For example:
vss-cli raw GET /status
Downloadable Cheat Sheet