What is DSC? Declarative artifact Make it so, define what you want the final state to be PS based extensible provider model to support custom providers and platform based providers It provides Language extensions, Cmdlets to manage configuration, Built-in resources Ships the agent with server OS. Declarative syntax Can parameterize the configuration Uses powershell remoting For each node in configuration you get a MOF file generated.
Overall DSC Workflow MOFs (Extensible to otherformats like JSON/XML etc) (Contains only DSC data) 3 rd party languages and tools Authoring Phase (May include imperative as well as declarative code) Staging Phase (Fully declarative configuration representation using DMTF standard MOF instances) PS V1, V2, V3 PS V4*** Application Phase (Declarative configuration is reified by imperative providers.) Agent of Consistency Imperative Provider Imperative Provider ***On top of PSV3 imperative features, PSV4 adds: Declarative syntax extensions Schema-driven Intellisense Schema validation (early- bound)
Push and Pull Models Binaries + MOF DSC N1 N2 N3 PUSH Adhoc operations Source Code + PS DSC Binaries + MOF DSC N1 N2 N3 PULL Gets to cloud Scale Pull Server Source Code + PS DSC WSMan pushes config to Managed Node, Binary packages are always pulled. Supports both SMB & Http. Generation Developer Model PS DSC Script Source DSC Resource Module PowerShell V4 MOF Generated Configuration Documents (MOF) PowerShell Language extensions compile PowerShell DSC source + resource modules to produce per node configuration documents. Developer authors a PowerShell script using DSC language extensions in ISE or VS. DSC Resource Module DSC Resource Modules Managed Nodes Managed Nodes Managed Nodes Managed Nodes MAGIC: Deploy each configuration document to the DSC agent at the targeted node Same Config multiple environments 6 PS DSC source Dev Environment Dev Environment Test Environment Dev Environment Dev Environment Dev Environment Production Environment DSC AUTHORING - DEMO DSC In-box Providers 1. Archive - to unpack archive (.zip) files at a specific path. 2. Environment - to manage system environment variables. 3. File - to manage files and folders on the target node. 4. Group - to manage local groups on the target node. 5. Package - to install or uninstall packages, such as Windows Installer and setup.exe 6. Process - a mechanism to configure processes on a target node. 7. Registry - to manage registry keys and values on a target node. 8. Role - provides a mechanism to ensure that roles and features are added or removed 9. Script - a mechanism to run Windows PowerShell script blocks on target nodes. 10. Service - provides a mechanism to manage services on the target node. 11. Log sends logs to windows event log. 12. User - to manage local user accounts on the target node.
Generation Developer Model PS DSC Script Source DSC Resource Module PowerShell V4 MOF Generated Configuration Documents (MOF) PowerShell Language extensions compile PowerShell DSC source + resource modules to produce per node configuration documents. Developer authors a PowerShell script using DSC language extensions in ISE or VS. DSC Resource Module DSC Resource Modules Managed Nodes Managed Nodes Managed Nodes Managed Nodes MAGIC: Deploy each configuration document to the DSC agent at the targeted node Implementing customDSC Providers Resource definition file schema.mof Resource implementation file .psm1 Get-TargetResource: Get-TargetResource is used to get the status of the entity modeled by the resource. Test-TargetResource: Test-TargetResource is used to determine whether the entity modeled by resource is in a desired state or not. Set-TargetResource: Set-TargetResource is used to verify that the entity modeled by resource is in a desired state. If the entity modeled by the resource is not in the desired state, then the functionality of Set-TargetResource is responsible for putting the entity in the desired state. Deployment of DSC resource: x-copy deployed
Configuration Delivery Default delivery mechanism (Can be changed in LCM to Pull) PS C:\> $Session = New-CimSession ComputerName "Server01" Credential FAREAST\pryenugu PS C:\> Start-DscConfiguration -Path "C:\DSC\Configurations\" -CimSession $Session Test-DscConfiguration Get-DscConfiguration Agent Components Local Configuration Manager (LCM) Primary push interface Manages local config store Local Config store Holds the configuration documents Pending, Current, Previous1, Previous2, Currently stored as files under $ENV:SystemRoot\System32\Configuration Consistency engine Processes the configuration document and calls the providers Loads modules from pull server if needed Provider Modules Downloaded provider modules are placed in: $ENV:CommonProgramFiles \WindowsPowerShell\Modules Local Configuration Manager Customizes how the DSC Engine operates in the target deployment node. Configuration LocalConfigurationManager {
} Supported Platforms DSC Ships in the box with Windows 8.1, Windows Server 2012r2 DSC will be a part of Windows Management Framework (WMF) WMF ships as an optional update WMF goes downlevel to WS 2012, WS2008R2, Win7 and Win8
Asks for DSC (aka gaps) Synchronization/Orchestration across multi-machine deployments Collection of detailed logs on deployment Multiple mofs per node Combined CSM and DSC model Rich provider support
Requirement Feature Priority I can deploy PS scripts to any tier easily using CSM+DSC OS DSC Provider & related CSM resource extension P0 I can Understand status including completion across multi-tier environment in pull mode. Agent nodes to report status P0 I can deploy to transient environments without explicit agent registration to server Bootstrap environments to listen to a pull server on the fly P0 I can publish new configurations/modules to pull server over HTTP from TFS A simple upload mechanism to pull server P0 I can reliably deploy using Pull deployment model Stability issues/Tenets/Perf/Stress etc should be handled P0 I can install multiple applications in the same environments Multiple MOFs per node [Merging/etc] P0 I can deploy easily to the data tier using CSM+DSC SQL DSC Provider & related CSM resource extension P0 I can deploy easily to the web tier using CSM+DSC IIS DSC Provider & related CSM resource extension P0 I can control access to the push server Fine grained access control around push P0 I can move files over WAN more rapidly More efficient DSC fileprovider to handle file syncs across WAN like rsync P0 I can secure secrets used in my deployment configurations Crypto store for secrets P1 I can easily diagnose failures in pull model. Fetch agent logs in Pull server & Consistent Interface for logging in providers P1 I can deploy applications "instantaneously" in pull model. Poke to Pull. P1 I can install, find & update PS modules in various artifact galleries. Install/Find/Update Module P1 I can control node level access to the pull server Basic access control around which nodes can pull P1 I can compose multiple modules to build my master deployment script Class based composition P1 I can consume modules from feeds and install them for my use Module as Feed [like Nuget package] P1 ,