The Soul of a Virtual Machine

Things to know about running a virtual machine under Virtual Server

April, 2005

  • How Microsoft is using Virtual Server

    Many of you would like to know how Virtual Server is being used at Microsoft. Here's a response from Jeff Woolsey, Lead Program Manager for virtualization. Thanks Jeff!

    Virtual Server is being used in a variety of ways at Microsoft, including for test and development and online training, such as Microsoft Learning.

    Test and Development

    Virtual Server is used by test teams throughout Microsoft, including Exchange, SQL, SBS, MOM, and many others. This is because Virtual Server allows you to rapidly deploy test servers within virtual machines while minimizing hardware requirements. Also, Virtual Server makes debugging easier. Debugging typically requires that a test computer is attached to a developer’s computer via a serial cable. With Virtual Server there's no need for this. The process is as follows:

    1. Testers reproduce the issue in a virtual machine.
    2. The virtual machine is saved at the point the issue occurs.
    3. The virtual machine is copied to the developer’s computer.
    4. The developer connects the virtual machine to a debugger though a named pipe (a virtual serial port) and debugs the issue in the development environment.

    Production Use by Microsoft Learning

    In the past year, Microsoft Learning has converted the majority of their online training from scripted Flash-type demos to live interactive training using Virtual Server. They started off slowly and have been ramping up with the increase in demand. Users log in and perform step-by-step interactive training with Virtual Server. On the back end, this is all done using virtual machines and Undo disks. When the customer logs in, an Undo disk is created for the session. When the user finished and logs out, the Undo disk is discarded and immediately the virtual machine is ready for the next user.

    Benefits

    Microsoft Learning is servicing more customers than ever. This is a production environment in use everyday: 30,143 attendees in January (972 attendees daily) alone with a 206,390 YTD. Because of the huge success of this program, Microsoft Learning is adding more hardware to increase the number of available labs.

    Here are a few of the positive results they’ve seen…

    • The 90-minute lab sessions are the most popular.
    • Lab session use has gone up.
    • Time spent in the lab has gone up (averaging 75 minutes per lab now).
    • Customer satisfaction is up (way up!).
    Customer Comments
    • I think this is the way IT was meant to be all along.  Thank You Bill and company. 
    • The implementation is entirely innovative and gives administrators like me a chance to experiment away from production systems.
    • Awesome. This is the type of thing IT training has needed for ages.
    • Excellent. Very useful hands on training.  This module needs to be longer.
    • EXCELLENT!  This is extremely useful hands on training.
    • Great! This is what admins who need to implement your products need. What about providing other training on SMS site design configurations, clusters etc.? A virtual lab setup like that will again help admins who are looking to implement this product.
  • Tip: Opening the Administration Website over a remote connection

    If you're connected to Virtual Server over a Terminal Services or Remote Desktop connection, you'll get a "Page cannot be displayed" error if you try to launch the Administration Website from the shortcut on the Start menu. Instead, you can provide this URL in Internet Explorer: http://server_IP_address:VS_port, where server_IP_address is the IP address of the computer running Virtual Server and VS_port is the port number assigned to Virtual Server, 1024 by default.

    Alternatively, you can remote into the computer running Virtual Server and access the Administration Website in one step. To do this, click Start > Run, and then type: mstsc /v:server_IP_address /console.

  • Tip: Turning off the virtual machine beep

    If you want to turn off the beep that sounds when you turn on a virtual machine, you can run the following two commands. The first stops the BEEP service and the second disables it on subsequent reboots.

     net stop beep

    sc config beep start= disabled 

    (Be sure to include a space after the = sign.)

  • Tip: Speeding up application installation

    If you want your applications to install more quickly in a virtual machine, do this: After you install the guest operating system, install Virtual Machine Additions, restart the virtual machine, and then install the applications.
  • Tip: How an app can discover it's running in a virtual machine

    Here's a tip from Paul Adare (author of Paul's Digital Lounge and Cigar Bar). If you want an application to discover it's running in a virtual machine, you can do the following:

    You could query the registry for the existence of the HKLM\SOFTWARE\Microsoft\Virtual Machine key. Or you could use an WMI query, such as this:

    On Error Resume Next

    strComputer = "."

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
    \cimv2")

    Set colItems = objWMIService.ExecQuery("Select * from Win32
    _BaseBoard",,48)

    For Each objItem in colItems

    if objitem.Product = "Virtual Machine"

  • Tip: Changing a VHD from IDE to SCSI

    You can easily change your virtual hard disk (VHD) attachment from IDE to SCSI:

    1. Shut down the guest operating system.
    2. Add a SCSI adapter to the virtual machine, if one isn't already available (under "Virtual Machine" Configuration, click SCSI adapters and then click Add).
    3. Turn on the virtual machine and verify in Device Manager that the Microsof Virtual Machine PCI SCSI Controller is installed (it should be listed under SCSI and RAID controllers).
    4. Shut down the guest operating system and change the attachment of the VHD from IDE to SCSI (under "Virtual Machine" Configuration, click Hard disks and in the Attachment box, select the appropriate attachment).
    5. Turn on the virtual machine.
  • Steve Ballmer's remarks on virtualization at MMS 2005

    In his keynote address this morning at Microsoft Management Summit 2005, Steve Ballmer talked about Microsoft's virtualization strategy. The following is excerpted from the transcript of this address. To read the complete transcript, go to: http://www.microsoft.com/presspass/exec/steve/2005/04-20ManagementSummit.asp.

    Increased Virtualization Capabilities

    Virtualization, I think, is an area of intense interest and activity throughout our industry these days, certainly at Microsoft. All operating systems have essentially been in the business to some degree in some way, shape and form a virtualization for all time. That's how operating systems grew up, Windows grew up virtualizing the screen, the printers, et cetera, so virtualization in a sense is not a new concept.

    But this notion of taking virtualization in the PC world, in the PC server world and really taking it to the next level, driving virtualization as a key technology to facilitate better compatibility, lower total cost of ownership and with the appropriate management tools really helping you operate a simple environment, that's an area of intense focus, passion and interest certainly at Microsoft and I think a number of places in our industry these days.

    Again in this area if I don't get anything else across, I really want you to understand that this is an area where you should expect to see a large amount of very exciting and interesting innovation that should help you improve quality and cost of operation going forward.

    We bought a company called Connectix a little over a year ago. That was part of us beefing up the arsenal of technologies that we had to apply to making virtualization a key part of our quality and cost proposition to you and we're going to show you some of the product shipments and deliverables that are coming out of that acquisition during the course of my talk here today.

    I want to start though with a little longer term perspective, the "Longhorn" timeframe, and I'm not saying "Longhorn" but about that timeframe there's a number of things that we're working on that are very important in virtualization. We're going to take the virtualization format, the .vhd format, which we're working today to get standardized across industry participants, we're going to take that format and make it extensible, which we think is very important for all of you and for us in terms of where virtualization technologies can go in the future, open and extensible approach to virtualization we think is very important.

    You'll see us introduce hypervisor technologies around Windows. That is important. We have virtualization technologies today but really this notion of a smaller, thinner hypervisor and what that can mean I think is very important. We're building on some of the work that we started on with NGSCB just in the security context and are broadening it out to really a very rich set of hypervisor technologies.

    You'll see us support key hardware technologies for virtualizations from Intel and from AMD and in System Center we will bring the capability to help you manage a set of virtual machines to make it easier to run virtual technologies as a way of improving datacenter consolidation, running multiple applications on a set of virtual machines, on a given server, et cetera.

    So underlying core infrastructure, operating system infrastructure technology enhancements and management tool enhancements delivered in a very open and extensible way; that's the target for our technology ambition in virtualization in the "Longhorn" timeframe.

    Microsoft Virtual Server 2005

    Today we have available Microsoft Virtual Server 2005. We'll deliver SP 1 later in the year. It is in beta today. We have a Management Pack available for Virtual Server for MOM today. When we release Virtual Server SP 1 you'll see a number of improvements. We've added support for non-Windows virtual machines being hosted on top of our Virtual Server product, including support for Linux. Remember what I said earlier about interoperability? We're really believing that. We know folks are going to want to run Windows systems and Linux systems and other systems together on top of our Virtual Server and Windows. You'll see support for that later in the year.

    We're dramatically improving our performance and you'll see us support 64-bit hosts now that we have 64-bit support in the Windows Operating System. We're licensing our VHD format broadly. You'll see that in the fall, and there's a large amount of support going into all of our Windows Server System products to support the Virtual Server in a very strong way.

    Today I would tell you the following: If you are looking for a virtualization environment to improve cost and quality of any person in your environment or any set of people in your environment doing software development for tests, we have absolutely a blow-away product, and I encourage you to take a look at Virtual Server 2005.

    Virtualization Today

    For people looking to do data center consolidations for production applications, we have a very good product, but we also have a list as long as my arm of requests for enhancement, improvements, additional features, more performance, and we're working, and we're working, and we're working, and we're working and we're working. This really is with the technologies I talked about before, one of the most significant areas of R&D investment for us, because we think that this is a core enabler to help us improve our enterprise management, and to help deliver to you the lowest TCO platform absolutely on the planet.

    What I'm going to do now is ask Jeff Woolsey from our Virtual Machine Technology Group to come up on stage. Jeff is going to demonstrate some of the new capabilities in Virtual Server 2005 SP 1. Please welcome Jeff. (Applause.)

    JEFF WOOLSEY: Hi, Steve.

    STEVE BALLMER: Before you get started, I'll now point out, it's been seven minutes since he kicked off the demo. We'll see how he does.

    JEFF WOOLSEY: Excellent.

    STEVE BALLMER: Not that I'm going to interrupt you when that thing finishes, but I may have a small celebratory dance.

    JEFF WOOLSEY: No problem, we're all looking forward to Bill keeping his job.

    STEVE BALLMER: There you go.

    JEFF WOOLSEY: As Steve mentioned, we have some major announcements around virtualization and virtualization management, and I want to demonstrate some of those deliverables that you can start using today. As you can see, I'm running the 64-bit version of Virtual Server SP 1 Beta, and I'm running it on Windows Server 2003 Enterprise X64 Edition. With the 64-bit host OS support, and additional performance improvements in Virtual Server SP 1, we have seen significant performance improvement. In fact, some of our early adopters have reported as much as a 50 percent decrease in host CPU usage running the same number of virtual machines and workload. This translates into higher virtual machine density, and lower hardware cost, making Virtual Server an even better platform for server virtualization and consolidation.

    Let's bring up the master status and show you all of the virtual machines we're currently running. As you can see, I'm running a variety of operating systems, including Windows 2000 Server SP 4, 2003 SP 1 Enterprise, and as Steve has been mentioning with interoperability and heterogeneity, you may want to avert your eyes, Steve, this is Red Hat's Enterprise Linux Advance Server 3.

    STEVE BALLMER: As much as that hurts my eyes, I know that's an important capability for the virtual server technology for our customers.

    JEFF WOOLSEY: We recognize the interoperability needs of our customers, and want to ensure that Virtual Server running on Windows Server 2003 is a great solution for that environment.

    Next, I would like to switch gears and tell you what we're doing to improve manageability around our Virtual Server. Well, some vendors have created completely separate tools to manage their virtual servers and virtual machines. We've listened to our customers who have told us very loudly and clearly that they expect to be able to manage their virtual machines using the same management tools that they use to manage their physical ones. And that's exactly what we've build.

    So, I brought up the MOM 2005 console so I can demonstrate the Virtual Server Management Pack. The Virtual Server Management Pack allows administrators to monitor the health and performance of their virtual server and their associated virtual machines. So, let's take a look at the health status of our virtual server. By clicking on my virtual state view, I can get a list of all the virtual servers on my network. To drill down and see all of the virtual machines associated with this particular hardware server, I click on the virtual machine role and I can see all of the virtual machines that are actually running on this physical box.

    But, because we're leveraging the power of MOM, and our Management Pack uses that intelligence very well, I want to show you an even more detailed look at our Virtual Server. I'm going to drill down and get detailed information about the role my virtual server. AS you can see here, all of my virtual machines are displayed in this role view. I can see the instance name, the guest operating system version, I can see the location of all of my virtual hard disks, the amount of memory being used, the amount of disk space being used, even the network the MAC addresses for all of the virtual machines displayed in a single detailed role view within the MOM Management Pack.

    And as you've seen earlier, you've seen MOM managing a Sun box, you've seen MOM managing Solaris, now you've seen MOM managing virtual machines and virtual server. And by working with our partners such as Sun and Vintella. Vintella is working on a Management Pack to provide the same types of performance, the same type of management for Linux virtual machines, as well.

    STEVE BALLMER: Today we still don't have much information about the Red Hat system, but we will that's part of our absolute plan.

    JEFF WOOLSEY: You're right. Absolutely. You see the Linux virtual machine is lacking some of that detail, and we're working with them to improve that level of integration.

    The last thing I want to show is actually some new features and functionality that's enabled by the virtual server Management Pack. One of the things that our customers have asked for is the ability to perform tasks on multiple virtual machines simultaneously. And with the virtual server management tasks it's simply not a problem. Select the task you'd like to perform, such as save state virtual machine, walk through the wizard, select all of the virtual machines I'd like to save state and click finish. It's that easy.

    Steve, the team is really excited about this opportunity to deliver on this deeper commitment to virtualization, and virtualization management. And I hope you'll find that Virtual Server Service Pack One, and the MOM Management Pack go a long way towards providing improvement in performance, interoperability, and manageability necessary to make Virtual Server running on Windows Server 2003 a great platform for server virtualization and consolidation.
    Thanks for this opportunity, Steve.

    STEVE BALLMER: Thanks, Jeff. (Applause.)

  • Steve Ballmer on Microsoft's virtualization strategy

    In his keynote address this morning at Microsoft Management Summit 2005, Steve Ballmer reaffirmed Microsoft's commitment to the Dynamic Systems Initiative (DSI), of which virtualization is a key component. Ballmer explained that Microsoft is increasing investment in both virtualization and virtualization management technology, describing near-term product improvements and laying out a long-term strategy for both areas. For a summary of Steve's keynote address, go to http://www.microsoft.com/presspass/press/2005/Apr05/04-20VirtualizationInvestmentsPR.asp. For a verbatim transcript of his comments on virtualization, go to http://blogs.technet.com/megand/articles/403997.aspx. To view an on-demand Web cast (including Jeff Woolsey's demonstration of Virtual Server 2005 SP1), go to http://www.microsoft.com/presspass/events/mgmtsummit/keynotes.asp.

  • Announcing Virtual Server 2005 SP1 Beta

    This morning at Microsoft Management Summit 2005, Steve Ballmer  announced the availability of Virtual Server 2005 Service Pack 1 (SP1) Beta. To view an on-demand Web cast of Steve's talk (including Jeff Woolsey's demonstration of Virtual Server 2005 SP1), go to http://www.microsoft.com/presspass/events/mgmtsummit/keynotes.asp.

    SP1 contains the latest software updates for Virtual Server 2005. SP1 includes the following new features (detailed later in this post):

    • Support for additional host operating systems, including 64-bit versions of Windows Server 2003 and Windows XP
    • Virtual Disk Precompactor
    • Performance enhancements
    • Built-in support for network installations
    • Reserved disk space for saved state files
    • Virtual floppy disk for pre-loading virtual SCSI drivers
    • Support for hyperthreading

    In addition to these features, Steve announced that support will be expanded for third-party operating systems such as Linux, Solaris, and other x86 operating systems to better meet the needs of customers with heterogeneous environments. Steve also announced that we are licensing royalty-free our VHD file format to promote a consistent and widely-adopted virtual machine file format for Windows to dramatically improve security, reliability and cost efficiency for customers.

    To sign up for the Beta program

    1. Go to http://beta.microsoft.com. Note: You need a Passport account to sign in.  If you don’t have one, BetaPlace will help you create one.
    2. Once logged into Beta Place with a Passport account, provide vssp1BetaTester as the guest account. This will take you to the nomination page for the SP1 beta. Note: The Guest ID is both case and space sensitive and must be entered exactly as shown.  The most common reasons for a “Guest ID is locked out” or “invalid Guest ID” error message is because you either incorrectly entered the Guest ID or you entered a space before or after entering the Guest ID in the Guest ID field.  
    3. Follow the directions on this page to nominate yourself. In about 24 hours you'll receive an e-mail notice that you've been accepted into the program. You can then log in to Beta Place and download the SP1 beta, read the documentation, etc.

    What's new in SP1

    Support for additional host operating systems

    In addition to the host operating systems supported by Virtual Server 2005, SP1 adds support for the following host operating systems:

    • Microsoft Windows Server 2003 Standard Edition Service Pack 1
    • Microsoft Windows Server 2003 Enterprise Edition Service Pack 1
    • Microsoft Windows Server 2003 Standard x64 Edition
    • Microsoft Windows Server 2003 Enterprise x64 Edition
    • Microsoft Windows XP Professional Service Pack 2
    • Microsoft Windows XP Professional x64 Edition

    Support for additional guest operating systems

    In addition to the guest operating systems supported by Virtual Server 2005, SP1 adds support for the following guest operating systems:

    • Microsoft Windows Server 2003 Standard Edition Service Pack 1
    • Microsoft Windows XP Professional Service Pack 2

    Virtual Disk Precompactor

    SP1 includes Virtual Disk Precompactor, a utility designed to "zero out"—that is, overwrite with zeros—any available blank space on a virtual hard disk (VHD). We recommend that you use Virtual Disk Precompactor before you compact a dynamically expanding VHD in order to create a smaller compacted VHD.

    Performance enhancements

    Changes have been made to the way that Virtual Server allocates physical memory to guest operating systems. In some scenarios, this could result in significant performance improvements.

    Built-in support for network installations

    PXE boot support has been added to the virtual machine network adapter. This means that when the appropriate network infrastructure is in place, you can perform a network installation of a guest operating system without needing a PXE boot floppy disk.

    Reserved disk space for saved state files

    With SP1, Virtual Server now reserves sufficient space on the physical disk to save the state of each running virtual machine. It does this when the virtual machine starts up by creating an empty saved state (.vsv) file equal to amount of memory allocated to the virtual machine plus a 20 MB buffer.

    Virtual floppy disk for pre-loading emulated SCSI drivers

    SP1 includes a virtual floppy disk, SCSI Shunt Driver.vfd, that you can use to load the emulated SCSI drivers during installation of a Windows Server 2003, Windows Server 2000, or Windows XP Professional guest operating system. This will speed the installation when the virtual hard disk is attached to a virtual SCSI adapter.

    Support for hyperthreading

    With Virtual Server 2005, we recommended that you disable hyperthreading on the host operating system to improve the performance of your virtual machines. With SP1, this is no longer necessary. Hyperthreading does not affect virtual machine performance.

  • VirtualStrategy Magazine interview: PowerRecon

    Platespin CEO, Stephen Pollack, talked to VirtualStrategy Magazine about PowerRecon, Platespin's new tool for consolidation planning. Read all about it at http://www.virtual-strategy.com/article/articleview/778/1/2/.
  • Announcing Virtual Server Deployment Manager (VSDM) 1.3.0

    Finally, this very cool tool created by Nelson Araujo is available as a free download from Microsoft (it was demo'd last year at TechEd in WINIL401). VSDM manages a virtual library of templates and ISO images and provides a streamlined way to manage and deploy virtual machines. Administrators can configure VSDM to allow non-administrators to create and manage their own machines without impacting other users' machines, or even being able to view them. This is a "must have" tool if you manage a large number of virtual machines or need to frequently recreate images based on a master image (template).

    To download VSDM, go to http://www.microsoft.com/downloads/details.aspx?familyid=FF59C543-5107-42F6-9252-A8CDE3B53915&displaylang=en.

    For lots of good information and support for using the tool, see Nelson's blog: http://blogs.msdn.com/nelson_araujo/archive/category/9970.aspx. For some draft installation instructions, see Paul Adare's blog:  http://www.identit.ca/blogs/paul.

  • MOM report for evaluating virtualization candidates

    Chong Lee and Thomas Mathew -- Technology Specialists here at Microsoft -- are developing a report that you can load into Microsoft Operations Manager 2005 (MOM) to monitor the performance of physical computers that are candidates for virtualization. This report can help you determine which computers are good candidates for virtualization, and of those, which computers you can virtualize on the same hardware. This report will be available for download when it's complete. I'll let you know where you can get it. In the meantime, you can ask your TAM or account rep for a copy.

    Click here to see a view of the report: http://megandavis.members.winisp.net/Resources/VS-Candidate-Report.JPG

  • Script: Show the state of all virtual machines

    Here's another script from John Kelbley, written in VBScript. It shows the current state of all virtual machines on the current instance of Virtual Server. Remember that this script is provided as-is, with no warranties, and is not supported by Microsoft.

    VMStateCodes = Array("Invalid", "Turned Off", "Saved",_  "Turning On",  "Restoring", "Running", "Paused", _  "Saving","Turning Off", "Merging Drives", _
      "Deleting Machine")

    Set vpcApp = WScript.CreateObject("VirtualServer.Application")
    Set vmCollection = vpcApp.VirtualMachines

    'start up all saved state VMs
    For each vm in vmCollection
     Wscript.Echo "      " & VMStateCodes(vm.State)
    Next

  • Script: Generate a list of virtual machines

    These two scripts from John Kelbley, written in VBScript, list the virtual machines that are currently registered on a given instance of Virtual Server. Remember that these scripts are provided as-is, with no warranties, and are not supported by Microsoft.

    This script shows the virtual machines registered on the current instance of Virtual Server:

    Set vpcApp = CreateObject("VirtualServer.Application")

    Set vmCollection = vpcApp.VirtualMachines

    For each vm in vmCollection
     Wscript.Echo vm.Name

    Next

    This script shows the virtual machines registered on a remote instance of Virtual Server:

    Set vpcApp = CreateObject("VirtualServer.Application“,_ “\\remoteServer”)

    Set vmCollection = vpcApp.VirtualMachines

    For each vm in vmCollection
     Wscript.Echo vm.Name

    Next

  • New e-learning course on Virtual Server 2005

    Title: Course 2288: Using Microsoft® Virtual Server 2005
    Course Type: Self-paced course
    Available Offline: Yes
    Estimated Time to Complete: 5 hours
     
    Description:
    This course prepares students to migrate legacy applications and consolidate server functions by using Microsoft Virtual Server 2005. 
     
    Objectives:
    At the end of the course, students will be able to:

    • Install and configure Virtual Server 2005.
    • Configure virtual machines on Virtual Server 2005.
    • Migrate applications and servers to virtual machines.  

    Visit https://www.microsoftelearning.com/eLearning/offerDetail.aspx?offerPriceId=62154 for more information.

     

  • New e-learning course on Virtual Server 2005

    Title: Course 2288: Using Microsoft® Virtual Server 2005
    Course Type: Self-paced course
    Available Offline: Yes
    Estimated Time to Complete: 5 hours
     
    Description:
    This course prepares students to migrate legacy applications and consolidate server functions by using Microsoft Virtual Server 2005. 
     
    Objectives:
    At the end of the course, students will be able to:

    • Install and configure Virtual Server 2005.
    • Configure virtual machines on Virtual Server 2005.
    • Migrate applications and servers to virtual machines.  

    Visit https://www.microsoftelearning.com/eLearning/offerDetail.aspx?offerPriceId=62154 for more information.

     

  • New e-learning course on Virtual Server 2005

    Title: Course 2288: Using Microsoft® Virtual Server 2005
    Course Type: Self-paced course
    Available Offline: Yes
    Estimated Time to Complete: 5 hours
     
    Description:
    This course prepares students to migrate legacy applications and consolidate server functions by using Microsoft Virtual Server 2005. 
     
    Objectives:
    At the end of the course, students will be able to:

    • Install and configure Virtual Server 2005.
    • Configure virtual machines on Virtual Server 2005.
    • Migrate applications and servers to virtual machines.  

    Visit https://www.microsoftelearning.com/eLearning/offerDetail.aspx?offerPriceId=62154 for more information.

     

  • Warm backup and restore scripts

    I just posted two scripts from John Kelbley, a technical specialist at Microsoft. They are examples of scripts you can write to perform a warm backup of your virtual machines and restore them to a different instance of Virtual Server. You'll find them in the new Scripts category (http://blogs.technet.com/megand/articles/category/9995.aspx).
  • Script to perform a warm backup of a virtual machine (faster)

    Here's an example of a script written in VBScript that you can use to make a warm backup of a virtual machine using UNC paths. It was written by John Kelbley. He says using this script that relies on UNC paths is faster than using the other script with the same title, so I added "faster" to the title of this script.

    Please pay attention to all of the warnings and caveats in the script.

    Thanks John!

    Introduction from John

    You may need to do some or all of the following to get UNC-based VHDs and the COM/DCOM stuff to work

    Installation Config (stuff I did that I may not have needed to)

    • Install Virtual Server for Constrained Delegation
    • Set IIS - Virtual Server authentication to "Basic"
    • Configure "Constrained Delegation"  as per the Virtual Server 2005 Administrator's Guide (Admin Guide)• Load hotfix listed in KB 829011 as per Admin Guide
    • Add "Anonymous" to Everyone group on UNC endpoint (file server)
    • Component Services / Computers / My Computer / Properties / Default Properties Tab - set Impersonation Level to Impersonate
    • Component Services / Computers / My Computer / DCOM Config / Virtual Server / Properties / Security / Launch Permissions / Everyone - Allow

    Setup

    • Make sure that all the virtual network names you are going to use are the same on both (all) Virtual Servers
    • Set all VHDs to use static MAC addresses
    • Set search path / default config path in Virtual Servers to a UNC (give yourself lots of rights on the share and NTFS)
    • Put VHDs out on share (no config files)
    • Manually create config files on one of the Virtual Servers (need to be out on the UNC along with the VHDs)
    • Fire up the VHDs
    • Change Target Host in script to the name of the "TO" server
    • Run script on the "FROM" server

    And the script...

    ' READ THIS LINE!!!   The sample scripts are not supported under any Microsoft standard support program or service.  The sample scripts are provided AS IS without warranty of any kind.  Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose.  The entire risk arising out of the use or performance of the sample scripts and documentation remains with you.  In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.
    '
    ' Script saves the state of all running VMs in Virtual Server, register and start them on another system
    ' Assumes VMs are mounting via share (UNC)

    ' Cobbled together by John Kelbley
    '
    '
    TargetHost  = "ToVirtServerName"  ' put name or IP Address of target server here, NOT preceeded by two slashes
    TargetHostServer = "\\" & TargetHost


    VMStateCodes = Array("Invalid", "Turned Off","Saved","Turning On", "Restoring", "Running", "Paused", "Saving",_
        "Turning Off", "Merging Drives", "Deleting Machine")

    Dim VPCNames()
    VPCCount = 0

    Set vpcApp  = WScript.CreateObject("VirtualServer.Application")

    ' Get list of VMs on server
    Set vmCollection = vpcApp.VirtualMachines

    ' Get maximum Name Length for Formatting
    For each vm in vmCollection
     ReDim Preserve VPCName(VPCCount)
     VPCName(VPCCount) = vm.Name
     VPCCount = VPCCount + 1
     NameLength = Len(vm.Name)
     If MaxNameLength < NameLength Then
      MaxNameLength = NameLength
     End If
    Next
    Set vmCollection = Nothing
    Set vpcApp = Nothing

    Wscript.Echo VbCrLF & "Total VMs meeting migration criteria:  " & VPCCount & VbCrLF

    For LoopCount = 0 to (VPCCount - 1)
     vm_name = VPCName(LoopCount)
     Set vpcApp = CreateObject("VirtualServer.Application")
     Set objVMUnregister = vpcApp.FindVirtualMachine(vm_name)

     Wscript.Echo VbCrLF & vm_Name & Space(MaxNameLength - Len(vm_name)) & " - " & VMStateCodes(objVMUnregister.State)
     While objVMUnregister.State > 2 ' if the VM is not turned off of saved...
      if VMStateCodes(objVMUnregister.State)  = "Running" Then
       objVMUnregister.Save()
     End If
      wscript.sleep(100)        
      Wscript.Echo Space(MaxNameLength) & "   " & VMStateCodes(objVMUnregister.State)
     Wend

     'Unregister on local box
     ConfigFile = objVMUnregister.File
     errReturn = vpcApp.UnregisterVirtualMachine(objVMUnregister)
     Set objVMUnregister = Nothing
     Set vpcApp = Nothing

     ' start call remote server directly

     Set objREMOTEVS = CreateObject("VirtualServer.Application", TargetHostServer)
     errReturn = objREMOTEVS.RegisterVirtualMachine("", ConfigFile)
     Set objREMOTEVM = objREMOTEVS.FindVirtualMachine(vm_Name)
     objREMOTEVM.Startup()
     Set objREMOTEVS = Nothing
     Set objREMOTEVM = Nothing

    Next
    Wscript.Echo VbCrLF & "Processing complete!" & VbCrLF

  • Script to perform a warm backup of a virtual machine

    Here's an example of a script written in VBScript that you can write to perform a warm backup of a virtual machine. It was written by John Kelbley, who's a technology specialist for Microsoft. Please pay attention to the warnings and caveats given in the script.

    Thanks John!

    ' READ THIS LINE!!!   The sample scripts are not supported under any Microsoft standard support program or service.  The sample scripts are provided AS IS without warranty of any kind.  Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose.  The entire risk arising out of the use or performance of the sample scripts and documentation remains with you.  In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.
    '
    '
    ' MoveWarm.VBS  written by John Kelbley
    '
    '
    ' This the mother of all Demo Virtual Server Availability scripts! 
    '
    ' When the script is executed properly from a running Virtual Server system with active Guest images,
    ' it hibernates, copies, installs, and starts all active Guest images on another Virtual Server!
    '
    ' This could be used in a production environment to allow for hardware maintenance while minimizing down time of Guest images, if all assumptions are met, including:
    ' Identical Virtual Server hardware configuration - enough RAM, disk space with same drive letters, etc. on target to accommodate migrated guest images
    ' Identical Virtual Network configuration (it's just easier, otherwise, they may not start automatically, and you'll have to adjust the config)
    ' Other things I haven't run into in my testing (I only have a couple of Evo's to test on!)
    ' XP SP2 (connection firewall) can keep this from running, depending on the hosts you are using (rumor that some DCOM security thing might mess things up, too)
    ' I sometimes have been know to setup a local account on both hosts with the same name and password as my domain credential, and map drives back and forth to
    ' make sure everything will run right before kicking off the script for a demo!
    '
    ' NAME RESOLUTION IS A BIG DEAL HERE TOO!!!
    '
    ' How does the Script do it?  It does a few key things:
    ' 1) "saves state" on running VPC images
    ' 2) Creates a .BAT and .VBS on original host for each of the hibernated images in current directory
    ' 3) Starts .BAT for each hibernated image on local host (this kind of multi-threads the copy)
    '  a) copies files related to image to new host (.VHD config, save state)
    '  b) runs .VBS to register config file on new host, and re-start from Saved State
    '
    ' The script does not clean up after itself, as it is a sample meant for training purposes!
    '
    ' The .BAT and .VBS files generated may be of interest to someone, so at this time, I did not want to delete them
    '
    '
    ' When I run the demos, I usually use smaller VMs  - some from the VMSTORE areas - like Windows 3.0 or BOB on Windows 95
    '
    '
    ' Thanks to the Tech Net Script Center folks for all their guidance (great examples on the web, as well as usable reference books on VBS!)
    '
    '
    Option Explicit
    'On Error Resume Next

    Const ForWriting = 2 ' constant used for openning text files

    Dim ToSystem  ' Computer Name of Target host system
    Dim FromSystem  ' Computer Name of source host system
    Dim VMStateCodes ' Array of VM State Codes - to display kinder status that integers
    Dim VMStuff  ' Virtual Server Info instance
    Dim SourcevmCollection ' Collection of VMs from Source Server
    Dim vm   ' instance of a VM from collection loop
    Dim objVM  ' instance of a VM
    Dim MoveVM  ' instance of a VM
    Dim colHardDisks  ' Collection of VHDs in a VM
    Dim objDrive  ' instance of a VHD from collection loop
    Dim objHardDisk  ' instance of a VHD
    Dim NameLength   '   for tidy display of VM names
    Dim MaxNameLength  '  for tidy display of VM names
    Dim VMCount  ' counter for all VMs
    Dim MoveCount  ' counter for VMs to move - VMs that are currently running (nicer demo!)
    Dim MoveName  ' local var with VM name
    Dim VMInfo(100)  ' array of VM names to be moved
    Dim TargetHost  ' The server where all the runnning VM's will be moved
    Dim TargetHostServer ' The server where all the runnning VM's will be moved
    Dim TargetHostAvailable ' Boolean to track if the target host is pingable
    Dim MyShell   '  Used to find local host name, if required
    Dim MyEnvironment  '  Used to find local host name, if required


    ' Set Target host variables
    'TargetHost = "192.168.0.3" ' put name or IP Address of target server here, NOT preceeded by two slashes
    'TargetHost = "WS03VS01"  ' put name or IP Address of target server here, NOT preceeded by two slashes
    TargetHost = "CHANGEME"  ' put name or IP Address of target server here, NOT preceeded by two slashes


    '
    ' Should not need to change anything after here to get script to run!
    '
    TargetHostServer = "\\" & TargetHost
    TargetHostAvailable = TRUE  ' setting default before ping test

    Call Housekeeping()

    VMCount = 0
    Set SourcevmCollection = VMStuff.VirtualMachines
    '
    ' Get maximum Name Length for Formatting - just makes some things look nice
    '
    For each vm in SourcevmCollection
     NameLength = Len(vm.Name)
     If MaxNameLength < NameLength Then
      MaxNameLength = NameLength
     End If
     '
     ' If VM is "Running" them target for WARM migration to other host system
     ' Here is where the systems are identifed at migration targets
     '
     if VMStateCodes(vm.State) = "Running" Then
      VMInfo(VMCount) = vm.Name
      VMCount = VMCount + 1
     End If
    Next

    For each vm in SourcevmCollection
       Wscript.Echo VbCrLf & "--------------------------------------------------------------------"
     Wscript.Echo "     " & vm.Name & Space(MaxNameLength - Len(vm.Name)) & " - State is:  " & VMStateCodes(vm.State)
    Next

    Wscript.Echo VbCrLf & "--------------------------------------------------------------------"
    Wscript.Echo "--------------------------------------------------------------------"
    if VMCount = 0 then
     Wscript.Echo VbCrLf & "No VMs are runnning, nothing to warm move"
    End If

    '****************************************************
    ' Engine is here!!!!!
    '****************************************************
    if TargetHostAvailable = TRUE Then
     For MoveCount = 1 to VMCount
      MoveName = VMInfo(MoveCount-1)
      Wscript.Echo "Processing " & MoveName & Space(MaxNameLength - Len(MoveName)) & " VM " & MoveCount & " of " & VMCount & "..."
      Set objVM = VMStuff.FindVirtualMachine(MoveName)

      ' Save State of all running VMs
      Call SaveVMState(MoveName)

      ' Generage .BAT and .VBS for each of the running VMs
      Call MakeScriptFiles(MoveName)

     Wscript.Echo VbCrLf & "--------------------------------------------------------------------"
     Next
    End If

     

    Wscript.Echo VbCrLf & "--------------------------------------------------------------------"
    Wscript.Echo "--------------------------------------------------------------------"
    'End Script

    '******************************************************************************
    '******************************************************************************
    '******************************************************************************
    '******************************************************************************
    '*                                                                            *
    '*                                                                            *
    '*            Subroutines to make the stuff up top look nicer!                *
    '*                                                                            *
    '*                                                                            *
    '*                                                                            *
    '******************************************************************************
    '******************************************************************************
    '******************************************************************************
    '******************************************************************************


    '******************************************************************************
    '*                                                                            *
    '*     Do some if the ugly stuff that I didn't want to put at the front       *
    '*     of the script                                                          *
    '*                                                                            *
    '******************************************************************************
    Sub Housekeeping()

     Dim objPing ' use for ping test - poached from TechNet examples
     Dim objStatus  ' use for ping test - poached from TechNet examples

     Wscript.Echo VbCrLf & "--------------------------------------------------------------------"
     Wscript.Echo VbCrLf & "-                                                                  -"
     Wscript.Echo VbCrLf & "-                                                                  -"
     Wscript.Echo VbCrLf & "-                        WarmMove.VBS                              -"
     Wscript.Echo VbCrLf & "-                                                                  -"
     Wscript.Echo VbCrLf & "-                             by                                   -"
     Wscript.Echo VbCrLf & "-                                                                  -"
     Wscript.Echo VbCrLf & "-             John Kelbley                                 -"
     Wscript.Echo VbCrLf & "-                                                                  -"
     Wscript.Echo VbCrLf & "-                                                                  -"
     Wscript.Echo VbCrLf & "-    Finds running VM's running under Virtual Server 2005          -"
     Wscript.Echo VbCrLf & "-    on local system, pauses them, moves them to specified target  -"
     Wscript.Echo VbCrLf & "-    and unpauses them!                                            -"
     Wscript.Echo VbCrLf & "-                                                                  -"
     Wscript.Echo VbCrLf & "-    Please read comments in script carefully before running!      -"
     Wscript.Echo VbCrLf & "-                                                                  -"
     Wscript.Echo VbCrLf & "-    This is a sample, and is not meant for use in production.     -"
     Wscript.Echo VbCrLf & "-                                                                  -"
     Wscript.Echo VbCrLf & "-    Script expects NO paramameter - the name of the target        -"
     Wscript.Echo VbCrLf & "-    Virtual Server host is specified internally                   -"
     Wscript.Echo VbCrLf & "-    (I WANT YOU TO LOOK AT THE SCRIPT!!!!)                        -"
     Wscript.Echo VbCrLf & "-                                                                  -"
     Wscript.Echo VbCrLf & "-                                                                  -"
     Wscript.Echo VbCrLf & "-      Example:   cscript MoveWarm.VBS                             -"
     Wscript.Echo VbCrLf & "-                                                                  -"
     Wscript.Echo VbCrLf & "-                                                                  -"
     Wscript.Echo VbCrLf & "-                                                                  -"
     Wscript.Echo VbCrLf & "--------------------------------------------------------------------"

     ' Populate VM State Array
     VMStateCodes = Array("Invalid", "Turned Off","Saved","Turning On", "Restoring", "Running", "Paused", "Saving",_
        "Turning Off", "Merging Drives", "Deleting Machine")

     ' Create VS application instance
     Set VMStuff = WScript.CreateObject("VirtualServer.Application")

     Wscript.Echo VbCrLf & "Source Host System (this box!): " & FromSystem

     Wscript.Echo VbCrLf & "--------------------------------------------------------------------"

     Wscript.Echo "Default VM configuration path: " & VMStuff.DefaultVMConfigurationPath
     Wscript.Echo "Default VN configuration path: " & VMStuff.DefaultVNConfigurationPath


     ' Check to see if remote target system is accessible...
     '
     Wscript.Echo VbCrLf & "Pinging  " & TargetHost & " to see if warm migration can occour..."
     Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("select * from Win32_PingStatus where address = '" & TargetHost & "'")
     For Each objStatus in objPing
      If IsNull(objStatus.StatusCode) or objStatus.StatusCode<>0 Then
       TargetHostAvailable = FALSE
       WScript.Echo VbCrLf & "machine " & TargetHost & " is not reachable"
       WScript.Echo "CANNOT EXECUTE Warm migration" & VbCrLf 
      End If
     Next
     '***********************************************************************************
     ' should add a check to see if remote system has Virual Server installed, too!!!!!
     '***********************************************************************************
    End Sub

     

    '******************************************************************************
    '*                                                                            *
    '*     Saves the State of Running VMs - creating a "hibernated" VM            *
    '*                                                                            *
    '******************************************************************************
    Sub SaveVMState(subVMName)
     Wscript.Echo Space(MaxNameLength + 12) & "Saving State"
     While objVM.State > 2 ' if the VM is not turned off of saved...
      if VMStateCodes(objVM.State)  = "Running" Then
       objVM.Save()
     End If
      wscript.sleep(1000)        
      Wscript.Echo Space(MaxNameLength + 12) & VMStateCodes(objVM.State)
     Wend
    End Sub


    '******************************************************************************
    '*                                                                            *
    '*     Generate .BAT and .VBS files to handle the migration of VM files       *
    '*                                                                            *
    '******************************************************************************
    Sub MakeScriptFiles(subVMName)

     Dim LocalBatchFile 
     Dim LocalVBSFile 
     Dim LocalFSO
     Dim LocalFile
     Dim FileFSO
     Dim FileToCheck
     Dim FoundFolder
     Dim FromFileConfig
     Dim ToFileConfig
     Dim ConfigFolder
     Dim FromFileState
     Dim ToFileState
     Dim FromFileVHD
     Dim ToFileVHD
     Dim FromFileVUD
     Dim ToFileVUD
     Dim CommandString
     Dim objShell

     Set MoveVM = VMStuff.FindVirtualMachine(subVMName)
     Wscript.Echo VbCrLf & "Beginning Move Processing..."

     ' ***********************************************************************************************************************
     ' ***********************************************************************************************************************
     ' code to create .BAT to copy files and call .VBS to register config file and start image
     ' ***********************************************************************************************************************
     ' ***********************************************************************************************************************
     LocalVBSFile = subVMName & "_" & "local.vbs" 
     LocalBatchFile = subVMName & "_" & "local.bat" 


     Set LocalFSO = CreateObject ("scripting.FileSystemObject")
     Set LocalFile = LocalFSO.CreateTextFile(LocalBatchFile)

     ' start writing batch file
     LocalFile.WriteLine "@Echo off"
     LocalFile.WriteLine "Echo ---------------------------------------------------------"

     ' Construct destination UNC for Config File to copy
     ' Need the path for the parent directory of the file to copy to make Xcopy work right...this seemed easier than parsing the string!
     FromFileConfig = MoveVM.File
     Set FileFSO = CreateObject("Scripting.FileSystemObject")
     Set FileToCheck = FileFSO.GetFile(FromFileConfig)
     FoundFolder = FileFSO.GetParentFolderName(FileToCheck)
     ConfigFolder = FoundFolder ' Saving this for the VBS later...
     ToFileConfig = TargetHostServer & "\" & Left(FoundFolder, 1) & "$" & Mid(FoundFolder, 3, 1024)
     CommandString = "xcopy " & CHR(34) & FromFileConfig & CHR(34) & " " & CHR(34) & ToFileConfig & "\" & CHR(34) & " /Y"
     LocalFile.WriteLine "echo Copying " &  FromFileConfig & " to remote, please wait..."
     LocalFile.WriteLine CommandString
     LocalFile.WriteLine "Echo ---------------------------------------------------------"

     ' Construct destination UNC for Save State File n
     FromFileState = MoveVM.SavedStateFilePath
     Set FileFSO = CreateObject("Scripting.FileSystemObject")
     Set FileToCheck = FileFSO.GetFile(FromFileState)
     FoundFolder = FileFSO.GetParentFolderName(FileToCheck)
     ToFileState = TargetHostServer & "\" & Left(FoundFolder , 1) & "$" & Mid(FoundFolder, 3, 1024)
     CommandString = "xcopy " & CHR(34) & FromFileState & CHR(34) & " " & CHR(34) & ToFileState & "\" & CHR(34) & " /Y"
     LocalFile.WriteLine "echo Copying " &  FromFileState & " to remote, please wait..."
     LocalFile.WriteLine CommandString
     LocalFile.WriteLine "Echo ---------------------------------------------------------"

     ' Take Care of VHD (drive image) and VUD files (undo files) - can be more than one for a Guest...
     Set colHardDisks = MoveVM.HardDiskConnections
     For Each objDrive in colHardDisks
             FromFileVHD = objDrive.HardDisk.File
      Set FileFSO = CreateObject("Scripting.FileSystemObject")
      Set FileToCheck = FileFSO.GetFile(FromFileVHD)
      FoundFolder = FileFSO.GetParentFolderName(FileToCheck)
      ToFileVHD = TargetHostServer & "\" & Left(FoundFolder, 1) & "$" & Mid(FoundFolder, 3, 1024)
      CommandString = "xcopy " & CHR(34) & FromFileVHD & CHR(34) & " " & CHR(34) & ToFileVHD & "\" & CHR(34) & " /Y"
      LocalFile.WriteLine "echo Copying " &  FromFileVHD & " to remote, please wait...(big file!)"
      LocalFile.WriteLine CommandString
      LocalFile.WriteLine "Echo ---------------------------------------------------------"
            If MoveVM.Undoable Then
         FromFileVUD = objDrive.UndoHardDisk.File
       Set FileFSO = CreateObject("Scripting.FileSystemObject")
       Set FileToCheck = FileFSO.GetFile(FromFileVUD)
       FoundFolder = FileFSO.GetParentFolderName(FileToCheck)
       ToFileVUD = TargetHostServer & "\" & Left(FoundFolder, 1) & "$" & Mid(FoundFolder, 3, 1024)
       CommandString = "xcopy " & CHR(34) & FromFileVUD & CHR(34) & " " & CHR(34) & ToFileVUD & "\" & CHR(34) & " /Y"
       LocalFile.WriteLine "echo Copying " &  FromFileVUD & " to remote, please wait..."
       LocalFile.WriteLine CommandString
       LocalFile.WriteLine "Echo ---------------------------------------------------------"
      End If
     Next

     ' Call .VBS to register configuration file and start the VPC image
     LocalFile.WriteLine "Echo Calling script to register config file on remote and start VM..."
     LocalFile.WriteLine "CScript " & CHR(34) & LocalVBSFile & CHR(34) & " //NoLogo"

     LocalFile.WriteLine "Echo  End of Batch file"
     LocalFile.WriteLine "Echo ---------------------------------------------------------"
     LocalFile.Close  'close batch file


     ' ***********************************************************************************************************************
     ' ***********************************************************************************************************************
     ' code to create .VBS to register config file with Target Virtual Server
     ' ***********************************************************************************************************************
     ' ***********************************************************************************************************************
     Set LocalFSO = CreateObject ("scripting.FileSystemObject")
     Set LocalFile = LocalFSO.CreateTextFile(LocalVBSFile)

     ' start writing .VBS file
     ' LocalFile.WriteLine "On Error Resume Next"
     LocalFile.WriteLine "Set objVS = CreateObject(" & CHR(34) & "VirtualServer.Application" & CHR(34) & ", "  & CHR(34) & TargetHostServer & CHR(34) & ")"
     LocalFile.WriteLine "errReturn = objVS.RegisterVirtualMachine(" & CHR(34) & subVMName  & CHR(34) & "," & CHR(34) & ConfigFolder & CHR(34) & ")"
     LocalFile.WriteLine "Set objVM = objVS.FindVirtualMachine(" & CHR(34) & subVMName  & CHR(34) & ")"
     LocalFile.WriteLine "objVM.Startup()"

     LocalFile.Close  'close .VBS file
     
     Set objShell = Wscript.CreateObject("Wscript.Shell")
     CommandString = "%comspec% /c " & CHR(34) & LocalBatchFile & CHR(34)
     Wscript.Echo VbCrLf & "Command string:  " & CommandString
     objShell.Run(CommandString)

     Wscript.Echo VbCrLf & "End Move Processing"
    End Sub

  • Read my draft whitepaper on Virtual Server versus Virtual PC

    I just posted a new article: a draft whitepaper that I'm writing to compare Virtual Server and Virtual PC (http://blogs.technet.com/megand/articles/category/8232.aspx). If you read it, I'd appreciate hearing your comments and suggestions.

    Update: This whitepaper is now available on Microsot.com at http://download.microsoft.com/download/1/4/d/14d17804-1659-435d-bc11-657a6da308c0/VSvsVPC.doc. Thanks to those of you who gave me comments on the draft.

    Thanks!
    Megan

  • Draft whitepaper: Virtual Server versus Virtual PC

    Update: This whitepaper is now available on Microsot.com at http://download.microsoft.com/download/1/4/d/14d17804-1659-435d-bc11-657a6da308c0/VSvsVPC.doc. Thanks to those of you who gave me comments on the draft.

    ------------------------------------------------------------------------

    Here's a draft of a whitepaper I'm working on that will ultimately be posted on Microsoft.com. Comments and suggestions would be appreciated. Thanks!

    ** This information is provided as-is with no warranties. **

    Introduction

    This whitepaper explains the difference between Virtual PC and Virtual Server, and discusses when you would use one versus the other. Virtual PC is Microsoft's virtual machine solution for desktop applications, and Virtual Server is its solution for server applications. While they share many features in common, because of their different usage scenarios, a number of their features are different.

    Virtual PC provides an optimal experience for a desktop user who wants to run one or more additional desktop operating systems on his or her PC. The user interface is fairly simple and there is extensive integration between the host operating system running on the physical computer and the guest operating systems running in virtual machines. For example, users can easily drag and drop data between virtual machines and their host. In addition, the sound and display features of virtual machines are much the same as physical computers.
    On the other hand, Virtual Server provides features to support the requirements of enterprise server applications and administration. For example, due to more stringent security requirements, there is less integration between the host and guest operating systems. Virtual Server also provides a number of features to support greater manageability, scalability, and extensibility.

    Virtual Server versus Virtual PC

    The fundamental difference between Virtual PC and Virtual Server is that Virtual PC is designed for desktop (or "client" or "PC") operating systems and Virtual Server is designed for server operating systems.

    While the two products have many features in common, they serve different needs, so there are crucial differences between them as well. For example, because it supports desktop applications, the Virtual PC user interface is designed with the typical desktop user in mind. The configuration options are relatively simple and easy for the average computer user to understand and use. On the other hand, Virtual Server is designed for running enterprise server operating systems and applications. It provides the configuration and management options that are required for server management, and these necessarily make the user interface more complex. As a result, making effective use of Virtual Server requires some degree of knowledge of server technologies.

    Usage scenarios for Virtual PC

    As already mentioned, Virtual PC is designed for running desktop operating systems and applications. Some primary usage scenarios for Virtual PC are:

    • Support for legacy desktop applications. For example if you have applications that were designed to run on Windows 98 that won’t run on your new Windows XP computer, you can run Windows 98 and your application in a virtual machine.
    • Help desk. If you're a help desk technician, you could set up a variety of desktop environments inside virtual machines to duplicate those of your clients, so you could reproduce problems when clients call in.
    • Desktop application testing. If you're a developer, you can use virtual machines to test desktop applications in a variety of operating system environnments.
    • Training. If you're a trainer, you can set up your training programs to run inside virtual machines. This way you can offer more types of classes. In addition, you can set up the virtual machines to discard changes that were made during the class. This dramatically reduces setup time.

    These scenarios are described in detail in the Microsoft Virtual PC 2004 Technical Overview white paper, available the Microsoft Web site at http://go.microsoft.com/fwlink/?LinkId=45404. The uses that you can find for Virtual PC are limited only by your resourcefulness, though. For example, you might set up Virtual PC for your family to use for browsing the Internet. That way you don’t have to worry about anything they download because it won’t affect the host operating system. If the virtual machine becomes corrupted or infected with a virus, you can simply delete it and start over.

    Usage scenarios for Virtual Server

    Virtual Server is designed for running enterprise server operating systems and applications. Some primary usage scenarios for Virtual Server are:

    • Test and development for server applications. You can use Virtual Server in situations that require rapid and frequent server reconfiguration, as required with development and testing, product demonstrations, and training. You can create a library of virtual machines in different server configurations without needing to dedicate a physical computer to each configuration. Your virtual machines then can be deployed from this library with a few mouse clicks. You can also set up the virtual machines to use Undo disks so that changes can be discarded, or you can use differencing disks to create a variety of configurations from one base disk. This is useful for many testing scenarios, such as software patch testing.
    • Server consolidation. Many companies have departmental and branch office servers that are underutilized. This is often because different departmental or branch office applications were written for different operating systems or different versions of the same operating system. To reduce the number of physical servers you must maintain, you can migrate these applications and operating systems into virtual machines running under Virtual Server on a single physical server.
    • Application migration. Many companies have server applications that require an older operating system, such as Microsoft Windows NT® Server 4.0. To upgrade to a newer, more resiliant system would require rewriting the applications, but doing this is often prohibitively costly. Instead of rewriting the applications though, you can move older operating systems and server applications into virtual machines running under Virtual Server and Microsoft Windows Server 2003.

    Shared features

    Virtual Server and Virtual PC have a number of features in common, such as:

    • Basic file architecture. Both Virtual Server and Virtual PC use the same file types for configuration and resource files. For example, virtual machine configuration files are .vmc files, virtual hard disk files are .vhd files, and saved state files are .vsv files. This common file architecture allows files (within certain limitations) to be shared between Virtual Server and Virtual PC.
    • Networking. Both Virtual Server and Virtual PC allow networking between virtual machines and physical machines. Virtual Server allows you to create and configure virtual networks, however.
    • Virtual machine control options. Options for controlling virtual machines, such as starting, stopping, shutting down, saving state are the same for Virtual Server and Virtual PC.
    • Disk features. Undo and differencing disks are available in both Virtual Server and Virtual PC.

    Feature differences

    While they share many features in common, due to the different usage scenarios there are also a number of differences between Virtual Server and Virtual PC, which are described in this topic.

    Unique features of Virtual PC

    To support the requirements of desktop users, Virtual PC provides the following features that are not available in Virtual Server:

    • Supported operating systems. For Virtual PC, both the host operating system (the one you install Virtual PC itself on) and the guest operating systems (the ones running inside virtual machines) must be desktop operating systems for Microsoft to support them. Supported host operating systems include Windows XP Professional, Windows 2000 Professional, or Windows XP Tablet PC Edition. Supported guest operating systems include these plus a number of others, such as Windows 98 and MS-DOS 6.22. See the Virtual PC documentation for a complete list.
    • Emulated sound card. Both Virtual Server and Virtual PC provide integration with the physical computer's mouse and keyboard. Only Virtual PC, however, provides an emulated sound card to support the needs and expectations of desktop users.
    • Extensive host-guest integration. One of the key goals in the design of Virtual PC was user convenience in a desktop environment. Users can switch between operating systems as easily as they switch between applications by simply clicking on the window containing the virtual machine. Users can copy, paste, drag and drop between the guest and host operating systems. They also can dynamically resize the guest operating system’s desktop when resizing the virtual machine window and share folders between operating systems
    • Shared networking. So that users can easily configure a connection to an external network that uses the host computer's network adapter, Virtual PC offers shared networking through network address translation (NAT).

    Unique features of Virtual Server

    To support the requirements of an enterprise environment, Virtual Server provides the following features that are not available (or needed) in Virtual PC:

    Supported operating systems

    For Virtual Server, supported host and guest operating systems are server operating systems, except for Windows XP Professional, which is supported as a host operating system. Supported host operating systems are Windows Server 2003 (Standard, Enterprise, and Datacenter Editions), Windows Small Business Server (Standard and Premium Editions), and Windows XP Professional. Supported guest operating systems include these plus Windows 2000 Server, all editions except Enterprise as well as Windows NT Server 4.0 Enterprise Edition SP6a. See the Virtual Server documentation for more information.

    Administration
    • Remote management. You can administer Virtual Server remotely by using the Web-based Administration Web site. You can also access and administer virtual machines remotely by using Virtual Machine Remote Control (VMRC).
    • Scripted management.  You can manage Virtual Server and its virtual machines by using the COM API. For more information, see the Virtual Server Programmer’s Guide included with the product.
    • WMI integration. Virtual Server provides WMI counters to the host operating system, which can be integrated into a non-Microsoft management solution or passed to Microsoft Operations Manager for monitoring and alerting.
    • Compatibility with Windows Server System management products. To deploy and manage virtual machines, you can use products such as Automated Deployment Services, Systems Management Server 2003 SP1, and Microsoft Operations Manager (MOM) 2005. There is a MOM management pack available for Virtual Server 2005.
    • Delegated administration. You can delegate administration and provide secure, authenticated guest access.
    • System event logging. Virtual Server logs events on the host operating system event log, which can be integrated into a non-Microsoft management solution, or passed to Microsoft Operations Manager for alerting. Virtual Server can send event notices—such as when a virtual machine session has stopped functioning—to external scripts.
    Scalability
    • SCSI support. Virtual Server supports virtual SCSI disks up to 2 TB in size.
    • Host multi-processor support.  Virtual Server scales across multiple processors on the host computer - up to 32. Each running virtual machine can take advantage of up to one CPU. For example, on a 32-processor host computer, you could allocate your CPU capacity so that 31 simultaneously running virtual machines would each use up to one CPU, leaving a CPU free for the host operating system. 
    • Multithreading. Virtual Server 2005 is a multithreaded application that runs as a system service, with each virtual machine running in its own thread of execution. In contrast, Virtual PC is a single-threaded application, and all simultaneously running virtual machines run on the same processor.
    • RAM. Support for up to 3.6 GB RAM per virtual machine.

    Security
    • Support for Secure Sockets Layer (SSL) security. For access to the Administration Website and the Virtual Machine Remote Control (VMRC) client, Virtual Server supports SSL security, as well as NTLM and Kerberos V5 authentication.
    • Configurable user context for virtual machines. By default, a virtual machine runs under the account of the user who turned it on. For added security, you can configure each virtual machine to run under a specified user account. Virtual machine scripts also run under this account, and it must be configured before virtual machine scripts can run.
    Resource management
    • Flexible memory and CPU allocation. Virtual Server supports flexible memory configuration and dynamic CPU resource allocation for each virtual machine.
    Other enterprise features
    • Virtual networking. Virtual Server allows you to create an unlimited number of virtual networks, each with its own virtual DHCP server. It also allows you to configure DNS and WINS servers, IP addresses and IP address lease time.
    • Two-node clustering. Virtual Server provides simple two-node failover from one virtual machine to another for testing and development.

    Additional Information

    The following are references to additional information and resources for using Virtual PC and Virtual Server.

  • Just released: Virtual Server Management Pack for MOM 2005

    This Management Pack is an add-on for Microsoft Operations Manager (MOM) 2005. It monitors the health, availability, and performance of Virtual Server. You can download it from the Microsoft Web site at: http://www.microsoft.com/downloads/details.aspx?FamilyId=B8BBF08F-134A-46CE-9D63-FB7EF5258059&displaylang=en.
     
    Overview of the Virtual Server Management Pack
    The Microsof Virtual Server 2005 section of the Virtual Server Management Pack monitors the performance and availability of Virtual Server and virtual machines. By detecting and providing alerts for critical events and performance indicators, this Management Pack helps you correct and prevent possible service outages. As a result, this Management Pack can play an important role in ensuring that Virtual Server and virtual machines are available and working correctly.

    By using embedded expertise, this Management Pack provides alerts for performance, health, and availability conditions that indicate problems. In some cases it can even identify issues before they become critical, allowing you to maintain a high level of availability and performance for Virtual Server and your virtual machines. As a result, this Management Pack can reduce the cost of ownership by enabling proactive management and reducing resolution times for identified issues.

  • New article on estimating system capacity

    I just posted an article on figuring out how much system capacity a host computer will need in order to run a given set of virtual machines. You can find it in the Deployment section (http://blogs.technet.com/megand/articles/category/8299.aspx).

    Happy estimating,
    Megan

  • Estimating system capacity requirements

    I've gotten a number of queries about estimating how many virtual machines can be run on a given host computer. In order to provide a general answer from which you can extrapolate for your own situation, I'm going to approach this issue from the other side -- estimating the host system capacity required to run the workload created by a given set of virtual machines.

    This is actually a fairly complicated issue because so many factors affect virtual machine performance, such as:

    • Amount of physical RAM in the host computer
    • Amount of RAM assigned to each guest operating system
    • Workload for each guest operating system
    • Total workload for all running guest operating systems
    • Workload for the host operating system
    • Type of guest operating system
    • Number of physical NICs used by virtual machines
    • Speed of the NICs (100Mb vs. 1Gb, switched vs. non-switched)
    • Speed and number of host processors
    • Number of hard disk spindles
    • Type of physical hard disk (IDE, SCSI, Fibre, iSCSI, RAID 5, etc)
    • Number of host bus adapters
    • Virtual Server CPU resource allocation settings

    There are some general approaches and rules of thumb that you can use for your estimate, though, which I'll cover in this article.

    1. Gather workload data
     
    As a first step in estimating the required system capacity, you can gather information about the workload of the servers you plan to virtualize. You'll need to determine the CPU, RAM, and hard disk, and network usage for each candidate server's workload.  I understand that Unisys has a tool called Sentinel that can help in this respect, at least in the hands of one of their consultants. Aogtech is another company that provides decision support tools (http://www.aogtech.com) as well as BMC with their Perform and Predict tool (http://www.bmc.com/products/proddocview/0,2832,19052_19429_26203_8707,00.html). Platespin has also just announced a product that is designed for this very purpose - PowerRecon (http://www.platespin.com/products/PowerRecon.aspx). I haven't tried any of these tools. If you have, the rest of us would like to hear about your experiences. You can also use Microsoft Operations Manager (MOM) to determine CPU utilization.
     
    2. Decide how to group workloads

    Once you've estimated the workloads of the physical servers that you want to virtualize, you can determine which ones to run together on the same instance of Virtual Server. It's best to run dissimilar workloads together. In other words, you'll want to deploy workloads that have similar resource requirements on different instances of Virtual Server. For example, mix network-intensive applications with those that are CPU-intensive and hard disk-intensive. This avoids excessive demands being made on a single system resource, such as processors. For additional best practices, see "Improving performance" in the Virtual Server 2005 Administrator's Guide.

    3. Calculate system requirements

    Finally, you need to determine the system requirements for each host computer, based on the workloads you intend to run on it. You'll likely need to adjust your estimates and your workloads iteratively until you find a sensible balance between a proposed workload for a host computer and the hardware required to run it.

    You can use the guidelines and formulas in the Planning Guide included in the Solution Accelerator for Consolidating and Migrating LOB Applications for calculating how much system capacity you'll need for a given set of server workloads (http://www.microsoft.com/technet/itsolutions/ucs/lob/lobsa/default.mspx). The following are some quick rules of thumb you can use when estimating system capacity requirements:
     
    RAM:
    Required RAM is the sum of RAM needed for each proposed server workload plus a 20 percent buffer per virtual machine plus the RAM required by the host. In Virtual Server, any memory assigned to a virtual machine is fully committed. If you assign 1 GB of RAM to a virtual machine, when it's running that 1 GB of RAM will not be available for any other purpose. As a rule of thumb, a virtual machine requires the RAM that's assigned to it plus an additional 20 MB. The host operating system also needs some available RAM, and that amount is variable. It depends on how many files are open, whether network connections are active, etc. In practice, the host operating system takes up about 15% of the total RAM in a system with 2 GB RAM or less, or 10% of the total RAM in a system with more than 2 GB.
     
    Processor:
    Required CPU capacity is the sum of CPU needed for each proposed server workload plus that required for the host. Host processors can be overcommitted, and when that happens, the virtual machines are time-sliced in the same way that threads are time-sliced by the system. If the multi-programming level (MPL) -- e.g., the number of virtual machines that can run on one processor in any instant -- exceeds 4.0, then virtual machine response time may suffer. You can estimate MPL  as the sum of the average utilization of the virtual machine divided by 100 times the number of virtual machines divided by the number of host logical processors.
     
                MPL = Sum(vm_util1,…,vm_utiln) / 100 * total_VMs / total_host_logical_processors
     
    The number virtual machines that can be running reasonably well depends on how active they are.
     
    Disk:
    Required hard disk space is the sum of hard disk space needed for each proposed server workload plus that required for the host. Quantifying disk is difficult because this activity is bursty. When configuring virtual machines, it's important to locate the virtual hard drives (VHDs) on different physical drives if the amount of activity is significant.
     
    Network:
    Required network capacity is the sum needed for each proposed server workload plus that required for the host. It's best to dedicate a NIC to the host. Networking has similar issues to disk due to bursty activity. If the total bandwidth being used by the virtual machines begins to approach the maximum bandwidth supported by a physical NIC, then you need to add additional physical NICs to the host machine.