45
The Release Pipeline Model Applied to Managing Windows Server and Microsoft Cloud Michael Greene Principal Program Manager Microsoft Enterprise Cloud CAT

WinOps Conf 2016 - Michael Greene - Release Pipelines

Embed Size (px)

Citation preview

Page 1: WinOps Conf 2016 - Michael Greene - Release Pipelines

The Release Pipeline ModelApplied to Managing Windows Server and Microsoft Cloud

Michael GreenePrincipal Program ManagerMicrosoft Enterprise Cloud CAT

Page 2: WinOps Conf 2016 - Michael Greene - Release Pipelines

whoamiMichael GreenePrincipal Program ManagerEnterprise Cloud Engineering CAT Team(Customer Feedback, Technical Enablement)CAT PM for PowerShell & DevOps

12 yrs at Microsoft3 yrs BPOSD/O365D Ops

@migreeneMgreenegithttp://aka.ms/thereleasepipelinemodel

Page 3: WinOps Conf 2016 - Michael Greene - Release Pipelines

When does a concept become a revolution?

First, the new candidate must seem to resolve some outstanding and generally recognized problem that can be met in no other way.Second, the new paradigm must promise to preserve a relatively large part of the concrete problem-solving ability that has accrued to science through its predecessors.

(The Structure of Scientific Revolutions, Thomas S. Kuhn)

Page 4: WinOps Conf 2016 - Michael Greene - Release Pipelines

Reading http://stevenmurawski.com/devops-reading-list/

Page 5: WinOps Conf 2016 - Michael Greene - Release Pipelines

Customer Landscape

patterns & practices

how do we include Windows Server?

that’s a little more on the dev side, than IT

Pro?

Page 6: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 7: WinOps Conf 2016 - Michael Greene - Release Pipelines

Treat Servers like PaaS

service consistency

fabric consistency

Software As a Service

consume service

Platform As a Service

deploy apps, jobs, data

Infrastructure As a Servicecustom baselinemanage binaries

SQL Azure

Azure App Services

Azure Virtual Machines

application consistency

Increasing opportunity

for configuration

drift

Physical/Virtual Servers

Page 8: WinOps Conf 2016 - Michael Greene - Release Pipelines

Configuration as Code• Lots of API's• Complex scenarios should be property:value• Living documentation• PowerShell DSC is the PLATFORM that all solutions can

use to deploy and manage Windows Server• Azure Resource Manager is also Configuration as Code• Nothing replaces knowledge about the systems you

intend to manage

Page 9: WinOps Conf 2016 - Michael Greene - Release Pipelines

The Release Pipeline

Page 10: WinOps Conf 2016 - Michael Greene - Release Pipelines

Who changed the environment?

What did they change, exactly?

When did the change occur?

Page 11: WinOps Conf 2016 - Michael Greene - Release Pipelines

What we did before

Prototype in VMSubmit change formPresent to CABArgue that the change is worthwhileConflict oversight by committeeUpdate docs

Page 12: WinOps Conf 2016 - Michael Greene - Release Pipelines

What we do now

• Document everything in configuration as code• Including automated deployment and testing

• Clone latest to workstation•Make change• Run tests locally• Push to Source• Who, What, When, Why (comments)

•Merge with Master, resolve conflicts if needed

Page 13: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 14: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 15: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 16: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 17: WinOps Conf 2016 - Michael Greene - Release Pipelines

How will I catch problems at the earliest possible moment?

Can elements be combined cleanly to produce the correct results?

How will I be notified of a problem?

Page 18: WinOps Conf 2016 - Michael Greene - Release Pipelines

What we did before

• Remote in on Saturday•Make sure servers are listed in RDCMan• Connect to servers and make changes• Reboot in order• Say a prayer / squeeze rabbit’s foot / perform tribal dance• Check that services still work correctly

Page 19: WinOps Conf 2016 - Michael Greene - Release Pipelines

What we do now

• Trigger Build service• Webhook/agent, schedule, manual

• Run scripts stored in Source• Validate quality• Perform work• Capture output

* opportunity to implement Just Enough Administrationhttp://aka.ms/JEA

Page 20: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 21: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 22: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 23: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 24: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 25: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 26: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 27: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 28: WinOps Conf 2016 - Michael Greene - Release Pipelines

Engineer for Resiliency• What will this project require on Day 2? Day 30?

Day 100?• Monitoring rules• Monitoring alerts• Automation runbooks• JEA endpoints• Onboard to backup services• Operational Validation Tests

Page 29: WinOps Conf 2016 - Michael Greene - Release Pipelines

How do we check for regulatory issues?

How do I know this change will not cause an outage?

Will this change work across every variation I have in my environments?

Does this configuration meet our business requirements?

Page 30: WinOps Conf 2016 - Michael Greene - Release Pipelines

What we did before

• Create VM• Install OS• Install app/service• Implement change• Manual, test OU, run script

• Try app/service• Make an educated guess whether it still works

Page 31: WinOps Conf 2016 - Michael Greene - Release Pipelines

What we do now

• Build runs Scripts from Source• Linting - Script Analyzer

• Must meet guidelines set by organization• Unit Tests – Pester

• Functionally should work as expected• Integration Tests – Pester / Kitchen

• Should work across matrix of diverse combinations• Operational Validation – Pester / OVF

• Service should do what it is supposed to do• TDD

Page 32: WinOps Conf 2016 - Michael Greene - Release Pipelines

Integration Testing with Pester

All examples courtesy of the following blog post - https://pshirwin.wordpress.com/2016/04/08/active-directory-operations-test/

$ADConfiguration = @{ Forest = @{ FQDN = 'pshirwin.local' ForestMode = 'Windows2012R2Forest' GlobalCatalogs = @( 'DC-DSC-01.pshirwin.local' ) SchemaMaster = 'DC-DSC-01.pshirwin.local' DomainNamingMaster = 'DC-DSC-01.pshirwin.local'

} Domain = @{ NetBIOSName = 'PSHIRWIN' DomainMode = 'Windows2012R2Domain' RIDMaster = 'DC-DSC-01.pshirwin.local' PDCEmulator = 'DC-DSC-01.pshirwin.local' InfrastructureMaster = 'DC-DSC-01.pshirwin.local' DistinguishedName = 'DC=pshirwin,DC=local' DNSRoot = 'pshirwin.local' DomainControllers = @('DC-DSC-01') }

Describe 'Active Directory configuration operational readiness' {

Context 'Verifying Forest Configuration'{ it "Forest FQDN $($ADConfiguration.Forest.FQDN)" { $ADConfiguration.Forest.FQDN | Should be $SavedADReport.ForestInformation.RootDomain } it "ForestMode $($ADConfiguration.Forest.ForestMode)"{ $ADConfiguration.Forest.ForestMode | Should be $SavedADReport.ForestInformation.ForestMode.ToString() } }

Context 'Verifying GlobalCatalogs'{ $ADConfiguration.Forest.GlobalCatalogs | ForEach-Object{ it "Server $($_) is a GlobalCatalog"{ $SavedADReport.ForestInformation.GlobalCatalogs.Contains($_) | Should be $true } } }

Page 33: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 34: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 35: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 36: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 37: WinOps Conf 2016 - Michael Greene - Release Pipelines

POSHSpecDescribe 'Services' { Service w32time Status { Should Be Running } Service bits Status { Should Be Stopped }}

Describe 'Files' { File C:\inetpub\wwwroot\iisstart.htm { Should Exist } File C:\inetpub\wwwroot\iisstart.htm { Should Contain 'text-align:center' }}

Describe 'Registry' { Registry HKLM:\SOFTWARE\Microsoft\Rpc\ClientProtocols { Should Exist } Registry HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ "SyncDomainWithMembership" { Should Be 1 } Registry 'HKLM:\SOFTWARE\Callahan Auto\' { Should Not Exist }}Describe 'Http' { TcpPort localhost 80 PingSucceeded { Should Be $true } TcpPort localhost 80 TcpTestSucceeded { Should Be $true } Http http://localhost StatusCode { Should Be 200 } Http http://localhost RawContent { Should Match 'X-Powered-By: ASP.NET' } Http http://localhost RawContent { Should Not Match 'X-Powered-By: Cobal' }}Describe 'Hotfix' { Hotfix KB3116900 { Should Not BeNullOrEmpty} Hotfix KB1112233 { Should BeNullOrEmpty}}

https://github.com/Ticketmaster/poshspec

Page 38: WinOps Conf 2016 - Michael Greene - Release Pipelines

How do I make changes without granting long term administrative access?

Does anyone need to sign-off before deployment?

How do I keep services consistent across all my environments?

Can I integrate service management?

Page 39: WinOps Conf 2016 - Michael Greene - Release Pipelines

What we did before

• Request/create VM• Request/manage environmental changes• Install OS• Install app/service (or defer to app/service owner)• Onboard to patching, anti-malware, backup,

monitoring• Validate app/service is working• Go Live

Page 40: WinOps Conf 2016 - Michael Greene - Release Pipelines

What we do now

• Build runs scripts from Source• Potentially automatically releases when Tests pass• Deploy artifacts to environment• Simplify complex work through automation• Promote through stages• QA, Prod, Green/Blue

Page 41: WinOps Conf 2016 - Michael Greene - Release Pipelines
Page 42: WinOps Conf 2016 - Michael Greene - Release Pipelines

Getting Started Guide

• Use Source Control• Don't expect to cutover instantly• Require tests• Keep options open• Old and new tools can be integrated

Page 43: WinOps Conf 2016 - Michael Greene - Release Pipelines

Make change visible

• If change is happening fluidly, everyone needs to know• Your peers are not going to go check reports, the way

they check Facebook• Notify all stakeholders in the way they collaborate

Managing outages without randomizing servers

Page 44: WinOps Conf 2016 - Michael Greene - Release Pipelines

Map your requirements

Plaster

PSake

Pester

POSHSpec

OVF

PSDeploy

Lability

Community Projects

PowerShell Slack

Page 45: WinOps Conf 2016 - Michael Greene - Release Pipelines

Finally

Everyone must be onboard for long term success but it starts with one passionate engineer