Show Menu
Cheatography

ITS Private Cloud CLI Cheat Sheet by

Command Line Interface (vss-cli) Cheat Sheet

Global options (account)

Username
--username
VSS_AP­I_USER
env variable
Password
--password
VSS_AP­I_U­SER­_PASS
env variable.
MFA TOTP Token
--totp
If MFA enabled, will be prompted.
Config­uration Path
--config
Altern­ative config­uration path.

Global options (format) vss-cli

Table format to use
--tabl­e-f­ormat
csv, fancy_­grid, github, grid, html, jira...
Custom columns
--columns
Any VM attribute:
moref,­nam­e,c­pu_­cou­nt,­ip_­address
Truncates column values
--colu­mns­-width
0: auto, -1: disable
Don't use headers
--no-h­eaders
When printing tables
Sort output
--sort-by
Sort table by the jsonpath expres­sion.
Output
--output
json|y­aml­|ta­ble­|au­to|­ndjson

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|of­f|r­ebo­ot|­res­et|­shu­tdo­wn|­sus­¬≠pend}
Disk New (adv.)
disk mk -i '{"c­apa­cit­y_g­b": 100, "­scs­i": 1}'
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
NIC Update Net
nic up {nicN} --network {netName}
NIC Update State
nic up {nicN} --state {conne­ct|­dis­con­¬≠nect}
NIC Update Type
nic up {nicN} --adapter {type}
NIC Delete
nic rm {nicN}  {nicN}
Storage Type
storag­e-type {ssd|hdd}
Add vTPM
tpm mk
Add
--wait
to global
vss-cli
and get immediate change request results.

Virtual Machine (deplo­yment) compute vm mk

Shell VM
 shell \ 
--desc­rip­tio­n="U­buntu OS VM deploy­men­t" \
--clie­nt=­{cl­ient} --usag­e=Prod \
--os="u­bun­tu6­4Gu­est­" --fold­er=­VSS­-CL­I-VMs \
--memo­ry=­{nGiB} --cpu={n} \
--net=­{ne­tName} \
--disk­={nGiB} --disk­='{­"­cap­aci­ty_­gb": 100}' \
--iso {isoName} \
--extr­a-c­onfig disk.E­nab­leU­UID­=TRUE \
--power-on \
--firmware efi \
ubuntu­-20­04-vm
Clone VM or Template
{from-­clo­ne|­fro­m-t­emp­late} \ 
--desc­rip­tio­n={­des­cri­ption} \
--source {sourceVM} \
--cust­om-spec '{"h­ost­nam­e": "­ubu­ntu­-cl­one­", "­dom­ain­": "­loc­al", "­int­erf­ace­s": [{"d­hcp­": true}]}' \
--power-on
Clone VM (from snapshot)
from-clone \ 
--snapshot {snapId} \
--desc­rip­tio­n={­des­cri­ption} \
--source {sourceVM} \
--cust­om-spec vm-clo­ne-­spe­c.yaml \
--power-on
CLI Spec (existing)
from-file {cli-s­pec­}.{­jso­n|yaml}
CLI Spec (new)
from-file --edit --save --spec­-te­mplate {shell­|cl­ib|­tem­pla­te|­clone}
Retirement requests can be added to
shell
,
from-clone
,
from-t­emplate
,
from-clib
as follows:

--reti­re-type {timed­elt­a|d­ate­time}
: Retirement request type.
--reti­re-­warning {n}
: Days before retirement date to notify.
--reti­re-­value {hours­},{­day­s},­{mo­nths}
: Value for given retirement type.

The power of --col­umns with vss-cli

Look for a VM by IP address
--columns moref,­nam­e,f­old­er.p­at­h,'­dis­ks[­*].c­ap­aci­ty_­gib­',c­pu_­cou­nt,­mem­ory­_gb­,ip­_ad­dre­ss,­pow­er_­state \ 
compute vm ls -f ip_add­res­s={ip}
List including storage type and prefer­ences
--columns moref,­nam­e,f­old­er.p­at­h,s­tor­age­_ty­pe,­pre­fer­ences 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
configure mk
List
conifgure ls
Set
configure set {attr} {name}
Default config­uration file is available at
~/.vss­-cl­i/c­onf­ig.yaml
.

Virtual Machine Snapshot

Create now
compute vm set {id-or­-name} snapshot mk
\
--desc­ription {descr­iption} --lifetime {n<72} --memory 
Create later
compute vm set {id-or­-name}  snapshot mk
\
--desc­ription {descr­iption} --lifetime {n<72} --memory 
\
--time­sta­mp=­{YY­YY-­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 {reque­stId} 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­|AU­THE­NTI­CAT­OR|SMS}
Disable MFA
account set mfa rm
Verify
account set mfa verify

VM Folders

Create
compute folder mk --pare­nt=­{fo­lder} {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"­Cre­ate­" command by adding
--wait
to the global
vss-cli
. i.e.

vss-cli --wait compute inventory mk --fmt csv --all
 

Account Notifi­cations

Format
account set notifi­cation format {html|­text}
Filter
account set notifi­cation request 
{all|none|error|completion|submission}
Method
account set notifi­cation method {mail|­mes­sage}

OVF/OVA parsing

Get Deployment Option parameters
ovf get {filePath} deploy­men­t-p­arams
Generate additi­ona­l-p­arams spec
ovf get {filePath} params­-spec
Get Property parameters
ovf get {filePath} proper­ty-­params

Raw requests

vss-cli raw {GET|P­OST­|PU­T|D­ELE­TE|­PATCH} {resource}
For example:
vss-cli raw GET /status
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Android Package Manager (pm) Cheat Sheet
          Tmux basics Cheat Sheet
          Basic Cisco IOS Commands Cheat Sheet