26
Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia [email protected]

Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia [email protected]

Embed Size (px)

Citation preview

Page 1: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Design for Operations

Building Manageable Enterprise Applications for Windows

Graham ElliottArchitectural Technology Specialist, Microsoft Australia

[email protected]

Page 2: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

App Code

App Code

Energy And Entropy

App Code

AdminView

AdminView

AdminView

En

d-u

ser:

valu

es

En

d-u

ser:

valu

es

UN

IQU

EN

ES

SU

NIQ

UEN

ES

S

Ad

min

istr

ato

r: v

alu

es

Ad

min

istr

ato

r: v

alu

es

SIM

ILA

RIT

YS

IMIL

AR

ITY

UserView

UserView

UserView

Management features are a way to present a Management features are a way to present a homogenous view of things in a heterogeneous homogenous view of things in a heterogeneous

environmentenvironment

App logic contributes to both user view and admin App logic contributes to both user view and admin view.view.

Page 3: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Monitoring Server

Router/Firewall

100 Mbps Switch

Web Server 4

Web Server 3

Web Server 2

Web Server 1

Order Processing Server (with message queue,

payment component, and SMTP)

Admin Server (with Domain

Controller & DNS)

Database Server 1

Disk Array

Database Server 2

Active Directory Domain Controller

(with DNS)

InfrastructureInfrastructureArchitectArchitect

System System AdministratAdministrat

ororDeveloperDeveloper

TesteTesterr

SystemSystemArchitectArchitect

BusinessBusiness StakeholdStakehold

erer

IT IT ManagerManager

Importance & Challenges• “Hard-2-Manage” Applications:

– Increase Operating Costs– Lower Agility, Increase Complexity– Increase Support Response Times– Unpredictable Behavior

• “Easy-2-Manage” Applications:– Reduce Operating Costs – Increase Agility, Reduce Complexity– Reduce Support Response Times – Predictive Behavior

• Improves User Confidence • Competitive Advantage

Page 4: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Designing for OperationsDesign

MOMAdmin Console

Health ModelDesigner

CustomTools

Visual StudioDesigners

DeploymentValidation

Health Model

DatacenterModel

ApplicationModels

Build

Events

PerformanceCounters

InstrumentedApplication

Configuration

WMI

FilesGroupPolicy

Deploy

SMS

MSIInstaller

Custom /Other

OperateSMS

MOM

Event Viewer

Perf Mon

WMI Tools

Scripting

MMC

Feedback

Design

Deploy

Operate

Build

Page 5: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Design

• Health / Management Modelling– Design for YOUR operations

• Configuration Models• Task Models• Health Models

– Microsoft Management Model Designer

• Visual Studio 2005 Team System Distributed System Designers– System Definition Model– Built-in Designers

Design

Deploy

Operate

Build

Page 6: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Health Modelling

• Documents how to detect / verify the operational state of an application & how to resolve problems

• Defines what it means for a system to be healthy (operating normally) or unhealthy (degraded state or not working)

• Defines states / transitions• Capture system events

and instrumentation • Once in place, mgt.

is done through the model

Online

Degraded

Failed

Offline

StoppedStarted

Problem Detected

Recovered Successfully

StoppedCannot Diagnose

FailedCannotRecover

All ProcessesShut Down / Killed

Page 7: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

How to Build a Health Model

• Identify Managed Entities• Create Logical Hierarchy• Identify the Aspects• Define Detectors• Define Verifiers• Define Diagnosers• Define Resolvers• Create Rollup Monitors for like-category aspects• Validate / score, export MOM packs, instrument app

Page 8: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Build

• Implement the Health Model– Application Instrumentation and Configuration

• Performance Counters• Windows Eventing and Tracing• WMI and WS-Management• Enterprise Library

– Operations Friendly Interface via MMC– MOM Management Packs

Design

Deploy

Operate

Build

Page 9: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Performance Counters

• What are Performance Counters?– Numerical counters and performance tools built into the

Windows Operating System– Provide statistical real-time performance data

• Why use Performance Counters?– Measure application performance

• Requests / Sec, Response Time, No. Threads, Queue Length etc.

• Identifying application problems• Providing SLA metrics

Page 10: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Implementing Counters in .NET• Implement counters based upon the Health Model• Create an instance of PerformanceCounter class

• CategoryName, CounterName, InstanceName or MachineName

• Provide Data using IncrementBy, Increment, Decrement or RawValue– Increment, IncrementBy and Decrement use interlocks (Thread Safe)– Use RawValue for performance (x5)

• Requires PerformanceCounterPermission to run– .NET 1.0/1.1 requires full trust

• Create a custom installer to install the counters– MSI or InstallUtil

Page 11: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

NT Eventing

• What is Eventing?– Mechanism to say “something interesting has happened”

• Administrative Events - Used by IT Operations Staff• Operational Events - Used by monitoring tools• Debug and Tracing Events - Used only by developers

– Windows Event Logs• Application (IT ops), System, Security (audit) OR custom (app logs)

• Why use Eventing?– Indicate state changes from the Health Model– Tell OPERATIONS when and what has happened– Events logged to a well know place (event log) with built in viewer

• Broad OS Support (Not Win98 or WinME)

Page 12: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Implementing Eventing in .NET

• Create Events from Health Model• Register Event Source

– EventLog.CreateEventSource()• Write Events as Required by the Health Model

– Catch exceptions– myEventLog.WriteEntry()

• Create a custom installer• Windows Vista – Windows Eventing 6.0

– Better performance and reliability– Declarative Event Structure– Subscription services– Event forwarding within domain and through firewalls

Page 13: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Windows Mgt Instrumentation

• What is WMI?– Exposes Configuration / Management data and tasks to the OS

• Instrumentation (get/set/invoke), Configuration, Events, Scripting

– Windows Implementation of Web Based Enterprise Management– Supports various WMI Clients and command line operations (WMIC)– Exposed to WS-Management

• Why use WMI?– Expose Configuration Information to the OS and Management tools– Allow Scriptable Configuration Changes– Allow Remote management– Instrument the application

WMI DCOM Proxy

WMIService WMI Provider

Application

COM / DCOM

CIM Repository

WSH Script

MOM COM / DCOM

Page 14: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Implementing WMI in .NET

• Decide which configuration to expose to WMI• Create Provider class (system.management)

• Map Existing Configuration Properties to Class Provider Attributes (get/set)

• Build an Installer

Page 15: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

WS-Management

• 2 Faces of WS-Management– WS-Management: The Protocol

• Joint effort with AMD, BMC, Dell, Intel, Sun and WBEM Solutions to use web services protocol for interoperable management.

– WS-Management: The Implementation

WS-Man WS-Manhttps

CIM Repository

winRM

WMI

Page 16: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

WS-Management: Implementation

• WS-Management is:– A Web Service (over HTTPS in “R2”)– An XML/SOAP-based Management Protocol– Can access most existing WMI objects– In-Band provides a richer set of capabilities than the

OOB, specifically software management • Microsoft Windows Server “R2” ships with the first

version of WS-Management. This allows for:– Access to Hardware Instrumentation– Firewall Friendly access to Windows Instrumentation

Page 17: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Microsoft Patterns & Practices

EEngineering Practicesngineering Practices

Guidance for tasks such as security, performance, Guidance for tasks such as security, performance, test, deployment and operationstest, deployment and operations

EEngineering Practicesngineering Practices

Guidance for tasks such as security, performance, Guidance for tasks such as security, performance, test, deployment and operationstest, deployment and operations

Application Application BlocksBlocks

& Libraries& Libraries

Code abstractions Code abstractions with guidancewith guidance

Application Application BlocksBlocks

& Libraries& Libraries

Code abstractions Code abstractions with guidancewith guidance

D A D I

A

D

I

PatternsPatterns

Known solutions to Known solutions to recurring problemsrecurring problems

PatternsPatterns

Known solutions to Known solutions to recurring problemsrecurring problems

D A D I

A

D

I

BaselineBaselineArchitecturesArchitectures

Durable starting Durable starting points to begin points to begin developmentdevelopment

BaselineBaselineArchitecturesArchitectures

Durable starting Durable starting points to begin points to begin developmentdevelopment

D A D I

A

D

I

Architecture & Architecture & Design GuidesDesign Guides

System-Level System-Level ArchitecturesArchitectures

Architecture & Architecture & Design GuidesDesign Guides

System-Level System-Level ArchitecturesArchitectures

D A D I

A

D

I

Available online: http://www.microsoft.com/practices

Page 18: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Enterprise Library

• A library of application blocks from patterns & practices– Guidance for common enterprise development challenges– Reusable, extensible and modifiable source code

• Instrumentation now core– Windows Events– Performance Counters– WMI Events– Requires Installation and “Switch on”

Page 19: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Microsoft Management Console

• What is MMC?– Provides Common Administrator Interface in Windows– MMC 3.0 in Windows 2003 R2 (Download for XP and 2003)

• Managed Code Support

• New Action Pane

• Windows form hosting capability

• Why use MMC?– Easy way to build administrative consoles– Same technology Windows uses– Consistent management experience for administrators– Reduced Development Costs

Page 20: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Snap-in(Stand Alone or Extension)

Node

NodeNode

ViewDescViewDesc Views

• HTML• Msg• List• WinForm

View

ActionAction ActionAction ActionAction

Selected Data

Property PageProperty Page

Verbs Verbs

Tree Pane Result Pane

Action Pane

Implementing an MMC Snap-In

Property Sheet

Page 21: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Deploy: MSI

• What is MSI?– Windows Installer Technology

• Part of OS

• Specifies what to install not how

• Database of all installations

• Supports Self-repair and Installation roll back

• Why use MSI?– Windows Standard for Installing Applications

– Advanced Installation Features

– Multiple Installation Options

Design

Deploy

Operate

Build

Page 22: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Windows Installer Capabilities

• Files & Folders• File Extensions• Authenticode Signatures and Strong Name Signatures• Localization• Registry• User Interface• Global Assembly Cache• Custom Actions• Administrative Installation• Conditional Deployments

Page 23: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Windows Installer Types

• Merge Module– Shared by multiple applications

• Setup Project– Installer for Windows Based Application

• Web Setup Project– Installer for Web Application

• Cab Project– Legacy Web Browser Support

• Smart Device Cab Project– For Device Applications

Page 24: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

MS Operations Framework

• Operational Guidance

• MOF Components– The Team Model– The Process Model– The Risk Management Discipline

• http://www.microsoft.com/mof

Design

Deploy

Operate

Build

Page 25: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Summary

• Design and Build Manageable Applications – Build a Health Model– Instrument Your Application– Create an Installer– Ensure Management Tools Can Use the Instrumentation

• Windows Management Tools • MOM - Build a Management Pack

• Useful Resources– http://www.microsoft.com/windowsserver2003/techinfo/overview/

designops.mspx– http://www.microsoft.com/dsi – http://www.microsoft.com/practices– http://channel9.msdn.com/shows/The_DFO_Show

Page 26: Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com

Questions?