Virtualization is a rapidly changing technology that's useful for server consolidation, testing and deployment, training, and disaster recovery. Stay current with this hot technology by reviewing these best practices for running SQL Server in a virtual environment.
7. Say Yes to 64-bit Host Support.
Both VMware's VMware Server and Microsoft Virtual Server 2005 Release 2 (R2) support 64-bit architecture on the host side, which raises host memory capabilities to 1TB, enabling many more active virtual machines (VMs). VMware Server also supports 64-bit guests.
6. Allocate Enough Memory.
Each VM needs enough of the host's physical memory to support the guest server, plus 32MB per VM to cover VM overhead. For example, if you migrate a SQL Server system that requires 1GB (1024MB) of RAM, be sure to allocate 1056MB (1024MB + 32MB) for the VM. Always leave RAM for the host—about 512MB.
5. Use a Virtual SCSI Controller.
Although you can choose between using a virtual IDE controller and using a virtual SCSI controller, usually the virtual IDE controller is the default. However, you can get up to a 20 percent performance boost by using the virtual SCSI controller instead.
4. Use Different Drives or a SAN.
Create the VM's virtual hard drive on a different physical drive from the host's OS to reduce drive-spindle contention and improve the performance of SQL Server running in a VM. Better yet, use a SAN, which can increase I/O capabilities, improving VM performance.
3. Preallocate Storage.
Most virtual hard drives are configured with a default setting to dynamically expand as VM storage needs increase. This default setting saves storage space but slows performance. Instead, choose the preallocate storage setting (aka Fixed VHD) to avoid this performance hit.
2. Add Clustering.
Important for server consolidation, clustering combines with virtualization to increase availability at either host of the VM guest levels. Virtual Server 2005 R2, VMware Server, and ESX Server support VM guest clustering, in which each guest participates as a cluster node with nodes located on other hosts. In addition, Virtual Server 2005 R2 supports host clustering, in which the host can be the cluster node and—in the event of a failure— the host and all of its VMs can fail over to a backup and be automatically restarted.
1. Use Multicore CPUs.
Multicore CPUs from AMD and Intel support virtualization directly in the CPU. (AMD's virtualization support is always enabled; Intel's must be enabled through a BIOS setting.) Virtualization products run one thread per VM in each separate core, and adding cores increases the performance of multiple VMs. Note that at the guest level, SQL Server is licensed by CPU, and virtual CPUs configured in the guest VM must be licensed.