It’s new release day and Datacenter CLI (DCLI) 2.10.2 is here! DCLI is one of VMware’s newest command-line interfaces and it continues to show amazing extensibility!
DCLI 2.10.2 introduces the following improvements and changes:
- Added the ‘Filter’ parameter
- Added the ‘Verbose’ option
- Added support for NSX-T APIs via VMware Cloud on AWS
- Added ability to run a command while initializing ‘interactive mode’
- Updated the ability to have connections to multiple server types
- Updated the ability to retrieve Python version, and other environmental, information
Let’s check out a couple of these updates in more detail.
New Filter Parameter
One of the most requested features I hear for DCLI is the ability to modify the output. For example, if I want specific information about a VM, I have to return the entire output for the VM object and parse through it myself. The filter parameter corrects this issue!
Example: We need to obtain information about a VM’s network adapter/s.
We can now run the following, and it will return the ‘nics’ section of the given VM:
dcli> vcenter vm get --vm vm-99 +filter nics
distributed_switch_uuid: 50 3e 25 b0 06 0d 92 87-60 79 bc 3f ff 40 1e cc
label: Network adapter 1
Example: We need to further fine tune the output about our VM’s network adapter. We’d like to see the VM’s name, the NIC’s MAC address, and the type.
Since we need to output several different, specific, properties, we’ll need to make use of a list as follows:
dcli> vcenter vm get --vm vm-99 +filter [name, nics.value.type, nics.value.mac_address]
SJC-WEB-07, VMXNET3, 00:50:56:be:9a:dd
Note: It’s important to know the data structure we’re working with. In this case, the nics property is a list so we have to refer to the nics as a list with
The format parameter is able to do what it does because of JMESPath. This allows us to query the JSON response from the API endpoint and only return exactly what we’re looking for. Keep your eyes on the VMware Code blog to see some more examples to really show the power of this new functionality!
Multiple Server Connections
The other new feature I want to show is the ability to connect to multiple server type. This is extremely important when managing an SDDC in VMware Cloud on AWS.
Example: We are already connected to the VMware Cloud on AWS service, but we need to do some management of our firewall rules through the NSX-T endpoint.
dcli> vmc orgs sddcs get --org xxxxxxx --sddc xxxxxxx +filter resource_config.nsx_api_public_endpoint_url
dcli> +nsx https://[nsxurl]
Datacenter CLI 2.10.2 has been released and it is full of new features. We can now filter the output with the new ‘Filter’ parameter. When used in-conjunction with VMware Cloud on AWS, DCLI can connect to multiple server types to streamline the automation process between the service’s available endpoints. Speaking of which, this includes VMware Cloud on AWS’ new NSX-T endpoint. There’s also the new ‘verbose’ option to return more information about the ongoing processes. You will definitely want to upgrade today!
If you already updated to DCLI version 2.9.1 or newer, the upgrade process is extremely simple and follows the standard Python Package Index (PyPI) upgrade method:
pip install dcli --upgrade
If you haven’t already installed DCLI from PyPi, repeat the same command from above only without the ‘upgrade’ parameter:
pip install dcli
For more information on changes made in VMware DCLI 2.10.2, including improvements, security enhancements, and more, see the VMware DCLI 2.10.2 Release Notes. For more information on specific product features, see the VMware DCLI 2.10.2 User’s Guide.