Your SlideShare is downloading. ×
0
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Desired state-configuration-ravikanth-august-2013-vtc india

1,178

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,178
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Desired State Configuration in PowerShell 4.0 Ravikanth Chaganti @Ravikanth http://www.ravichaganti.com/blog
  • 2. About Me • Work at Dell Inc. • Windows PowerShell MVP since 2010 • Founder and Editor of PowerShell Magazine • Twitter: @Ravikanth • Facebook: /Ravikanthc • http://www.powershellmagazine.com • http://www.ravichaganti.com/blog
  • 3. Desired State Configuration • A new management platform for management of configuration data – Helps prevent configuration drift – Helps DevOps! • Provides – Language Extensions – Cmdlets to manage configuration – Built-in resources
  • 4. DSC Basics … Configuration ArchiveDemo { Node SRV3-WS2012R2 { Archive ArchiveDemo { Path = "10.10.10.101BackupScripts.zip" DestinationPath = "C:Scripts" Ensure="Present" } } } ArchiveDemo Declarative Syntax .PS1 • Can take parameters like a function • Uses PowerShell Remoting • Each Configuration document gets converted to a MOF
  • 5. DSC Resources Archive Environment File Group Log Package Process Registry Role Script Service User … Of course, You can build your own resources
  • 6. BUILT-IN RESOURCES Demo
  • 7. Custom DSC Resources • Create a MOF file describing the resource • Create a PowerShell Module (PSM1 & PSD1) – Set-TargetResource – Test-TargetResource – Get-TargetResource – Must be idempotent • Copy all files to C:Windowssystem32WindowsPowerShellv1.0Mo dulesPSDesiredStateConfigurationPSProviders
  • 8. Custom Resource - MOF [version("1.0.0"), FriendlyName("HostsFile")] class HostsFile : MSFT_BaseResourceConfiguration { [Key] string hostName; [Key] string ipAddress; [write,ValueMap{"Present", "Absent"},Values{"Present", "Absent"}] string Ensure; }; • [Key] for unique attributes; become mandatory • [Write] for attributes for which a value can be specified • [Read] for readonly attributes • ValueMap defines the possible values • Naming: classname.schema. mofHostsFile.Schema.Mof
  • 9. Custom Resource – Module • Same parameters on – Get-TargetResource • Must return hashtable of the configuration – Set-TargetResource – Test-TargetResource • Must return true or false • Module Manifest is required – Use New-ModuleManifest
  • 10. DSC Execution Flow Start Run Test-TargetResource Run Set-TargetResource False End True
  • 11. CUSTOM DSC RESOURCE Demo
  • 12. DSC Configuration Data • Separate business logic from configuration data • Makes configuration logic more re-usable $AllNodes = @( @{ NodeName = "*"; RecurseValue = $true }, @{ NodeName = “SRV2"; HostName = "Web01"; IPAddress = “10.10.10.101"; }, @{ NodeName = “SRV3"; HostName = "Web02"; IPAddress = “10.10.10.102"; }, );
  • 13. DSC – Local Configuration Manager • Each computer with PS 4.0 runs a DSC Engine (as SYSTEM) • Responsible for calling the DSC resources • LCM properties can be updated to use pull model; of course, using DSC 
  • 14. CONFIGURING CM Demo
  • 15. Configuration Delivery • Push – Default delivery mechanism – Start-DSCConfiguration • Pull – DSC Service – IIS Endpoint – Requires • Windows Server 2102 or • Windows Server 2012 R2
  • 16. Summary • Understanding DSC and implementing custom resources can change the way configuration management is done • Endless opportunities for System administrators and DevOps engineers
  • 17. Resources • DSC Overview http://technet.microsoft.com/en- us/library/dn249912.aspx • DevOps and DSC www.youtube.com/watch?v=w3A2RmppBG4 • DSC at TechEd 2013 http://channel9.msdn.com/Events/TechEd/NorthAme rica/2013/MDC-B302 • Github repo for DSC custom resources https://github.com/smurawski/DSC-Contrib
  • 18. QUESTIONS?

×