Windows Azure Kick Start - Windows Azure Compute

39
Windows Azure Roles Eric D. Boyd Founder and CEO, responsiveX Windows Azure MVP [email protected] @EricDBoyd – EricDBoyd.com

Transcript of Windows Azure Kick Start - Windows Azure Compute

Page 1: Windows Azure Kick Start - Windows Azure Compute

Windows Azure Roles

Eric D. BoydFounder and CEO, responsiveX Windows Azure MVP

[email protected]@EricDBoyd – EricDBoyd.com

Page 2: Windows Azure Kick Start - Windows Azure Compute

Session Objectives and Takeaways

Describe Windows Azure Compute

Understand Model and Terminology

Understand role customization, scalability and upgrade

Page 3: Windows Azure Kick Start - Windows Azure Compute

Core Services

Caching CDN

Service Bus Reporting

Data Sync Azure Connect

Identity HPC

Additional Services

Windows Azure

Compute Storage Database

Page 4: Windows Azure Kick Start - Windows Azure Compute

Microsoft Confidential

Some terminology…

+ Subscription - unit of billing, associated with Live ID

+ Hosted Service - DNS name reservation- Certificates - used for deployment+ Deployments - 2 slots, Production & Staging

+ Roles - defines types of instances to be created

Instances - has a size and an instance identifier

Page 5: Windows Azure Kick Start - Windows Azure Compute

Microsoft Confidential

Service Definition• Definition:

• Role name• Role type• VM size (e.g. small, medium...)• Network endpoints

• Code: • Web/Worker Role: Hosted DLL

and other executables• VM Role: VHD

• Configuration:• Number of instances• Number of update domains

Mike’s Service

ConfigurationInstances: 2Update Domains: 2Fault Domains: 2

Role: Front-End

DefinitionType: WebVM Size: SmallEndpoints: External-1

ConfigurationInstances: 3Update Domains: 2Fault Domains: 2

Role: Middle-Tier

DefinitionType: WorkerVM Size: LargeEndpoints: Internal-1

Page 6: Windows Azure Kick Start - Windows Azure Compute

The Fabric Controller (FC)

• The “kernel” of the cloud operating system• Manages datacenter hardware• Manages Windows Azure services

• Four main responsibilities:• Datacenter resource allocation• Datacenter resource

provisioning• Service lifecycle management• Service health management

• Inputs:• Description of the hardware and network resources it will

control• Service model and binaries for cloud applications

ServerKernelProcess

DatacenterFabric ControllerService

Windows Kernel

Server

WordSQL

Server

Fabric Controller

Datacenter

Exchange

Online

SQL Azure

Page 7: Windows Azure Kick Start - Windows Azure Compute

Example Service Allocation Role B

Count: 2Update

Domains: 2Fault Domains: 2

Size: Medium

Role ACount: 3Update

Domains: 3Fault Domains: 2

Size: Large

Fault Domain 1 Fault Domain 2Fault Domain 3

LoadBalance

r

www.mycloudapp.net : 88.34.138.28

10.100.0.36

10.100.0.122

10.100.0.185

Page 8: Windows Azure Kick Start - Windows Azure Compute

VM Size in Windows AzureWindows 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 .02

Small 1 1.7GB 250GB .12

Medium 2 3.5GB 500GB .24

Large 4 7GB 1000GB .48

Extra large 8 14GB 2000GB .96

Page 9: Windows Azure Kick Start - Windows Azure Compute

demo

Page 10: Windows Azure Kick Start - Windows Azure Compute

What is Windows Azure Compute?

Virtual Machines in the CloudThree Flavors:

Web Role Worker Role

VM Role

Page 11: Windows Azure Kick Start - Windows Azure Compute

Web Role

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

Can optionally implement RoleEntryPoint

Page 12: Windows Azure Kick Start - Windows Azure Compute

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 13: Windows Azure Kick Start - Windows Azure Compute

Windows Azure Service Architecture

Windows Azure Data Center

Storage

Internal Communication

Page 14: Windows Azure Kick Start - Windows Azure Compute

What Can It Run?

Page 15: Windows Azure Kick Start - Windows Azure Compute

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

Can be updated any time through Portal or API

Page 16: Windows Azure Kick Start - Windows Azure Compute

<?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 17: Windows Azure Kick Start - Windows Azure Compute

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 18: Windows Azure Kick Start - Windows Azure Compute

<?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 19: Windows Azure Kick Start - Windows Azure Compute

Debugging in the cloud

Page 20: Windows Azure Kick Start - Windows Azure Compute

Debugging developmentOption 1 – use local emulator support for F5 debugging requires run in Admin mode full debugging support Windows Azure Storage

emulator

Page 21: Windows Azure Kick Start - Windows Azure Compute

Debugging development

Option 2 – use Intellitrace in cloud historical debugging uses agent deployed with code only when deployed with VS download and replay what

happened

Page 22: Windows Azure Kick Start - Windows Azure Compute

demo

Page 23: Windows Azure Kick Start - Windows Azure Compute

Startup TasksRuns before RoleEntryPoint OnStart()Can run as elevated or standard user

ImportsPackage up startup commands into a

reusable format

Stored in the sdk installation directory

Real World Windows Azure Guidance - Corey Fowler @SyntaxC4http://msdn.microsoft.com/en-us/library/windowsazure/hh127476.aspx

Page 24: Windows Azure Kick Start - Windows Azure Compute

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 25: Windows Azure Kick Start - Windows Azure Compute

Local StorageRole 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 26: Windows Azure Kick Start - Windows Azure Compute

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 27: Windows Azure Kick Start - Windows Azure Compute

More small instances == more redundancy

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

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 28: Windows Azure Kick Start - Windows Azure Compute

Deployment, Scaling and UpgradingDeploymentDirect from Visual StudioManagement portalService management RESTScripting with PowerShell

Scaling optionsManagement portal config changesPowerShellCustom Code

UpgradeVIP SwapRolling Upgrades

Page 29: Windows Azure Kick Start - Windows Azure Compute

demo

Page 30: Windows Azure Kick Start - Windows Azure Compute

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: Windows Azure Kick Start - Windows Azure Compute

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 32: Windows Azure Kick Start - Windows Azure Compute

Upgrade Domains

Page 33: Windows Azure Kick Start - Windows Azure Compute

Roles and InstancesExample role with six instances distributed across two fault domains

ROLE

VM1 VM2

VM3

VM4 VM5

VM6

Page 34: Windows Azure Kick Start - Windows Azure Compute

Upgrading Your ApplicationVIP 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 35: Windows Azure Kick Start - Windows Azure Compute

ROLE

VIP Swap

VM1 VM2

VM3 VM4

VM1 VM2

VM3 VM4

Page 36: Windows Azure Kick Start - Windows Azure Compute

Building our Lab app

A simple web role for the web siteWe will build a simple ASP.NET web application that will be a insurance application to calculate car premiums. This web app will run in a simple web role.

Storage of data in SQL AzureIn the afternoon we will look at storage and SQL Azure. We will then add the backend to the application.

Page 37: Windows Azure Kick Start - Windows Azure Compute

Summary

Service model defines service shape

Service configuration defines service scale

Selectable VM Sizes

Windows Azure provides specific configuration capabilityScale out awareAllows event based change subscription

Upgrading and Deployment

Page 38: Windows Azure Kick Start - Windows Azure Compute

lunch & lab 1

Page 39: Windows Azure Kick Start - Windows Azure Compute

© 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.