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”:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
VMHostScsiLun 'VMHostScsiLun_mpx.vmhba0C0T0L0' { Server = $Server Credential = $Credential VMHostName = $vmHostName CanonicalName = 'mpx.vmhba0:C0:T0:L0' BlocksToSwitchPath = 0 CommandsToSwitchPath = 0 IsLocal = $true IsSsd = $false MultipathPolicy = 'Fixed' PreferredScsiLunPathName = 'vmhba0:C0:T0:L0' } VMHostScsiLunPath 'VMHostScsiLunPath_vmhba0:C0:T0:L0' { Server = $Server Credential = $Credential VMHostName = $vmHostName Name = 'vmhba0:C0:T0:L0' ScsiLunCanonicalName = 'mpx.vmhba0:C0:T0:L0' Active = $true Preferred = $true DependsOn = '[VMHostScsiLun]VMHostScsiLun_mpx.vmhba0C0T0L0' } VmfsDatastore 'VmfsDatastore_Local Datastore - ESX01' { Server = $Server Credential = $Credential VMHostName = $vmHostName Ensure = 'Present' Name = 'Local Datastore - ESX01' Path = 'mpx.vmhba0:C0:T0:L0' BlockSizeMB = 1 CongestionThresholdMillisecond = 30 FileSystemVersion = '5.81' StorageIOControlEnabled = $false DependsOn = '[VMHostScsiLun]VMHostScsiLun_mpx.vmhba0C0T0L0' } |
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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
StandardSwitch 'StandardSwitch_vSwitch0' { Server = $Server Credential = $Credential VMHostName = $vmHostName Name = 'vSwitch0' Ensure = 'Present' Mtu = 1500 NicDevice = @() LinkDiscoveryProtocolType = 'Unset' LinkDiscoveryProtocolOperation = 'Unset' AllowPromiscuous = $false ForgedTransmits = $true MacChanges = $true Enabled = $false CheckBeacon = $false ActiveNic = @(‘vmnic0’) StandbyNic = @() NotifySwitches = $true Policy = 'Loadbalance_srcid' RollingOrder = $false DependsOn = '' } StandardPortGroup 'StandardPortGroup_VM Network' { Server = $Server Credential = $Credential VMHostName = $vmHostName Name = 'VM Network' VssName = 'vSwitch0' Ensure = 'Present' VLanId = 1730 LoadBalancingPolicy = 'Unset' ActiveNic = @(‘vmnic0’) StandbyNic = @() UnusedNic = @() NetworkFailoverDetectionPolicy = 'Unset' DependsOn = '[StandardSwitch]StandardSwitch_vSwitch0' } |
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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
vCenterVMHost vCenterVMHost { Server = $Server Credential = $Credential Name = $VMHostName Location = 'Demo/DemoCluster' DatacenterName = 'Demo' DatacenterLocation = '' Ensure = 'Present' VMHostCredential = $VMHostCredential ResourcePoolLocation = '/' Port = 443 Force = $true DependsOn = '[Cluster]Demo' } |
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.
1 2 3 4 5 6 7 8 |
VMHostAdvancedSettings 'VMHostAdvancedSettings' { Server = $Server Credential = $Credential Name = $vmHostName AdvancedSettings = @{ 'NFS.MaxQueueDepth' = '1' } } |
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:
1 |
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!
I am going to reread and apply your advice to my work.
This is great I will love to share this article. 🙂
This is fantastic, and I will gladly share it.
I am going to reread and apply your advice to my work.
thanks !
Great Content, love to share it.
Thanks.
This is great I will love to share this article.
I must appreciate it as being an effortfully written piece of work. Keep it up
Very amazing article, I would Like to thank you for writing this. keep doing well!
chaturbate
Thanks so much for such article.
Thanks for the amazing article brother. Keep doing well
Very Well Elaborate Thanks A Lot. Also I Have One Question About “Datastore Related Resources” Can Someone Reply it.
very nice
This topic is very interesting and I am interested but do not know where to find, thankfully you create this topic, hope everyone will help me
Very amazing article, I would Like to thank you for writing this. keep doing well!
Mainly this website gives a lots of good updates. sarkariexam
VMware recently released PowerCLI version 12.1. This features a number of new capabilities that are worth highlighting in PowerCLI 12.1 Release 1. With this release, PowerShell Desired State Configuration (DSC) can now be used to deploy VMware Cloud on AWS. This will allow you to provision and manage resources within your AWS account by using PowerCLI and DSC.
Amazing Information. Keep Working and Updating. Thank You.
Excellent Post. I bookmarked it.
The things you shared here are amazing, this knowledge I didn’t know before so worked very hard.
The things you shared here are amazing, this knowledge I didn’t know before so worked very hard.
good its very interesting admin
Thanks for this sharing information
Hi admin It was very useful
Thanks for this post
Thank for the valuable content I loved it
Thank for the valuable content I loved it
Hi admin It was very useful
good its very interesting admin
really informative article. i love it i didn’t read that information before about it
good really interesting article
Very detailed Topic will you please share your git repository link
Thank you in advance
SEO reporting tracks your website’s SEO performance. It tells you which SEO marketing efforts are working (e.g., identify specific keywords for organic search) and recommends opportunities for growth.
Super cool and awesome thing you have shared. Thanks
Your site was very informative and interesting as well. Thanks a lot and good luck.
How to create background Job in SAP
good really interesting article. ANSWER KEY
Your site was very informative and interesting as well. Thanks a lot and good luck.
Your site was very informative and interesting as well. Thanks a lot and good luck.
always used to find and work for her way
http://www.sanyamahajan.com/
Nice to read to article. Excellent way of content delivery. Keep sharing more blogs like this
very good and meaningful article, i have learned a few more things.
Wheel spinner is a game that I am sure that anyone who loves spins of fortune will be addicted to sitting in front of the computer playing this game for hours on end. The game has no age limit for players, suitable for those who want healthy entertainment and improved hand reflexes.