• subscribe
May 11, 2009 12:00 AM

Running SQL Server on Hyper-V

What you need to know
SQL Server Pro
InstantDoc ID #102074

Calculating VM Memory
To size the memory for a SQL Server VM, simply create the VM with the same amount of memory allocated to that VM on the Hyper-V host. If the host is memory-constrained, this is a good time to add more memory. Hyper-V supports up to 64GB per VM, and the host can support up to 1TB of physical memory. To take advantage of memory beyond 4GB, the VM's guest OS must be 64-bit. It's important to note that the combined RAM requirements of the active VMs can't be more than the amount of physical RAM in the Hyper-V host. For instance, a 32GB Hyper-V host couldn't support five 8GB VMs.

To calculate the Hyper-V host memory requirements, you first need to add about 32MB of memory for virtualization overhead to each VM's RAM, then aggregate all the VMs' RAM. In addition, you need to reserve memory for the host. As a general rule of thumb, reserving 512MB of RAM for the Hyper-V host is adequate. The hypervisor itself requires about 300MB. So, you can use the following formula to calculate host memory requirements:

Sum(VM RAM + 32MB) + 512MB + 300MB

You can find a handy Excel spreadsheet for calculating Hyper-V host memory requirements at the Hyper-V RAM Calculator.xls web page. A useful tip to remember regarding memory is that adding memory to the VM can help boost its I/O performance by enabling SQL Server to use the additional memory for caching.

Using Hyper-V Synthetic Network Devices
Another configuration setting that can have a big impact on server performance under Hyper-V is making sure the SQL Server VM uses Hyper-V's new synthetic network devices. Synthetic network devices take full advantage of the Hyper-V high-performance VM bus architecture. For SQL Server virtualization, it's important that the VM uses the new synthetic network adapter. The legacy network drivers are provided in Hyper-V for compatibility with older OSs, but they're processed by threads in the parent partition and don't provide the same level of performance as the newer synthetic network devices.

Drivers for the new synthetic network devices are part of Windows Server 2008 and Windows Server 2008 R2. If you use them as guest OSs in your VMs, the synthetic device drivers will be present. However, these synthetic device drivers aren't part of Windows Server 2003 or earlier server OSs. If you're running Windows Server 2003 as your guest OS, you need to install the Hyper-V Integration Components. The Integration Components include the synthetic network device drivers as well as enhanced mouse and video support and host time-synchronization. You can ensure that you're using the synthetic devices by connecting to the VM, then opening Device Manager. Expand the Network adapters node and check for the value Microsoft VMBus Network Adapter, like you see in Figure 3.


Figure 3: Checking for the synthetic network device drivers (click to enlarge)


To install the Integration Components, open the Hyper-V Manager, right-click the VM, and select Connect. In the Virtual Machine Console that appears, select Action, Insert Integration Services Setup Disk. Then just click Next throughout the wizard screens.

Calculating Available Network Adapter Capacity
One of the easiest performance factors to overlook when performing server consolidation is your available network adapter capacity. When you consolidate multiple physical SQL Server systems on a single server, you're essentially taking all the network traffic that was previously directed to multiple servers and their NICs and funneling them through fewer NICs on the Hyper-V hosts. To calculate the network capacity required, you can use the formula

VM NICs x NIC Speed x NIC Utilization = NIC Requirements

where VM NICs are the number of virtual machines that will be active on the host, NIC Speed is the speed of the NICs, and NIC Utilization is the average network utilization of those NICs.

To calculate the host's total network capacity, take the number of NICs in the host and multiply that number by their speed, as is shown in the formula

Number of NICs x NIC speed = Total NIC Capacity

If you divide the Total NIC Capacity by the NIC Requirements, you'll have an idea of how many Hyper-V host network adapters you'll need. Ideally, you should allocate a separate host NIC for each VM. Another recommended practice is to reserve an additional network adapter for Hyper-V host management. For added security, it's a good idea to put the management NIC on a separate network and not with the NICs used by the production VMs.

If you're familiar with ESX Server, you might be wondering about NIC teaming. NIC teaming lets you bind multiple host network adapters together. Although Hyper-V doesn't support NIC teaming, you can implement it if you buy the right NICs.

Virtually SQL
Virtualization is a mature technology that's ready for prime time. While the Hyper-V platform can provide production-level performance for SQL Server, you still need to be sure to correctly size your VMs as well as take advantage of Hyper-V features such as multiple virtual processors, 64-bit guest support, and synthetic network devices.



ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here