Being able to manage large numbers of computers or services and applications in efficient harmony is the key to low cost and low risk IT operations. Microsoft has released in preview version the engine to manage resources with brutal efficiency— Windows PowerShell Desired State Configuration (DSC). DSC preview version is available to download as part of the Windows Management Foundation (WMF) 4.0. WMF 4.0 is in preview stage and production release is expected by the end of 2013.

DSC is the brainchild of Jeffery Snover, Distinguished Engineer at Microsoft and lead architect for Windows Server and System Center. Jeffrey describes the delivery of DSC as completing an eleven-year journey to deploy automation to the data center in the form of PowerShell. From the PowerShell automation model itself (V1) emerged next remote PowerShell scripting (V2), then a PowerShell scripting console (V3), and now, a management model (V4) known as DSC.

The business aim of PowerShell DSC

Jeffery Snover identified “the primary cause of failure [in IT] is change”. This makes sense—it does seem most times there is a major e-commerce or ISP failure, that it is discovered the outage occurred during deployment of new systems, updates, or modifications. Maximum IT management efficiency demands that “rapid change, at scale, with constant failure” be tolerated. Frankly, the only way to achieve continuous service availability, in a continuous release cycle, with continuous deployments, is through automation.

I wrote recently about Service Management Automation (SMA), which is fundamentally PowerShell behind Windows Azure Pack (WAP). Microsoft leverages PowerShell again for automation in DSC. The business aim of PowerShell DSC is to take an idea from inception to development to operations with as little cost and lowest risk possible. For IT pros that avoid scripting, if there was ever a time to dive into PowerShell, this may be it.

Mastery of DSC will be required to take full advantage of the Datacenter Abstraction Layer (DAL)—an industry-standard abstraction for all the resources of a data center fabric including network switches and out of band server management. Being able to deploy and operate entire data centers of any size using the same tool set (PowerShell) speaks of the economic potential of this technology.

Introducing Desired State Configuration (DSC)

DSC is a new management platform in Windows PowerShell that enables deploying and managing configuration data for software services and computing environments. DSC provides a set of Windows PowerShell language extensions and resources that you can use to specify how you want your software environment to be configured. It also provides a means to maintain and manage existing configurations.

Practical applications where you can use built-in DSC resources to configure and manage a set of computers (known as nodes in DSC) in an automated way include: enabling or disabling server roles and features, managing registry settings, deploying new software, and fixing a configuration that has drifted away from the desired state. In addition, you can create custom resources to configure the state of any application or system setting.

How to deploy DSC

For supported computers, the key software component to deploy to enable DSC for both servers and clients is Windows Management Foundation (WMF) 4.0. Once you install WMF 4.0, you can configure DSC client components to have their configuration pushed from a central server, or they can pull their configurations from a central web service. The most common implementation is expected to be the pull server model. That is, DSC client will query a specific web URL to check for configurations they are to load. WMF 4.0 also installs the software needed to enable the DSC pull server component.

You can install the DSC pull server component on a computer running Windows Server 2008 R2 or Windows Server 2012. The DSC client component, WMF 4.0, can be installed on Windows 7, Windows Server 2008 R2, and Windows Server 2012 computers. You will need to uninstall WMF 3.0 if you installed that previously. The MSDN blog has important information about considerations for deploying the WMF 4.0 preview.

On Windows Server 2012 R2, you can install the Windows PowerShell Desired State Configuration Service using Server Manager. This will automatically also install the Management oData IIS Extension used by the DSC web service.  

Using DSC to automatically deploy services

You will extend the PowerShell functions on the DSC pull server by creating configurations which are then called to create MOF (Management Object Format) files. Those files (in the pull model) are staged on the DSC pull server to be queried for then applied (or enacted) by the DSC client. Think of these as the Author-Stage-Enact phases of DSC.

In a simplification, consider that you create a wrapper around a function (literally one or more lines—a block—of PowerShell script) called a configuration. If you want to specify the server the configuration applies to, you can wrap the resources in a Node block. The configuration then gets parsed by client computers (or target nodes) and the change (or configuration) is implemented.

DSC is a function of PowerShell, so you will probably do your work to use DSC capabilities through the PowerShell Integrated Scripting Environment (ISE) that is installed on all modern Windows servers. You could use Notepad and the command prompt, but the ISE makes PowerShell a lot easier to work with. Figure A shows the Configuration and Node blocks in the ISE, then the MOF configuration file being created by calling the configuration as a function.

Figure A

PowerShell DSC at work in the PowerShell ISE: Calling the configuration to generate a MOF file.

Learn more

The Building Clouds blog at Microsoft has a high-level overview of DSC that is easy to follow at this link: