Table of Contents |
---|
Global options
...
The following table includes global vss-cli
options related to account
username and password, API endpoint and MFA TOTP token.
Name | Option | Environment Variable | Description |
---|---|---|---|
Username |
|
|
|
User to interact with the VSS API. | ||
Password |
|
|
|
User password. | |
MFA TOTP Token |
|
Virtual Machine (update): compute vm set {id}
...
CPU
...
Code Block |
---|
cpu count {n} |
...
Memory
...
Code Block |
---|
memory size {nGiB} |
...
Disk New (basic)
...
Code Block |
---|
disk mk -i {nGiB} -i {nGiB} |
...
Power State
...
Code Block |
---|
state {on|off|reboot|reset|shutdown|suspend} |
...
Disk New (adv.)
...
Code Block |
---|
disk mk -i '{"capacity_gb": 100, "scsi": 1}' |
...
Disk Copy (adv.)
...
Code Block |
---|
disk cp -i \
'{"capacity_gb": 100, "backing_vmdk": "[XXNN] VM/vmdk"}' |
...
Disk Update
...
Code Block |
---|
disk up {diskN} --capacity {nGiB} |
...
Disk Update (adv.)
...
Code Block |
---|
disk up {diskN} --capacity {nGiB} --scsi {busN} \
--notes "data disk e:/" |
...
Disk Delete
...
Code Block |
---|
disk rm {diskN} {diskN} |
...
NIC New
...
Code Block |
---|
nic mk --net {network} |
...
NIC new (adv.)
...
Code Block |
---|
nic mk --net {NetName}={NICType} |
...
NIC Update Net
...
Code Block |
---|
nic up {nicN} --network {netName} |
...
NIC Update State
...
Code Block |
---|
nic up {nicN} --state {connect|disconnect} |
...
NIC Update Type
...
Code Block |
---|
nic up {nicN} --adapter {type} |
...
NIC Delete
...
Code Block |
---|
nic rm {nicN} {nicN} |
...
CD/ISO Create
...
Code Block |
---|
cd mk --backing {iso}
cd mk --backing client |
...
CD/ISO Update
...
Code Block |
---|
cd up --backing {iso}
cd up --backing client |
...
Storage Type
...
Code Block |
---|
storage-type {ssd|hdd} |
...
Domain
...
Code Block |
---|
domain {name-or-id} |
...
Operating System
...
Code Block |
---|
os {name-or-id} |
...
Add vTPM
...
Code Block |
---|
tpm mk |
...
Add vGPU
...
Code Block |
---|
gpu mk --profile {gpu-profile} |
...
Enable|Disable VBS
...
Code Block |
---|
vbs on|off |
...
Enable|Disable Secure Boot
...
Code Block |
---|
secure-boot --on/--off |
...
FIrmware
...
Code Block |
---|
firmware bios|efi |
...
Convert to|from template
...
Code Block |
---|
template –-{on|off} |
...
Administrator
...
Code Block |
---|
admin "Admin Name" admin.email@utoronto.ca 416-666-6666 |
...
Informational Contacts
...
Code Block |
---|
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
...
Code Block |
---|
compute vm get {id} restore-point ls -f timestamp=2023-11 |
...
Submit Restore
...
Code Block |
---|
vss-cli compute vm res {id} --timestamp=2023-11-11 \
--reason 'OS corrupted' |
Virtual Machine (deployment) compute vm mk
...
Shell VM
...
Code Block |
---|
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
...
Code Block |
---|
{from-clone|from-template} \
--description={description} \
--source {sourceVM} \
--custom-spec '{"hostname": "ubuntu-clone", "domain": "local", "interfaces": [{"dhcp": true}]}' \
--power-on |
...
Clone VM (from snapshot)
...
Code Block |
---|
from-clone \
--snapshot {snapId} \
--description={description} \
--source {sourceVM} \
--custom-spec vm-clone-spec.yaml \
--power-on |
...
CLI Spec (existing)
...
Code Block |
---|
from-file {cli-spec}.{json|yaml} |
...
CLI Spec (new)
...
Code Block |
---|
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 |
---|
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
| If MFA enabled, will be prompted. | ||
Configuration Path |
|
| Alternative configuration path. |
Global options (format) vss-cli
...
Table format to use
...
--table-format
...
csv, fancy_grid, github, grid, html, jira...
...
Custom columns
...
--columns
...
Any VM attribute:
moref,name,cpu_count,ip_address
...
Truncates column values
...
--columns-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
...
json|yaml|table|auto|ndjson
Request Timeout |
|
| Request timeout in seconds. |
API 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 |
|
|
|
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 |
|
|
|
Example 1. List virtual machines in yaml
format:
Code Block |
---|
vss-cli --output yaml compute vm ls |
Example 2. List virtual machines with only moref
, name
, cpu_count
, ip_address
with fancy_grid
in the table format.
Code Block |
---|
vss-cli --columns moref,name,cpu_count,ip_address --table-format fancy_grid compute vm ls |
Virtual Machine (update)
Manage virtual machine attributes with the vss-cli
.
Add --wait
to global vss-cli
and get immediate change request results.
Action | Description | Command | ||
---|---|---|---|---|
CPU | Update VM CPU count. |
| ||
CPU hot-add | Update VM cpu hot-add settings. |
| ||
Memory | Update VM memory size. |
| ||
Memory hot-add | Update VM memory hot-add settings. |
| ||
Disk New (basic) | Create single or multiple disks. |
| ||
Power State: | Turn off, on, reset. Shutdown and reboot (VMware Tools required) |
| ||
Disk New (adv.) | Create single or multiple disks using specific SCSI controller |
| ||
Disk Copy (adv.) | Copy and attach disks to VM from |
| ||
Disk Update | Update VM disk |
| ||
Disk Update (adv.) | Update VM disk |
| ||
Disk Delete | Delete VM disk(s). Confirmation will be prompted. |
| ||
NIC New | Create new network interface specifying Network name. |
| ||
NIC new (adv.) | Create new network interface specifying Network name and Type. |
| ||
NIC Update Network: | Update network interface network. |
| ||
NIC Update State | Update network interface state to either |
| ||
NIC Update Type | Update network interface adapter type. defaults to |
| ||
NIC Delete | Delete network interface adapter(s) |
| ||
CD/ISO Create | Create CD drive with attached ISO image from Content Library or client. |
| ||
CD/ISO Update | Update CD drive to connect to a different ISO or disconnect. |
| ||
Floppy Drive Create | Create virtual floppy drive with given image or client. |
| ||
Floppy Drive Update | Update virtual floppy backing with a different image or client. |
| ||
Floppy Drive Remove | Remove virtual floppy |
| ||
Storage Type | Update VM storage type to either |
| ||
Domain | Update VM compute domain. This action will perform vMotion and storage vMotion. |
| ||
Operating System | Update VM operating system settings. This setting is responsible to present the right virtual hardware to the guest OS. |
| ||
Add vTPM | Add virtual Trusted Platform Module to VM. Virtualization Based Security, EFI and secure boot will be also en |
| ||
Add vGPU | Add GPU to VM based on given profile. |
| ||
Enable|Disable VBS | Enable or disable Virtualization Based Security. |
| ||
Enable|Disable Secure Boot | Enable or Disable secure boot. |
| ||
FIrmware | Update VM firmware to bios or EFI. |
| ||
Convert to|from template | Mark VM as template or template as VM. |
| ||
Administrator | Update VM admin metadata. |
| ||
Informational Contacts | Add Informational Contacts in VM metadata. |
|
Virtual Machine (deployment)
Deploy virtual machines from content library, clone, template, shell, file specification and more.
Type | Description | Command | ||
---|---|---|---|---|
Content Library | Deploy a virtual machine from an OVA image with pre-installed operating system from our Content Library. |
Note. | ||
Shell VM | Deploy an empty virtual machine to be manually installed by the mounted iso. |
| ||
Clone Virtual Machine or Deploy from Template | Clone virtual machine from another VM, template. |
| ||
Deploy multiple Virtual Machine in batch | Deploy multiple virtual machines in a single command. |
| ||
Clone Virtual machine from snapshot | Clone virtual machine from another VM snapshot id. |
| ||
CLI Spec (existing) | Deploy a virtual machine from existing |
| ||
CLI Spec (new) | Deploy a virtual machine from new |
| ||
From Image | Note: Upload
|
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:
Virtual Machine Inventory
...
Create
...
Code Block |
---|
compute inventory mk --fmt {json|csv} --all |
...
Download
...
Code Block |
---|
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}}
Create virtual machine snapshot now | ||
| ||
Create virtual machine snapshot later | ||
| ||
List existing virtual machine snapshots | ||
| ||
Revert to existing virtual machine snapshots | ||
| ||
Create later | ||
| ||
Remove existing virtual machine snapshot | ||
| ||
Extend virtual machine snapshot lifetime | ||
| ||
List | ||
| ||
Revert | ||
| ||
Remove | ||
| ||
Extend snapshot lifetime | ||
|
Remember that every change, new vm submission and snapshot request create a unique ID.
Virtual Machine Folders
...
Create
...
Code Block |
---|
compute folder mk --parent={folder} {folder} |
...
Rename
...
Code Block |
---|
compute folder set {folder} name {new-name} |
...
Move
...
Code Block |
---|
compute folder set {folder} parent {nparent} |
|
Remember that every change, new vm submission and snapshot request create a unique ID.
Virtual Machine Folders
Manage virtual machine vSphere folders.
Create Folder | ||
| ||
Rename Folder | ||
| ||
Move Folder with its contents | ||
|
Virtual Machine Inventory
Generate virtual machine inventory files.
Create Inventory File |
| ||
Download Inventory File |
|
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. |
| ||
Submit Restore | Submit a restore request. |
|
Virtual Machine query
Action | Description | Command | ||
---|---|---|---|---|
List | List all virtual machines |
| ||
Search | Search for vm by attribute |
|
Search for vm by name
|
|
Get a vm attribute
| ||||
Attributes | Get additional info for specific attribute |
|
Virtual Machine query (advanced): The power of --columns
with vss-cli
Look for a VM by IP address | ||
| ||
List including storage type and preferences | ||
|
...
Show VM info before decommissioning | ||
|
Initialize and Configure the vss-cli
Initialize |
| ||
List |
| ||
Set |
|
...
Code Block |
---|
~/.vss-cli/config.yaml |
Account MFA management
Enable MFA |
| ||
Disable MFA |
| ||
Verify |
|
Account Notifications
Format
Account Notifications
Format |
| ||||
Filter |
| ||||
Method |
| Filter
Account Group Membership
Get Group membership |
|
Method
| |||
Get group details |
| ||
Get group members |
|
OVF/OVA parsing
Get Deployment Option parameters |
| ||
Generate additional-params spec |
| ||
Get Property parameters |
|
...
Code Block |
---|
vss-cli raw GET /status |
Downloadable Cheat Sheet
...