Home > Blogs > VMware PowerCLI Blog > Monthly Archives: June 2019

Monthly Archives: June 2019

New Release: VMware PowerCLI 11.3.0

Today marks the release of VMware PowerCLI 11.3.0 and this one brings the count up to 732 different cmdlets. The combination of all these cmdlets allow us to manage and automate a majority of the VMware ecosystem! The HCX module receives the bulk of the new cmdlets, however there is also a new cmdlet to interact with the vSphere Storage Policy Based Management (SPBM) APIs. There is a new way to view opaque network types and a high-level method of promoting instant clones to full clones. Last, but certainly not least, this release also includes a handful of updates for reported issues and two deprecations.

PowerCLI 11.3.0 comes with the following updates:

  • Added 22 new cmdlets for HCX and SPBM management
  • Added support for vSphere 6.7 Update 2 to the VMware.VIM module
  • Added support for opaque networks to the Get-VirtualNetwork cmdlet
  • Added support for the creation of additional network adapter types
  • Added support for the high-level promotion of instant clones
  • Updated the handling of a Cluster’s ‘SpbmEnabled’ status
  • Updated the handling of bulk tagging assignments

Let’s take a more in-depth look at some of the updates.

Tag Improvements

vSphere tags are always a popular discussion. Normally, the conversation ends up being about performance. This update, with PowerCLI 11.3, allows us to make use of the backend API where we can perform bulk assignment of tags. This means that the New-TagAssignment cmdlet has been updated to allow for arrays to be passed for either the Entity or Tag properties. In my test environments, I am able to report anywhere from a 12x to 18x improvement in performance. Of course, the performance will vary by environment. The following is an example of running the same set of 100 vSphere tags to a single VM. In PowerCLI 11.3, the task took 1.771 seconds whereas in PowerCLI 11.2, it took 32.495 seconds. That’s a pretty impressive improvement.

Example: Bulk Tag Assignment Operations

For more information about general vSphere tag performance with PowerCLI, check out a recently released blog from the Performance team: Writing Performant Tagging Code

New Cmdlets for HCX

VMware HCX is best thought of as a swiss army knife – a single tool with multiple options to move your workloads in and out of the cloud. The HCX module was introduced just earlier this year, in PowerCLI 11.2.0, as the 21st module for PowerCLI. New in PowerCLI version 11.3.0, the module receives an additional 21 cmdlets to interact with your HCX deployment. A majority of the new cmdlets deal with profiles, which are used as a site’s deployment configurations for items like storage, compute, and networking. There are also new cmdlets to manage the HCX Service Mesh, which is composed of the source and destination sites.

A complete list of the newly added cmdlets:

  • Get/New/Remove/Set-HCXComputeProfile
  • Get-HCXInventoryCompute
  • Get-HCXInventoryDatastore
  • Get-HCXInventoryDVS
  • Get-HCXInventoryNetwork
  • Get-HCXNetworkBacking
  • Get/New/Remove/Set-HCXNetworkProfile
  • Get/New/Remove/Set-HCXServiceMesh
  • Get-HCXStorageProfile
  • New-HCXComputeProfileDVS
  • New-HCXComputeProfileNetwork
  • New-HCXServiceMeshDVS

More information on using the HCX module can be found in the following blog post: Getting Started with the HCX Module

Opaque Network Support

Another improvement to the PowerCLI 11.2 release was the addition of a new object type for opaque networks. These network types are the result of logical switches that have been created in NSX-T. That update allowed us to retrieve these objects through only low-level, direct API access, commands. With PowerCLI 11.3, the Get-VirtualNetwork cmdlet has been updated so we can now view opaque networks with a high-level cmdlet!

An example of using Get-VirtualNetwork to display distributed, opaque, and standard networks:
Example: Showing all types of virtual networks

For some additional information about working with opaque networks in vCenter, see the following blog: Configuring VMs with Opaque Networks

Instant Clone Promotion

Instant Clone is a functionality which has been around VMware in one form or another for quite a while. First discussed as “VMFork”, going back as early as 2014, this allows us to immediately create a child VM based off of a presently powered on VM, which we can then viewe as a cloned VM in vCenter. vSphere 6.7 was the first release to have this available as a public feature, though it was only available through the API. This is where PowerCLI, and specifically version 11.3, comes into play because we can now make use of the Set-VM cmdlet combined with the PromoteDisks parameter against one of the available child VMs to create a fully cloned VM object. The selling point is that afterwards, there is no longer a dependency on that parent VM!

Look for more information about this great new functionality in a future blog post.

SPBM Updates

The last big update we’re going to cover is for those looking to automate the management of vSphere Storage Policy Based Management (SPBM) policies. The first update comes in the form of a new cmdlet named Get-SpbmView. This cmdlet gives us direct access to the available APIs for SPBM. In the example below, we can see the usage of this cmdlet to list out the available services and start to interact with the Replication Manager service to see the available methods.

Example: Get-SpbmView Usage

The other update is to how the Get/Set-SpbmEntityConfiguration cmdlet operates. Both of these cmdlets can now display or modify policies for datastores. However, there is also a deprecation for cluster objects and whether they display an “SpbmEnabled” status. This is due to a change, which happened as of vSphere 6.0, where clusters always have a status of “Enabled.” Here is an example of using the Get-SpbmEntityConfiguration to display information about the specified datastore.

Example: Viewing SPBM Policies for datastores

Summary

The second release of the year is here in the form of PowerCLI 11.3.0. This release adds 22 new cmdlets to help automate workload migrations and granular management of SPBM policies. There are new ways to manage network-based objects, whether those are networks themselves or network adapter types. We can also now upgrade an instant clone to a full clone with an easy to use, high-level cmdlet. Lastly, bulk tag assignment is now a supported mechanism of the New-TagAssignment cmdlet.

For more information on changes made in VMware PowerCLI 11.3.0, including improvements, security enhancements, and deprecated features, see the VMware PowerCLI Change Log. For more information on specific product features, see the VMware PowerCLI 11.3.0 User’s Guide. For more information on specific cmdlets, see the VMware PowerCLI 11.3.0 Cmdlet Reference.

Remember, updating your PowerCLI modules is now as easy as ‘Update-Module VMware.PowerCLI’.
Example: Update-Module -Name VMware.PowerCLI

Let us know in the comments what you’re most excited about!

New Release – DSC Resources for VMware 2.0

The Desired State Configuration (DSC) Resources for VMware was released late last year. This initial release was able to leverage the PowerShell DSC engine in order to declare configurations for a handful of ESXi host settings and a couple vCenter server settings. The response to these resources has been amazing! So amazing that over the last 7 months, there have been 64 issues and 74 pull requests. A result of all of that feedback, input, and code contributions brings us to the next release, version 2.0 of the DSC Resources for VMware!

The DSC Resources for VMware version 2.0 contains a number of new resources, lots of improvements, and a new way to access them. First and foremost, as requested, these resources are now available on the PowerShell Gallery! There are also a number of examples which have been added to the repository since the first release. In the root of the repo, there’s an ‘Examples’ folder which contains some examples of combining multiple resources into a single configuration. Then, within the resource itself, there’s a folder by the name of ‘Configurations’. This folder has example configurations of using these resources with configuration management utilities like Ansible, Chef, and Puppet. Lastly, there are 14 new resources for us to use!

Let’s walk through some of the new resources.

New Resources

These newly added resources can be easily categorized into the following buckets: Inventory, vSphere Standard Switch (vSS), and VMHost.

The new Inventory resources, which allow us to manage the existence of these object types, are:

  • Cluster
  • HACluster
  • DRSCluster
  • DatacenterFolder
  • Datacenter
  • Folder

The following is an example of using the Folder resource to manage a VM based folder, named Management, along with a folder nested in the first folder:

The new vSS resources, which allow us to manage a VMHost’s vSS configuration, are:

  • VMHostVss
  • VMHostVssBridge
  • VMHostVssSecurity
  • VMHostVssShaping
  • VMHostVssTeaming

The following is an example of using the VMHostVss resource to manage a vSS on a particular VMHost:

The new VMHost resources, which have been added to the already existing set of resources that manage VMHosts, are:

  • VMHostService
  • VMHostSettings
  • VMHostSyslog
  • VMHostAccount

The following is an example of using the VMHostService resource to manage an ESXi host’s SSH service to ensure it is running and the policy is set to automatic:

Here’s a demo which combines a number of the new resources for the following configuration:
Datacenter: DemoLab
Folder Structures:
Development
- Linux
- Windows
Management
- Linux
- Windows
- VMware
Production
- Linux
- Windows

PowerCLI DSC v2 Resources Demo

Summary

The DSC Resources for VMware have only been available for a short period of time, however they have made a tremendous impact! Over the last 7 months, there have been 64 issues and 74 pull requests to the GitHub repository. Today, we’re taking the culmination of that input and releasing the 2.0 version of these resources. This adds an additional 14 resources, a number of functionality improvements, and they have been added to the PowerShell Gallery!

I also want to say a special thank you to some of our community contributors: Luc Dekens, for his immense contributions to this release including having a hand in at least 8 of the new resources as well as Brett Johnson and Markus Fischbacher for their contributions as well!

To get started, it is now as simple to install as:

Demo: DSC Resource Installation

For more information on this release, see the latest release page on the DSC Resources for VMware GitHub page.

Let us know in the comments how you’re using these in your environment and what resources you’re looking for next!