Home > Blogs > VMware PowerCLI Blog

What’s New for the VMware Cloud on AWS Module

PowerCLI’s 11.5 was a big release for several reasons. One of those reasons is due to the introduction of some new cmdlets for use with the VMware Cloud on AWS service! These cmdlets are all high-level, which allows us to interact with our SDDCs in a much easier fashion than before.

The new cmdlets in the VMC module are:

  • Get-VmcSddc
  • Set-VmcSddc
  • New-VmcSddc
  • Remove-VmcSddc
  • Add-VmcSddcHost
  • Remove-VmcSddcHost
  • Get-AwsAccount
  • Get-AwsVpcSubnet

Let’s walk through how to use these within your own VMware Cloud on AWS Organization, as we manage each part of an SDDC’s lifecycle.

Creating New 1 Host SDDC

The first cmdlet we’ll walkthrough using is the one which creates a new SDDC, New-VmcSddc. This cmdlet requires fairly minimal information such as SDDC name, AWS region, and how many hosts the SDDC should have. We also have the ability to specify the management subnet CIDR as a parameter too, but that parameter is optional.

One big item of note, at the time of the PowerCLI 11.5 release, it can only provision one host SDDCs without an AWS account being linked. We do plan to improve the cmdlet in a future release to support all SDDC deployment configurations.

Here’s an example of creating a VMware Cloud on AWS single host SDDC where we don’t link an AWS account:

Example: Creating a new 1-host SDDC

Creating New 3-Host SDDC

We can also create a standard, 3 host or larger, SDDC which requires an AWS account be linked. There are two new cmdlets which simplifies this process from more than 10 lines of code down to 2 lines.

The first thing we’ll need to obtain, the AWS account we’ll be using. That information can be found with the following command:

Example: listing out an AWS account

We’ll store that output in a variable and move on to the next step, which is to pick out our desired AWS VPC Subnet. We can use a single cmdlet to do this, however we will need to reference the AWS Account and which region the VPC should reside.

We can find the available VPC subnets with the following command:

Example: List available AWS VPC subnets

At this point, we have all the information needed to create our SDDC. With some minimal updates to the command from the previous section, we can create a new 3 host SDDC, have it linked to our AWS account, and using our requested VPC subnet with the following code:

Example: New SDDC - 3 Hosts

Viewing SDDC Information

We’ve created two SDDCs in the prior sections, now it’s time to find out what information about each of these SDDCs are available. The Get-VmcSddc cmdlet will turn several lines of API interaction into a single line.

We can find out some basic information about our newly created SDDCs with the following command:

Example: List SDDCs

The above shows some great high-level information. However, if you’ve seen the API response, there’s a lot more information available to us. We can find some additional information about a particular SDDC by piping that command to Format-List. An example:

Example: Detailed SDDC View

The above examples shows some important information, such as AWS region, how many hosts the SDDC has, what version the SDDC is on, and even the URL to reach the vCenter server. One thing you may notice is missing though, ExtensionData! This property, and all the information it provides us, is something that is not available at this point in time. We hope to add it in a future release.

In the meantime, you can take the information provided here and simplify the process to retrieve the rest of the properties which make up the SDDC object from the API level. An example to do that is as follows:

Example: Retrieving all the SDDC information from the API

Host Capacity Management

One of the amazing parts about a service such as VMware Cloud on AWS is that we can add and remove ESXi hosts to our SDDC in a matter of minutes! We now have two cmdlets to make the management of our ESXi hosts as simple as a one-liner.

We can add a single new host to our SDDC with the following command:

Example: Add a new host to the SDDC

Similarly, we can also remove a single host from our SDDC with the following command:

Example: Removing a host from a SDDC

In the above examples you’ll also notice the flexibility to several different methods of input for each command, whether that be variables or even using a pipeline.

Removing SDDCs

Completing the lifecycle management of an SDDC is the removal of our created SDDC. Much like the prior create and retrieve cmdlets, we also have a cmdlet to delete an SDDC.

We can now remove our SDDC with the following command:

Example: Remove SDDC

More Updates

There are a couple other cmdlets worth discussing when it comes to using PowerCLI with VMware Cloud on AWS. One of the more popular requests was to rename an SDDC. This was recently enabled through the API and PowerCLI can also make this change in a high-level cmdlet.

We can update the name of our SDDC with the following command:

Example: Update the name of an SDDC

An existing cmdlet was also updated to help us out when it comes to retrieving, and even reporting, on tasks within our Organization. Get-Task now supports these VMC based tasks. If you’ve had a change to view the tasks for any given Organization, unlike vSphere tasks, they are available for quite a long time so the output could be unexpectedly longer than expected.

We can retrieve the tasks of our Organization with the following command:

Example: Retrieve tasks

Each of these tasks are objects, so we can take one of those tasks and expand the available properties with Format-List by using the following command:

Example: List additional properties of a task

Summary

The release of PowerCLI 11.5 added a ton of functionality when it comes to VMware Cloud on AWS. We can manage the entire lifecycle of an SDDC with high-level cmdlet. We can also pull task-based information from an existing cmdlet!

Update to the latest version of PowerCLI with the following command:
Example: Update to PowerCLI 11.5.0

Let us know in the comments what cmdlets we should be adding next!

New Release – PowerCLI 11.5.0

The days are ticking away until VMworld Europe, but we have some exciting news that we just couldn’t keep quiet about! PowerCLI version 11.5.0 is here and it is a huge release! More than 20 cmdlets have been added. There are new properties available for the objects we all know and love, one of which has been requested for years. A big update for the VMC module, support for Horizon 7.10.0, and so much more.

PowerCLI 11.5.0 comes with the following updates:

  • Added cmdlets for Content Library management
  • Added cmdlets for vCenter alarm management
  • Added cmdlets for VMware Cloud on AWS SDDC management
  • Updated Get-*Service output
  • Updated New-VM parameters for networking
  • Updated performance for Tag based operations
  • Updated properties of Virtual Machine object
  • Updated support for Horizon 7.10.0
  • Updated support for HCX migration types

Let’s dig in on some of these updates!

Content Library Management Update

Content Library’s features and capabilities have been going through some impressive updates over the last few versions of vSphere. It was one of the first services available through the vSphere Automation (REST) API and has maintained a steady stream of improvements. The latest update added some long-awaited support for templates! PowerCLI is improving the management of the Content Library with eight new cmdlets!

The new cmdlets for Content Library management are as follows:

  • New-ContentLibraryItem
  • Set-ContentLibraryItem
  • Remove-ContentLibraryItem
  • Export-ContentLibraryItem
  • New-ContentLibrary
  • Set-ContentLibrary
  • Get-ContentLibrary
  • Remove-ContentLibrary

Here’s a brief example of viewing the available Content Libraries and the contents within a specified Content Library.
Example: Content Library cmdlet usage

Look for a blog to be released shortly to dive deeper in to the use of these cmdlets!

vCenter Alarm Management Update

Managing vCenter alarms always comes up as one of those things that could be improved when using PowerCLI. There’s a solid set of alarm-based cmdlets which already exist. However, as evidenced by a PowerCLI session at VMworld in 2017 where we dug into some examples only available by the API, those cmdlets didn’t give quite give us everything we needed. PowerCLI 11.5 adds 6 new cmdlets and 3 updated cmdlets to help manage alarm definitions, create alarm triggers, and pull information about available event types and metrics.

These new cmdlets are as follows:

  • New-AlarmDefinition
  • Remove-AlarmDefinition
  • New-AlarmTrigger
  • Get-AlarmTrigger
  • Get-EventType
  • Get-Metric

The updated cmdlets are as follows:

  • New-AlarmAction
  • New-AlarmActionTrigger
  • Set-AlarmDefinition

Here’s a sneak peak at these new cmdlets in action, creating a new vCenter alarm definition:
Example: New alarm definition created

More details on these new vCenter alarm management cmdlets will be released in future blog post shortly.

VMware Cloud on AWS Module Update

The module for managing VMware Cloud on AWS (VMC) is one of PowerCLI’s newest modules. Initially it was released as a low-level module, which interacted directly with the available VMC APIs. As of PowerCLI 11.5, the VMC module introduces eight new cmdlets to make the management process easier. There’s a cmdlet to easily retrieve high-level information about our SDDCs. We can deploy an SDDC in a single command, down from the 20+ lines it took before. There are also cmdlets to streamline the process of retrieving information about our AWS linked accounts!

The new cmdlets are as follows:

  • Get-VmcSddc
  • Set-VmcSddc
  • New-VmcSddc
  • Remove-VmcSddc
  • Add-VmcSddcHost
  • Remove-VmcSddcHost
  • Get-AwsAccount
  • Get-AwsVpcSubnet

Here’s a quick example of how we can compress all those lines of code to deploy and view an SDDC down to, essentially, two lines:
Example: VMware cmdlet usage to create an SDDC

For more details on these new VMC cmdlets, see the following blog: What’s New with the VMware Cloud on AWS Module

VMware Core Module Update

The Core module received a handful of upgrades outside of just the new cmdlets for Content Library and vCenter alarms.

The usage of tags within vSphere environments continues to steadily increase, as well as requests to make the management of those tags more performant. Previously, as of PowerCLI 11.3, the ability to perform batch operations was added. PowerCLI 11.5 builds on that and adds some additional, general, performance improvements to several cmdlets. The Get-Tag cmdlet and Tag parameter for Get-VM have both been updated, as well as Get/Remove-TagAssignment.

There are a couple highly requested updates for some of the standard VM cmdlets too! The ability to configure a new VM’s portgroup, when deploying from template, has been added through the usage of either NetworkName or Portgroup parameters when using New-VM. As of vSphere 6.7, there’s been a new property of VirtualMachine vSphere objects called CreateDate. As of PowerCLI 11.5, the VirtualMachine .Net object now also has a CreateDate property!

Example: Viewing CreateDate property

Note: Only vSphere 6.7 environments and newer support this property. On vSphere 6.5 and older environments, the property may be blank. An additional caveat, this property is also only supported on VMs which have been created since that environment was on vSphere 6.7 or newer. VMs that have been migrated from older environments will show an older date, generally 1/1/70 12:00:00 AM.

Summary

PowerCLI 11.5.0 has been released and there are tons of new updates! There are more than 20 new cmdlets and 9 cmdlets which have been improved. Support has been added for Horizon 7.10.0 as well as two new migrations types for HCX, Replication Assisted vMotion (RAV) and OS Assisted Migration (OSAM). Plus, when you’re working with a service’s underlying API service, the listing of available services has been updated for easier viewing. The third release of PowerCLI is one you’ll want to update to today!

For more information on changes made in VMware PowerCLI 11.5.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.5.0 User’s Guide. For more information on specific cmdlets, see the VMware PowerCLI 11.5.0 Cmdlet Reference.

Remember, updating your PowerCLI modules is now as easy as:

Example: Update to PowerCLI 11.5.0

Let us know in the comments what you’re looking forward to most!

PowerCLI at VMworld Europe 2019

VMworld US Banner

It feels like VMworld US was just yesterday and yet, here we are, a month away from VMworld Europe! This year, VMworld continues to have all kinds of sessions related to PowerCLI. From the always popular PowerCLI Deep Dive to more specifically focused sessions on VMware Cloud on AWS, vSphere update lifecycle, vSAN, and even Horizon View. There’s also a very special session given by a member of the PowerCLI engineering team which gives an in-depth look at how new features are added automatically! If you haven’t already registered, the time is quickly slipping away!

Schedule builder is already live, so make sure to add the following sessions to your schedule and catch up with the PowerCLI team and all of the amazing PowerCLI community members!

Breakout Sessions

Session: HBI1729BE – PowerCLI Deep Dive
Date: Thursday, November 7, 10:30 – 11:30
Speakers: Luc Dekens & Kyle Ruddy
Luc and Kyle are back with another edition of the PowerCLI Deep Dive, where they’ll show you some of the advanced methods they use to make even the hardest of tasks look easy.

Session: HBI1463BE – VMware Cloud on AWS: Advanced Automation Techniques
Date: Wednesday, November 6, 15:30 – 16:30
Speakers: William Lam & Kyle Ruddy
William and Kyle will walk you through the available APIs and tooling for VMware Cloud on AWS, then demonstrate they can be used to automate all aspects of the SDDC lifecycle and workload consumption.

Session: HCI1864BE – Automating vSAN from CLI to API: PowerCLI, Govc, and Beyond
Date: Thursday, November 7, 09:00 – 10:00
Speakers: Andreas Scherr & Cedric Rajendran
Andreas and Cedric will show how to automate some of the routine vSAN tasks using the wide variety of APIs and CLIs available and at your disposal.

VMware {code} Sessions

Session: CODE2214E – How PowerCLI Makes Configuration Management Easy
Date: Tuesday, Novmeber 5, 11:00 – 12:00
Speaker: Kyle Ruddy
Kyle will cover some configuration management principles and then dive in to show the latest ways PowerCLI is using PowerShell DSC to make vSphere configuration management easy.

Session: CODE1817E – Automating vCenter Server Appliance Update Lifecycle
Date: Wednesday, November 6, 15:00 – 15:25
Speaker: David Stamen
David will show off his new community module for PowerCLI which can be used to ease the lifecycle management of the vCenter Server Appliance.

Session: CODE2649E – How PowerCLI Gives Day 1 Access to the Latest VMware APIs
Date: Wednesday, November 6, 17:00 – 17:25
Speaker: Nikola Klinkachev
Nikola, an engineer on the PowerCLI team, will provide a “look behind the curtain” when it comes to how PowerCLI can automatically interact with the latest and greatest APIs.

Session: CODE1316E – Horizon 7 Automation 101: How to Get Started with the Horizon API
Date: Thursday, November 7, 10:00 – 10:25
Speaker: Wouter Kursten
Wouter will provide an overview of the Horizon 7 API and how PowerCLI can be leveraged to simplify the automation process for those Horizon environments.

VMTN TechTalk Sessions

Session: VMTN5092E – Clones as a Service
Date: Wednesday, November 6, 12:45 – 13:00
Speaker: Dan Belmonte
Dan will cover how both linked clones and instant clones can be incredibly useful for development environments and how PowerCLI can be used to create them.

Hands on Labs

Lab: SPL-2012-01-SDC_E – VMware vSphere Automation – PowerCLI
Date: Anytime the HOL area is open and available
Get hands-on with VMware PowerCLI. Gain familiarity with the tool, and then dive deeper into the functionality available with real world examples. Both new and experienced users are sure to learn something new about automating their environments.

Session: ELW-2012-01-SDC_E – Expert-Led Workshop – VMware vSphere Automation – PowerCLI
Date: Monday, November 4, 14:00 – 15:30
Date: Thursday, November 07, 11:45 – 13:15
Speaker: Peter Kieren
Peter will show attendees how to get hands-on with VMware PowerCLI. You will gain familiarity with the tool, and then dive deeper into the functionality available with real world examples.

Summary

VMworld Europe continues to be the premier event in EMEA to learn about PowerCLI. Come hear directly from the PowerCLI team, as well as numerous community members, how you can harness PowerCLI to automate even the most difficult of tasks.

Make sure you’re registered for VMworld today!

New Release: PowerCLI 11.4.0

August is always a great month when it comes to new releases, and this year is no different. Even before VMworld, there have already been announcements for vSphere 6.7 Update 3, NSX-T 2.4.2, and a new version of HCX. The PowerCLI team has one more exciting release for you in the form of PowerCLI 11.4.0!

PowerCLI 11.4.0 comes with a bunch of new improvements. The Horizon View module has been updated to support the newest release of Horizon View which is version 7.9. There are a handful of updates to the Storage module, including updates and three new cmdlets. Lastly, there are numerous updates to cmdlets in the HCX module.

PowerCLI 11.4.0 comes with the following updates:

  • Add support for Horizon View 7.9
  • Added new cmdlets to the Storage module
  • Updated Storage module cmdlets
  • Updated HCX module cmdlets

Let’s take a closer look at some of the updates.

Storage Module Updates

The Storage module received a number of new updates, many of which are there to support brand new features released with vSAN 6.7U3! The first improvement is to the Get/Set-VsanClusterConfiguration cmdlets. These two cmdlets can now access and make use of the newly added functionalities of Proactive Rebalance and vSphere Update Manager baseline preference.

Example of Get-VsanClusterConfiguration and Set-VsanClusterConfiguration in action:
PowerCLI 11.4.0 - Storage Module Updates

It’s worth noting that those new properties will return no information, nor can you change them, until your vSAN cluster has been updated to version 6.7 U3, as noted in the above error message.

The Storage module also has a couple new cmdlets. The first is the Add-VsanObjectToRepairQueue cmdlet. This cmdlet can repair vSAN objects that are referenced when using the command. This functionality was formerly available with the Repair-VsanObject cmdlet, however this particular cmdlet has been modified to be an alias for Add-VsanObjectToRepairQueue. The other two new cmdlets are Get-VsanResyncingOverview and Get-VsanEnterMaintenanceMode. Both of these cmdlets operate only against vSAN clusters of version 6.7U3 or newer.

HCX Module Updates

The HCX module has seen a flurry of activity since its initial release, and PowerCLI 11.4.0 continues that trend. There are six cmdlets which have been updated to add new capabilities. The Get-HCXAppliance cmdlet returns new information about the current version of an appliance as well as any available versions which exist. This can be combined with the New-HCXAppliance cmdlet that will allow us to upgrade an appliance to one of the available versions. The Get-HCXContainer cmdlet now adds the ability to list containers of a “OrgVdc” type. The Get-HCXNetwork cmdlet adds the ability to view two more types of networks, NsxtSegment and OrgVdcNetwork. Then, there is the New-HCXNetworkExtension cmdlet that can now work with networks of type NsxtSegment. Lastly, we have Get-HCXServiceMesh which has a new property available to view the status of several services.

Example of Get-HCXAppliance and Get-HCXServiceMesh, specifically viewing the new ServiceStatus property:
PowerCLI 11.4.0 - HCX Module Updates

A couple other issues were addressed with the HCX module as well. The Cmdlet Reference has been updated to reflect the .NET object type of an HCX Migration. Get-HCXServiceMesh and Get-HCXInterconnectStatus have both been updated to remedy issues. Lastly, the DestinationNetworkValue property now properly appears for replication objects.

Summary

This release of PowerCLI has some significant updates. PowerCLI 11.4.0 introduces new support for Horizon View 7.9, new functionality for vSAN 6.7 Update 3 objects, and numerous updates to the HCX module!

For more information on changes made in VMware PowerCLI 11.4.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.4.0 User’s Guide. For more information on specific cmdlets, see the VMware PowerCLI 11.4.0 Cmdlet Reference.

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

Let us know in the comments what you’re looking forward to most!

PowerCLI at VMworld US 2019

VMworld US Banner

Would you believe it, VMworld is already right around the corner! This year, VMworld has all kinds of sessions related to PowerCLI. From the introduction and deep dive sessions to more specifically focused sessions on VMware Cloud on AWS, vSphere update lifecycle, vSAN, and even Horizon View. There’s also a very special session given by a member of the PowerCLI engineering team which gives a special look at how new features are added automatically! Plus, a bunch of community sourced sessions and the always fantastic Hands-on-Lab! If you haven’t already registered, the time is quickly ticking away!

Schedule builder is already live, so make sure to add the following sessions to your schedule and catch up with the PowerCLI team and all of the amazing PowerCLI community members! And if the session is already full, don’t worry. Join the waitlist and help us move these sessions to larger rooms!

Breakout Sessions

Session: HBI1743BU – Introduction to PowerCLI
Date: Monday, August 26, 02:30 PM – 03:30 PM
Speakers: Brian Bunke & Kyle Ruddy
Brian and Kyle will show how PowerCLI is one of the easiest ways to manage your environment and how you can easily get started in your own environments.

Session: HBI1729BU – PowerCLI Deep Dive
Date: Thursday, August 29, 12:00 PM – 01:00 PM
Speakers: Luc Dekens & Kyle Ruddy
Luc and Kyle are back with another edition of the PowerCLI Deep Dive, where they’ll show you some of the advanced methods they use to make even the hardest of tasks look easy.

Session: HBI1463BU – VMware Cloud on AWS: Advanced Automation Techniques
Date: Wednesday, August 28, 01:00 PM – 02:00 PM
Speakers: William Lam & Kyle Ruddy
William and Kyle will walk you through the available APIs and tooling for VMware Cloud on AWS, then demonstrate they can be used to automate all aspects of the SDDC lifecycle and workload consumption.

Session: HCI1864BU – Automating vSAN from CLI to API: PowerCLI, Govc, and Beyond
Date: Wednesday, August 28, 09:30 AM – 10:30 AM
Speakers: Cedric Rajendran & Dharmesh Bhatt
Cedric and Dharmesh will show how to automate some of the routine vSAN tasks using the wide variety of APIs and CLIs available and at your disposal.

Session: HCI1825BU – Automate VMware HCI Deployments at Any Scale with PowerCLI
Date: Wednesday, August 28, 02:00 PM – 03:00 PM
Speakers: Shane Limbach & Jase McCarty
Shane and Jase will show you how to harness the power of PowerCLI to build, manage, and report on your vSAN environment regardless of scale.

VMware {code} Sessions

Session: CODE2214U – How PowerCLI Makes Configuration Management Easy
Date: Tuesday, August 27, 01:00 PM – 02:00 PM
Speaker: Kyle Ruddy
Kyle will cover some configuration management principles and then dive in to show the latest ways PowerCLI is using PowerShell DSC to make vSphere configuration management easy.

Session: CODE1817UR – Automating vCenter Server Appliance Update Lifecycle
Date: Wednesday, August 28, 09:00 AM – 09:30 AM
Speaker: David Stamen
David will show off his new community module for PowerCLI which can be used to ease the lifecycle management of the vCenter Server Appliance.

Session: CODE2649U – How PowerCLI Gives Day 1 Access to the Latest VMware APIs
Date: Wednesday, August 28, 04:00 PM – 04:30 PM
Speaker: Nikola Klinkachev
Nikola, an engineer on the PowerCLI team, will provide a “look behind the curtain” when it comes to how PowerCLI can automatically interact with the latest and greatest APIs.

Session: CODE1316UR – Horizon 7 Automation 101: How to Get Started with the Horizon API
Date: Wednesday, August 28, 09:30 AM – 10:00 AM
Date: Thursday, August 29, 09:00 AM – 09:30 AM
Speaker: Jack McMichael
Jack will provide an overview of the Horizon 7 API and how PowerCLI can be leveraged to simplify the automation process for those Horizon environments.

VMTN TechTalk Sessions

Session: VMTN5040U – Beginning PowerShell from Cmdlet to Function
Date: Tuesday, August 27, 05:30 PM – 05:45 PM
Speaker: Mike Nelson
Mike will cover a quick introduction to PowerShell, as well as PowerCLI, to help you down the path of getting started with PowerShell.

Session: VMTN5004U – ReportCardPS – Create Pretty Reports Using PowerCLI and Clarity
Date: Wednesday, August 28, 01:00 PM – 01:15 PM
Speaker: Justin Sider
Justin will show you how to easily combine the reporting power of PowerCLI with the UI stylings of clarity to create amazing reports.

Session: VMTN5026U – Automating VDI Tasks, the story of the life of a VDI admin
Date: Thursday, August 29, 01:00 PM – 01:30 PM
Speaker: Chris Hildebrandt
Chris will tell you his personal story of how he learned to automate his daily tasks with, amongst other things, PowerCLI to make him more productive as a VDI administrator.

Hands on Labs

Lab: SPL-2012-01-SDC_U – VMware vSphere Automation – PowerCLI
Date: Anytime the HOL area is open and available
Get hands-on with VMware PowerCLI. Gain familiarity with the tool, and then dive deeper into the functionality available with real world examples. Both new and experienced users are sure to learn something new about automating their environments.

Session: ELW-2012-01-SDC_U – Expert-Led Workshop – VMware vSphere Automation – PowerCLI
Date: Tuesday, August 27, 02:15 PM – 03:45 PM
Date: Thursday, August 29, 08:30 AM – 10:00 AM
Speaker: Peter Kieren
Peter will show attendees how to get hands-on with VMware PowerCLI. You will gain familiarity with the tool, and then dive deeper into the functionality available with real world examples.

Summary

VMworld US 2019 continues to be the premier event to learn about PowerCLI. Come hear directly from the PowerCLI team, as well as numerous community members, how you can harness PowerCLI to automate even the most difficult of tasks.

Make sure you’re registered for VMworld today!

Check Out VMware Code’s Talking Code

Talking Code
There’s a new(-ish) series going on through VMware Code, it’s called Talking Code. This series has been taking a look at new features, such as Code Capture, as well as how to accomplish certain tasks in short, demo-based videos. PowerCLI has been featured in several of these videos already posted to the VMware Code blog and will continue to be included going forward.

Here’s a sampling of some of the PowerCLI based videos already available:

For a complete list of the videos in the Talking Code series, see the: Talking Code Archive

If there’s anything you would like to see covered in the future, let us know in the comments!

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!

Automating VMware Cloud on AWS SDDC Cluster Lifecycle

VMware Cloud on AWS has the ability to add new clusters to an existing SDDC. This is most useful for workload separation. A cluster could be specified as the failover resource, a development environment, and so forth. However, as of Version 1.6, there’s a new reason to add new clusters to an SDDC: custom core counts! The ability to control the CPU count for hosts in a cluster is extremely important when it comes to running mission-critical applications that happen to be licensed per-core. Even better, it is extremely easy to automate the lifecycle of a cluster with PowerCLI.

Let’s check out some examples of how we can manage clusters within the VMware Cloud on AWS service.

Environment Setup

As part of this blog, I will be using a previously deployed SDDC and will begin by working with the low-level VMC module to perform these tasks. We will start by opening a PowerShell session and authenticating to the VMware Cloud on AWS service with our API Token. Then, we need to identify a couple services to use. These services will be the following:

  • com.vmware.vmc.orgs
  • com.vmware.vmc.orgs.sddcs
  • com.vmware.vmc.orgs.sddcs.clusters
  • com.vmware.vmc.orgs.tasks

One last setup requirement, we will need to grab IDs for the Organization and SDDC which we’ll be working with.

We can summarize the above criteria with the following code:

If any of these commands seem foreign, please check out the following blog post for more information: Getting Started with the VMware Cloud on AWS Module

SDDC Cluster Service Overview

We will be using the SDDC Clusters service, and therefore the sddcClusterSvc variable. In order to discover the actions we can perform with the Clusters service, we will take the output from the sddcClusterSvc variable and pipeline that into the Get-Member cmdlet:

Sample: Getting additional information from the SDDC Cluster Service

Here we can see that there are two methods available, create and delete. As part of this blog post, we will walk through the usage of these two methods in the following sections. However, there’s a method or two that are missing, get and list. We can pull that information directly from the get method on the SDDC itself. The cluster information is available by referencing the resource_config property, then the clusters property.

To pull out some basic cluster information, we can use the following command:

Example: Pulling output from the SDDC response about only the clusters

Cluster Creation

For the first example, we have been tasked with creating a new cluster within our SDDC.

In order to populate the parameters for the create method, we will make use of the Help property for the SDDC Cluster service stored in the sddcClusterSvc variable. We can identify all of the parameters required for the create method, including an Org ID, SDDC ID, and the cluster configuration specification, with the following command:

Example: Output from Help for the Create method

We already have our Org ID and SDDC ID stored in a variable. Next, we need to create a cluster config spec for the new cluster. If we take the prior command and append the ‘cluster_config’ property, we can view all of the properties available to populate the spec. Then, by again using ‘Get-Member’, we can see that the cluster_config has a method of create which we can use to create the object for that particular specification.

Example: Establishing the contents for the Cluster Config spec

We’ll then store the spec in a variable named sddcClusterCreateSpec. Based on the prior screenshot, there’s only one required property. This property is for the desired number of hosts for the new cluster. We’ll populate that property with a value of ‘1’, then run our create method to start the creation of the new cluster.

Example: Creating a new cluster with 1 host

Putting the above together, we can create a new cluster with a single host using the following code:

If we login to the VMware Cloud on AWS Cloud Console, we should see the following in our SDDC’s Summary tab:

Example: SDDC Cluster Deployment

Cluster Creation – Custom Core Count

For the second example, we have been tasked with creating another new cluster within our SDDC. However, this time, we only want a specific core count to be available. We will use our prior example and add-on to the specification by setting the host_cpu_cores_count to be a value of 8, 16, 36, or 48, depending on the host type. We can do this by adding the following command to the existing workflow:

Putting the prior example together with the above command, we can create a new cluster with a single host that’s been configured with a CPU core count of 8 using the following code:

Example: Creating a new cluster with 1 host and only 8 CPU cores per host

Cluster Removal

For the third example, we have been tasked with deleting the first cluster we created, Cluster-2. Making use of the Help property from the SDDC Cluster service, we can run the following command to find out what parameters the delete method requires:

Example: Output from Help for the Delete method

We can see that we have three parameters to enter: Org ID, SDDC ID, and Cluster ID. We still have the first two stored in variables, so we need to obtain the Cluster ID. If we remember back to the SDDC Cluster Service Overview section, there’s no list or get methods for the SDDC Cluster service. Therefore, we need to refresh our sddc variable and return back the updated list of clusters to obtain the ID. We can do that with the following commands:

We will then store the cluster information for only Cluster-2, by filtering the cluster_name property with a where statement and storing it in a variable by the name of cluster. Then, we’re ready to run the delete method. We can do that with the following commands:

Example: Deleting a cluster from an SDDC

Putting the above together, we can delete the newly created Cluster-2 with the following code:

VMC Community Module Update

Another option to perform the above tasks is with the VMware.VMC community module, which is available on the PowerCLI Community Repository as well as the PowerShell Gallery. I have updated the module to include the following advanced functions:

  • Get-VMCSDDCCluster
  • New-VMCSDDCCluster
  • Remove-VMCSDDCCluster

The only difference between the above sections and these functions, these functions expect names instead of IDs as input. Otherwise, they work exactly as you would expect. An example of them in use:

Example: Using the SDDC Cluster functions from the VMware.VMC module

Summary

VMware Cloud on AWS based SDDCs can contain multiple clusters, which is beneficial for a couple reasons. First, workload separation. A cluster could be specified as the failover resource, a development environment, and more. Second, and new as of Version 1.6, these clusters can be deployed with a specific amount of CPU cores. This control is certainly important when it comes to running mission-critical applications that happen to be licensed per-core. All of the cluster actions are available via the VMware Cloud on AWS APIs, and therefore PowerCLI as well! This blog post walked us through how to identify the deployed clusters, deploy new clusters, and remove clusters which are no longer needed.

Let us know in the comments how you’re making use of additional clusters in your automation workflows!

New Release: PowerCLI 11.2.0

The first release of 2019 is here! Today marks the release of PowerCLI 11.2.0 and it is an exciting one. PowerCLI now has 21 modules, to ensure you can automate roughly any VMware product. We’re adding new, and more secure, methods to authenticate. There are also improvements to existing cmdlets so you can use the latest and greatest technologies alongside the newest APIs available.

PowerCLI 11.2.0 comes with the following updates:

  • New module available for VMware HCX
  • Added support for NSX-T Policy services
  • Added support for OAuth based connectivity to vCenter
  • Added support for Opaque Networks
  • Updated Storage module cmdlets

Let’s take a look at some of the updates.

New Module for VMware HCX

VMware HCX is an amazing option that breathes new life into the term Hybrid Cloud. To give a quick overview, think of VMware HCX as a swiss army knife – a single tool with multiple options to move your workloads in and out of the cloud. Schedule migrations with HCX vMotion, take advantage of replication assisted vMotion for bulk migrations and even VMs with larger footprints, or protect your data with the available disaster recovery options. HCX is a powerful tool to easily manage the location of your workloads, and PowerCLI now offers 20 cmdlets to help automate its management.

More information on this exciting, new module can be found on the following blog post: Getting Started with the HCX Module

Added Support for NSX-T Services

NSX-T gives administrators the ability to abstract the management of the applied networking, security, and even availability into what’s known as policies. These policies greatly simplify the management experience. Making it even simpler, with the new Get-NsxtPolicyService cmdlet, we can now use PowerCLI to automate these policies with direct connectivity to the API. This cmdlet is also compatible with the newly announced NSX-T 2.4!

PowerCLI Compatibility Matrix with NSX-T

The new policy service cmdlet is great, but that isn’t the only update for NSX-T PowerCLI 11.2.0 comes with. There’s also new support for opaque networks in some of the cmdlets we already know and love. The cmdlets updated to support opaque networks are: Set-NetworkAdapter and Import-VApp.

For more information about how to use these cmdlets with opaque networks, see the following blog: Configuring VMs For Opaque Networks

Updated Authentication Support

Security is always an important topic, especially when it comes to automation. As part of VMware Cloud on AWS, there has been an update to expand into GovCloud. In order to participate in GovCloud, the service has to adhere to a more stringent set of security and privacy controls. The control that will be the most noticeable for PowerCLI users will be around authentication. Therefore, we have added two new cmdlets and updated an existing cmdlet to support OAuth2. For the VMC module, we have a new cmdlet, named New-VcsOAuthSecurityContext, which will produce an OAuth security context based off our VMware Cloud on AWS refresh token. For the Core module, there’s a new cmdlet, named New-VISamlSecurityContext, which will take the OAuth security context and translate it to a SAML2 security context. That SAML2 security context can then be used with the updated cmdlet, Connect-VIServer, to authenticate to the vCenter.

This exchange should look like the following:

It’s worth noting, at this point in time, this functionality is reserved only for GovCloud instances of VMware Cloud on AWS deployed SDDCs.

Storage Module Updates

Last, but certainly not least, the Storage module has a number of updates. The Get-VsanSpaceUsage cmdlet has a new parameter which allows us to return results for a specific storage policy. There has been quite a few new parameters added to the Set-VsanClusterConfiguration cmdlet, which includes: CustomizedSwapObjectEnabled, GuestTrimUnmap, LargeClusterSupported, ObjectRepairTimerMinutes and SiteReadLocalityEnabled. Another updated cmdlet is Test-VsanNetworkPerformance, which now has a DurationInSecond parameter so we can control how long the performance test actually lasts.

For more information about the updates to the Storage module, see the following post by my colleague Jase McCarty: PowerCLI 11.2 Released, with more goodness for vSAN!

Summary

The first PowerCLI release of 2019 has some significant improvements. PowerCLI 11.2.0 introduces OAuth2 support and the ability to access the new NSX-T Policy APIs, plus an entirely new module containing 40 cmdlets to manage HCX!

For more information on changes made in VMware PowerCLI 11.2.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.2.0 User’s Guide. For more information on specific cmdlets, see the VMware PowerCLI 11.2.0 Cmdlet Reference.

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

Example: Update-Module

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