Cheatography
https://cheatography.com
Command Line Interface (vss-cli) Cheat Sheet
Global options (account)
Username |
|
VSS_API_USER
env variable |
Password |
|
VSS_API_USER_PASS
env variable. |
MFA TOTP Token |
|
If MFA enabled, will be prompted. |
Configuration Path |
|
Alternative configuration path. |
|
Global options (format) vss-cli
Table format to use |
|
csv, fancy_grid, github, grid, html, jira...
|
Custom columns |
|
Any VM attribute: moref,name,cpu_count,ip_address
|
Truncates column values |
|
0: auto, -1: disable |
Don't use headers |
|
When printing tables |
Sort output |
|
Sort table by the jsonpath expression. |
Output |
|
json|yaml|table|auto|ndjson
|
|
Virtual Machine (update): compute vm set {id}
CPU |
|
Memory |
|
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 Update |
disk up {diskN} --capacity {nGiB}
|
Disk Update (adv.) |
disk up {diskN} --capacity {nGiB} --scsi {busN} --notes "data disk e:/"
|
Disk Delete |
|
NIC New |
|
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 |
|
Storage Type |
|
Add vTPM |
|
Add --wait
to global vss-cli
and get immediate change request results.
|
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}
|
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.
|
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
|
Configure
Initialize |
|
List |
|
Set |
configure set {attr} {name}
|
Default configuration file is available at ~/.vss-cli/config.yaml
.
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.
|
|
Account MFA
Enable MFA |
account set mfa mk {EMAIL|AUTHENTICATOR|SMS}
|
Disable MFA |
|
Verify |
|
VM Folders
Create |
compute folder mk --parent={folder} {folder}
|
Rename |
compute folder set {folder} name {new-name}
|
Move |
compute folder set {folder} parent {nparent}
|
VM 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
|
|
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
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets