What you need to know to get it right
Server virtualization technologies have become so commonplace that they're the de facto standard for server deployment in many organizations. It's becoming more and more common to run into data center environments that operate with the assumption that all new servers will be deployed as virtual machines (VMs), unless there's some specific reason not to virtualize. This is a significant change from even just a few years ago when the situation was reversed and servers were deployed on physical equipment unless there was a specific reason to virtualize.
So, what about Microsoft SharePoint? Should you virtualize some or all of a SharePoint environment and take advantage of the consolidation, optimization, and flexibility options that a virtualization infrastructure provides? The reality is that SharePoint environments, particularly those running SharePoint Server 2010, can be robustly deployed on virtual servers as long as sufficient resources are allocated to virtual guests and the virtual hosts are scaled correctly. Deploying SharePoint improperly in a virtual environment can lead to slowness and other performance problems, and can decrease management's confidence in virtualization as a whole. So, before you virtualize SharePoint, it's vital that you know the requirements and design criteria for both the virtualization technology and SharePoint.
Virtualization Infrastructure Requirements and Recommendations
The key to a stable and high-performance virtualized SharePoint environment is using the proper architecture in the virtualization hosts. Out-of-the-box settings and slow disks might work for a test environment, but specific requirements need to be met when building the host system for proper performance to be achieved. Therefore, be sure to follow these minimum requirements when you design the virtualization host infrastructure:
- The processors must support hardware-assisted virtualization, which is available in processors that include a virtualization option. Specifically, this means processors with Intel Virtualization Technology (Intel VT) or AMD Virtualization (AMD-V) technology.
- Hardware-enforced data execution prevention (DEP) must be available and enabled.
- SharePoint guests must be deployed on a Hyper-V hypervisor or a third-party hypervisor that's part of the Server Virtualization Validation Program. (For information about this program, see the sidebar "Microsoft's Virtualization Support Story.")
- Sufficient memory must be allocated for the host OS. If you're using Hyper-V, you need to reserve at least 1GB of RAM for use by the Hyper-V host. If you're using a third-party hypervisor, check with the individual provider to determine the minimum amount of memory required.
- A dedicated NIC must be allocated for host management. This NIC must be separate from the NICs used by the VMs.
- Use multiple storage arrays or sets of disk spindles. Best practice is to allocate a dedicated storage array or set of disk spindles for the host OS, another for the guest OS, and at least two more for logs and database volumes in virtualized SQL Server sessions.
- Fixed-size or pass-through Virtual Hard Disks (VHDs) must be used. All VHDs used by SharePoint servers need to be either fixed-size or pass-through (raw) disks that are directly connected to a volume on the host storage. Pass-through disks give you the fastest performance, which is highly recommended for SharePoint servers. Fixed-size disks are faster than dynamically expanding disks, which can suffer performance hits when they're resizing.
- A 2:1 ratio for the number of virtual processors to physical cores must be used. A virtual host that has too many allocated virtual CPUs can be overloaded and perform poorly. Therefore, you need to have a 2:1 ratio (or less) for the virtual processor to physical core ratio. For example, if your host is a 2-processor quad-core system (8 cores total), the maximum number of virtual processors that can be allocated and running at any one time is 16. If each VM is allocated 4 virtual processors, the number of running VMs is capped at 4 on that host.
In addition to these technical requirements for the virtualization host, you need to keep in mind these recommendations when you design your virtual environment:
- You should allocate a dedicated NIC for failover. If you're using virtual host failover software such as Hyper-V Live Migration, you should use a dedicated NIC for the failover.
- You should give as much memory and as many processor cores to your virtual hosts as your budget allows. Virtual hosts with multiple multicore processors and large amounts of RAM (64GB or more) are becoming commonplace because of the virtual host software's ability to take advantage of the additional resources and because host failover solutions require additional resources. When it comes to sizing virtualization hosts, there's a sweet spot that balances the cost of the additional components against the need to have fewer hosts. Generally, the virtualization overhead required to run virtual servers is only 5 percent, so the cost of adding memory and processor cores is more than made up by the advantages of having those additional resources.
- You should run only the virtualization software and the virtualization role on the virtual hosts. (The two exceptions are antivirus and backup software.) Overloading a virtual host with other software or other server roles can significantly degrade guest performance. In addition, from a Windows Server licensing perspective, running any roles other than the virtualization role on a Windows server requires one additional license. However, if the host runs only virtualization host software, the host OS isn't counted when determining the number of Windows licenses that are used as part of Microsoft's virtualization licensing program.
- You shouldn't install all the SharePoint roles and the SQL Server role on the same VM for performance reasons. Even small environments should use at least two VMs—one for the SQL Server database role and one for the SharePoint front-end and application roles.
Software Recommendations and Licensing Notes
It's highly recommended that you use the latest virtualization host software from your particular vendor. For example, the latest version of Hyper-V is included with Windows Server 2008 R2. Hyper-V 2.0 has significant performance improvements over Hyper-V 1.0, such as I/O improvements for fixed-size VHDs. Hyper-V 2.0 also has new features such as Core Parking, Live Migration, TCP Offload, Jumbo Frames, and support for Second-Level Address Translation (SLAT)–enabled processors. If you're virtualizing SharePoint on Hyper-V, you should also consider deploying the virtual host on Server Core to minimize its security footprint, OS disk overhead (2GB versus 10GB), and memory use.
If you're managing multiple virtual host machines, centralized management software is also recommended. For example, Microsoft offers System Center Virtual Machine Manager (VMM) 2008 R2 for virtualization management. It allows for physical to virtual (P2V) server migration, server template libraries, and management of both Hyper-V and VMware hosts and guests through a single console.
Microsoft provides cost-effective virtualization licensing options for Windows Server, which lets organizations save significantly on Windows Server licenses when virtualizing servers. The three types of virtualization server licenses are:
- Windows Server Standard Edition, which allows a single physical OS environment (POSE) or a single virtual OS environment (VOSE) with each Standard Edition license. Note that a virtualization host that's dedicated to virtualization tasks doesn't consume a license, regardless if it's running Windows Server (such as in the case of Hyper-V).
- Windows Server Enterprise Edition, which allows for up to four VOSEs to be run at any one time on the host. Note that only running VMs are counted, so if a VM is shut down, it doesn't count against the four concurrent VOSEs permitted by the Enterprise Edition license.
- Windows Server Datacenter Edition, which is a per-processor license for the virtual host (e.g., a dual quad-core server would require two licenses) that grants you the right to run an unlimited number of VMs on the host.
These licensing options apply not only to Hyper-V but also to any hypervisor that's part of the Server Virtualization Validation Program. For organizations with a significant investment in virtualization infrastructure, buying the appropriate number of Datacenter Edition licenses to cover all the virtual hosts is the most cost effective.
Virtualization of the Web Role
Any SharePoint role or service can be virtualized, so which SharePoint server should you virtualize first? The best candidate is the SharePoint server that has the web role, which means it runs Microsoft IIS and handles all web requests sent to SharePoint. Table 1 shows resource guidelines for virtualized SharePoint servers that have the web and other roles.
As you can see in Table 1, a SharePoint server that holds only the web role (aka web server) should be allocated two virtual processors and a minimum of 6GB of RAM, along with a single VHD for the OS. If a web server needs to handle more web traffic, you can simply allocate additional web servers using the same specifications. The size of the host OS VHD should be at least 12GB plus the total amount of memory allocated to the VM, but it's good practice to size this volume larger (typically around 50GB to 100GB) to allow the host OS to grow in size.
Virtualization of the Application Role
The next likely candidates for virtualization are the SharePoint servers with the application role (aka application servers). Application servers can include various service applications, such as Access Service, PerformancePoint, and Managed Metadata. Generally, this excludes search services. Although they’re technically service applications, they're typically classified under different server roles for architectural purposes. Thus, I'll talk about the search roles separately.
As Table 1 shows, the typical virtualized application server consists of a VM with two virtual processors and a minimum of 6GB of RAM allocated to it. It needs a single VHD that's presized in the 50GB to 100GB range for the guest OS. Note that these numbers can vary, depending on how many service applications are installed on a single machine and how many people use the applications.
Smaller organizations sometimes combine the application and web roles on one SharePoint server. Combining the roles will increase the memory and processor requirements of the guest session.
Virtualization of the Search Roles
Third in line for virtualization are the SharePoint search servers, which are servers that hold one or more of the search roles. The search roles include the query, index, and crawl roles. The query role provides querying functionality, whereas the index role provides indexing functionality. SharePoint 2010 doesn't have the same single-index restrictions that Microsoft Office SharePoint Server (MOSS) 2007 did, which makes this role more scalable and allows for more distributed deployment models. The crawl role represents the crawler component used by SharePoint to crawl documents for search purposes. Multiple crawl components can be created on different servers for redundancy.
A typical virtualized search server consists of a VM with four virtual processors and 8GB of RAM allocated to it (see Table 1), assuming that SharePoint 2010's out-of-box search functionality is being used. If FAST Search Server 2010 is being used, the RAM requirements will be in the 12GB to 16GB range. Like the application server numbers, the search server numbers can vary, depending on how many items are being indexed and how heavy the search requirements are.
The search server needs a single VHD that's presized in the 50GB to 100GB range for the guest OS and another VHD for the index and query corpus. The size of this VHD will vary, depending on how much full text is being indexed from various sources.
Smaller organizations sometimes use one SharePoint server for the search and web roles. Combining these roles can increase the memory and processor requirements of the guest session.
Combining All the Roles on a Virtualized Server
Many organizations combine the web, application, and search roles on a single virtualized SharePoint server. This is often the case in small organizations that want to deploy SharePoint across two guest sessions to be highly available, but have a small number of guests.
Although combining these roles results in additional load on an individual server session, many of the same processor and memory guidelines that apply to a dedicated web server apply to a combined server. As Table 1 shows, a typical virtualized combined server consists of a VM with four virtual processors and 10GB to 16GB of RAM allocated to it, depending on how many users the system will support. It has a single VHD presized in the 50GB to 100GB range for the guest OS and another VHD for the index and query corpus.
SharePoint administrators familiar with MOSS 2007 might be dismayed at the memory requirements of SharePoint 2010, but the fact is that SharePoint 2010 requires much more memory than previous versions. RAM requirements can be lessened, however, by turning off service applications that aren't required by the business.
Virtualization of the Database Role
The SQL Server database role is the last and most challenging server role to virtualize. The server with the database role (aka database server) needs the lion's share of RAM and processor allocation. A minimum of four virtual processors and 8GB of RAM should be allocated to the database server. For best performance, though, at least 12GB of RAM should be allocated.
Like SharePoint VMs, SQL Server VMs require either fixed-sized or pass-through VHDs. The same disk considerations that would apply to a physical SQL Server machines apply to virtual SQL Server machines, so be sure to allocate enough disk spindles for the database and log volumes. In addition, be sure to follow standard best practices for SharePoint–SQL Server optimization, such as presizing tempdb and moving it to fast disk volumes.
Keep in mind that these guidelines are simply guidelines. Actual performance will be dictated by the type of disk, hardware architecture, and other factors. Some organizations calculate their hardware requirements, then simply add RAM or reduce the number of databases on a single SQL Server session.
Microsoft supports both database mirroring and clustering as high-availability options in a virtualized SQL Server environment. In addition, host failover options such as Hyper-V Live Migration are supported for SQL Server VMs. One fact to note, however, is that all SQL Server databases within a SharePoint farm need to be restored from the same point in time as the other databases. This applies to virtualization snapshot technology or SAN-based snapshots of SQL Server databases.
Sample Virtualized SharePoint 2010 Architectures
There are many ways to deploy SharePoint 2010 in a virtualized environment. However, some designs are more common than others and reflect common needs across many organizations. For example, high availability is becoming a must for the crucial document management and collaboration functionality in SharePoint. All the new high-availability options in SharePoint 2010 are available for virtual environments and can be easier to deploy because of the flexibility that virtualization provides.
Figure 1 illustrates a small virtualized SharePoint 2010 environment with all components running on a single virtual host. This type of deployment doesn't have any built-in high availability or disaster recovery, but it's the simplest environment to set up and it can still take advantage of virtualization benefits and scalability. Table 2 shows sample server specifications for an environment of this size. These specifications assume there are 500 active users in the environment.
Figure 2 illustrates a virtualization architecture that provides a high level of availability, disaster tolerance, and scalability for an environment with 2,000 active users. The entire SharePoint environment is deployed across two virtual hosts, which provides for high availability of the environment. SQL Server databases are mirrored from one virtual guest to another, and a witness SQL Server instance monitors the principal SQL Server instance, providing for automatic failover in the event the virtual host or virtual guest fails.
These high-availability and disaster-recovery options are possible without the need for shared-storage, SAN, or host-availability solutions. Table 3 lists the sample virtual host and guest architecture guidelines for the solution in Figure 2.
Virtualization technologies allow for a high degree of scalability and aren't limited to small and mid-sized organizations. For example, the architecture shown in Figure 3 allows for tens of thousands of SharePoint users, full disaster tolerance, and high availability, all with the high performance expected from SharePoint. In this particular model, multiple SQL Server machines are used for the various SharePoint databases, with one used for content databases, one for service application databases, and one for the search databases. Server groups are created for different SharePoint server roles, and the web tier is broken into two components: one for users and another for crawl and administration. In this example, host-based failover solutions such as Hyper-V Live Migration could also conceivably provide for failover of individual guest sessions between failed hosts. The virtual host and guest architecture guidelines for the solution in Figure 3 would be similar to the guidelines in Table 3, but scaled larger.
These three samples architectures illustrate some of the potential design options that are available for a virtual SharePoint environment. Every environment is unique, and specifics will vary based on business and technology needs. However, you can use these sample architectures as a starting point for developing a high-performance virtualized SharePoint 2010 environment.
The Virtualization Advantage
Server virtualization can provide significant advantages and can let SharePoint architects design highly available and disaster-tolerant environments more easily than could be done solely on physical hardware. In addition, virtualized environments have consolidation, optimization, and cost-saving benefits that make them ideal for many organizations. With proper thought into host and guest virtualization architecture, you can deploy a fault-tolerant and high-performance SharePoint environment that lets you fully capture the benefits of virtualization for your organization.