General

New Release – DSC Resources for VMware 2.1

There has been a flurry of activity on a particular GitHub repository over the past couple months and we are now extremely excited to be releasing version 2.1 of the Desired State Configuration (DSC) Resources for VMware. While it might be minor in version number, it is major in terms of features and functionality. This release is the result of over 60 pull requests, a completed GitHub project, and tons of community feedback. All of which we have converted into fourty-five new DSC resources, which triples the available resources from 22 to 67!

The main focus of these new resources is on the management of ESXi hosts. From firewall settings to authentication, configurations for both standard and distributed networking objects, and even setting up datastores. If you can configure a particular setting on an ESXi host, there’s an extremely good chance you can now apply that in an infrastructure-as-code manner with this latest release.

Let’s check out what’s now available with these new resources.

Datastore Related Resources

There are a handful of new resources that give us the ability to apply standard configuration management practices to our vSphere environment’s disks and datastores. These include the creation of an NFS datastore, including the configuration of any required authentications, VMFS datastores, as well as managing the host’s underlying SCSI LUNs and HBAs.

The new disk and datastore based resources:

  • NfsDatastore
  • NfsUser
  • VmfsDatastore
  • VMHostIScsiHba
  • VMHostIScsiHbaTarget
  • VMHostScsiLun
  • VMHostScsiLunPath

Here’s an example configuration where we are using the SCSI LUN and SCSI LUN Path resources to then define a local datastore by the name of “Local Datastore – ESX01”:

Networking Resources

The 2.0 release included a couple new resources to manage vSphere Standard Switches (VSS), but only the switch itself. This new release takes those existing resources and dramatically improves on the functionality. We can now manage VSS portgroups, VMKernel ports, physical ports, as well as some basics when it comes to vSphere Distributed Switches (VDS).

There are also some composite DSC resources for VSS and VSS based portgroups. These composite resources allow us to turn multiple resources into a single, easy to use resource. Both of these composite resources are comprised of four DSC resources, the top object level resource followed by the security, shaping, and teaming resources.

The new network resources:

  • StandardPortGroup (Composite)
  • StandardSwitch (Composite)
  • VDPortGroup
  • VDSwitch
  • VDSwitchVMHost
  • VMHostFirewallRuleset
  • VMHostIPRoute
  • VMHostNetworkCoreDump
  • VMHostPhysicalNic
  • VMHostVDSwitchMigration
  • VMHostVMKernelActiveDumpPartition
  • VMHostVMKernelModule
  • VMHostvSANNetworkConfiguration
  • VMHostVssMigration
  • VMHostVssNic
  • VMHostVssPortGroup
  • VMHostVssPortGroupSecurity
  • VMHostVssPortGroupShaping
  • VMHostVssPortGroupTeaming

Here’s an example configuration of using the composite resources to manage a host’s existing VSS, vSwitch0, and a VSS portgroup, VM Network:

ESXi Host Resources

The last twenty new resources are all solely focused on ESXi host-based configuration. We can manage whether an ESXi host is present in a vCenter and, if so, where. Then, there’s the Advanced Settings, Power Policy, PCI Passthrough, and so many more items which we can address through configuration management.

The new ESXi host resources:

  • vCenterVMHost
  • VMHostAcceptanceLevel
  • VMHostActiveDumpFile
  • VMHostAdvancedSettings
  • VMHostAgentVM
  • VMHostAuthentication
  • VMHostCache
  • VMHostConfiguration
  • VMHostDCUIKeyboard
  • VMHostDumpFile
  • VMHostGraphics
  • VMHostGraphicsDevice
  • VMHostIPRoute
  • VMHostPciPassthrough
  • VMHostPermission
  • VMHostPowerPolicy
  • VMHostRole
  • VMHostSharedSwapSpace
  • VMHostSNMPAgent
  • VMHostSoftwareDevice

Here’s an example of using the vCenterVMHost resource to ensure my desired host is attached to my vCenter server, part of the DemoCluster cluster which is inside of the Demo datacenter:

Here’s another example, this time we’ll be using the VMHostAdvancedSettings resource to ensure that we have an NFS MaxQueueDepth of 1. It’s worth noting, none of the other advanced settings that already exist on the host are modified with this configuration.

Summary

The latest version of the Desired State Configuration (DSC) Resources for VMware is here! This release triples the amount of resources which were already available from twenty-two to a staggering sixty-seven. The primary goal of this release is to be able to apply configuration management to an environment’s ESXi hosts, regardless of the setting. This has been the number one ask from the community, and we are excited for this release!

As usual, I want to say a special thank you to some of our community contributors: Luc Dekens, for all his contributions, as well as Daniel Siegenthaler, Colin Westwater, and GitHub user RamblingPSTech for their contributions as well!

The VMware.vSphereDSC module has been updated on the PowerShell Gallery, and updating is as simple as:

Update-Module -Name VMware.vSphereDSC

For more information on this release, see the 2.1 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!

Comments

One comment has been added so far

Leave a Reply

Your email address will not be published. Required fields are marked *