operating system for the cloud runs applications in the cloud provides storage application...

38
Windows Azure Compute Name Title Microsoft Corporation

Upload: felix-armstrong

Post on 16-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:
Page 2: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Session Objectives and Takeaways

Describe Windows Azure Compute

Understand Model and Terminology

Page 3: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Windows Azure

Windows Azure is Microsoft’s Cloud Platform for Developers

Operating System for the CloudRuns applications in the cloudProvides StorageApplication Management

Windows Azure ideal for

applications needing:ScalabilityAvailabilityFault ToleranceOn-Demand ComputingPerformance

Page 4: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

What is Windows Azure Compute?

Virtual Machines in the CloudThree Flavors:

Web Role Worker Role VM Role

Page 5: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

What Can It Run?

Page 6: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Roles and Instances

At runtime each Role will execute on one or more instances A role instance is a set of code, configuration, and local data, deployed in a dedicated VM

Roles are defined in a Hosted ServiceA role definition specifies:VM sizeCommunication EndpointsLocal storage resourcesetc.

Page 7: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Roles and InstancesExample Hosted Service configuration with a single web role and a single worker role

HOSTED SERVICE

VM1 VM2 VM3 VM4

VM5 VM6 VM7 VM8

VM9 VMn

VM1 VM2 VM3 VM4

VM5 VMn

Page 8: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Fault Domains

99.95% Uptime GuaranteeRequires 2 or more instance per role

Role instance are isolated by fault domainFault domains isolate VMsFault domains provide redundancyAt least two fault domains per role

Page 9: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Upgrade Domains

Page 10: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Roles and InstancesExample role with nine virtual machines distributed across three fault domains

ROLE

VM1 VM3

VM5 VM8

VM2 VM4

VM6 VM9

VM6 VM9

Page 11: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

The High Scale Application ArchetypeWindows Azure provides a ‘pay-as-you-go’ scale out application platform

Async Activation

Network Activation

Page 12: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Windows Azure SDKs and Tools

.NetVisual Studio ToolsClient Libraries for .Net

Node.jsPowerShell ToolsNode.js for WindowsIISNodeClient Libraries for Node.js

JavaEclipse ToolsClient Libraries for Java

phpCommand Line ToolsClient Libraries for php

Page 13: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Windows Azure for .Net Developers

Visual Studio 2010

Project Templates

Model & Config Tooling

Package & 1 Click Deploy

Debugging Support

Storage Explorer

Server Explorer

IntelliTrace Support

Profiling Support

Page 14: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Inherits RoleEntryPoint

OnStart() Method

Run() Method

OnStop() Method

Role Programming Model

Page 15: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Role Lifecycle

All roles may extend RoleEntryPoint

Roles report status via RoleEnvironment

StatusCheck

StatusCheck

StatusCheck

Stopping

METHODS EVENTS STATUS

Page 16: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Worker Role

Poll and Pop Messages within while(true) loopE.g. Map/Reduce pattern, background image processing

Create TcpListener or WCF Service HostE.g. Run a .NET SMTP server or WCF Service

OnStart or Run method executes Process.Start()Startup Task installs or executes background/foreground processCustom Role Entry Point (executable or .Net assembly)E.g. Run a database server, web server, distributed cache

Page 17: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Web Role

Webforms or MVCFastCGI applications (e.g. PHP)Multiple Websites

Can optionally implement RoleEntryPoint

Page 18: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Understanding Packaging and ConfigWindows Azure Services are described by two important artifacts:Service Definition (*.csdef)Service Configuration (*.cscfg)

Your code is zipped and packaged with definition (*.cspkg)Encrypted(Zipped(Code + *.csdef)) == *.cspkg

Windows Azure consumes just (*.cspkg + *.cscfg)

Page 19: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Describes the shape of your Windows Azure ServiceDefines Roles, Ports, Certificates, Configuration Settings, Startup Tasks, IIS Configuration, and more…

Can only be changed by upgrades or new deployments

Page 20: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

<?xml version="1.0" encoding="utf-8"?><ServiceDefinition name="WebDeploy" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">

<WebRole name="WebUX"><Startup>

<Task commandLine="..\Startup\EnableWebAdmin.cmd" executionContext="elevated" taskType="simple" /></Startup><Imports>

<Import moduleName="RemoteAccess" /><Import moduleName="RemoteForwarder"/>

</Imports><Sites>

<Site name="Web"><Bindings> <Binding name="HttpIn" endpointName="HttpIn"/></Bindings>

</Site></Sites><Endpoints>

<InputEndpoint name="HttpIn" protocol="http" port="80"/><InputEndpoint name="mgmtsvc" protocol="tcp" port="8172" localPort="8712"/>

</Endpoints>

Page 21: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Supplies Runtime Values (Scale, Config Settings, Certificates to use, VHD, etc.)

Can be updated any time through Portal or API

Page 22: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

<?xml version="1.0"?><ServiceConfiguration serviceName="WebDeploy" xmlns="http://schemas.microsoft.com/serviceHosting/2008/10ServiceConfiguration"> <Role name="Webux">

<Instances count="1"/><ConfigurationSettings>

<Setting name="DiagnosticsConnectionString" value="UseDevelopmentStorage=true/><Setting name="Microsoft.WindowsAzure.plugins.RemoteAccess.Enabled" value="True"/><Setting name="Microsoft.WindowsAzure.plugins.RemoteAccess.AccountUsername" value="dunnry"/><Setting name="Microsoft.WindowsAzure.plugins.RemoteAccess.AccountEncryptedPassword" value="MIIBrAYJKoZIhvcNAQcDoIIB"/><Setting name="Microsoft.WindowsAzure.plugins.RemoteAccess.AccountExpiration" value="2010-12-23T23:59:59.0000000-07"/><Setting name="Microsoft.Windows Azure.Plugins.RemoteForwarder.Enabled" value="True"/>

<ConfigurationSettings><Certificate>

<Certificates name="Microsoft.WindowsAzure.Plugins.remoteAccess.PasswordEncryption" thumbprint="D6BE55AC439FAC6CBEBAF"/>

</Certificate></Role>

</ServiceConfiguration>

Page 23: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Run any executable in your role

Not just limited to .Net code

Run custom processes without code

Role automatically restarts if process stops

Page 24: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

<?xml version="1.0" encoding="utf-8"?>

<ServiceDefinition name="WindowsAzureProject11" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">

<WorkerRole name="WorkerRole1" vmsize="Small">

<Runtime executionContext="limited">

<EntryPoint>

<ProgramEntryPoint commandLine="myProcess.exe" setReadyOnProcessStart="true" />

</EntryPoint>

</Runtime>

<Endpoints>

<InputEndpoint name="Endpoint1" protocol="tcp" port="80" />

</Endpoints>

</WorkerRole>

</ServiceDefinition>

Page 25: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

VM Size in Windows Azure

Windows AzureSupports Various VM SizesSize set on Role in Service Definition - All instances of role will be of equal size Service can have multiple rolesBalance of Performance per node vs. High Availability from multiple nodes

Extra Small Shared 768M 20GB .05

Small 1 1.7GB 250GB .12

Medium 2 3.5GB 500GB .24

Large 4 7GB 1000GB .48

Extra large 8 15GB 2000GB .96

Page 26: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

More small instances == more redundancy

Some scenarios will benefit from more coresWhere moving data >$ parallel overheadE.g. Video processing, Stateful services (DBMS)

Choosing Your VM Size

Don’t just throw big VMs at every problem

Scale out architectures have natural parallelism

Test various configurations under load

Page 27: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Networking in Windows Azure

Input (VIP) InternalWindows Azure

Connect

3 types of Endpoints in Windows Azure

Specify Connectivity Rules in Service DefinitionNetworkTrafficRules

Port Ranges

Local Ports

TCP only

Page 28: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Local Storage

Role instances have available disk storage

Use LocalStorage element in service definitionNameCleanOnRoleRecycleSize

Persistent but not guaranteed durableGood for cached resources or temporary files

Windows Azure Storage Drives provide guaranteed durable storage

Page 29: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Local Storage

<LocalResources>

<LocalStoragename="myLocalDisk" sizeInMB="10"

cleanOnRoleRecycle="false" />

</LocalResources>

string rootPath = RoleEnvironment.GetLocalResource["myLocalDisk"].RootPath;

DirectoryInfo di = new DirectoryInfo(rootPath);

foreach(di.EnumerateFiles())

….

Page 30: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Configuration Values

Store arbitrary configuration string valuesDefine in modelPopulate in configuration

RoleEnvironment.GetConfigurationSettingValue()

Don’t use web.config for values you wish to change at runtimeApp/Web.config is packaged with deployment change requires re-deploy*.cscfg supports change tracking and notification to running role instances

Page 31: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Upgrading Your Application

VIP Swap:Uses Staging and Production environmentsAllows to quickly swap environmentsProduction: v1 Staging: v2, after swap then Production: v2 Staging: v1

In-Place UpgradePerforms a rolling upgrade on live serviceEntire service or a single roleManual or Automatic across update domainsCannot change Service Model

Page 32: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

ROLE

VIP Swap

VM1 VM2

VM3 VM4

VM1 VM2

VM3 VM4

Page 33: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Summary

Service model defines service shape

Service configuration defines service scale

Selectable VM SizesWindows Azure provides specific configuration capabilityScale out awareAllows event based change subscription

Upgrading and Deployment

Page 34: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION

IN THIS PRESENTATION.

Page 35: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Windows Azure Service Architecture

Windows Azure Data Center

Storage

Page 36: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Handling Config Changes

RoleEnvironment.ChangingOccurs before configuration is changedCan be cancelled – causes a recycle

RoleEnvironment.ChangedOccurs after config change has been applied

RoleEnvironmentConfigurationSettingChangeProvides config value that was changed

RoleEnvironmentTopologyChange When role count is changed

Page 37: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Handling Config ChangesPort 80Http

Port 8090HTTP

StatusSvc

HTTP83425

StatusSvc

HTTP73984Regular Polling for StatusRegular Polling for Status

Page 38: Operating System for the Cloud Runs applications in the cloud Provides Storage Application Management Windows Azure ideal for applications needing:

Monitoring

Monitoring is not Debugging

Instrument your application using Trace, DebugDiagnosticMonitorTraceListener

Use Diagnostics API to Configure and CollectEvent LogsPerformance CountersTrace/Debug information (logging)IIS Logs, Failed Request LogsCrash Dumps or Arbitrary files

Request data on demand or scheduledTransferred into your table and/or blob storage