You are on page 1of 100

Using Microsoft Virtualization Technologies

:

Ronald Beekelaar
Beekelaar Consultancy
ronald@beekelaar.com

Virtualization Seminar - Geneva - 24-Apr-2007

Agenda

• Part 1 - Overview
• Virtualization overview
• Usage scenarios for virtualization
• Virtualization licensing and support
• Part 2 - Architecture and Future
• Architecture of Virtual Server
• The need for VM Additions
• Virtual Server 2005 R2 SP1
• Hardware-assisted virtualization
• Windows Virtualization and Hypervisor (Viridian)
• Part 3 - Operations
• Virtual Server host and guest clustering
• Virtual Server backup and recovery
• Performance optimization of Virtual Server
• Part 4 - Management
• Scripting Virtual Server
• System Center Virtual Machine Manager (Carmine)
• For further information
• Useful links / whitepapers / software download

2

Seminar hours

Schedule:
• 09.00 – 10.15: Session
• 10.15 – 10.45 – Break
• 10.45 – 12.00: Session
• 12.00 – 13.00 – Lunch (one hour)
• 13.00 – 14.15: Session
• 14.15 – 14.45 – Break
• 14.45 – 16.00: Session
• 16.00 – 16.15: Q&A

3

ISA Server and Forefront • Virtualization background: • Microsoft MVP for Virtual Machine Technology • Whitepaper at microsoft.com: "Virtual PC for Developers" • Manage all Virtual PC / Virtual Server-based labs at TechEd / IT Forum and other international TechEds • Create and optimize many VMs • Create virtualization tools (Virsoft) • Tools to analyse and optimize VMs • Tools to handle VHD-files • Contact: • Beekelaar Consultancy ronald@beekelaar.com 4 . About the Presenter • Consultant and trainer • Virtualization • Security.

exe + Mount read-only 5 . Virtualization Tools Virsoft • Virsoft Lab Menu • Manage. compact and configure VHDs offline + Compact differencing disks + Compact folder with multiple VHDs • Virsoft VHD Info • Inspect VHD files + Detect parent-link problems • Virsoft VHD Mount • Provide interface to vhdmount. run. log VMs at events + Synchronize VM changes • Virsoft VM Trimmer • Optimize.

manageability • Long term. Microsoft strategy Vision of virtualization • IT organization benefit when workloads are decoupled from hardware • Increased availability. workloads will be increasingly dynamic • Virtualization is a key enabling technology to achieve this Virtual Applications SoftGrid Any application on any computer on-demand via network Virtual Operating Systems VPC/VS Can be assigned to any hardware Virtual Hardware (Grid Computing) Windows CCS Can change its computing tasks in real-time Virtual Storage SANs Storage and backup over the network Virtual Network VPNs Localizing dispersed resources 6 .

Type of Virtualization • Application Virtualisation Application Application • Microsoft SoftGrid Application Application • Desktop/Presentation Virtualisation • Windows Terminal Services Desktop • Machine Virtualisation Operating • Virtual Server & Virtual PC System • File Virtualization in Vista ? Hardware 7 .

Machine Virtualisation Application Service Application Service Application Service Application Service Application Service Application Service Desktop Desktop Desktop Operating Operating Operating System System System Hardware 8 .

Desktop/Presentation Virtualisation Remote Desktop Application Application Application Application Application Application Application Application Application Application Application Application Desktop Desktop Desktop Operating System Hardware 9 .

Application Virtualisation Application Application Application Application Application Desktop Operating System Hardware 10 .

Application Virtualization SoftGrid Traditional Isolated Layered Install Model Virtual Application Model 11 .

Application Virtualization
SoftGrid
• Applications are virtualized per instance:
• Files (including System Files)
• Registry
• .ini files
• Fonts
• COM / DCOM objects
• Services
• Semafores, Mutexes
• Name spaces
• Applications do not get 'installed'
• Applications do not alter the host OS
• Note:
Tasks process locally on the host computer

12

Product versions
Product Release Hosts Guests **
• MS-DOS 6.22 * / OS/2
• Win 95, 98, 98SE, ME *
• Win2000 Pro SP4
Virtual PC 2004 Oct 2003 • Win XP Pro (Tablet, SP1)
• Win NT4 SP6a (wrkstn) *
• Win2000 Pro SP4
• Win XP (Tablet, SP1)
• Win XP Pro • Win NT4 SP6a (server) *
Virtual Server 2005 Jul 2004 • Win2003 SBS • Win2000 Server
• Win2003 (SE, EE, Data) • Win2003 (SE, EE, Web)
Same as Virtual PC 2004 Same as Virtual PC 2004
Virtual PC 2004 SP1 Oct 2004 + Win2003 SE + Win XP SP2
Same as Virtual Server 2005 Same as Virtual Server 2005
+ Win XP Pro SP2 (non prod) + Win XP Pro SP2
Virtual Server 2005 R2 Nov 2005 + Win2003 (SP1, R2) + Win2003 (SP1, R2)
+ Win XP / Win2003 x64 + Linux (9x distro's) - Apr 2006
Same as Virtual PC 2004 SP1
Virtual PC 2004 Express Mar 2006 + But can only run a single VM
+ With Vista Enterprise / only for Software Assurance customers
+Intel VT and AMD Virtualization processor support
Virtual PC 2007 19-Feb 2007 +Vista support (Host and Guest)
+Intel VT and AMD Virtualization processor support
Virtual Server 2005 R2 SP1 ~Mar 2007 +Volume Shadow Copy Service support (for backup)
Implement Windows Hypervisor
Longhorn
Windows Virtualization + < 180 days
New virtualization model, requires VT/Virtualization hardware
Code name "Viridian"

* Currently at end of support lifecycle
** See http://vpc.visualwin.com for a list of 1200+ (!) OS that run in Virtual PC / Virtual Server
See KB 867572 for a list of supported OS in Virtual Server 2005 R2
13

Usage Scenarios for Virtualization

 Production server consolidation
• Consolidate low-utilization workloads
• Legacy OS (NT4) and application re-hosting
• Resource partitioning (limit resources per VM)
 Business continuity management
• Workload deployment and provisioning
• OS and application patching (swap VMs)
• Isolation / sandboxing
 Dynamic data center
• Workload mobility
 Development and test
• Rapid provisioning of multiple virtual machines
• Undo-disk and save state helpful
14

Usage Scenario Production server consolidation • Consolidate workloads • Infrastructure applications • Branch office and datacenter workloads • Low-utilization workloads • Efficient use of available hardware resources • Re-host legacy OS and applications • NT4 guest applications on Win2003 host • Run on current hardware and current OS • No application updates required • Partition resources • Limit CPU resource per VM 15 .

and swap • Eliminate scheduled downtime • Isolation / sandboxing • Isolate OS environments for untrusted applications • Prevent malicious code from affecting others 16 . Usage Scenario Business continuity management • Workload deployment • Quickly switch pre-configured VM (vhd-files) • For disaster recovery • Eliminate unscheduled downtime • OS and application patching • Deploy and test patches off-production.

Usage Scenario Dynamic datacenter • Workload mobility • Package up entire OS environment and move to other location • Flexible deployment of workloads 17 .

Usage Scenario Development and test • Rapid provisioning of virtual machines • Provide multiple VMs for testing quickly • Use save state to start up quickly • Create arbitrary test scenarios • Recreate reported issues • Avoid use of production network • Use undo-disk to rollback to known state • Wider test range for niche scenarios • Provision multiple VMs with variations • Use difference-disks for easy provisioning 18 .

0 applications from 1.0 applications on blades 19 . Usage Scenario Other server consolidation Workload Microsoft products Sample scenario Enterprise customer migrates Windows NT Branch office and 4.000 stand-alone Win2003 and Virtual Server 2005 servers to 50 centralized. 4-way. rack-mount department applications systems Medium-sized customer moves enterprise Enterprise applications Win2003 and WSRM resource planning suite onto 8-way systems running Windows Server 2003 and WSRM Small business consolidates file and print File and print Windows Storage Server servers by using network attached storage (NAS) Enterprise customer consolidates databases Database Win2003 and SQL Server 2005 on highly scalable IA-64 systems Medium-sized business consolidates e-mail E-mail Win2003 and Exchange Server 2003 servers using Exchange Server on scalability cluster Hosting service consolidates extranet Web Win2003 and IIS 6.

Virtualization Support and Licensing • Support (two meanings) • Supported by Microsoft Product Support • Technical possible with the product • Needed licenses • On host .guest OS and applications ? 20 .host OS and Virtual Server ? • In guests .

. KB 917437 ..microsoft.For Microsoft customers who do not have a Premier-level support agreement.. Support By Microsoft PSS • Vision in WSS Common Engineering Criteria: . KB 897615 .www.Is supported. KB 897614 .Only with Win2003 SP1 or later guest and host (KB 897614) ISA Server 2006 . Sharepoint Portal Server. ISA Server 2000/2004.The following Windows Server System software is not supported within a Microsoft Virtual Server environment: Speech Server. • Core product scenarios fail because of virtualization performance or scaling issues. MIIS 2003.Microsoft supports Windows Server System software running within a Microsoft Virtual Server environment subject to the Microsoft Support Lifecycle policy . all server products will support Microsoft Virtual Server 2005.Microsoft support for Linux guest operating systems is currently limited to 21 the following list of qualified and tested operating systems: [9 Linux distributions] . • See . Exemptions will be granted if: • The product requires hardware that is not currently supported in the VM environment.. but not recommended (KB 897613) KB 897613 .Only on Virtual Server 2005 R2 or later (KB 320220) Certificate Server . Each product must be capable of running from within a virtual instance.com/windowsserversystem/cer • Limitations Exchange Server 2003 . Microsoft will require the issue to be reproduced independently from the non-Microsoft hardware virtualization software.

Pricing Product Price (US) After 12-Jul-2006: Virtual PC 2004 Free (was $ 129) Virtual Server 2005 Standard Edition $ 499 Virtual Server 2005 Enterprise Edition $ 999 Virtual Server 2005 R2 Standard Edition $ 99 Virtual Server 2005 R2 Enterprise Edition $ 199 After 1-Jan-2006: Virtual Server 2005 R2 Enterprise Edition * Free download Virtual PC 2007 Free download Windows Virtualization Free download * Virtual Server 2005 Standard Edition is no longer available 22 .

etc) • Ease migration to Longhorn virtualization 23 . Virtual Server 2005 R2 Free Why would Microsoft do that? • Reasons: • Customer satisfaction • Increase interest in Win2003 R2 EE • 1 license = 4 VMs + host • Accelerate proof-of-concept test efforts • Rapidly deploy workloads (AD / SQL / BizTalk.

microsoft. only count virtual CPUs in VM  Single Win2003 R2 EE license: • 1 host + 4x Win2003 R2 EE in guest • Virtualization unlimited (after 1-Oct-2006)  Single Win2003 R2 Datacenter license: 1 host + unlimited Win2003 R2 (any) guests • See . Licensing Windows server licenses • Licensing changes for server products • Virtualization friendly (after 1-Dec-2005)  Only count licenses for running VMs  For per-processor licenses.www.mspx 24 .com/licensing/resources/volbrief.

Architecture Virtual Machine Monitor (VMM) • CPU needs to switch between host process and guest process • VMM switches context between those processes • Computer runs either host context or VMM context • Only one operating system can "run" on CPU • Ring compression 25 .

sys Hardware 26 . Provided by Architecture Windows Virtual Server Host Guest (VM) Others Admin Web Site Virtual Server Service Guest Applications IIS Ring 3 Ring 3 Ring 1 Ring 1 VM Additions Windows in VM Virtual hardware Ring 0 Win2003 or WinXP Kernel VMM.

CPU virtualization Still one problem left to solve • We want CPU direct-mode execution • Guest OS runs directly on CPU . a trap occurs.fast! (99% speed) • When a priviliged operation is required. and VMM handles operation in kernel mode • Problem: x86 is not fully virtualized in this way • 20 kernel-mode read CPU instructions are allowed from outside ring 0 ! • Four possible solutions: a) Recompile OS and applications without those 20 instructions • = avoid those 20 instructions b) Use Binary Translation execution • = patch code while running on host c) Install VM Additions in guest • = patch code in memory in VM d) Use hardware-assisted virtualization • = catch instructions in special ring "-1" 27 .

CPU virtualization
Solutions

• Binary translation
• Translate guest instruction code to host instruction code
• Always possible, but is very slow
• VM Additions
• Patches dll-code in memory in VM (=similar to a rootkit)
• Not possible for 64-bit Vista/Longhorn
• Note that VM Additions also do:
• Time-sync, heartbeat, shutdown support
optimized SCSI disk, and better mouse/video driver
• Hardware-assisted virtualization
• Use Intel VT or AMD Virtualization CPU
• CPU solves the problem by maintaining settings per VM
• Can be considered as ring "-1"

28

VM Additions
Versions
Build Release Notes
10.21 with Virtual PC 5.2 (was named Virtual PC Additions)
13.40 with Virtual PC 2004

13.187 (download) Supports Win XP SP2
13.206 with VS2005

13.306 with Virtual PC 2004 SP1

13.518 with VS2005 SP1 beta

13.531 (download) Supports Win2003 SP1
13.552 with VS2005 R2 Supports Win2003 R2 and Vista (-build 5270)
13.705 with VS2005 R2 SP1 beta1

13.706 (download - Connect) Supports Vista B2 (-build 5384) and Longhorn
13.709 (download - Connect) Supports Vista RC1
13.715 with VS2005 R2 SP1 beta2 Supports Vista RTM
13.724 with Virtual PC 2007 beta

13.803 with Virtual PC 2007 Get at www.microsoft.com/virtualpc

VM Additions
Linux
• Adds:
• time sync
• Heartbeat
• shutdown support
• SCSI disk
• mouse/display driver
• But not direct-mode execution support
• Distributions (9x)
• Red Hat 7.3/9.0, Enterprise 2.1/3/4
• SuSE Linux 9.2/9.3/10.0, Enterprise Server 9
• More available at release VS 2005 R2 SP1
30

sys Ring "-1" Virtual hardware CPU Hardware 31 . Provided by Architecture Windows Hardware-assisted virtualization Virtual Server Host Guest (VM) Others Admin Web Site Virtual Server Service Guest Applications IIS Ring 3 Ring 3 Ring 1 Ring 0 Win2003 or WinXP VM Additions Windows in VM Kernel VMM.

Netware) run faster 32 . Hardware-assisted virtualization Intel VT or AMD Virtualization • Supported in: • Virtual PC 2007 • Virtual Server 2005 R2 SP1 • Windows Virtualization (is requirement) • Enable in BIOS • Plus enable in Virtual PC 2007 Options • Windows guests do not run faster • Up-to-date VM Additions already provide direct-mode execution • Windows installation is 2x-3x faster • Non-Windows guests (Linux.

6 GB • Network adapters: max 4 • Unlimited bandwidth ! • USB: no • USB keyboard/mouse is supported • Workaround for USB smartcard-readers exists ! 33 . Virtual Server 2005 R2 Specifications • Host • CPU  VS2005 Standard Edition: max 4 CPUs (1 or 2 cores) • VS2005 Enterprise Edition: max 32 CPUs (1 or 2 cores) • Memory: max 64 GB • Guest • CPU: max 1 • Memory: max 3.

microsoft.http://go. Virtual Server 2005 R2 What's new • Performance • Increased performance • Scalability • x64 hosts: Win2003 and WinXP • Availability • Virtual Machine clustering • Failover VM on same host • Uses Shared SCSI (or iSCSI) in guest • Virtual Server Host clustering • Move VS2005 to other host • Planned and unplanned downtime 34 • Requires script .com/fwlink/?LinkId=55644 .

.vsv) • Open Windows Firewall ports at install 35 . • Supports hyperthreading on host • Reserve space for save state file (..iso • Also. Virtual Server 2005 R2 What's new (cont'd) • Additional guest support + Win2003 SE SP1 + WinXP SP2 • PXE Booting • F6 disk (SCSI disk) • Speeds up Windows installation • Virtual Disk Precompactor.

..x guests 36 . Virtual Server 2005 R2 SP1 What's new • Features • Intel VT and AMD Virtualization support • Volume Shadow Copy (VSS) support • Active Directory integration using Service Connection Points • Vista as Guest support • Includes VHD mount tool • Also. • Host clustering whitepaper included • Default vhd capacity is 127 GB (was 16 GB) • Virtual SCSI fix for Linux 2.6.

VPC2007 • Virtual Server 2005: • Virtual PC 2007: • Use multiple host CPUs • Use single host CPU • Multithreaded • Single thread for all VMs • Multiple CD ROM drives • Single CD ROM drive • NAT through host ICS • NAT support • Unlimited networks • Unlimited networks • Using vnc-files on host • Using host (loopback) adapters • Only in VS2005: • Only in VPC2007: • SCSI disk (in VM) • Sound card (VM) • COM API • Folder Sharing • Remote Management • Drag-and-drop • Run as service • Copy / Paste 37 • Auto start VMs . Differences VS2005 .

JVM . Windows Virtualization VMM arrangements Type-2 VMM Hybrid VMM Type-1 VMM Hypervisor Guest 1 Guest 2 VMM Guest 1 Guest 2 Guest 1 Guest 2 Host OS Host OS VMM VMM (Hypervisor) Hardware Hardware Hardware Examples: Examples: Example: .Windows Virtualization .Virtual PC .NET CLR ..Virtual Server ("Viridian") 38 .

manages child partitions • Child partition .any number of OS. managed by parent • Virtualization Stack • Runs in root partition (= parent partition) • Provides virtualization of devices • WMI interface for management • Virtualization Service Providers (VSPs) • Hardware sharing architecture 39 • Need "viridian" drivers in guest . underneath "host OS" (~160 KB) • Parent partition . Windows Virtualization • Virtualization for Windows Server • Code name "Viridian" (= color: rgb 64-130-109 ) • Windows Hypervisor • Thin layer of software.

memory. Windows Virtualization • Virtualization for Windows Server • Requires • x64 hardware • Intel VT / AMD-V processor • Provides • 32-bit and 64-bit guest • Max 8 CPU per VM • Hot "add": processor. network. etc • Support for Server Core as parent OS 40 . disk • 32+ GB RAM per VM • Live virtual machine migration • Multiple snapshots • No new driver model • Can use existing Windows drivers in guest • Same set of emulated hardware • S3 Trio video card. DEC 21440 network card.

sys Hardware 41 . Provided by Architecture Windows Virtual PC / Virtual Server 2005 R2 Virtual Server Host Guest (VM) Others Admin Web Site Virtual Server Service Guest Applications IIS Ring 3 Ring 3 Ring 1 VM Additions Windows in VM Virtual hardware Ring 0 Win2003 or WinXP Kernel VMM.

Provided by Windows Virtualization Windows Win Virtualizaton Parent partition Child partition Others Virtualization Stack WMI VM VM Service Worker Guest Applications Ring 3 Windows (core) Windows VSPs VSCs Kernel Kernel VMBus Ring 0 Drivers Enlightments Ring "-1" Windows Hypervisor Hardware 42 .

VSP Communication Parent Partition Child Partitions Provided by: VM Worker Process Applications Windows User Mode Windows Virtualization Windows File System ISV Volume Partition Virtual Service Disk Disk Provider (VSP) Fast Path Filter (VSC) StorPort Virtual Storage iSCSIprt StorPort Miniport (VSC) Miniport VMBus Kernel Mode Windows hypervisor Hardware 43 . Windows Virtualization VSC .

up to 8 processor VMs VM memory support? 3.0 Interface 44 . Virtual Server 2005 vs Windows Server Virtualization Virtual Server 2005 R2 Windows Server Virtualization 32-bit VMs? Yes Yes 64-bit VMs? No Yes Multi-processor VMs? No Yes. User interface Web Interface MMC 3.6 GB per VM More than 32 GB per VM Hot add memory/processors? No Yes Hot add storage/networking? No Yes Can be managed by System Center Yes Yes Virtual Machine Manager? Microsoft Cluster support? Yes Yes Scriptable / Extensible? Yes. COM Yes. WMI More than 64. Number of running VMs? 64 As many as hardware will allow.

virtual relationship • Ownership • Patching and servicing 45 . Management Pain points now • Existing tools: • Do not map to virtual environments • Provisioning • Backup • Health monitoring • Performance monitoring / management • Do not consider physical .

\root\virtualization") 46 .Set WMIService = GetObject("winmgmts:\\.Application") • WMI .Set virtualServer = CreateObject("VirtualServer.Set vsWMIObj = GetObject("winmgmts:\\. Scripting Virtual Server • Virtual Server • COM .\root\vm\virtualserver") • Virtual Machine Manager • PowerShell (Monad) • Windows Virtualization • WMI .

Scripting • SMS 2003 • Fault and Performance Management • Microsoft Operations Manager (MOM) Pack • Released in April 2005 • VSMP – Provides control. Virtualization Management Today • Configuration Management • Web UI with Virtual Server 2005 R2 • Configuration Files. Win2000. physical/virtual relationships • Virtual Server Migration Toolkit (VSMT) • Physical to Virtual Conversion (P2V) • Built on ADS technology . monitoring. Win2003 47 .supports NT4.

MOM 2005 • Knowledgebase Management tool • Provides Health and Performance Monitoring • Requires Agents • Relationships aware • Provides Actions • Operational Reporting and Data Warehousing 48 .

Management Pack Diagram view 49 . MOM 2005 .

Management Pack Virtualization candidates report 50 . MOM 2005 .

wmv • Available • Beta: Sep 2006 • RTM: ~Oct 2007 • For Virtual Server and for Windows Virtualization • Is MMC console 51 . Virtual Machine Manager VM VMVM VM VMVM V VM M VM VM VM VMVM VM VMVM VMVM VM VM VM VM VMVM Management Tool • System Center Virtual Machine Manager • Code name: "Carmine" (= color: rgb 150-0-24 ) • Incorrect name: Virtual Server Manager • Shown at WinHEC 2006 (23-May-2006) • See mms://wm.com/ms/windowsserversystem/ systemcenter/WinHEC_Content_For_TechEd_MBR.microsoft.

vnc-files • Self-service provisioning • Templates: create standardize VMs • Automatic placement on suitable host computer • Distributed storage infrastructure . Virtual Machine Manager Features • Resource optimization • Identify consolidation candidates • Fast P2V • Optimum workload placement on host computers • Rapid provisioning • Central library of virtualization components • Running VMs. vhd-files.uses DFS • Host provisioning • Uses PowerShell ("Monad") for scripting 52 . offline VMs.

Virtual Machine Manager Physical to Virtual (P2V) • Identify consolidation candidates • Looks at peak and average performance • Configurable selection parameters • Physical to virtual migration • Uses fast VSS. or scripted through PowerShell 53 . not based on existing VSMT • Support Win2000 Server and Win2003 Server • Uses BITS for network transport speed • Wizard based.

self-service • Rating scheme • Hard requirement • Minimum CPU. template deployment. network usage • Soft requirements • Historic VM performance • Current host performance 54 . migration. Virtual Machine Manager VM placement • Capacity planning everywhere • Used for • P2V. disk space needed. RAM needed.

Virtual Machine Manager Offline library • Contents • Templates • Sysprepped VHDs • Standardizes deployments of VMs • Virtual machines • Store non-running VMs • Disks • ISO • Scripts • Architecture • Distributed • Multiple library servers • Access through DFS Namespaces • Replicated • Uses DFS-R and RDC 55 .

Virtual Machine Manager Self-service portal • Web based interface • Controls management deployment • End users interact with their own VMs • Deployment based on templates • Resource quotas set per user • VMs may retire after "lease" expires 56 .

Centralized Management: Views By Resource Pool By VM State By Owner By Creation Date By Operating System 57 .

integration with MOM database Actions one click away in context sensitive Actions Pane 58 . Centralized Management: Reports Full set of reports.

Centralized Management: Library Templates contain both “Gold” image of software as well as hardware settings Offline Virtual Disks Offline Virtual Machines Scripts for post deployment configuration and customization 59 .

New Virtual Machines Choose whether to place new VM into library or place on physical host 60 .

Hardware Configuration Configuration of target virtual machine resouces with default values from physical source machine 61 .

hard requirements. Capacity Planning models. historical performance data. 62 . Virtual Machine Placement Subset physical hosts to appropriate resource pool(s) Rank-ordered recommendations of physical hosts for placement of virtual machine. … incorporated into algorithm.

Self-Service Portal Customized Per User Ability to control owned virtual machines Thumbnails of all owned virtual 63 machines .

Self-Service Portal Controlled by Administrator Quotas used to manage resource allocation across users 64 .

Self-Service Portal Provisioning User selects from list of templates Administrator has associated with that user 65 .

Terminal Services connection information automatically emailed to user. 66 . Self-Service Portal Provisioning New virtual machine ready for use.

iSCSI • Cluster VMs on different hosts • Virtual Server Host Clustering • Cluster VS on different hosts 67 . Virtual Server Clustering • Three different options • Virtual Machine (Guest) Clustering .Shared SCSI • Cluster VMs on same host • Virtual Machine (Guest) Clustering .

Clustering Guest to Guest Host to Host iSCSI SAN or iSCSI connection connection Cluster Cluster storage storage 68 .

then failover to other VM on same host or on another host 69 . Clustering Virtual Machine (Guest) Clustering • VM (Guest) is the cluster node • Application in guest is a resource group • Application is cluster-aware (or Generic) • Protects against failure of Guest • If VM or application fails.

Out-of-the-Box High Availability Host Updating WSUS server Shared Storage WSUS • Administrator wants to update Shared node 1 with Windows Server Storage Update Services • Microsoft Cluster Administration Console saves the state of virtual machines and restores Node 1 Node 2 Node 3 them on another node • Node 1 is ready for update installation VM VM VM 70 .

Out-of-the-Box High Availability Unplanned downtime Shared Storage Shared Storage • Node 1 suffers a power outage or a network failure • A simple script attached to the Microsoft Cluster Administration Console notices the lack of heartbeat and starts the virtual Node 1 Node 2 Node 3 machines associated with node 1 X on other nodes VM VM VM 71 .

.] 'send save state control to VM Function Terminate() [.] 'quick check if VM is alive Function IsAlive() [.] 'send start control to VM Function LooksAlive() [....] 'best attempt to take offline • Protects against failure of Host • Application in guest is not monitored by cluster 72 .] 'starts Virtual Server service Function Online() [..] 'thorough check if VM is alive Function Offline() [.vbs makes VM "cluster-aware" Function Open() [.. Clustering Virtual Server Host Clustering • Host is the cluster node • Each VM (Guest) is a resource group • Generic Script havm.

Clustering Virtual Server Host Clustering • Benefits • Move VMs before scheduled host maintenance • Hardware upgrades • Software updates on host • Steps: Saves state VM1 .startup VM2 • Run legacy operating systems in a "clustered" way 73 .failover .failover .restore state in VM2 • Protect against unscheduled host failure • Steps: (Oops) .

vbs  OS disk  Data disk 74 . vhd-file and vsv-file • Add havm.vbs as Generic Script in Resource Group • Resource dependencies: • Script havm. Clustering Virtual Server Host Clustering • Deploy • Hosts run Cluster service • Uses iSCSI or SCSI/Fibre Channel to shared storage • Note: Disable Cluster service when installing VS2005 • Each VM is in a Resource Group • Or multiple VMs in same Resource Group • Implemented as Physical Disk resource • Containing vmc-file.

it is very easy to use backup methods that you cannot safely restore • Issues are: • Running state of vhd-file • Restore unusable "snapshot" of a database • Best example: Active Directory database 75 . Virtual Server Backup and Recovery • Do you need to backup VMs? • Because a VM is a single file (*.vhd).

On host.Needs: Virtual Server 2005 R2 SP1 . run backup application .On host.uses VSS and VS Writer • VS Writer ensures vhd-file is in consistent state  Do NOT use without Virtual Server 2005 R2 SP1 76 . Backup of VM • Three methods:  .Inside VM. backup vhd/vsv files .Copy 'open' vhd files .Stop VM (save state) . run backup application • Treat VM as a normal physical machine  .Start up VM • Only short VM downtime  Not supported for DCs in VM !  .

Backup of VMs VSS explained • Roles • VSS Requestor = backup application • Initiates backup action • VSS Writer = Virtual Server 2005 R2 SP1 • Ensures data consistency Freeze SQL Server VSS Writer 4 Snap In guest (VM1) Service Exchange 3 "Backup files" Writer VS Writer 5 6 Virtual Server SnapID "Unfreeze" 2 Snap "Backup VM1" 7 VSS VSS 1 Copy files On host Service Service based on SnapID Backup Backup Application Application 77 .

Networking • Create .Network name • .vnc • Separate vnc-file for each host network adapter • Unique MAC-address assigned • Unlimited network speed (not max 10/100 Mbps) 78 .DHCP settings for this switch • Pre-defined vnc-files: • Internal network.Connected to which host network adapter or to None (guest-only) • .vnc-files to define "virtual switches" • Three settings per vnc-file: • .

0 GB) 79 .088.557 MB (= 127.vhd) files • File format is the same: • Virtual PC 2004 • Virtual Server 2005 • Windows Virtualization (future) • Max sizes • IDE (VPC2004): 130.0 GB) • SCSI (VS2005): 2.048 MB (= 127.960 MB (= 2040.5 GB) • IDE (VS2005): 130. Disks • Data store in virtual hard disk (.

com/windowsserversystem/virtualserver/ techinfo/vhdspec.microsoft.VHD Header Format • PlateSpin • Block Allocation Table and Data Blocks • WinImage • Implementing a Dynamically expanding .VHD • Mapping a Disk Sector to a Sector in the Block • XenSource • Splitting virtual hard disks • Implementing a Differencing virtual hard disk • CHS Calculation • From 17-Oct-2006: • Unregistered download available 80 . Disks VHD Format • Free license from Microsoft • www.mspx • 45 vendors signed up (April 2006) Virtual Hard Disk Format Specification • Examples: • Introductions • Overview of Virtual Hard Disk Types • Diskeeper • Virtual hard disk Footer Format • Dynamically expanding .

vud) Base Session Differencing Persistent parent-child hierarchy Base SP1 SP2 Saved states Flush memory to disk (*. VHD Types Base VHD types Dynamically Default type: Grows as needed Host 1GB 2TB expanding Guest 2TB Fixed size Highest performance type Host 2TB Guest 2TB State drive types Undo Non-persistent. per VM (*.vsv) VM Host 81 .

com/vhd for more information 82 .microsoft. VHD Test Drive Program • New: announced 6-Nov-2006 • Fully configured VHD-files • Downloadable from Microsoft's Web site • Evaluation versions • Expires after 30 days • Partners can also provide their applications • See www.

msi" /qn ADDLOCAL=VHDMount • Use as command-line tool: C:\Program Files\Microsoft Virtual Server\Vhdmount> vhdmount.lists mounted vhd-file or all • Use for copying or injecting files.exe Usage: VHDMOUNT /p VHDFileName . VHD Mount Tool Access VHD content offline • VHDMount tool is included with VS2005 R2 SP1 • Can install separate: C:\> msiexec. assign drive letters VHDMOUNT /u VHDFileName | All . virus-scanning • Do not use for offline patching (yet) 83 .exe /i "Virtual Server 2005 Install.mounts vhd-file VHDMOUNT /m VHDFileName [DriveLetter] .mounts vhd-file. inspecting.unmounts vhd-file or all VHDMOUNT /q VHDFileName | All .

VHD Enhancements Windows Virtualization • While VM is running • Compact VHD-file • Create new diff-disk (snapshotting) • Create VHD-chain • Schedule snapshot every 10 minutes • Merge • Hot add VHD-file • Add VHD-file notes • Think: 1000s of VHD-files on network • Pass-through VHD .map to SAN 84 .

doc File-d.doc File-d. Differencing disks • VHD files use blocks of 2 MB Virtual Server service Read Write Create Delete 3 1 2 3 4 Grow Link to parent File-c.doc 1 2 3 4 1 2 3 4 1 2 3 4 Read only File-a.doc File-b.doc 85 .

doc Pagefile... Disks Read/write zero-filled files • VHD file format optimizes read/write of zero-filled blocks • Best example: empty pagefile.sys 86 . 1 2 3 4 1 4 File-a.sys Virtual Server service Write Write Read 000 000 000 000 000 000 000 000 000 000 1 2 3 4 1 2 3 4 5 000 000 000 1112 000 000 000 000 000 000 000 .

Compact 3 Use VPC Disk Wizard or VS Inspect Disk to compact 87 .iso • Shutdown VM • On host . Compact VHD Files • Steps • Note: Does not work on differencing disks • In VM .Cleanup • Startup VM without Undo disks 1 Defragment disk 2 Zero-fill all unallocated spaces • Use Precompactor.

com) • Do not include save state (.vsv) file • Stop VS when shutting down host computer • Use script for UPS 88 . or Newsid (sysinternals. Operations Best practices • Disable VM time synchronization when VMs are in a domain • Does not use time zones ! • When copying VMs: • Run Sysprep.

VM Additions SCSI driver (fastest) 89 . Windows SCSI driver (slowest) 2. IDE driver (=only option for Virtual PC) 1. Performance Optimizations • Virtual Server is usually faster than Virtual PC • Except for video (screen) handling • Disk • Three possible disk drivers in guest (in order of speed): 3.

sys (56 KB) • Now you can boot as SCSI. but this is a slow SCSI driver. Move disk from VPC to VS From IDE to SCSI • Issue: How to boot IDE vhd as SCSI vhd • Steps 1. Startup VM • Found new hardware: Adaptec AIC-7870 PCI SCSI Adapter • Needs Win2003 CD for aic78xx. 90 . In VS console: • Add SCSI Adapter (ID 7) to VM • Leave boot disk as IDE disk 2.

In VS console: • Swith boot disk from IDE to SCSI adapter • Virtual PC can still boot from disk as IDE 91 . Move disk from VPC to VS From IDE to SCSI 3. In running VM: • Open Device Manager • Right-click Adaptec / Update Driver • Install from a specific location / Have Disk • Browse to C:\Program Files\Virtual Machine Additions • Installs SCSI driver: Microsoft Virtual Machine PCI SCSI • Now the fast SCSI driver is loaded 4.

Performance Most important tips  Install VM Additions in all VMs • Consider latest VM Additions  Use enough memory per VM • To avoid paging inside VM  Plan capacity of running VMs • Total disk usage • Total CPU usage • Total network bandwidth needed 92 .

Performance On host • On host. do not use /3GB in boot.vhd from virus-scanning • On host. for disks: • Use multiple physical disks • Use SCSI host disks • Defragment host disk • Use NTFS • Use NTFS compression .maybe • On host. use multiple network adapters • Unbind Virtual Machine Network Service from dedicated host adapter • On host. exclude .ini • VMs use non-paged kernel memory 93 .

Performance In guest • VM configuration • Use SCSI disk for vhd-file • Ensure VM Additions SCSI driver is used • Use fixed disk instead of dynamic disks • Guest configuration • Disable unnecessary services: • Indexing. auto-search for network resources. etc • Defragment guest disk • Not when using differencing disk 94 . tracing.

Summary/Call to Action 95 .

msdn.msdn.com/technet/scriptcenter/scripts/vs/default.com/mikekol/ • Windows Virtualization (John Howard .com/jhoward/ • Scripts • TechNet • www.MS) • http://blogs.mspx 96 .com/Virtual_PC_Guy/ • Virtual Vista (Mike Kolitz .MS) • http://blogs.MS) • http://blogs.microsoft. For more information Useful links • Weblogs • Virtual PC Guy (Ben Armstrong .technet.

microsoft.microsoft.com/licensing/resources/volbrief.com/windows/virtualpc/techinfo/debug.com/fwlink/?LinkId=55644 • Virtual Server Guest Clustering • www.mspx • Using iSCSI with Virtual Server 2005 R2 • http://go.mspx • Virtual PC for Development and Debugging • www. For more information Whitepapers • Virtualization Licensing Brief • www.com/fwlink/?LinkId=55646 • Virtual Server Host Clustering whitepaper and script • http://go.mspx 97 .microsoft.microsoft.microsoft.com/technet/prodtechnol/virtualserver/deploy/ cvs2005.

mspx • Virtual Server 2005 R2 SP1 Beta2 • connect.microsoft.com/fwlink/?LinkId=37030 98 .sign-up for beta • Virtual PC 2004 SP1 • www.microsoft.mspx • Virtual PC 2007 RC (including VM Additions 13.mspx • VSMT • http://go.com .com/windowsserversystem/virtualserver/software/ default.com .microsoft.com/windows/virtualpc/downloads/sp1.802) • connect. For more information Download software • Virtual Server 2005 R2 EE • www.microsoft.com/windowsserversystem/virtualserver/ evaluation/linuxguestsupport/default.microsoft.sign up for beta • Linux VM Additions • www.microsoft.

.

All rights reserved. MICROSOFT MAKES NO WARRANTIES. .© 2006 Microsoft Corporation. IN THIS SUMMARY. This presentation is for informational purposes only. EXPRESS OR IMPLIED.