SQL Server Technical Article
Writers: Anthony T. Mann, President, Mann Publishing Group
Published: March 2007
Applies To: SQL Server 2005
Summary: This white paper discusses the advantages of using SQL Server 2005 in a virtual environment and the factors an organization must consider when determining whether to virtualize SQL Server 2005.
This is a preliminary document and may be changed substantially prior to final commercial release of the software described herein.
The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication.
This White Paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.
Unless otherwise noted, the companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted in examples herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred.
2007 Microsoft Corporation. All rights reserved.
Microsoft, Windows, Windows NT, and Windows Server are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
All other trademarks are property of their respective owners.
Table of Contents
Introduction to Virtual Environments 2
Running SQL Server in a Virtual Environment 2
Licensing Considerations 3
Example 1 4
Example 2 4
Example 3 5
In recent years, there has been a surge of interest in virtualization technologies. This interest is generated by the fact that virtualization can lower overall IT costs. Companies of all sizes are looking at ways to use this relatively new technology to cut IT costs and increase server and application performance. There are many ways virtualization can benefit an organization, including:
Server Consolidation – Production environments can benefit from virtualization because multiple existing physical servers that are under-utilized can possibly be combined into a single server. Alternatively, when an IT organization is ready to purchase new servers, it may be more cost-effective to purchase a single server that has more resources than to purchase several less powerful servers. This approach enables a single server to employ virtual environments without sacrificing functionality or performance. Consolidating servers reduces the overall footprint required by your data center, including rack and floor space.
Licensing Savings – In certain scenarios, an organization can save on Microsoft® Windows® and SQL Server™ 2005 licensing costs by implementing virtualization. Licensing is discussed later in this paper.
Higher Utilization – Many servers implemented in organizations today are under-utilized. In some cases, a server can be using as little as 15 percent of its processing power. Virtualization technology enables IT departments to better utilize existing servers, while still providing a separate operating environment as required by some applications.
Power Savings – By implementing virtualization in your organization, you can reduce the power and cooling requirements in your data center. Fewer cooling fans and power supplies in the data center means lower power requirements and costs.
Centralized Administration – With multiple virtual environments running on a single server, it becomes easy to administer, from a single location, environments that use Remote Desktop or Microsoft System Center Virtual Machine Manager. For more information about Microsoft System Center Virtual Machine Manager, see Introducing System Center Virtual Machine Manager.
Disaster Recovery and High Availability – Production environments can benefit from virtualization because it provides a separate disaster recovery for high availability environments. For SQL Server 2005, this environment can use any strategy, such as database mirroring, active or passive clustering, replication, and log shipping.
Testing Environment – Many IT organizations do not have adequate budgets for setting up testing environments. By using virtualization, testing environments can be easily created, destroyed, and reused for different testing scenarios.
Training – Training centers benefit from virtualization because deploying virtual machines is as simple as copying files to multiple physical machines. This approach enables the training center to create a virtual environment for each student.
Legacy Applications – Older legacy applications benefit from virtualization because an IT department does not have to run outdated and unsupported hardware. The virtual environment can be built to emulate the environment required by the legacy application.
To determine if virtualization can benefit your organization, you must consider all aspects of the overall environment, including hardware performance, licensing costs, deployment, administration, maintenance, and more. As most applications use an underlying database, virtualizing SQL Server is a compelling scenario. SQL Server 2005 Enterprise Edition has favorable licensing policies over other editions of SQL Server 2005; these are discussed later in this paper. This paper also discusses the overall concept of virtualization and factors to consider when deciding whether to use SQL Server in a virtual environment.
While this paper focuses on SQL Server licenses, you must also comply with Windows licensing requirements in your virtual environments. The following resources will help you to determine proper Windows licensing requirements in addition to SQL Server 2005 licenses:
Licensing Microsoft Server Products with Microsoft Virtual Server and Other Virtual Machine Technologies. This 32-page white paper discusses all possible licensing scenarios for using Windows in a virtual environment.
Windows Server Virtualization Calculator. This is an interactive calculator to help you determine the number of Windows licenses you need by entering the number of servers, processors, and virtual machines used within your organization.
Introduction to Virtual Environments
Virtualization, virtual environment, and virtual operating environment (VOE) are all synonymous terms used to describe the concept of hosting software in an emulated environment. To achieve virtualization, application software must be installed onto a physical server and configured to run one or more virtual environments, called virtual machines (VMs).
Many applications can benefit from virtualization, including Microsoft Exchange Server, Microsoft Systems Management Server (SMS), Microsoft Operations Manager (MOM), Microsoft Customer Relationship Management (CRM), custom Line of Business (LOB) applications, and many others. Most of these applications store data in a Microsoft SQL Server database. Therefore, virtualizing SQL Server is an important topic for all organizations.
Microsoft has two separate virtual environment applications—Microsoft Virtual PC 2004 (VPC) and Microsoft Virtual Server 2005 (VS). Virtual PC 2004 runs on a workstation, while Virtual Server 2005 runs on a server. If your organization wants to virtualize SQL Server, it is likely that Virtual Server 2005 is the virtual environment to use because it runs on a server platform. Figure 1 shows a system diagram of the relationship between a physical machine and a virtual environment.
Figure 1 System diagram of a virtual environment
Figure 1 shows a physical server that contains four CPUs running Microsoft Windows Server™ 2003. Virtual Server 2005 is also installed on the physical server and is configured with four virtual machines, each running a virtual instance of Microsoft Windows Server 2003 that accesses a single virtual processor. Each of the virtual machines runs a virtual instance of SQL Server 2005. The configuration shown in Figure 1 is used as the basis for the examples discussed later in this paper.
Running SQL Server in a Virtual Environment
There are two ways to separate SQL Server applications into logical units of isolation. One is to run SQL Server in multiple instances inside a physical environment. Another way is to run SQL Server inside a virtual environment. Running multiple SQL Server instances in a physical environment isolates each instance at the application level. In other words, it is up to each SQL Server instance to isolate system resources, data, and security from the others. Multiple SQL Server installations that each run inside a virtual environment are completely isolated from each other as if each were running on a separate physical server; this provides isolation at the operating system level.
It is important to note that one benefit of a virtual environment is that it can run any operating system supported by the virtual technology application. For example, one virtual environment can be running Windows Server 2003, another can run Windows NT® 4.0, and yet another one can run Windows Server 2000. Each one of these environments is configured as a separate virtual machine running on a physical server and must comply with that specific operating system’s licensing requirements.
A virtual environment consists of one or more virtual machines. Each virtual machine requires its own operating system, application stack, and resources, including disk space, memory, and processor cycles. If you plan to virtualize SQL Server 2005, you must consider the resources required for each virtual machine. A virtual machine requires approximately 32 MB more than the same configuration running on a physical machine. This additional memory is required by Virtual Server 2005 to manage the virtual environment.
Another consideration is disk space and performance. Because each virtual machine runs a virtual instance of Windows, each one manages paging to disk, just as physical environments do. However, each virtual machine is doing this at the same time, which results in real disk operations on the physical machine. These factors must be considered when selecting the type of hardware that will run virtual environments.
Running multiple physical instances of SQL Server within an environment is well-suited for applications that have very high throughput or those that must be highly scalable or require some level of isolation. Applications that use multiple physical instances cannot be easily rebuilt or reset to a pristine state. Therefore, running multiple physical instances in a training environment may not be the best choice. Virtual SQL Server 2005 instances are well-suited for medium and low throughput applications, such as training environments. Virtual environments decouple applications and data from the underlying hardware. This enables a virtual machine to be copied from one server to another very easily.
Following are the three main factors to consider when determining the number of SQL Server 2005 licenses that you need for your organization:
Licensing Model – Choices are:
Per Processor – Enables a company to purchase one license for each physical processor that is installed on the server. Multi-core processors are counted as single processors for the purpose of licensing. With the Per Processor licensing model, it does not matter how many users or devices connect to the server. For physical SQL Server 2005 instances, you need one license for each processor. For virtual SQL Server 2005 instances, you need only a single license for each virtual environment because each can access only one virtual processor.
Server/CAL – Enables a company to purchase one license for an instance of SQL Server, regardless of the number of processors, and one Client Access License (CAL) for each user or device that will connect to the SQL Server instance. This is true for physical and virtual SQL Server 2005 instances.
SQL Server 2005 Edition – SQL Server 2005 Enterprise Edition has licensing advantages over the Standard and Workgroup editions. If you are using Enterprise Edition and the Per Processor licensing model, licensing all physical processors in the server requires no additional licenses for virtual SQL Server 2005 instances. For example, if your organization uses a server that contains four physical processors with SQL Server 2005 that is licensed for four physical processors, but also uses six virtual machines (each containing one or more instances of SQL Server 2005), you only need four Per Processor licenses. On the other hand, if you are using Standard Edition or Workgroup Edition, in the same scenario you would need six Per Processor virtual licenses as well as the four physical processor licenses, for a total of ten.
Virtualization – Dictates how instances of SQL Server will be used. Choices are:
Multi-Instance – Multiple physical instances of SQL Server 2005 are running in a physical environment or multiple virtual instances are running in a virtual environment. Multiple instances within a single environment (either virtual or physical) only need to be licensed the same as if a single instance were running in that environment. This concept is illustrated in Example 2 and Example 3 later in this paper.
Virtual – One or more virtual instances of SQL Server are running in a virtual environment.
To help you decipher these factors when calculating SQL Server 2005 licenses, examples are included in the following sections.
Note: The following examples show how to calculate SQL Server 2005 licenses. For a complete picture of the total number of licenses required, you also need to consider Windows licenses and other application licenses that run on the server. See the links to resources earlier in this paper for more information on calculating Windows licenses.
The first example of licensing is for an organization that wants to run three physical instances of SQL Server 2005 Standard Edition without any virtual environments, using the Per Processor licensing model. The server running this scenario has four processors, as shown in Figure 2.
Figure 2 SQL Server 2005 Standard Edition using Per Processor licensing and no virtual instances
Using the Per Processor licensing model, you must have one license for each physical processor that is used by physical instances of SQL Server 2005. Figure 2 shows three physical instances, but licenses are required for only one instance. Therefore, the number of SQL Server 2005 licenses required for this scenario is four (one for each physical processor).
The second example of licensing builds upon Example 1. The scenario in this example also uses SQL Server 2005 Standard Edition on a server with four processors, but also uses five virtual machines, each running two instances. This is illustrated in Figure 3.
Figure 3 SQL Server 2005 Standard Edition using Per Processor licensing and five virtual machines, each containing two virtual instances
Example 1 shows that you need four SQL Server 2005 licenses for the physical environment. Building upon that example, each of the five virtual environments shown in Figure 3 has two virtual instances of SQL Server 2005. Because each virtual environment can only access a single virtual processor, only one Per Processor SQL Server 2005 license is needed for each of the five virtual environments. Multiple instances inside each environment need licenses for only one instance. Therefore, five additional Per Processor SQL Server 2005 licenses are needed for the virtual environments shown this example, for a total of nine required SQL Server 2005 licenses.
This final example builds upon Example 2. It uses the same scenario, but uses the Enterprise edition of SQL Server 2005 instead of Standard Edition. Enterprise Edition is licensed the same as the other editions of SQL Server 2005, with one notable exception. If your organization licenses all physical processors for use with SQL Server 2005, no additional licenses are needed for virtual SQL Server 2005 instances. Figure 3 shows five virtual environments running SQL Server 2005 and four physical processors. Therefore, using SQL Server 2005 Enterprise Edition and licensing all four physical processors and all five virtual environments requires only four SQL Server 2005 licenses.
Alternatively, suppose your organization were to license only two of the four physical processors. Two Per Processor licenses are needed for the physical SQL Server 2005 instances and four Per Processor licenses are needed for the virtual SQL Server 2005 instances, for a total of six. In this scenario, licensing all physical processors for SQL Server 2005 Enterprise Edition saves the cost of two licenses.
Microsoft provides free tools and technologies to enable quick and effective deployment of SQL Server 2005 in a virtual environment. If an organization uses Virtual Server 2005 R2, the following tools and technologies can help deployment:
PXE Booting – Preboot eXecution Environment (PXE) technology to enable a virtual machine to boot and install software from a network using a virtual emulated Ethernet card.
Virtual Server Migration Toolkit – Provides command-line tools to automate physical machine to virtual machine migration. This technology makes it possible to mimic the SQL Server environment that resides on a physical machine to make it run exactly the same way in a virtual machine. The Virtual Server Migration Toolkit uses Automated Deployment Services (ADS) for virtual machine rollout to a large number of servers.
Running SQL Server 2005 in a virtual environment has numerous benefits. Virtual environments can effectively consolidate servers so that the number of total servers needed by an organization is minimized. Virtualization also enables legacy applications and databases to run in a technologically current environment and can save floor space and power expenses.
If your organization is considering virtualizing SQL Server 2005, Enterprise Edition has licensing advantages over the Standard and Workgroup editions when you license all available physical processors. If all available physical processors are licensed, Enterprise Edition does not require additional SQL Server 2005 licenses for virtual machines.
While virtualization has many benefits, it is not the right solution for every case. For very high throughput applications and database applications that must be highly scalable, virtualization may not be the best choice. In these scenarios, running multiple instances of SQL Server 2005 would be a better choice.
For more information:
Did this paper help you? Please give us your feedback. On a scale of 1 (poor) to 5 (excellent), how would you rate this paper?