VSS-CLI v0.7.0ย is available for download viaย PyPIย orย GitLab. Latest version includes the following improvements and bug fixes:
Managed Object Reference Identifier for Virtual Machines
UUIDs have been always too hard to manage. They are long and sometimes meaningless but originally the ideal way to identify and efficiently look up a virtual machine in vCenter. However, earlier this year we have added support to the VSS API to lookup and identify virtual machine objects with its Managed Object Reference Identifier (moref).ย Every object within a vSphere environment is internally tracked, and referred to, by a unique identifier called moref. If you are familiar with other virtual infrastructure objects such as clusters, networks, folders and so on, they have a moref. In the search for a better user experience, we have decided to prioritize the vSphere identifier (moref) over the UUID which brings an additional level of interoperability between the ITS Private Cloud components (VSS CLI, PyVSS and VSS API) with the vCenter REST API and ease of use to the vss-cli.
Version 0.7.0 adds support to handle virtual machine commands with VM morefs in addition to UUID and Name. UUIDs will be marked as deprecatedย and will be removed in a future version of the vss-cli but for now, backwards compatibility is provided. This means the vss-cli supports both MoRef and UUID as virtual machine identifiers. Again, the VSS API, VSS CLI and PyVSS will still be working with UUIDs but we are planning to stick with morefs.
Improvements
List VM command adds moref to default attributes (#278)
Commands:
compute vm ls
For example
vss-cli compute vm ls -f name=Front moref name folder.path cpu_count memory_gb power_state ip_address ------- --------------- ------------------------- ----------- ----------- ------------- ------------ vm-2183 2004T-Frontend2 VSS > Development > Dev02 2 2 poweredOff vm-2185 2004T-Frontend3 VSS > Development > Dev03 1 1 poweredOn
Get VM info command adds support to use morefย in addition to name and uuid (#279)
Get VM info command adds `moref` attribute (#283)
Commands:
compute vm get
The following command demonstrates how to get basic Virtual Machine summary with its moref.
vss-cli compute vm get vm-2183 moref : vm-2183 uuid : 50309a8a-88ca-5291-2ad3-63f2522c3f8e name : 2004T-Frontend2 folder.path : VSS > Development > Dev02 guest_id : centos8_64Guest version : vmx-15 overall_status : green power_state : poweredOff alarms : False cpu : 2 memory_gb : 2.0 provisioned_gb : 82.18 snapshot : True disks : 1, 2 nics : 1 floppies : 1
Update VM command adds support to use moref in addition to name andย uuid (#280)
Commands:
compute vm set
Updating any vm attribute works with managed object reference id:
vss-cli compute vm set --wait vm-2183 cpu count 2 id : 186 status : IN_PROGRESS task_id : 06acfd3e-3278-4123-af8d-7e17aa07aed9 message : Request has been accepted for processing โณ Waiting for request 186 to complete... ๐ Request 186 completed successfully: warnings : New CPU is 2 errors :
Decommission VM command adds support to use moref and name in addition to uuid (#284)
Commands:
compute vm rm
Decommissioning virtual machines is easier now. The command now has autocompletion and supports both vm identifiers (moref, uuid) and name:
vss-cli compute vm rm --wait vm-2173 vm-2180 1908Q-VM-2 id status task_id message ---- ----------- ------------------------------------ ---------------------------------------- 191 IN_PROGRESS 526ec374-4cbc-49f5-a91b-d9e3927711de Request has been accepted for processing 192 IN_PROGRESS 6398c56b-bf95-4307-acd2-ecaaad483c56 Request has been accepted for processing 193 IN_PROGRESS c8f4b4c8-f6b7-4117-b0b6-20685eb0c2bf Request has been accepted for processing โณ Waiting for request 191 to complete... โณ Waiting for request 192 to complete... โณ Waiting for request 193 to complete... ๐ Request 191 completed successfully: warnings : Virtual Machine has been deleted. errors : ๐ Request 193 completed successfully: warnings : Virtual Machine has been deleted. errors : ๐ Request 192 completed successfully: warnings : Virtual Machine has been deleted. errors :
VM requests commands provideย vm_moref (#287)
Commands:
request new ls
request change ls
request export ls
request snapshot ls
The vm_moref attribute has been added to the request objects and shown as follows.
vvss-cli request new ls -f vm_name=Front id created_on updated_on status vm_moref vm_name approval.approved built_from ---- --------------------------- --------------------------- --------- ---------- ---------------- ------------------- ------------ 75 2020-04-24 Fri 15:36:20 EDT 2020-04-24 Fri 15:36:22 EDT PROCESSED vm-2182 2004T-Frontend-1 True os_install 76 2020-04-24 Fri 16:36:15 EDT 2020-04-24 Fri 16:37:31 EDT ERROR vm-2183 2004T-Frontend2 True clone 78 2020-04-24 Fri 17:06:49 EDT 2020-04-24 Fri 17:06:51 EDT PROCESSED vm-2185 2004T-Frontend3 True os_install vss-cli request change ls -f vm_name=Front id created_on updated_on status vm_moref vm_name approval.approved attribute ---- --------------------------- --------------------------- --------- ---------- ---------------- ------------------- ----------- 183 2020-04-27 Mon 16:29:06 EDT 2020-04-27 Mon 16:29:06 EDT PROCESSED vm-2182 2004T-Frontend-1 True template 185 2020-04-28 Tue 10:28:23 EDT 2020-04-28 Tue 10:28:24 EDT PROCESSED vm-2183 2004T-Frontend2 True cpu 186 2020-04-28 Tue 10:28:31 EDT 2020-04-28 Tue 10:28:32 EDT PROCESSED vm-2183 2004T-Frontend2 True cpu
Virtual Machine HA-Group mk command support for moref or name (#281)
Virtual Machine HA-Group get command support for moref or name (#282)
Commands:
compute vm set ha-group mk
compute vm get ha-group
Create a virtual machine ha-group with morefs or names:
vss-cli compute vm set --wait vm-2183 ha-group mk vm-2185 id : 195 status : IN_PROGRESS task_id : d7adc2cd-1e83-42de-bf85-75ec159d512f message : Request has been accepted for processing โณ Waiting for request 195 to complete... ๐ Request 195 completed successfully: warnings : New VM HA Group updated on vm-2183 to vm-2185, vm-2183, New VM HA Group updated on vm-2185 to vm-2185, vm-2183 errors : vss-cli compute vm get vm-2185 ha-group moref name VALID ------- --------------- ------- vm-2183 2004T-Frontend2 False vm-2185 2004T-Frontend3 False
Virtual Machine HA-Group mg for existing ha-group migrationย (#294)
Commands:
compute vm set ha-group mg
Although all existing HA Groups have been migrated to the new Moref format, we have created a command to migrate existing vm with ha-group:
vss-cli compute vm set --wait vm-2183 ha-group mg
Get quick link to vSphere Client from vss-cli (#286)
Commands:
compute vm get vsphere-link
The command allows to generate and launch a vSphere client link to a given virtual machine:
Usage: vss-cli compute vm get vsphere-link [OPTIONS] Get vSphere Client Link to VM Options: -l, --launch Launch link to default handler --help Show this message and exit. vss-cli compute vm get Frontend vsphere-link --launch value : https://vcenter-lab.eis.utoronto.ca/ui/#?extensionId=vsphere.core.inventory.serverObjectViewsExtension&objectId=urn:vmomi:VirtualMachine:vm-2183:f699427d-21a0-4509-8184-dff02273538a&navigator=vsphere.core.viTree.vmsAndTemplatesView
Updated documentation to prioritize moref over uuid (#293)
Update pyvss from 0.13.1-> 0.14.1 (#267)
Update click-spinner fromย v0.1.8 -> v0.1.10 (#291)
Upgrade
Remember, VSS-CLI documentation is now available inย VSS-CLIย and the fullย Change Logย is available here.ย Upgrade or install VSS-CLI as follows:
# using vss-cli vss-cli upgrade # upgrade with pip pip install vss-cli --upgrade # install pip install vss-cli
For more information, please refer to the official documentationย site.