DevOps – Desired State Configuration –

Slides:



Advertisements
Similar presentations
Faith Allington Program Manager Microsoft Corporation WSV322.
Advertisements

C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.
System Center Configuration Manager Push Software By, Teresa Behm.
Module 1 review: added practice steps
$$$ Idea BusinessDevelopmentOperations codeProduct.
Lesson 18: Configuring Application Restriction Policies
Your CMDB and PowerShell DSC: DevOps Techniques
(ITI310) By Eng. BASSEM ALSAID SESSIONS
Deploying and Managing Software by Using Group Policy.
Microsoft ® Application Virtualization 4.6 Infrastructure Planning and Design Published: September 2008 Updated: February 2010.
DotNetNuke v4 on ASP.NET v2 Stan Schultes Stan Schultes Enterprise architect / application developer Enterprise architect / application developer Conference.
INFS 752 Summer Juan Salazar Please right click the symbol in the lower right corner, and then press preview, to hear the presentation for each page.
11 MANAGING AND DISTRIBUTING SOFTWARE BY USING GROUP POLICY Chapter 5.
Getting Started with the PowerShell.org DSC Toolkit Jason Hofferle
Module 7 Configure User and Computer Environments By Using Group Policy.
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
Scale means… Business is growing!! However… More servers => More Failures Scale * Complexity Exceeds Skill Rapid change means… Can respond and capture.
Module 6: Deploying and Managing Software by Using Group Policy.
1 PUPPET AND DSC. INTRODUCTION AND USAGE IN CONTINUOUS DELIVERY PROCESS. VIKTAR VEDMICH PAVEL PESETSKIY AUGUST 1, 2015.
Windows PowerShell Desired State Configuration Overview (for WMF 4.0 Preview) Windows PowerShell Desired State Configuration (DSC) is a new management.
Azure Automation Tao Yang & Pete Zerger ARC311 Microsoft Ignite 2015
Copyright © New Signature Who we are: Focused on consistently delivering great customer experiences. What we do: We help you transform your business.
Simple Push DSC with SCCM Compliance Items Matthew H. Teegarden Systems Software Engineer Lifetouch Inc. Joseph.
Configuration Management, Continuous Integration, Continuous Delivery Revealed.
Doron Orbach UCMDB Product Manager
SQL Replication for RCSQL Reporting
Struggles and Redemption of a DSC Deployment
Stress Free Deployments with Octopus Deploy
Shared Services with Spotfire
Azure, PowerShell, and SQL Server Virtual Machines
Windows Server 8 beta og Windows PowerShell 3.0
Installation, setup and use - Ferro Backup – V1.1
Braindumps Questions Answers
Deploying and Configuring SSIS Packages
Configuration Management with Azure Automation DSC
Andrew Pruski SQL Server & Containers
Working of Script integrated with SiteScope
Presenter: Karoline Lapko
One MOF to rule them all, and in the Azure bind them
Build /21/2018 © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION.
Putting DSC and PowerShell to Work for You Microsoft Tech Talks
11/8/2018 2:35 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or.
Troubleshooting Service Broker
SAP Dev/Test & Automation in Azure
The future of deployments by Rami Mounla
Author/Tech Trainer, Pluralsight
TechEd /13/2018 9:29 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
"SessionTitle": "Infrastructure as Code"
Microsoft Ignite NZ October 2016 SKYCITY, Auckland.
Getting Started with PowerShell Desired State Configuration (DSC)
PowerShell Desired State Configuration
Automating configuration of SQL Server
Unit 9 NT1330 Client-Server Networking II Date: 8/9/2016
SSIS Project Deployment: The T-SQL Way
Getting Started with PowerShell Desired State Configuration (DSC)
Microsoft Virtual Academy
The Current State of Powershell DSC for DBAs André Kamman
Introduction to Object-Relational Mapping for DBAs
What's New in Visual Studio 2005
MDC-B203 Deploying Applications in Microsoft System Center Virtual Machine Manager Using Services John Messec Program Manager Microsoft.
Microsoft Office Not in Textbook.
Microsoft Virtual Academy
Mass Hunting and exploitation with powershell
TechEd /23/2019 9:23 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Governing Your Enterprise with Policy-Based Management
Desired State Configuration
Server Management and Automation Windows Server 2012 R2
Web Deployment with Visual Studio
Preparing for the Windows 8.1 MCSA
Jeffrey Snover | Distinguished Engineer & Lead Architect
Presentation transcript:

DevOps – Desired State Configuration – Mohit K. Gupta DevOps – Desired State Configuration –

SQL Summit Annual International Conference November 6 -9 | Seattle, WA 2 Days of Pre-Cons 200+ sessions over 3 days Over 5,000 SQL Professionals Evening Networking Activities

Please Support Our Sponsors

Let’s Not Distract Others Please silent your phone We can chat later Please don’t snore

Agenda Introduction to Desired State Configuration (DSC) Requirements DSC v4 and DSC v5 DSC Terminology Development & Deployment DSC Resources

Introduction

Introduction DSC is a configuration management platform Service and Application Agnostic Standards-based Distributed Benefits Ensures configuration Supports continuous deployment Prevents configuration drift Change control becomes a text file

Challenge 1: Deployment & Consistency Manual deployment is neither repeatable nor consistent Dev, Test, Prod do not match Build scripts can break mid-stream

Challenge 2: Server Outage Change happened somewhere Configuration drift

Imperative vs Declarative Language Add-WindowsFeature Windows-Server-Backup Declarative Configuration BaseBuild { WindowsFeature Backup { Ensure = "Present" Name = "Windows-Server-Backup" }

Requirements

Operating System Requirements WMF 4.0 WMF 5.0 Windows 7 Upgrade Windows 2008 R2 Windows 8 Windows 2012 Windows 8.1 Default Windows 2012 R2 Windows 10 Windows 2016 PowerShell DSC requires .NET Framework 4.5

Windows 2008 R2 Compatibility Supports PowerShell DSC via WMF 4.0 or WMF 5.0 update Built-in resources will work Limited support for community resources

DSC v4 and DSC v5

DSC Command-Lets by Version Name DSC v4 DSC v5 Configuration X Get-DscConfiguration Get-DscLocalConfigurationManager Get-DscResource New-DscCheckSum Restore-DscConfiguration Test-DscConfiguration Set-DscLocalConfigurationManager Start-DscConfiguration Remove-DscConfigurationDocument Stop-DscConfiguration Update-DscConfiguration Find-DscResource Get-DscConfigurationStatus Invoke-DscResource Publish-DscConfiguration Enable-DscDebug Disable-DscDebug

Demonstration - Deploy SQL Server -

DSC Terminology

Terminology Configuration File Built-In Resources MOF Local Configuration Manager Push / Pull

Configuration File Configuration IISWebsite { Node Server1 WindowsFeature IIS Ensure = "Present" Name = "Web-Server" } WindowsFeature ASP Name = "Web-Asp-Net45"

Built-In Resources File Archive Environment Group Log Package Registry Script Service User WindowsFeature WindowsProcess

MOF File MOF – Managed Object Format Industry standard text file contain resource and configuration data. Consumed by WMI/CIM. localhost.mof

Local Configuration Manager (LCM) The “DSC engine” Enforces configuration and consistency Can auto-correct a state that changes Settings to configure intervals, reboots, etc. Local Configuration Manager

LCM Properties Get-DscLocalConfigurationManager ConfigurationMode ApplyOnly ApplyAndMonitor (Default) ApplyAndAutoCorrect ConfigurationModeFrequencyMins Interval to apply configuration RefreshFrequencyMins Interval to pull configuration RefreshMode Push Pull Disabled

Push / Pull Authoring Staging Nodes Config Pulled IIS Config Pulled Server1 Config Pushed Config Pulled Server1.mof Server1 Configs Deployed Server1.mof Config Pulled IIS Server1.mof Server1 Configs Deployed Server1.mof File Share

LCM Example - Pull [DscLocalConfigurationManager()] Configuration LCMPull { Node localhost Settings ActionAfterReboot = 'ContinueConfiguration' AllowModuleOverWrite = $True ConfigurationID = 'a019aeb4-27e0-4ae2-b2f9-edc0fc620338' ConfigurationMode = 'ApplyAndAutoCorrect' ConfigurationModeFrequencyMins = 15 RefreshFrequencyMins = 30 StatusRetentionTimeInDays = 7 RebootNodeIfNeeded = $True RefreshMode = 'Pull' } ConfigurationRepositoryWeb PullServer ServerURL = "https://psv52012r2pull.contoso.com:8080/PSDSCPullServer.svc" AllowUnsecureConnection = $false

LCM Example - Push [DscLocalConfigurationManager()] Configuration LCMPushv5 { Node localhost Settings ActionAfterReboot = 'ContinueConfiguration' AllowModuleOverWrite = $True ConfigurationMode = 'ApplyAndAutoCorrect' ConfigurationModeFrequencyMins = 15 RefreshFrequencyMins = 30 StatusRetentionTimeInDays = 7 RebootNodeIfNeeded = $True RefreshMode = 'Push' } LCMPushv5 Set-DSCLocalConfigurationManager -Path .\LCMPushv5

Development & Deployment

Quick Configuration – Snippets & Syntax CTRL + J snippet for configuration. Get-DscResourceName -Syntax Copy and Paste

Quick Configuration - IntelliSense Type the resource name and curly braces. CTRL+SPACE for IntelliSense. Use TAB completion for enumerated property values and DependsOn.

Quick Configuration - DependsOn Configuration DependsOnExample { Import-DscResource -ModuleName PSDesiredStateConfiguration Node localhost { File DSCTempFolder { DestinationPath = 'C:\DSCTemp\' Ensure = 'Present' Type = 'Directory' } Archive ExtractZIP { Path = 'C:\InstallSource\LogParser.zip' Destination = 'C:\DSCTemp\logparser\' Force = $true DependsOn = '[File]DSCTempFolder' Package InstallLogParser { Ensure = 'Absent' Name = 'Log Parser 2.2' Path = 'C:\DSCTemp\logparser\logparser.msi' ProductId = '4AC23178-EEBC-4BAF-8CC0-AB15C8897AC9' DependsOn = '[Archive]ExtractZIP' The order of execution of resources is not guaranteed. Use the common property DependsOn to establish order in the format [Resource]Name.

Start-DscConfiguration C:\Windows\System32\Configuration\ Start-DscConfiguration publishes and applies pending.mof 2. Renames current to previous previous.mof current.mof pending.mof 3. Renames pending to current

Start-DscConfiguration -UseExisting 1. Reapplies current.mof previous.mof current.mof

Restore-DscConfiguration previous.mof current.mof pending.mof 1. PUSH mode only. Renames previous to pending

Remove-DscConfigurationDocument Remove-DscConfigurationDocument -Stage Current Pending Previous previous.mof current.mof pending.mof Used to “unconfigure” DSC configuration, leaving the settings applied.

Query the Desired State Test-DscConfiguration – true/false desired state Get-DscConfiguration – current state of configured resources Get-DscConfigurationStatus – Date & time, success or failure Get-DscConfigurationStatus -All – History of DSC events and status

DSC Resources

Resources A resource is PowerShell code that tells a node how to configure the settings Use property values as parameters Can express dependencies Deployed using PowerShell modules

Resource Types Built-In Resource Kit(s) Community (ex. TechNet Script Center, GitHub) Custom

Key Command Lets Command Let Description Get-DscResource Shows current installed resources on system. Can also be used to determine the resource syntax. Find-DscResource Find-Module Search for repositories online. Install-Module Save-Module Install the DSC Resource.

Resource Naming Conventions Resource Name Meaning [ ]FileSystem This resource or other like it are built-in resources with no-prefix. [x]SQLServer Microsoft DSE Resource Kit, stands for eXperimental. Developed by Microsoft. [c]ResourceName Community Developed.

Questions?