service management automation (sma) from zero to hero

31
Service Management Automation From zero to hero…. Michael Rüefli Cloud Architect @itnetx gmbh (CH) Email: [email protected] Blog: www.miru.ch Twitter: @drmiru

Upload: michael-rueefli

Post on 07-Dec-2014

340 views

Category:

Software


0 download

DESCRIPTION

An introduction on the architecture, deployment and best practice deploying SMA to automate clouds and datacenters. How to install is covered too as well as basics on Powershell workflows.

TRANSCRIPT

Page 1: Service Management Automation (SMA) from zero to hero

Service Management AutomationFrom zero to hero….

Michael RüefliCloud Architect @itnetx gmbh (CH)Email: [email protected]: www.miru.chTwitter: @drmiru

Page 2: Service Management Automation (SMA) from zero to hero

What I am focused on…

Page 3: Service Management Automation (SMA) from zero to hero

Agenda

Why SMA?SMA architecture and conceptsInstallation and configurationBasics on PowerShell workflowsRunbook NestingAbout Modules / Integration with other systemsAuthoring / Debugging / LoggingCurrent limitationsNotes from the field / best practiceUseful resources to get started

Page 4: Service Management Automation (SMA) from zero to hero

So which one to go for?

SC Orchestrator

SMA

Better together ?

Page 5: Service Management Automation (SMA) from zero to hero

Why go for SMA?

Consistent author experienceRunbooks can be authored and tested exernally Very flexible, very scalableLightweight infrastructure64Bit Architecture Because we all love Powershell and its ecosystem

Page 6: Service Management Automation (SMA) from zero to hero

SMA Architecture

Page 7: Service Management Automation (SMA) from zero to hero

SMA Solution StackWAP Admin

Portal

REST APIWeb Service

WorkerWorkerWorker

SMA DB

SCOM

SCSMSCCM

SCVMM

SCORCH

Page 8: Service Management Automation (SMA) from zero to hero

SMA Web Service &Runbook Worker

Admin Portal

Typical Enterprise DeploymentPortal and Web Service Load BalancedMultiple Workers for Load DistributionHA SQL DBAlwaysOn or WFC

SMA Web Service &Runbook Worker

Admin Portal

SQL Always On SQL Always On

Page 9: Service Management Automation (SMA) from zero to hero

Installation(1) WAP Admin Portal via Web Platform Installer

Admin SiteAdmin Auth SiteAdmin APIPowershell APITenant API

(2) SMA Powershell Module via SCORCH Media(3) Web Service / Runbook Workers via SCORCH Media(4) Update to current Rollup Pack 2

Page 10: Service Management Automation (SMA) from zero to hero

DEMOSMA Deployment

Page 11: Service Management Automation (SMA) from zero to hero

Administration

How…Web-based runbook authoringSMA Powershell ModuleoDATA REST API

What…Powershell workflowsManage runbooks and jobsHistorical job state, output and debug info

Page 12: Service Management Automation (SMA) from zero to hero

SMA Object TypesRunbooksJobsAssets

Connection ObjectsVariablesPS CredentialsSchedules

Output Streams

Page 13: Service Management Automation (SMA) from zero to hero

PowerShell Workflows

Page 14: Service Management Automation (SMA) from zero to hero

About_Powershell_WorkflowsCode looks like a Function

Compiled on the fly into XAML code for WWF, executed by WWF engine

Limited CMDLET support (but we have inline scripts)

Support for selective parallel / sequential executions

Support for checkpoints / resumes

Page 15: Service Management Automation (SMA) from zero to hero

Powershell Workflow AnatomyParameter Block

Get Connection Info

Inline Script

Page 16: Service Management Automation (SMA) from zero to hero

Variable / Parameter Scoping3 Scopes (Workflow, InlineScript, PS Remote Session)$USING passes Variable from WF to InlineScriptPS Remoting not available as native WF action

Has to be invoked within an InlineScriptVariables from root scope to be re-instantiated

Alternative: Use -PSComputerName for InlineScript remoting

Page 17: Service Management Automation (SMA) from zero to hero

Variable / Parameter Scoping

VS.

Page 18: Service Management Automation (SMA) from zero to hero

DEMOCreating Runbooks

Page 19: Service Management Automation (SMA) from zero to hero

Runbook nestingINLINE (Synchronous call of child runbook)

Pro• Parent and child run in the same job

context• Parent waits for completion• Exceptions and output stream from

child directly available to parent• Supports complex input parameters

Con• Parallel execution can be limited• Child runbook must be published

before the parent runbook• Care has to be taken when naming

child runbooks to prevent conflicts with CMDLETs

Page 20: Service Management Automation (SMA) from zero to hero

Runbook nestingEXTERN (Aynchronous call of child runbook via Web Service)

Pro• Parent and child run in different job

context, allows parallel spin offs• Supports calling of runbooks from

other SMA instances

Con• Getting return data from child

runbooks is not straight forward• Input parameters have to be

«primitive» to survive the JSON serialization through web service

Page 21: Service Management Automation (SMA) from zero to hero

External Systems Integration

Page 22: Service Management Automation (SMA) from zero to hero

PS Modules <-> SCORCH IPsSCORCH uses Integration PacksSMA uses PowerShell ModulesImport PS Modules into SMAPortable Modules for complex code

Page 23: Service Management Automation (SMA) from zero to hero

DEMO Practical Example:Hyper-V Replica Management

Page 24: Service Management Automation (SMA) from zero to hero

Current Limitations• Multi Tenancy for SMA Admin Portal• No Access to SMA from Tenant Portal• Delegation for Assets and Runbooks to Tenants and

Admins• Selection of specific Runbook Worker when

executing / calling Runbooks• Limited Schedule Options

Page 25: Service Management Automation (SMA) from zero to hero

Notes from the field

Page 26: Service Management Automation (SMA) from zero to hero

Field Notes: Debugging / LoggingVerbose / Debug / Progress output per runbook

Use Progress / Debug options with caution (DB growth)Use write-verbose instead of write-outputProper use of try {} Catch {} blocksPrefer logging of proper errors instead of "throwing" exceptionsLog to a central location for simplified troubleshootingUse a custom PS Module for Error Logging and call it within RBs

Page 27: Service Management Automation (SMA) from zero to hero

Field Notes: Runbook Authoring• Name WFs like CMDLETs, respect approved Verbs

http://msdn.microsoft.com/en-us/library/ms714428(v=vs.85).aspx

• Name WFs with a custom prefix (prevent future conflicts)

• Follow general SCORCH Runbook authoring guidelineshttp://blogs.msdn.com/b/microsoft_press/archive/2013/09/18/free-ebook-system-center-designing-orchestrator-runbooks.aspx

• Use proper tagging, multiple tags can help with grouping

• Use Community SMA Module for external authoring in ISEhttp://blogs.technet.com/b/orchestrator/archive/2014/03/27/authoring-sma-runbooks-in-the-powershell-ise.aspx

Page 28: Service Management Automation (SMA) from zero to hero

Field Notes: Security• Do not assign high privileges to Worker Service

Account

• User SMA connection- / credendial-objects instead

• Use dedicated credentials for different target systems

• Do not use clear text passwords in Runbooks

Page 29: Service Management Automation (SMA) from zero to hero

Useful ResourcesSMA White Paper V1.03http://gallery.technet.microsoft.com/Service-Management-fcd75828

Building Clouds Bloghttp://blogs.technet.com/b/privatecloud

System Center Orchestrator Bloghttp://blogs.technet.com/b/orchestrator

Powershell Workflows introductionhttp://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx

Page 30: Service Management Automation (SMA) from zero to hero

WIN A TICKET FOR SCU EUROPE17. – 19. SEPT. 2014BASEL (SWITZERLAND)Question:Within a PS Workflow, non-native Workflow actions can be executed inside an

…………….

Page 31: Service Management Automation (SMA) from zero to hero

THANK YOU!

Michael RüefliCloud Architect @itnetx gmbh (CH)Email: [email protected]: www.miru.chTwitter: @drmiru