daniel moth developer and platform group...
TRANSCRIPT
![Page 1: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/1.jpg)
for Developers
Daniel Moth
Developer and Platform Group
Microsoft
http://www.danielmoth.com/Blog
![Page 2: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/2.jpg)
AGENDA
Top 7 Ways To “Light Up” Your Apps on Windows Server 2008
Part 1 emphasis on
IIS7, PowerShell
Part 2 emphasis on
WER, Restart and Recovery APIs, TxF
![Page 3: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/3.jpg)
1. Build More Flexible Web Apps
![Page 4: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/4.jpg)
2. Design Highly-Manageable Apps
![Page 5: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/5.jpg)
3. Develop Federation-Aware Apps
![Page 6: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/6.jpg)
4. Build Connected Systems
![Page 7: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/7.jpg)
The Top 7 Ways… Part 2
1. Build More Flexible Web Applications
2. Design Highly-Manageable Applications
3. Develop Federation-Aware Applications
4. Build Connected Systems
5. Build For Scalability
6. Develop More Reliable Applications
7. Virtualize
![Page 8: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/8.jpg)
5. Build For Scalability
![Page 9: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/9.jpg)
Native Threading Enhancementsin Windows Vista and Windows Server 2008
Thread Pools
One-Time Initialization
Slim Reader/Writer Lock
Condition Variables
Thread Ordering Service
Wait Chain Traversal
![Page 10: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/10.jpg)
Thread Pool in Vista and Server 2008
Re-architected Thread Pool
Simpler, more reliable, higher performance
Does not use a timer thread
Single queue
Dedicated persistent thread
Clean-up groups
Single worker thread type (both I/O and non-I/O)
Multiple pools per process
More flexible API
![Page 11: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/11.jpg)
Feature Original API Current API
Synch RegisterWaitForSingleObjectUnregisterWaitEx
CloseThreadpoolWaitCreateThreadpoolWaitSetThreadpoolWaitWaitForThreadpoolWaitCallbacks
Work QueueUserWorkItem
CloseThreadpoolWorkCreateThreadpoolWorkSubmitThreadpoolWorkTrySubmitThreadpoolCallbackWaitForThreadpoolWorkCallbacks
TimerCreateTimerQueueCreateTimerQueueTimerChangeTimerQueueTimerDeleteTimerQueueTimerDeleteTimerQueueEx
CloseThreadpoolTimerCreateThreadpoolTimerIsThreadpoolTimerSetSetThreadpoolTimerWaitForThreadpoolTimerCallbacks
I/O BindIoCompletionCallback
CancelThreadpoolIoCloseThreadpoolIoCreateThreadpoolIoStartThreadpoolIoWaitForThreadpoolIoCallbacks
Clean-up groupCloseThreadpoolCleanupGroupCloseThreadpoolCleanupGroupMembersCreateThreadpoolCleanupGroup
PoolCloseThreadpoolCreateThreadpoolSetThreadpoolThreadMaximumSetThreadpoolThreadMinimum
Callback environment
DestroyThreadpoolEnvironmentInitializeThreadpoolEnvironmentSetThreadpoolCallbackCleanupGroupSetThreadpoolCallbackLibrarySetThreadpoolCallbackPoolSetThreadpoolCallbackRunsLong
Callback CallbackMayRunLong
Callback clean up
DisassociateCurrentThreadFromCallbackFreeLibraryWhenCallbackReturnsLeaveCriticalSectionWhenCallbackReturnsReleaseMutexWhenCallbackReturnsReleaseSemaphoreWhenCallbackReturnsSetEventWhenCallbackReturns
![Page 12: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/12.jpg)
One-Time Initialization
Interlocked functions ensure that only one thread performs the initialization
One-time initialization is better
Optimized for speed
Appropriate barriers are created on processor architectures that require them
Support for both locked and parallel initialization
No internal locking so the code can operate asynchronously or synchronously
![Page 13: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/13.jpg)
One Time Init StepsBOOL WINAPI InitOnceBeginInitialize(
__inout LPINIT_ONCE lpInitOnce, __in DWORD dwFlags, __out PBOOL fPending, __out LPVOID* lpContext );BOOL WINAPI InitOnceExecuteOnce(
__inout PINIT_ONCE InitOnce, __in PINIT_ONCE_FN InitFn, __inout_opt PVOID Parameter, __out LPVOID* Context ); BOOL WINAPI InitOnceComplete(
__inout LPINIT_ONCE lpInitOnce, __in DWORD dwFlags, __in LPVOID lpContext );BOOL CALLBACK InitOnceCallback(
__inout PINIT_ONCE InitOnce, __inout_opt PVOID Parameter, __out_opt PVOID* Context );
![Page 14: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/14.jpg)
Slim Reader/Writer LockSRW locks – new synchronization primitive
enable threads to access shared resources
optimized for speed
take very little memory
built on top of windows kernel keyed events
Two modes
Shared mode
– grants shared read-only access to multiple reader threads
Exclusive mode
– grants read/write access to one writer thread at a time
![Page 15: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/15.jpg)
SRW Lock APIs
VOID WINAPI InitializeSRWLock(
__out PSRWLOCK SRWLock );
VOID WINAPI AcquireSRWLockExclusive(
__inout PSRWLOCK SRWLock );
VOID WINAPI ReleaseSRWLockExclusive(
__inout PSRWLOCK SRWLock );
VOID WINAPI AcquireSRWLockShared(
__inout PSRWLOCK SRWLock );
VOID WINAPI ReleaseSRWLockShared(
__inout PSRWLOCK SRWLock );
![Page 16: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/16.jpg)
Condition Variables
Used to synchronize a group of threads based on the result of some conditional test
Enable threads to atomically release a lock and enter the sleeping state
BenefitsMuch clearer and less error-prone
Can be more efficient– Tries to avoid trips to kernel mode (unlike
WaitForSingleObject)
![Page 17: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/17.jpg)
Condition Variable APIsVOID WINAPI InitializeConditionVariable(
__out PCONDITION_VARIABLE ConditionVariable );
BOOL WINAPI SleepConditionVariableCS(
__inout PCONDITION_VARIABLE ConditionVariable,
__inout PCRITICAL_SECTION CriticalSection,
__in DWORD dwMilliseconds );
BOOL WINAPI SleepConditionVariableSRW(
__inout PCONDITION_VARIABLE ConditionVariable,
__inout PSRWLOCK SRWLock,
__in DWORD dwMilliseconds,
__in ULONG Flags );
VOID WINAPI WakeConditionVariable(
__inout PCONDITION_VARIABLE ConditionVariable );
VOID WINAPI WakeAllConditionVariable(
__inout PCONDITION_VARIABLE ConditionVariable );
![Page 18: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/18.jpg)
Thread Ordering Service (TOS)
TOS controls the execution of client threads
Ensures that they run once and in order
5 APIs – AvRtXxxxThreadOrderingGroup
parent thread calls Create to set up the TOS
client threads call Join to join the TOS
all of them call Wait, run their code and Wait
...client threads call Leave when they are done
parent thread calls Delete to end it all
![Page 19: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/19.jpg)
TOS APIs - avrt.hBOOL WINAPI AvRtCreateThreadOrderingGroup(
__out PHANDLE Context, __in PLARGE_INTEGER Period, __inout GUID* ThreadOrderingGuid, __in_opt PLARGE_INTEGER Timeout );
BOOL WINAPI AvRtJoinThreadOrderingGroup( __out PHANDLE Context, __in GUID* ThreadOrderingGuid, __in BOOL Before );
BOOL WINAPI AvRtWaitOnThreadOrderingGroup( __in HANDLE Context );
BOOL WINAPI AvRtLeaveThreadOrderingGroup( __in HANDLE Context );
BOOL WINAPI AvRtDeleteThreadOrderingGroup( __in HANDLE Context );
![Page 20: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/20.jpg)
Wait Chain Traversal (WCT)
Enables debuggers to diagnose application hangs and deadlocks
“Wait chain is an alternating sequence of threads and synchronization objects; each thread waits for the object that follows it, which is owned by the subsequent thread in the chain”
WCT supports the following
ALPC, COM, Critical sections, Mutexes, SendMessage
![Page 21: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/21.jpg)
WCT APIs in Wct.h
HWCT WINAPI OpenThreadWaitChainSession( __in DWORD Flags, __in_opt PWAITCHAINCALLBACK callback );
BOOL WINAPI GetThreadWaitChain( __in HWCT WctHandle, __in_optDWORD_PTR Context, __in DWORD Flags, __in DWORD ThreadId, __inout LPDWORD NodeCount, __out PWAITCHAIN_NODE_INFO NodeInfoArray, __out LPBOOL IsCycle );
VOID WINAPI CloseThreadWaitChainSession( __in HWCT WctHandle );
VOID CALLBACK WaitChainCallback( HWCT WctHandle, DWORD_PTR Context, DWORD CallbackStatus, LPDWORD NodeCount, PWAITCHAIN_NODE_INFO NodeInfoArray, LPBOOL IsCycle );
typedef struct _WAITCHAIN_NODE_INFO { <SNIP>
![Page 22: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/22.jpg)
Native Threading Enhancementsin Windows Vista and Windows Server 2008
Thread Pools
One-Time Initialization
Slim Reader/Writer Lock
Condition Variables
Thread Ordering Service
Wait Chain Traversal
MSDN Magazine: Oct07, Jun07, Jul07
![Page 23: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/23.jpg)
6. Develop More Reliable Apps
![Page 24: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/24.jpg)
Windows Error Reporting & winqual
New User Experience
In addition to crashes, hangs are also detected
Privacy evaluation, Queuing and transport
Problem Reports and Solutions
Response management
New Public APIs
Adding additional file and memory data to a report (inc. minidump & heap information)
Create reports for custom events
![Page 25: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/25.jpg)
WER, Restart, Recovery
![Page 26: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/26.jpg)
![Page 27: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/27.jpg)
Restart API
Register to be restarted after fatal problemsRegistration also used for Restart Manager
– Restarts process after patch installation
All applications should support restart
– Especially if support document recovery
How it worksRegister command-line that should be called every execution
– HRESULT RegisterApplicationRestart (IN PCWSTR pwzCommandline, DWORD dwFlags)
After fatal event is reported, app is restarted
– Fatal events block user tasks
– Automatically restarting saves users from having to re-open the application
![Page 28: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/28.jpg)
Recovery APIs
Attempt to recover data after a fatal eventUsers should not lose any work to an app bug
How it works1. App registers a “recovery callback” every execution
HRESULT RegisterApplicationRecoveryCallback (IN RECOVERY_ROUTINE RecoveryRoutine, IN PVOID pvParameter)
2. Recovery routine called after data collection– Application’s code attempts to recover user work
– Flush to disk, repair on next run of application– Repair data in memory, save to disk
– Need to call RecoveryInProgress() every 5 seconds to heartbeat– Call RecoveryFinished() to signal recovery is completed
![Page 29: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/29.jpg)
Windows Installer (MSI)
• Fewer reboots when using the Windows Add/Remove Programs feature
• Developers can reduce reboots for installations and updates by using the Windows Installer v4.0
Key Microsoft Office 2007 Applications
• Automatically restart after a reboot due to an installation or update
• Recreate application state upon restart
Restart Manager Overview
With the Restart Manager technology installers canAutomatically shutdown only the applications and services holding
a file to be updated
When available, leverage specific application functionality to
restore the user to the state they were in before the restart
When a reboot cannot be avoided, automatically re-launch apps
after reboot
![Page 30: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/30.jpg)
Restart Manager
![Page 31: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/31.jpg)
Restart Manager, Call to Action
Installer software
call the Restart Manager APIs
Applications and Services
Restart Manager "aware”
![Page 32: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/32.jpg)
Transactional NTFS
Windows Vista and Windows Server 2008
Does what it says on the tin
System.Transactions.dll + PInvoke
![Page 33: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/33.jpg)
Transactional Platform
Kernel Transaction Manager (KTM)
Makes transactions available as kernel objects
Provides transaction management services to system components such as TxF
Can communicate with DTC to enable distributed transactions
Transactional NTFS (TxF)
Integrates transactions directly into the NTFS file system
Transactional Registry (TxR)
Integrates transactions directly into the Registry
![Page 34: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/34.jpg)
Transactional NTFS (TxF)K
ern
el KTM
CLFS
NTFS Registry
KtmRm KtmW32
DTC
Na
tive
Ma
na
ge
d
System.Tx LTM
WS-*
WCF
MSMQ
SQL
![Page 35: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/35.jpg)
TxF
![Page 36: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/36.jpg)
7. Virtualize
![Page 37: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/37.jpg)
Hosted Virtualization ProductsMicrosoft Virtual PC 2007
Over 3.5 million downloads
Support for Windows Vista as a host and guest
64-bit host support
Improved performance
Support for Intel VT and AMD-V
Microsoft Virtual Server 2005 R2 SP1Support for Intel VT and AMD-V
Support for SLES 10
VSS integration for live backup of running virtual machines
VHD mounting tool for offline servicing
Improved performance
Improved scalability: 512 VMs on x64 systems
![Page 38: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/38.jpg)
Server Virtualization
Application VirtualizationDesktop
Virtualization
Presentation Virtualization
Management
A comprehensive set of virtualization products, from the data center to the desktop
Assets – both virtual and physical – are managed from a single platform
Microsoft Virtualization Products
Centralized Desktop
Hyper-V Server
![Page 39: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/39.jpg)
Virtualization BenefitsServer consolidation
Business Continuity Flexibility
Utilization
![Page 40: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/40.jpg)
Hyper-V
Flexible and dynamic virtualization solution
A role of Windows Server 2008 (Std, EE, DC)
Can be a full role with local UI or Server Core role
Hypervisor based architecture
Managed by Microsoft System Center
Also provided as a standalone server
Microsoft Hyper-V Server ($28)
Codename "Viridian", Windows Server Virtualization
![Page 41: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/41.jpg)
Windows Server Core role
Server Core
Minimal Installation option in all x86/x64 editions
Command line interface only, no GUI shell
Provides essential server functionality
Deployed for a single role
– No need to deploy and service the whole OS
Benefits
Less code results in fewer patches and servicing burden
Low surface area targeted for server roles
More secure and reliable with less management
![Page 42: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/42.jpg)
Virtualization and High Availability
Traditional Non-Virtualized Environment
Downtime is bad, but affects only one workload
Virtualized Environment
Value of the physical server goes up
Downtime is far worse because multiple workloads are affected
Virtualization and High-Availability Go Hand in Hand
![Page 43: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/43.jpg)
Microsoft Hyper-V High Availability
Planned downtime
More common than unplanned
Quickly move virtualized workloads in order to service underlying hardware
Unplanned downtime
Not as common and more difficult
Automatic failover to other nodes
– hardware or power failure
![Page 44: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/44.jpg)
Quick Migration FundamentalsPlanned Downtime
Save state
Save entire virtual machine state
Move virtual machine
Move storage connectivity from origin to destination host
Restore state and Run
Restore virtual machine and run
VHDs
Network Connectivity
Shared Storage
![Page 45: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/45.jpg)
Quick Migration – Planned Downtime
• Active server requires
servicing
• Move virtualized workloads
to a standby server
• ~4 seconds downtime per
virtual machine
Virtualization Servers
(3 + 1 Servers)
System Center
Virtual Machine Manager
Windows Server 2008
Failover Cluster Manager
VHDs on
SAN
Domain
Controller
Eth
ern
et
Storage
Connectivity
![Page 46: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/46.jpg)
Quick Migration – Unplanned Downtime
• Active server loses power
• Virtual machines
automatically restart on the
next cluster node
• If there is not enough
memory, the failover
automatically moves to the
next node until done
Virtualization Servers
(3 + 1 Servers)
System Center
Virtual Machine Manager
Windows Server 2008
Failover Cluster Manager
VHDs on
SAN
Domain
Controller
Eth
ern
et
Storage
Connectivity
![Page 47: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/47.jpg)
Quick Migration – How Quick Is It?
Disc /VM Memory
1 GbE iSCSI 2 Gb FC 4 Gb FC
512 MB ~8 seconds ~ 4 seconds ~2 seconds
1 GB ~16 seconds ~8 second~ 4 seconds
2 GB ~32 seconds ~16 seconds~8 seconds
4 GB ~64 seconds ~32 seconds~16 seconds
8 GB ~2 minutes ~64 seconds ~32 seconds
![Page 48: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/48.jpg)
TerminologyHypervisor
A piece of software that provides the ability to run multiple operating systems on one piece of hardware
Ensures that the CPU and hardware answer the *correct* OS
Microkernelized or Monolithic
Hyper-VA role you can install in Windows that includes the Hypervisor as well as management software
PartitionAn “operating system” to the hypervisor
Virtual MachineA “child” partition
![Page 49: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/49.jpg)
Hyper-V Overview
Windows Hypervisor
Powerful virtualization built into the Windows platform
VirtualizationPlatform andManagement
Management tools
VM 2
“Child”
VM 1
“Parent”VM 2
“Child”
![Page 50: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/50.jpg)
Hyper-V Architecture
Parent Partition Child Partitions
Kernel Mode
User Mode
VirtualizationService
Providers(VSPs)
WindowsKernel
Server Core
IHVDrivers
VirtualizationServiceClients(VSCs)
WindowsKernel
EnlightenmentsVMBus
Windows hypervisor
Virtualization Stack
VM WorkerProcessesVM
Service
WMI ProviderApplications
“Designed for Windows” Server Hardware
Provided by:
Windows
ISV
OEM
Hyper-V
![Page 51: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/51.jpg)
Example VSP/VSC DesignParent Partition Child Partitions
Kernel Mode
User Mode
Windows hypervisor
Applications
Provided by:
Windows
ISV
OEM
Hyper-V
VMBus
Windows File System
Volume
Partition
Disk
Fast Path Filter (VSC)
iSCSIprtVirtual Storage
Miniport (VSC)
Virtual Storage
Provider (VSP)
StorPort
Hardware
StorPort
Miniport
VM Worker Process
Disk
![Page 52: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/52.jpg)
Monolithic vs. MicrokernelizedMonolithic hypervisor
Simpler than a modern kernel, but still complex
Contains its own drivers model
Microkernelized hypervisorSimple partitioning functionality
Increase reliability and minimize TCB
No third-party code
Drivers run within guestsVM 1
(“Admin”)VM 3
Hardware
Hypervisor
VM 2
(“Child”)
VM 3
(“Child”)
Virtual-izationStack
VM 1
(“Parent”)
DriversDriversDriversDriversDriversDrivers
DriversDriversDriversHypervisor
VM 2
Hardware
DriversDriversDrivers
Microkernelized Hypervisor has an inherently secure architecture with minimal attack surface
VMware ESX Approach Hyper-V Approach
![Page 53: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/53.jpg)
Virtual Server 2005 vs. Hyper-VVirtual Server 2005 R2 SP1 Hyper-V
32-bit Virtual Machines Yes Yes
64-bit Virtual Machines No Yes
Multi Processor Virtual Machines No Yes, up to 4 core VMs
Virtual Machine Memory Support 3.6GB per VM 32GB per VM
Physical Memory Support 256 GB 1 TB
Managed by System Center VirtualMachine Manager
Yes Yes
Support for Microsoft Clustering Services
Yes Yes
Host side backup support (VSS) Yes Yes
Scriptable / Extensible COM WMI + HyperCall API
User Interface Web Interface MMC 3.0 Interface
![Page 54: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/54.jpg)
Hyper-V Features and Abilities
Performance
Hypervisor
Synthetic Drivers
Server Core
Flexibility
Multi-architecture
Multi-OS VM’s
Manageability
Managed through WMI (PowerShell)
SCVMM
Windows
![Page 55: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/55.jpg)
Interoperability & Standards VHD (Virtual Hard Disk)
VHD specification is freely available under Open Specification Promise (OSP)
VHD TestDrive program for ISVs
Standards based management APIs
DMTF defining industry standard model for VM management
Hyper-V uses this model
Hypervisor hypercall API
Preliminary documentation available under OSP
Final version will be at RTM
![Page 56: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/56.jpg)
Interoperablity & 3rd Party OS Support
Linux
Working with XenSource
– Developing adapter layer to map Xen hypercall API to Hyper-V hypercall API
– Developing disk and networking drivers (VSCs) to integrate with the new I/O architecture
Working with Novell
– Interoperability and joint support for Windows Server and Novel SUSE Linux Enterprise Server 10
Support for Linux on Hyper-V
Solaris
Working with Sun to support Solaris on Hyper-V
![Page 57: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/57.jpg)
Windows Server Enterprise/Datacenter Includes 4/Unlimited virtual instances
Windows Vista (Software Assurance Customer Benefit)Allows Vista Enterprise Centralized Desktop deployments
Licensing per Virtual ProcessorSQL Server, BizTalk Server, etc.
Instance Based LicensingWill enable new usage models
Demo Distribution of Virtual Images
Industry Leadership In Licensing
![Page 58: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/58.jpg)
Virtualization Investments
Ease consolidationonto virtual infrastructure
Better utilizemanagementresources
Free up IT spend
Management
Supportheterogeneityacross thedatacenter
OSP (Open Specification Promise) VHD and HyperCall
Interoperability
Acceleratedeployment
Reduce the cost of supportingapplications
Turn apps into dynamic, real-time services
Applications
Deliver cost-effective, flexible and simplified licensing
Licensing
Create agility
Better utilizeserver resources
Partner with AMD and Intel
Infrastructure
![Page 59: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/59.jpg)
Summary
Build More Flexible Web Applications
Design Highly-Manageable Applications
Develop Federation-Aware Applications
Build Connected Systems
Build For Scalability
Develop More Reliable Applications
Virtualize
![Page 61: Daniel Moth Developer and Platform Group Microsoftdownload.microsoft.com/documents/uk/msdn/events/...The Top 7 Ways… Part 2 1. Build More Flexible Web Applications 2. Design Highly-Manageable](https://reader035.vdocument.in/reader035/viewer/2022070722/5f01db8b7e708231d4016012/html5/thumbnails/61.jpg)
© 2007 Microsoft Ltd. 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.