1 / 28

Windows Azure Advanced Scenarios

Windows Azure Advanced Scenarios. Name Title Microsoft Corporation. Agenda. Startup tasks Elevated privileges Remote Desktop Network traffic rules VM role. Startup Tasks. What Are Startup Tasks?. Introduced with SDK 1.3 (PDC ‘10). Commands executed before your role is started.

hea
Télécharger la présentation

Windows Azure Advanced Scenarios

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Windows Azure Advanced Scenarios Name Title Microsoft Corporation

  2. Agenda Startup tasks Elevated privileges Remote Desktop Network traffic rules VM role

  3. Startup Tasks

  4. What Are Startup Tasks? Introduced with SDK 1.3 (PDC ‘10) Commands executed before your role is started Generally “scripts” Useful for prepping the VM (install/Config) Add lots of flexibility to Windows Azure

  5. Why Do We Have Startup Tasks? Sometimes setup is required before execution “At the top of the code” isn’t good enough Elevated startup task, non-elevated role Scripting often easier than C# Reusable startup tasks “Upload a VHD” is overkill Often just need to run an MSI, unzip files Want full PaaS experience, including patching VM images aren’t very reusable

  6. Startup Task Options Defined in ServiceDefinition.csdef Can run elevated or not Three execution modes: Simple (default) Foreground Background synchronous asynchronous, block shutdown asynchronous, don’t block shutdown

  7. Startup Task Tips Log everything: command >> %~dp0log.txt 2>> %~dp0err.txt /y everything: copy /y foo bar echo y| cacls … [Note no space after “y”] Use local storage (guaranteed space) Reboots are fine, but don’t enter an infinite loop Use “psexec -s” to test (“local system” is a weird user) Consider “exit /b 0”

  8. When Not To Use Startup Tasks Long, manual, or fragile installations Use VM Role Things that require the IIS pool to exist already Use OnStart() in an elevated web role Processes that need to be monitored (for the most part) Easier to write proc.Start();proc.WaitForExit();

  9. Elevated Privileges for the Role Entire role can run elevated <Runtime executionContext="elevated" /> For web roles, doesn’t affect web app (IIS)

  10. Remote Desktop

  11. Remote Desktop For diagnostics/debugging Changes are not persisted Works through the load balancer

  12. Remote Desktop ROLE 1 ROLE 2 IN_0 IN_0 LB PORT 3389 IN_1 IN_1 IN_2 Internal Port 3389 Remote Forwarder

  13. Network Traffic Rules

  14. Specifying Traffic Rules • ServiceDefinition.csdef: • <NetworkTrafficRules> • <OnlyAllowTrafficTo> • <Destinations> • <RoleEndpointendpointName="ServiceEndpoint" roleName="WorkerRole1" /> • </Destinations> • <WhenSourcematches="AnyRule"> • <FromRoleroleName="WebRole1" /> • </WhenSource> • …

  15. VM Role

  16. Only Two Differences Who handles OS servicing How you package/deploy your application

  17. Punchline: When to Use VM Role Long running application installations Error-prone application installations Application installations requiring manual interaction

  18. VM Roles are fully integrated in the Windows Azure Platform-as-a-Service model

  19. WA Programming Model: Three Rules 1 A Windows Azure application is built from one or more roles 2 A Windows Azure application runs multiple instances of each role 3 A Windows Azure application behaves correctly when any role instance fails

  20. Benefits of This Model Lower administrative costs More scalable applications More available applications VM Role has these same benefits (and constraints)

  21. Windows Azure Application Platform •  •  •  •  •  • 

  22. Platform Capabilities and App Contract Stateless Images Consistent updates Consistent configuration Multi-instance management Multiple Instance Scale-out High Availability Not all applications can be migrated! •  •  •  •  • 

  23. VM Role Doesn’t Mean Single-Instance 2 Rule #2: A Windows Azure application runs multiple instances of each role No high-availability without multiple instances

  24. VM Role Doesn’t Mean “Stateful” 3 Rule #3: A Windows Azure application behaves correctly when any role instance fails Running a database? Think about how the data is replicated

  25. The Tradeoff VM roles and web/worker roles can do the same things We’re back to the two differences: Who handles OS servicing How you package/deploy your application To choose, consider: Development cost/effort Operating cost (OS maintenance) VM startup time Skills/resources available

  26. Summary Lots of flexibility Startup tasks + elevated privileges = EVERYTHING VM Role available for more control

  27. Thank You

More Related