Best practices for Virtual Server
Best practices
Ensure that the computer has adequate memory and disk space
The host operating system and each virtual machine that is running at the same time all require adequate memory. To calculate the total memory needed, you must allocate enough memory to each virtual machine to run its operating system in addition to the memory required by the host operating system.
It is also essential that you ensure that you have adequate disk space. You must have adequate disk space for each guest operating system that you plan to deploy along with enough disk space for the host operating system. You must also take into account the extra space needed for each virtual machine's paging file, all dynamically expanding virtual hard disks, and the space needed to save the contents of each virtual machine's RAM when putting the virtual machine into a saved state.
For information about calculating memory and disk space requirements for the host and guest operating systems, see System requirements for Virtual Server.
Enable large memory support where appropriate
You should enable Physical Address Extension (PAE) X86 on your host operating system if it is appropriate to do so. PAE X86 allows the host operating system to access more than 4 gigabytes (GB) of physical memory. You should not, however, enable PAE X86 on the virtual machines. Virtual machines can only access up to 3.6 GB of memory each; thus this technology is not necessary.
For more information about PAE X86, see "Enterprise Memory Architecture" at the Microsoft Web site.
Disable hyper-threading technology
Under heavy computing workloads, hyper-threading technology, which allows a single processor to appear as two processors, may cause poor server performance. Because workload is dynamic and can vary quickly, we recommended disabling hyper-threading on the physical server to prevent this potential problem.
Note
Changes have been made to the product that affect this information. For updated information, see the Virtual Server 2005 Release Notes.
Correctly configure physical network adapters
Virtual machines that require a high level of network activity can burden the physical network adapters on the physical computer. This in turn can make it difficult to connect to the host operating system or administer the host operating system using the network adapters. To alleviate this problem, we recommend that the physical computer be configured with two or more network adapters. One of the network adapters should be dedicated for use by only the host operating system. To do this, unbind the Virtual Machine Network service from this dedicated network adapter. You should unbind all network protocols (for example Transmission Control Protocol/Internet Protocol [TCP/IP] and Internetwork Packet Exchange/Sequenced Packet Exchange [IPX/SPX]) except for the Virtual Machine Network service from all of the other network adapters that you will use for virtual machines. This will ensure that these network adapters are dedicated to Virtual Server networking.
Use NTFS as the file system on the host operating system and on computers running the Administration Website
Using the NTFS file system access permissions allows you to restrict access to the Administration Website to only those user accounts that have Execute permissions for the folder containing the Web application. Furthermore, the security of the virtual machine configuration (.vmc) files, the virtual hard disk (.vhd) files, and the virtual network configuration (.vnc) files all rely on the NTFS file system.
For more information, see Securing Virtual Server.
Keep virtual machine components in a single folder
Virtual machines consist of two primary components, each with a unique file defining their configuration, as shown in the following table.
Data type | File name |
---|---|
Virtual machine general configuration |
Virtual machine name.vmc |
Virtual hard disk |
Name.vhd |
For ease of management, we recommend that you keep each of these files in a single folder representing the virtual machine. Other files associated with this virtual machine, such as undo disk and saved-state files, will be automatically placed in this same folder because these files are created in the same location as the virtual machine configuration (.vmc) file.
Create your virtual machine configuration files in appropriate folders
By default, all virtual machine configuration (.vmc) files and the related files (for example, virtual hard disk [.vhd] files) are created in the Shared Virtual Machines folder. As this might not be appropriate for your installation, you can create these files in a folder structure that more closely resembles your organization. Doing this might allow you to configure security for these files more appropriately.
For more information, see Securing Virtual Server.
Install Virtual Machine Additions
Virtual Machine Additions is a set of features that improve the integration of the host and guest operating systems. It also improves the performance and manageability of the guest operating system.
For more information about Virtual Machine Additions, see Installing Virtual Machine Additions.
Disable host time synchronization when running a domain controller inside a virtual machine
You should not enable host time synchronization on a virtual machine that is configured as a domain controller. You should instead use an external source for time synchronization.
For more information, see Install Virtual Machine Additions.
Run Sysprep on your virtual hard disks
A significant feature of Virtual Server is the portability of the virtual hard disk (.vhd) files. However, in order to use a .vhd file that contains an installed operating system on multiple virtual machines, you must first run Sysprep on the virtual hard disk. You should run Sysprep on the original virtual hard disk before you create additional copies of the virtual hard disk. Sysprep configures various operating system settings on the virtual hard disk to ensure that every copy of the operating system is unique when you distribute it to additional virtual machines.
Sysprep can be found on any Microsoft Windows Server™ 2003 or Microsoft Windows® XP Professional operating system CD. To obtain Sysprep, open the Support\Tools folder on any Windows XP Professional or Windows Server 2003 operating system CD, and then open Deploy.cab.
For more information about using Sysprep, see the Microsoft Windows Corporate Deployment Tools User's Guide (Deploy.chm). Deploy.chm is included in the Deploy.cab file in the Support folder on the Windows Server 2003 operating system CD. For more information, see Virtual Server Resources.
Do not use the VMRC client over a Terminal Services connection
You may experience poor mouse control if you attempt to use Terminal Services to access the host operating system and then use the Virtual Machine Remote Control (VMRC) client to access a guest operating system. You can, however, use Terminal Services to access the guest operating system directly, provided the guest operating system supports Terminal Services.
Important
Virtual Server is not a replacement for Terminal Services. The VMRC client does not operate in the same manner as Terminal Services or Remote Desktop because multiple users can use the VMRC client to connect to the same virtual machine, and each user can access the guest operating system without the knowledge of the other users. This is by design for training and lab scenarios where one user wants to demonstrate a task to other users who are connected to the same remote session. If you want exclusive access to a virtual machine, then you should connect to it by using Terminal Services or Remote Desktop rather than the VMRC client.
For more information about the limitations of using the VMRC client, see Using the VMRC client to access virtual machines.
Shut down virtual machines when making changes
When moving or copying virtual machines or any virtual machine components such as virtual hard disks, we recommend that you first shut down the virtual machine.
Ensure adequate storage space when using Undo Disks
The Undo Disks feature saves changes to a virtual disk in a separate file, which is stored in the same location as the virtual machine configuration (.vmc) file. Changes to the virtual hard disk are saved in the undo disk file until you either delete the changes, which erases the undo disk file, or commit the changes, which saves the changes to the original virtual disk. Depending on the number of changes saved in the undo disk file, it can grow quite large—up to the maximum size allocated to the parent disk. If you use Undo Disks, ensure that there is enough storage space for the undo disk file. By default, the virtual machine configuration file and undo disk file are stored in a folder with the same name as the virtual machine.
For more information, see Managing Virtual Hard Disks.
Write-protect the parent disk before using a differencing disk
You should always write-protect or lock the parent disk before using a related differencing disk. Otherwise, if the parent disk is modified by some other process, all differencing disks related to it become invalid, and all data written to the differencing disks is lost. Note that you also need to reconfigure the virtual machine to use the differencing disk instead of the parent disk. If you do write-protect the disk and do not reconfigure the virtual machine, you will receive an error when you try to start the virtual machine because it cannot use a read-only disk. For instructions, see Add or remove a virtual hard disk.
Use Relative Weight
Using the Relative Weight option on the CPU Resource Allocation page allows Virtual Server to adjust the CPU usage of each virtual machine dynamically, based on the existing workload. On the other hand, if you use the Reserved Capacity and Maximum Capacity options, you may need to actively monitor and adjust the settings to ensure you have the optimum configuration. In order to use Relative Weight rather than Reserved Capacity and Maximum Capacity, set Reserved Capacity to 0 percent and Maximum Capacity to 100 percent.
For more information, see Configuring CPU resources for virtual machines.
Ensure proper configuration for high disk-use scenarios
Under extreme workloads, the guest operating system may report a disk time-out. This can occur when a physical disk experiences extremely high usage due to a particular virtual machine configuration.
There are several ways to avoid this problem:
Use multiple physical computer spindles.
Use redundant array of independent disks (RAID) for the physical computer.
Use physical computer SCSI disks instead of IDE disks. SCSI disks allow for multiple simultaneous disk transactions.
If none of the previous options is feasible, you can modify a registry key in the affected guest operating system. For more information about modifying the registry, see article 818877, "Cluster Servers May Experience Connection Timeouts to Drives After You Install or Upgrade to the Windows Clustering Feature in Windows Server 2003," in the Microsoft Knowledge Base. You should change the default value of the TimeOutValue registry key described in this article from 45 to 90.
Warning
Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on your computer.
Understand the implications of using Virtual Server with Virtual PC
When using Virtual Server and Virtual PC together, there are several points to consider:
- Sound cards: Virtual Server does not include an emulated sound card in its virtual machines, while Virtual PC does. If you will be using a virtual machine on both Virtual Server and Virtual PC, you should disable the emulated sound card in Virtual PC. This will prevent the sound card's Plug and Play capability from causing errors on the virtual machine that you created with Virtual Server.
- SCSI support: Virtual Server provides SCSI support while Virtual PC does not. If you create a virtual machine with virtual SCSI disks on Virtual Server, the SCSI disks will be ignored if you move the virtual machine to Virtual PC. This can lead to negative consequences in many situations, for example if the virtual machine page file is on the SCSI disk or if you are trying to use a SCSI disk as the startup disk. If you plan to regularly move virtual hard disks between machines created with Virtual PC and Virtual Server, we recommend that you attach the virtual hard disks only to a virtual IDE bus in Virtual Server.
- Configuration files: The virtual machine configuration (.vmc) files are typically compatible between Virtual Server and Virtual PC. However, if a virtual machine is in a saved state, do not move the .vmc file between Virtual Server and Virtual PC. The saved-state (.vsv) files are incompatible between the two products.
- CD-ROM drives: Although Virtual Server allows for virtual machines with multiple CD-ROM drives, Virtual PC supports virtual machines with only one CD-ROM drive. If you are moving virtual machines between the two products, you should configure only a single CD-ROM drive on the virtual machine and attach it to secondary channel 0, which is the default setting.
Secure Virtual Server and its associated components
You should take steps to secure Virtual Server and its associated components, including the physical computer, the Administration Website, the virtual machines, and the virtual machine components such as the virtual hard disks and virtual networks.
For more detailed information about securing Virtual Server and the components of Virtual Server, see Securing Virtual Server.
In addition to the steps provided in Securing Virtual Server, you should secure your virtual machines just as you would secure a physical computer. For example:
- Enable a firewall on each virtual machine.
- Apply the latest security patches and updates to the operating system and to the applications that are running on each virtual machine.
- Install antivirus software on each virtual machine, as appropriate.
- Implement additional security lockdown procedures on each virtual machine, as appropriate.
Stop the Virtual Server service prior to shutting down the host operating system
Before you shut down the host operating system, be sure that you first stop the Virtual Server service. This will ensure that the virtual machines are turned off in the manner that you have specified for them. Otherwise, the virtual machines may be powered off rather than turned off, which can result in a loss of data.
Similarly, if you are using an uninterruptible power supply (UPS), you should ensure that when you start the UPS you also run a script to accomplish the following tasks sequentially:
- Save the state of every virtual machine.
- Stop the Virtual Server service.
- Shut down the host operating system.
You should ensure that your UPS can provide power long enough to accomplish all of these tasks.
For more information about stopping Virtual Server, see Starting and stopping Virtual Server.
Optimize the physical computer, Virtual Server, and the virtual machines for best performance
Several techniques can be used to optimize the performance of Virtual Server. These are described in Monitoring and Improving Performance. Review these techniques and implement as many of them as are appropriate for your environment.
Use appropriate high-availability techniques
You can use server clusters along with Virtual Server for training purposes or to test failover between two virtual machines on a single physical computer. You cannot, however, use server clusters with Virtual Server to fail over between host operating systems or virtual machines running on separate physical computers. Server clusters are typically used with Virtual Server in a test or training environment and are not intended as a high-availability solution in a production environment. If you require high availability of your physical computer, you should implement other methods to achieve this, such as the use of fault-tolerant hardware.
Perform proper backup techniques
You should define and implement an appropriate backup strategy for Virtual Server and your virtual machines. There are multiple methods for doing this. For more information, see Backing up and restoring Virtual Server.
Use the event log when troubleshooting
Virtual Server uses Windows event logging to record information about important events. You can view the event log using Event Viewer. We recommend that you review the event log when troubleshooting Virtual Server errors. For more information, see Help and Support Center for the Windows Server 2003 operating systems.