July 06, 2023

Automation Improvements using PowerCLI 13.1 with vSAN 8 U1

vSAN 8 U1 brings all new capabilities to vSAN, but PowerCLI 13.1 introduces some of this new functionality to PowerCLI.  Read on to learn more!

With all of the new features and capabilities announced with the release of vSAN 8 U1, it is easy to overlook the new vSAN functionality we've introduced through PowerCLI 13.1.  Many of the improvements found in PowerCLI 13.1 make the latest capabilities in vSAN 8 U1 available for scripting and automation.  This is an important, but non-trivial effort across multiple engineering teams here at VMware to ensure that vSAN capabilities are available in a programmatic way. 

While the new capabilities of PowerCLI extend far beyond vSAN, let's look through some of the new cmdlets that make PowerCLI 13.1 paired with vSAN 8 U1 noteworthy.

New PowerCLI Cmdlets and Parameters for vSAN

The new functionality provided to vSAN 8 U1 through PowerCLI 13.1 is delivered through a combination of new cmdlets, and additional parameters in existing cmdlets.  Let’s look at a few highlights in this latest release.

Disaggregation using Stretched Clusters

Disaggregation using Stretched ClustersThe ability for a vSphere or vSAN cluster to mount a remote vSAN datastore configured in a stretched cluster topology is a new capability as of vSAN 8 U1 when using the Original Storage Architecture, or OSA.  With the growing popularity and demand for disaggregated environments from our customers, having PowerCLI cmdlets to support these activities is a requirement. 

With that in mind, the new cmdlet New-RemoteVsanServerClusterConfig will enable the mounting of a vSAN cluster in this type of topology.  This cmdlet will work with both stretched clusters, and 2-node environments participating in a disaggregated topology.

Disaggregation using Multiple vCenter Server Instances (OSA)

Disaggregation using multiple vCenter Server InstancesFor environments running the OSA, disaggregation in vSAN 8 U1 now supports a vSAN cluster managed by one vCenter Server instance to be mounted by a vSphere or vSAN cluster managed by another vCenter Server instance.  This can be incredibly useful for environments who would like to take advantage of disaggregation but use more than one vCenter Server instance.

To support this ability in PowerCLI, four new cmdlets have been added.  The New-VsanHCIMeshDatastoreSource and Remove-VsanHCIMeshDatastoreSource cmdlets establish and remove the connection to the remote datastore respectively.  The Get-VsanHCIMeshDataStoreSource and Get-VsanHCIMeshDatastore allow you to query the existing connections.

vSAN Cluster Shutdown

vSAN Cluster ShutdownThe vSAN cluster shutdown workflow was introduced in vSAN 7 U3, and enhanced in more recent editions to make performing a cluster shutdown easy and repeatable.  This is especially helpful for customers who experience a sustained power-loss but only have uninterruptable power supplies (UPS) for temporary power.  These "on-battery events" can only be sustained by the UPS for a period of time, and without any secondary power, typically requires the administrator to perform an orchestrated shutdown procedure to ensure VMs and hardware are shut down gracefully before the UPS is fully depleted.  This scenario is ideal for a PowerCLI script that could perhaps be initiated by the UPS software when battery reserves hit a low threshold.

There are three new cmdlets available.  Get-VsanClusterPowerState, Start-VsanCluster and Stop-VsanCluster.  These new cmdlets can help initiate, and check shutdown workflows.  Additionally, a new Perspective parameter is available with the Test-VsanClusterHealth cmdlet to help with the precheck portion of the vSAN cluster shutdown workflows.

Recommendation:  Become familiar with the cluster shutdown process in a test lab, and perform a retrospective after any real sustained power-loss event in an environment.  The lessons learned from testing in a lab and event retrospectives can help identify gaps in your readiness, and can reduce potential unknowns when you wish to introduce these automation efforts in a production environment.

Object Format Updates

vSAN Object Format UpdatesNew features and capabilities in vSAN occasionally introduced a revised object format.  These are typically post-upgrade tasks that are required in order to take advantage of the new capability the object format brings.  In past versions of vSAN, object format updates could only be initiated when viewing the "vSAN object format health" finding in Skyline Health for vSAN.  To learn more about object formats, such as why they exist, and why they occasionally need to be upgraded, see the post "Upgrading On-Disk and Object Formats in vSAN."

With vSAN 8 U1 and PowerCLI 13.1, and object format update can now be performed via PowerCLI using the Start-VsanRelayoutOjbects cmdlet. 

Disk Management for Clusters using vSAN Direct Configuration

vSAN Direct Configuration is a vSAN cluster type that is used exclusively for shared nothing applications.  vSAN Direct Configuration clusters are unique, especially in terms of disk management, which had historically made disk management using PowerCLI more difficult than it needed to be.

For environments using vSAN Direct Configuration, PowerCLI 13.1 adds three new cmdlets assist with its unique handling of storage devices.  The new cmdlets include New-VsanDirectDisk, Get-VsanDirectDisk and Remove-VsanDirectDisk

New Way to Use PowerCLI

Automation through PowerCLI is not just for managing large environments at scale.  It can help improve operational consistency for environments of all sizes by making common tasks easily repeatable. But automation through PowerCLI or other tools can be intimidating for some.  Those who only dabble with it find their memory isn't as good as they thought when it comes to remembering how to execute a script, parameters, or the specific syntax of a cmdlet. 

If this describes you, VMware has an answer!  The new Power Actions vSphere Client plug-in provides an easy way for you to store PowerCLI scripts in a library, and execute them directly from the vSphere Client.  It can easily accommodate scripts that require parameters by allowing you to easily enter them in the GUI, simplifying the use of the script.  It will also keep a history of when the scripts were executed, and even provides an easy-to-access, built-in console to manually run additional PowerCLI commands.  To learn more, see the recent post "Power Actions 1.0" that describes this capability in more detail.

Summary

With the level of innovation with vSAN is seems to be accelerating with each release, it is nice to see that PowerCLI is making sure that the appropriate tools are available to deliver programmatic capabilities for our customers. 

@vmpete

Filter Tags

Storage vSAN vSAN 8 Blog What's New Overview