260 likes | 356 Views
Design for Operations. Building Manageable Enterprise Applications for Windows. Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com. Energy And Entropy.
E N D
Design for Operations Building Manageable Enterprise Applications for Windows Graham Elliott Architectural Technology Specialist, Microsoft Australia grahame@microsoft.com
Energy And Entropy Management features are a way to present a homogenous view of things in a heterogeneous environment User View App Code Admin View Administrator: values SIMILARITY End-user: values UNIQUENESS User View App Code Admin View User View App Code Admin View App logic contributes to both user view and admin view.
Active Directory Domain Controller (with DNS) Order Processing Server (with message queue, payment component, and SMTP) Monitoring Server Admin Server (with Domain Controller & DNS) Router/Firewall Web Server 1 System Administrator System Architect Developer BusinessStakeholder Database Server 1 Web Server 2 IT Manager 100 Mbps Switch Tester Web Server 3 Disk Array InfrastructureArchitect Web Server 4 Database Server 2 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
Design Operate SMS Visual Studio Designers MOM Health Model Designer Event Viewer Custom Tools Perf Mon MOM Admin Console WMI Tools Deployment Validation Scripting MMC Feedback Build Deploy Events Performance Counters Custom / Other MSI Installer Instrumented Application SMS Configuration WMI Files Group Policy Health Model Datacenter Model Application Models Designing for Operations
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
Problem Detected Recovered Successfully Online Stopped Cannot Diagnose Degraded Started Stopped Offline Failed Cannot Recover Failed All Processes Shut Down / Killed 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
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
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
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
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
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)
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
CIM Repository Application WSH Script WMI DCOM Proxy WMI Service WMI Provider MOM COM / DCOM COM / DCOM 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
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
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 CIM Repository winRM WS-Man WS-Man WMI https
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
Baseline Architectures Durable starting points to begin development Application Blocks & Libraries Code abstractions with guidance D D D A A A D D D I I I D A D I A A A A D D D D I I I I Engineering Practices Guidance for tasks such as security, performance, test, deployment and operations Microsoft Patterns & Practices Available online: http://www.microsoft.com/practices Architecture & Design Guides System-Level Architectures Patterns Known solutions to recurring problems
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”
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
Implementing an MMC Snap-In Snap-in (Stand Alone or Extension) Result Pane Tree Pane • HTML • Msg • List • WinForm Node ViewDesc Views ViewDesc View Node Node Selected Data Action Action Action Action Action Action Verbs Verbs Action Pane Property Page Property Page Property Sheet
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
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
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
MS Operations Framework • Operational Guidance • MOF Components • The Team Model • The Process Model • The Risk Management Discipline • http://www.microsoft.com/mof
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