Table of contents. Technical white paper

Size: px
Start display at page:

Download "Table of contents. Technical white paper"

Transcription

1 Technical white paper Provisioning Highly Available SQL Server Virtual Machines for the HP App Map for Database Consolidation for Microsoft SQL Server on ConvergedSystem 700x Table of contents Executive summary... 3 HP ConvergedSystem 700x introduction... 3 HP ConvergedSystem 700x overview... 4 HP ConvergedSystem 700x hardware configurations for the DBCAM... 4 Management software components... 6 HP DBCAM overview... 7 Small DBCAM overview... 8 Medium DBCAM overview... 8 Large DBCAM overview... 8 VM overview... 8 Clustered Shared Volumes... 9 DBCAM VM provisioning... 9 Overview... 9 Virtual machine variants Creating VHDs for DBCAM Adding VHDx files to the SCVMM library Systems Center VMM configuration Preparing a virtual machine gold image Creating a new VM template Creating service templates Deploy service templates SQL Server HA using Database Mirroring Overview SQL Database Mirroring Configuration Summary... 37

2 Appendix Custom script for SQL 2012 VMs Custom script for SQL 2014 VMs Sample script for attaching test database and modifying TempDB on small VMs For more information... 39

3 Executive summary The HP App Map for Database Consolidation for Microsoft SQL Server on ConvergedSystem 700x document (DBCAM) provides a tested solution for consolidating Microsoft SQL Server database servers performing transaction processing onto an HP ConvergedSystem 700x. Using the HP ConvergedSystem 700x as a virtualized consolidation platform features some of the following benefits: Optimized and validated to support OLTP specific workloads Designed to support and scale to several hundred VMs Decreased time to value This document is a companion guide for the DBCAM white paper that demonstrated the consolidation of SQL Server database servers into a virtualized infrastructure on the HP ConvergedSystem 700x. The HP ConvergedSystem 700x provides an optimized platform for hosting public or private clouds in a flexible fashion. The DBCAM shows the implementation of a flexible virtual infrastructure, demonstrating the design and consolidation of disparately sized SQL Servers into a cohesively managed virtual infrastructure with the flexibility to evolve into public or private cloud as infrastructure requirements change. This white paper follows up that document and provides additional detailed procedures for implementing and deploying VMs into the DBCAM using Microsoft System Center Virtual Machine Manager (VMM). The management platform for the DBCAM is based on Microsoft System Center 2012 SP1. This is a robust, comprehensive platform for monitoring, deploying and managing both the infrastructure fabric as well as the SQL workload VMs. VMM provides the ability to create customized VM templates and deployment configurations for ease in deploying and duplicating VM configurations throughout the DBCAM. This white paper describes how to configure VMM to deploy SQL VMs on the HP ConvergedSystem 700x as well as providing guidance in extending the DBCAM s VM Fault Tolerance by providing guidelines for implementing Microsoft SQL Server HA using Database Mirroring. Target audience: The intended audience for this white paper is the technical decision makers, data architects, database architects and solution architects. Document purpose: The purpose of this document is to describe and demonstrate an operational use-case for deploying Highly Available VMs into a tested App Map and to describe the best practices and design considerations for deployment. This is a companion guide to the HP App Map for Database Consolidation for Microsoft SQL Server on ConvergedSystem 700x white paper, which can be found at the following location: This white paper describes testing performed by HP in March HP ConvergedSystem 700x introduction HP ConvergedSystem 700x addresses one of today s top priorities for IT organizations reducing data center complexity. Pre-configured to meet a range of business needs, HP ConvergedSystem 700x offerings can be easily and rapidly deployed to support a variety of virtualized application environments. HP ConvergedSystem 700x delivers a best-in-class virtualized infrastructure, with integrated software, hardware, services, and support all delivered as a single, proven solution that can support multiple hypervisors and is enabled for cloud management. Transparent scalability allows the solution to grow as your business needs change, from entry-level to the enterprise. The HP ConvergedSystem 700x is pre-built with HP Converged Infrastructure consisting of HP ProLiant Gen8 servers, HP Networking and HP 3PAR StoreServ Storage arrays. For virtualization, the HP ConvergedSystem 700x is available in three flavors, the HP ConvergedSystem 700x model that doesn t use a specific model of hypervisor, the HP ConvergedSystem 700x for VMware model which is tailored for use on the VMware platform, and finally, the ConvergedSystem 700x for Microsoft Solution model which leverages Microsoft Windows Server 2012 Hyper-V, managed by Microsoft System Center 2012 SP1. The tested and recommended solutions in this document all use the Microsoft Solution model. 3

4 HP ConvergedSystem 700x overview The ConvergedSystem 700x for Microsoft Solution is available in two sizes, single rack and multi-rack. Table 1 details the specifications of each. Table 1. HP ConvergedSystem 700x technical overview #of Blades Est. VMs Memory/Server Storage Storage Controllers Drive Cages Drive Count Single rack 4 to /256/384GB 3PAR PAR or 4 Up to 6 Up to 240 Multi-rack /256/384GB 3PAR PAR or 4 2, 4 or 6 Up to 16 Up to 42 Up to 480 Up to 1920 The single rack configuration supports up to 16 blades in a single enclosure along with HP 3PAR StoreServ 7200 (3PAR 7200) or HP 3PAR StoreServ 7400 (3PAR 7400) storage with up to six additional drive cages (10 total). For each configuration, the HP ProLiant BL460c Gen8 blades support a maximum of 384GB of memory per host. The multi-rack configuration provides scale up capacity for larger environments and future growth. It features support for up to four blade enclosures and 64 blades. For storage capacity, both the 3PAR 7400 and series storage arrays are supported. Using the 4-node 7400 storage array, up to 16 additional drive cages are supported for a total of 480 drives. Scaling even further, the HP 3PAR StoreServ array features up to 1920 disk drives serviced by two, four or six storage controllers The flexibility in the HP ConvergedSystem 700x platform allows customers to purchase the correct hardware, software, and installation/configuration services to tailor to their needs. To that end, HP offers three different solution configurations for a customer s platform needs: HP ConvergedSystem 700x This base solution allows customers to develop a hardware platform for their needs. The base platform does not offer any operating system integration, or any enhancements for a particular virtual environment and software licensing is also not included. This solution is best for customers that simply want to purchase the HP ConvergedSystem 700x platform, and are willing to build and configure their solution themselves. HP ConvergedSystem 700x for Microsoft This Microsoft-based solution is the solution that is used for the basis of the DBCAM. This solution is targeted toward customers virtualizing their Microsoft applications using Microsoft Windows Server 2012 Hyper-V and managing their solution using Microsoft System Center 2012 SP1 management stack. This comes standard with HP Insight Control v 7.2, HP ProLiant Server and BladeSystem management packs for Microsoft System Center Operations Manager. Software licenses for Microsoft Windows Server 2012 Datacenter and Microsoft System Center 2012 Datacenter SP1 can also be purchased as part of this solution. Working jointly with Microsoft, HP has tested and validated this solution with the Microsoft Private Cloud Fast Track 3.0 program. The Fast Track program is designed for ease of deployment, scalability, and high availability for private cloud solutions. All Microsoft software components are licensed and sold separately. The HP ConvergedSystem 700x platform can be custom tailored to a customer s workload or environment. A wide range of configuration options are available from single rack configurations to multi-rack configurations allowing for future growth and scalability. The solution used for the DBCAM, the HP ConvergedSystem 700x for Microsoft, includes HP Factory Express racking, setup and configuration, along with onsite startup and installation. Once setup is complete, the HP ConvergedSystem 700x is delivered as a fully functional unit with all virtualization and management components set up and ready for customization or solution setup. HP ConvergedSystem 700x hardware configurations for the DBCAM The single rack HP ConvergedSystem 700x was used for the small and medium recommended configurations in the DBCAM white paper, while the multi-rack HP ConvergedSystem 700x platform was used for the large, tested configuration. 4

5 Figure 1 shows an example single rack configuration. Figure 1. HP ConvergedSystem 700x single rack architecture Single rack configurations can be customized for blades, storage, and management servers. The blade servers featured for the HP ConvergedSystem 700x, consists of the HP BL460c Gen8 blades with the following: Two Intel Xeon E v2 1 (3.0GHz/10-Core/25MB/130W) CPUs 256 RAM (PC3L-12800R) One HP FlexFabric 10Gb 2-port 554FLB Adapter One HP FlexFabric 10Gb 2-port 554M Adapter One 300GB 15K SFF SAS hard disk drives For storage, all single rack configurations utilize either the 3PAR 7200 or the 3PAR 7400 storage arrays. These arrays support three tiers of storage: SSD 100/200GB SLC SSDs and 400/480/920GB MLC SSDs. These SSDs are available in both large and small form factors. SAS 300GB (15K), and 450/600/900GB (10K) drives are available in small form factor only. NL Consists of 1/2/3/4TB drives. The 1TB drives are available in SFF size only, while the other drives are available as LFF models only. 1 The HP ConvergedSystem 700x configuration tested for the white paper featured the E V1 processors in the HP BL460c Gen8 servers. The V2 processors were not available when the test environment was built. 5

6 These three tiers of storage can be combined to provide flexibility for any workload or environment. Scaling beyond a single rack configuration requires a multi-rack configuration as shown in Figure 2. The multi-rack configuration utilizes separate compute and storage racks for ease of scalability. Figure 2. HP ConvergedSystem 700x multi-rack architecture 6 The multi-rack HP ConvergedSystem 700x configuration utilizes the same components as the single rack, but offers additional scalability and storage options. The 3PAR series storage arrays are also available with the multi-rack configuration and are available with up to six storage controllers for additional performance beyond the 7000 series storage arrays. Additionally, for ease of storage scalability, the multi-rack configuration features a separate Data Rack which houses only the storage array and storage controller. The additional Compute Rack houses the rest of the blade enclosures, management servers and network gear. Management software components Components The HP ConvergedSystem 700x for Microsoft provides the underlying infrastructure for running multiple workloads requiring high levels of performance and availability. To complete the solution, a software stack that can deliver the management, monitoring, operational control and lifecycle requirements is needed for a virtualized environment. To deliver these capabilities, System Center 2012 with HP Insight Control for System Center software is considered an integral part of the HP ConvergedSystem 700x for Microsoft solution. However the required licensing for System Center 2012 and Windows Server 2012 Datacenter are not included as a standard component part of HP ConvergedSystem 700x for Microsoft. HP customers that already have Microsoft Enterprise License Agreements (ELA) can leverage that agreement to acquire their licenses. HP customers requiring licenses may purchase them as an addendum to their HP ConvergedSystem 700x product order. Regardless of how Microsoft licenses are acquired the HP ConvergedSystem 700x for Microsoft solution includes a Deployment Accelerator service which implements the Microsoft components required to ensure a Microsoft Private Cloud Fast Track v3 environment. Microsoft System Center 2012 Microsoft System Center 2012 is a comprehensive management platform consisting of capabilities for infrastructure management, service delivery and automation, and application management and control. The System Center 2012

7 management stack is implemented in a core set of VMs running on the HP ConvergedSystem 700x management servers (HP ProLiant DL360p Gen8 servers), through which the services are delivered to the business users. The System Center 2012 product includes a number of core components that are installed including the following subset. Microsoft System Center Operations Manager (SCOM) Microsoft System Center 2012 Operations Manager (SCOM) with Service Pack 1 (SP1) provides a single point of management for servers, devices, operating systems, services and applications to ensure the data center infrastructure is running and to notify administrators in the event a monitored component fails. The basic functionality of SCOM is expandable using Management Packs. The Management Packs are available from Microsoft or other vendors, including HP. The Management Packs provide application or device awareness that integrates into the SCOM product and offers a single point of management to provide increased value for an organization to ensure that applications remain available and are running at the agreed upon service levels. Additional information on Microsoft System Center Operations Manager (SCOM) is available from Microsoft System Center Operations Manager. Microsoft System Center Virtual Machine Manager (SCVMM) Microsoft System Center 2012 Virtual Machine Manager (SCVMM) with Service Pack 1 (SP1) provides a single point of management for virtualized infrastructure including Hyper-V host and guest servers, network and storage devices, operating systems, services and applications to assist in deploying and managing the virtual infrastructure. SCVMM integrates with SCOM to ensure that the virtual infrastructure is running properly and to notify administrators in the event of a VM component failure. Figure 3. Microsoft System Center Virtual Machine Manager (SCVMM) Additional information on Microsoft System Center Virtual Machine Manager (SCVMM) is available from Microsoft System Center Virtual Machine Manager. The deployment procedures referenced in this white paper utilize SCVMM. HP DBCAM overview The DBCAM features three separate configurations: Small, Medium and Large, featuring three sizes of VMs. The deployment guidance in this white paper is independent of the configuration type and features instruction for deploying all VM sizes. This section provides an overview of the three DBCAM configurations and the VM types. 7

8 Small DBCAM overview The Small DBCAM is based on the single rack version of the HP ConvergedSystem 700x. It uses a single blade enclosure featuring four BL460c blades configured as two 2-node Windows failover clusters. Storage consists of the 3PAR Node storage array with three additional storage shelves (4 total) and GB SAS disks and 8 200GB SSDs. With a wealth of open Host bays, the Small DBCAM can easily be upgraded to the Medium DBCAM, by simply adding more blades, drive shelves and drives. Medium DBCAM overview The Medium DBCAM expands upon the HP ConvergedSystem 700x single rack architecture by featuring more host blades, more storage controllers, drives and shelves. It features eight host blades configured across two 4-node Windows Failover Clusters. The 3PAR Node storage array is employed, along with six additional storage shelves (8 total) with GB SAS disks, and GB SSDs. This single rack configuration is expanded by adding additional host blades, drive shelves and drives. Large DBCAM overview The Large DBCAM is based upon the HP ConvergedSystem 700x multi rack architecture. With 16 free blade slots and room for several more drive enclosures in the dedicated storage rack, the Large DBCAM is ready for future expansion. With 16 blades across 2 Windows Failover Clusters, and 10 additional storage shelves (12 total) configured with GB SAS and GB SSD, it has a total capacity of 73TB of RAW storage. VM overview For the DBCAM, our workload testing consisted of a mix of three different virtual machine sizes. The sizing of the three virtual machines was accomplished by researching industry statistics for average database sizes and resource requirements. Then, in order to optimize the virtual resource allotment on each blade server, three different sizes were developed, that span the range of typical database server sizes: Small For database servers with smaller or less frequently used databases Medium For database servers featuring databases with larger resource requirements or larger user loads Large For the largest databases or the heaviest user loads Table 2 shows the parameters used for each of the VM sizes: Table 2. VM overview Size CPU Cores Memory Storage Size IOPS VMs/Server Small 1 4GB 150GB Medium 2 8GB 400GB Large 8 16GB 800GB For the DBCAM, a workload mix of VMs is used across the three configurations. This workload mix can be customized for any given workload. For customer workloads requiring a larger number of smaller VMs, for example, the large configuration can support well over 300 VMs; whereas a customer deploying a Small DBCAM configuration with a requirement for mostly large VMs, may only support less than 50 VMs total. When designing workload mixes for the DBCAM, it is prudent to keep several factors in mind: Growth It is best to ensure that there is adequate resource headroom as databases expand and compute resource requirements increase. Failover The high availability provided by the Hyper-V Host clusters in this environment allows for the failover of one or several blades. As the blades failover, VMs are moved to the remaining blades during the outage. System resources must be available to take on the load of the additional VMs. The VM deployment guidance provided in this white paper encompasses all three sizes of VMs depicted in the DBCAM. 8

9 Clustered Shared Volumes Cluster Shared Volumes (CSV) is a feature of Windows Failover Clustering that enables simultaneous read and write operations to a volume by all nodes within the cluster. For architectures such as the DBCAM, which uses many different volumes for the various VMs, this greatly simplifies storage management. 3PAR Virtual Volumes are simply exported to all Hyper-V hosts in the cluster. These volumes are then mounted, formatted and then converted to CSVs, making them instantly accessible to all Hyper-V hosts. For fault tolerance purposes, this greatly enhances the resiliency of the cluster, as failed over VMs have instant access to the volumes they need to operate. The DBCAM employs several CSVs which tightly map back to the Common Provisioning Groups (CPGs) and Virtual Volumes (VVs) on the 3PAR storage array. Separate CSVs are created for small, medium and large VMs. Each VM utilizes the following type of CSV: DB Theses CSVs store the Database VHDx files for each type of server (S, M, L) LOG For storage of SQL Transaction Log VHDx files (S, M, L) TDB TempDB VHDx files (S, M, L) Additionally, a single operating system CSV is created within each cluster to house the VHDx files for each VMs operating system volume (all sizes). Figure 4 shows the CSVs mounted throughput a failover cluster. Note CSVs ending in the number 1, are used within cluster 1, those ending in the number 2 would be used in cluster 2. Figure 4. Cluster 1 CSV Layout DBCAM VM provisioning Overview In the original DBCAM white paper, we presented a high level overview of deploying VMs manually using PowerShell scripting. In this white paper we focus on the automated deployment of Highly Available SQL Server 2012 and SQL Server 2014 VMs using Microsoft Systems Center 2012 SP1 Virtual Machine Manager (SCVMM). Detailed procedures are provided for setting up and deploying the VMs and adding in a second layer of high availability through SQL mirroring. Before creating templates and deploying VMs, a number of steps must be undertaken to ensure that VMM has access to all the resources needed for deployment. The deployment of our example VMs for the DBCAM takes us through several phases: Creating any Template VHDs needed for deployment and adding them to the SCVMM library Setting up SCVMM network, storage and custom resources Creating Resource Profiles in SCVMM Creating a Gold Disk Image for OS deployment 9

10 Creating an automated SQL server image Setting up Deployment Templates Configuring SQL Server Database Mirroring Virtual machine variants The DBCAM utilizes 3 sizes of VMs, Small, Medium and Large, with various hardware settings and sizes of SQL databases. This white paper reviews the steps necessary to provision and deploy both SQL 2012 and SQL 2014 VMs into the DBCAM using Microsoft System Center Virtual Machine Manager (SCVMM). The DBCAM utilizes 3PAR Virtual Volumes (VV) segmented for OS, Database, Log, and TempDB. Each type of VM (S, M, L) will draw storage from an independent VV for Database, Log and TempDB (they all use the same VV for OS within each cluster). Windows Server 2012 R2 is not currently supported for SCVMM SP1 guest OS deployment; therefore, all examples will use Windows Server In addition, the deployment of SQL Server 2014 is not supported as a deployed service within SCVMM, so our SQL 2014 deployment utilizes an automated PowerShell script called by SCVMM to complete the SQL Server install during VM deployment. This white paper provides procedures for deploying both SQL Server 2012 and SQL Server 2014 VMs. The following scenarios will be depicted: SQL2012VM SQL 2012 VMs will be deployed by configuring a SQL Server configuration and attaching it to the VM template. SCVMM will take care of completing the SQL PrepareImage setup. SQL2014VM SQL 2014 VMs will be deployed using custom scripts that are assigned to an Application profile and attached to a VM template. SCVMM will call a PowerShell script that will complete the 2014 PrepareImage configuration using a SQL.ini file. The DBCAM utilizes a number of pre-configured Virtual Hard Disk files (VHDX) for Database, Log and TempDB. These VHDx files are stored in separate Cluster Shared Volumes (CSV) in order to group them together for storage tuning. Figure 4 shows an overview of the CSV layout for Cluster #1 in the DBCAM. Table 3 below depicts the various VHDx files that were deployed for our example configuration on the DBCAM. During deployment SCVMM will copy the various template VHDx files to the correct CSV folders. More detailed layouts and descriptions can be found in the DBCAM white paper. Table 3. CSV Allocation for VHDX Files Name Size Type VM CSV Location Note DBC-Template-SDB 60GB Fixed DBC-SDB (1 or 2) Database Disk for Small VMs DBC-Template-SLOG 10GB Fixed DBC-SLOG (1 or 2) Transaction Log Disk for Small VMs DBC-Template-TempDB 12GB Fixed DBC-STDB (1 or 2) DBC-MTDB (1 or 2) DBC-LTDB (1 or 2) For TempDB Disk; Same Template VHDx file used for all 3 VM sizes DBC-Template-MDB 160GB Fixed DBC-MDB (1 or 2) Database Disk for Medium VMs DBC-Template-MLOG 20GB Fixed DBC-MLOG (1 or 2) Transaction Log Disk for Medium VMs DBC-Template-LDB 500GB Fixed DBC-LDB (1 or 2) Database Disk for Large VMs SBC-Template-LLOG 40GB Fixed DBC-LLOG (1 or 2) Transaction Log Disk for Large VMs Before these template VHDs can be used in VM templates, they must be created and imported into the SCVMM library. The first step in implementing the automated deployment of VMs is to create all of the VHDs that are needed. The steps below can be used to pre-configure VHDx files for deployment. 10

11 Creating VHDs for DBCAM The easiest method for creating new VHDx files is through the PowerShell command interface using the New-VHD command. The PowerShell commands can be added to a.ps1 file so that they can all be created at the same time in an automated fashion. Below is an example of the commands to create the VHDx files for the medium VMs: New-VHD -Path C:\ClusterStorage\DBC-Template\DBC-Template-MDB.vhdx -size 160GB -Fixed New-VHD -Path C:\ClusterStorage\DBC-Template\DBC-Template-MLog.vhdx -size 20GB -Fixed Note For the DBCAM, we created a separate Virtual Volume and Cluster Shared Volume (DBC-Template) to store our Template VHDx files. This location is used for backup purposes only. Once we copy the files to the SCVMM library, the DBC-Template location is not used during VM deployment. If there are any pre-configured database files, backups or directories that need to be created on the VHDx files, once created the files can simply be mounted in the operating system by right-clicking the file and selecting Mount. The VHD will then appear as another drive letter. You can then copy files, create directories, etc. When the updates are complete, right-click the drive letter and select Eject to close the VHDx file. Once the VHDx files have been created, they need to be added to the SCVMM library so that we can use them in deployment templates. Adding VHDx files to the SCVMM library The System Center infrastructure within the DBCAM utilizes a virtual machine VS-FS1 configured for file sharing, that is setup and configured as a VMM library server. This server contains a shared disk that is configured as a VMM library which makes the contents accessible by templates, etc. created in VMM. Figure 5 below depicts some of the contents of our example VMM Library. Figure 5. VMM Library By clicking the Explore icon, a Windows Explorer window will appear that will allow you to copy the VHDx files to the library folder. Once the files have been copied, Click Refresh to update the library. 11

12 Systems Center VMM configuration A number of configuration steps are required to configure SCVMM to deploy VMs correctly into our DBCAM environment. These steps must be completed before the VM template is created. The resources configured will be accessed from the template. Set up a logical network In order for VMs to be automatically assigned virtual networks and IP addresses, a logical network must be created and configured in SCVMM. The DBCAM utilizes the Guest Network switch that is created on each blade host. The Guest Network is customized by the customers during installation. During the HP ConvergedSystem 700x configuration, the Top-of-Rack switches are configured for a specific VLAN that is routed to the Guest Network. In our testing of the DBCAM, we used a 210 VLAN with a network address of The following examples detail the setup of this network for our test DBCAM clients. The first step is to create a new logical network in SCVMM, selecting the Correct Host Group(s): Figure 6. Logical Network For each logical network configured, the VLAN and subnet is required. Once set up, this will allow for the VMs to utilize this network upon deployment. If static IP addresses are required, the next step is to configure a static IP pool within the logical network that we just created, by selecting the new network and right-clicking Create IP Pool. You can then configure the pools IP address range, subnet mask, DNS server, gateway, etc. In our example, we created an IP pool called SQL 14 Guests and assigned an IP range of to.254 as shown in Figure 7. Figure 7. Static IP Pool This IP range can then be assigned to VM templates within SCVMM. 12

13 Set up storage classifications SCVMM uses storage classifications to allocate VHDXs to the correct Virtual Volumes during the VM deployment process. During the VM template creation process, the VHDX files we use for SQL Database, Log and TempDB will be assigned storage classifications to ensure that upon VM deployment, the VHDX files will be copied into the correct Cluster Shared Volumes (CSVs). Table 4 below highlights the storage classifications used for the DBCAM. Table 4. Classifications Classification Assigned CPG Assigned CSVs Note OS CPG_OS DBC_OS_CC1 DBC_OS_CC2 Separate CSVs needed for each Cluster Compute_Data_Small CPG_Compute_Data_Small DBC_SQL_SDB.0 DBC_SQL_SDB.1 Compute_Data_Medium CPG_Compute_Data_Medium DBC_SQL_MDB.0 DBC_SQL_MDB.1 Compute_Data_Large CPG_Compute_Data_Large DBC_SQL_LDB.0 DBC_SQL_LDB.1 Compute_Log_Small CPG_Compute_Log_Small DBC_SQL_SLog.0 DBC_SQL_SLog.1 Compute_Log_Medium CPG_Compute_Log_Medium DBC_SQL_MLog.0 DBC_SQL_MLog.1 Compute_Log_Large CPG_Compute_Log_Large DBC_SQL_LLog.0 DBC_SQL_LLog.1 Compute_TempDB_Small CPG_Compute_TempDB_Small DBC_SQL_STDB.0 DBC_SQL_STDB.1 Compute_TempDB_Medium CPG_Compute_TempDB_Medium DBC_SQL_MTDB.0 DBC_SQL_MTDB.1 Compute_TempDB_Large CPG_Compute_TempDB_Large DBC_SQL_LTDB.0 DBC_SQL_LTDB.1 Each classification maps back to a specific Common Provisioning Group (CPG) within the 3PAR storage array. These CPGs in turn contain Virtual Volumes which are mapped to CSVs on the blade hosts. Separate virtual volumes allow for more fine tuning of the storage array using technologies such as 3PAR Adaptive Optimization (AO). 13

14 Assuming the CPGs defined in the DBCAM have already been configured on the 3PAR array (and that the array has been rescanned by SCVMM), to set up the classifications, go into SCVMM, go to the Arrays folder, and right-click your 3PAR storage array and click the Create Classification.. button. This will allow you to create all the needed classifications one after another. After all the classifications are set up, you can select all the CPGs in the area that are needed and assign them to the appropriate classifications that you just created. The virtual volumes that are contained within those CPGs will be automatically assigned. Figure 8 below shows our example DBC configuration. Figure 8. Storage Pools Click OK when all Storage Pools (CPGs) are selected. 14

15 Custom resource setup Our DBCAM configuration utilizes two scripts, a PowerShell script which completes the SQL 2014 installation for the VMs that run using SQL 2014, and a Windows Batch file that utilizes commands to attach pre-configured SQL databases that we used for our testing. These sample scripts can be found in the Appendix of this document. For VM deployment, these scripts are housed in the VMM library using a Custom Resource Package. The custom resource package is a special folder in the VMM library that is created by importing a physical resource into the library. After all the custom scripts have been created, save them to a folder with an extension of.cr, such as our example MyCustomResource.cr, then select Import Physical Resource in the VMM library. Select Add custom resource, browse to the.cr folder and select the folder. Then browse to the correct Library Share and select it. Figure 9. Custom Resource Import Once set up correctly, the folder will be imported into the library and will show up as a custom resource object. All script objects residing in the custom resource folder are copied down to the VMs during deployment and are accessible in the VMM application profiles. Figure 10. Custom Resource 15

16 Setting up VMM profiles The last configuration step before creating the images and templates for deployment is to set up the various resource profiles within SCVMM. These profiles are used in VMM to create standard configurations for things such as hardware, applications, etc. These profiles can then be easily assigned to a VM template reducing the time required to create them. Four types of profiles were used in our tested DBCAM deployment: Application Profile Application profiles have a feature that allows you to run custom scripts during VM deployment. We used an application profile to complete the SQL Server 2014 configuration at deployment time using a pre-configured SQL.ini file. Additionally, for our DBCAM testing, we deployed pre-configured SQL databases that were attached during deployment using a script within the application profile. Hardware Profiles Each of our 3 sizes of VMs, Small/Medium/Large use different hardware settings. Separate profiles were created for each size VM, allowing us to select them within each VM template. GuestOS Profile The GuestOS profile was used to capture the standard Windows OS Settings that we use, such as Windows Domain to Join, Local Administrator Password, Product Key, etc. SQL Server Profile The SQL Server profile was used during the deployment of our SQL 2012 VMs. The SQL profile dictates the SQL setup parameters such as Instance Name, Products Key, Run As accounts, etc. It eliminates the need to run a script and use a SQL.ini file. Application profile setup Application profiles are created by right-clicking Application Profiles in the Profiles section of SCVMM and then selecting Create Application Profile. After naming the profile, the scripts are assigned in the Application Configuration section. Click the Add/Script pull down to configure the scripts. Our first PowerShell script, which completes the installation of SQL 2014, is shown in Figure 11 below. Since we are not installing any application, only scripts, the type of script (Pre-Install, Post- Install, etc.) doesn t matter. Note These example scripts can be found in the Appendix of this document. Figure 11. Image Scripts The deployment order for the script that completes the SQL 2014 install is 1 since this script needs to run and complete to attach the SQL databases in script #2. All of the scripts are housed in the VMM Library using the custom resource package that was created earlier. Selecting this package will allow us to simply enter.\ as the path to our script in the Parameters section. In the Run As account box, ensure that a Run as account with adequate permissions is selected. 16

17 The second script, a windows batch file that attaches a SQL database, and modifies the SQL tempdb location, is specified by clicking the Add button, and adding script #2, with a deployment order of 2. The configuration settings are the same with the exception of the command line to run and the parameters as shown below. Figure 12. Script Parameters After the OS is deployed and configured, the custom resources folder is copied down to the VM and the scripts are run from there. Hardware profile configuration Separate hardware profiles were set up for each of the three sizes of VMs. These profiles are then assigned to the appropriate VM template. Table 5 below details the hardware profile parameters for each of the three sizes of VMs. Table 5. VM Sizes. Small VM Medium VM Large VM Note CPUs Memory 4GB 8GB 16GB Network Guest-Switch/StaticIP Guest-Switch/StaticIP Guest-Switch/StaticIP Availability High High High Allows VM to failover to another blade host in case of problems 17

18 VHDx files for each of the VMs are added in during VM template creation. To create a new Hardware Profile, right-click Hardware Profile in the profile section of VMM and select Create Hardware Profile. Modify the parameters for each type of VM according to Table 5. All other parameters are kept the same. Figure 13 below shows an example using the Large VM for the DBCAM Figure 13. Hardware Profile GuestOS profile The Windows Server 2012 GuestOS profile is the same for each type of VM. It contains a number of OS specific settings for the VM deployment. Table 6 below provides an overview of some of the settings available. Table 6. GuestOS Settings Setting Function Note Identity Information For Automatically assigning Host Names For DBCAM, we used DBC-VM### This assigned host names sequentially starting at DBC-VM001 Admin Password Roles and Features Domain/Workgroup Scripts Local Administrator Password on the VM To Install any additional Roles and features not in the image Specifies the Domain or Workgroup to join upon deployment Other commands to run upon first login or custom settings contained in a Windows Unattended answer file Specify Username with rights to join machine to the Domain 18

19 SQL Server profile The last type of VMM profile used for our DBCAM configuration is a SQL Server Profile. Since the deployment of SQL Server 2014 is not currently supported in System Center VMM 2012 SP1, this profile was only used during the deployment of SQL Server 2012 VMs. In order to use the SQL Server profile feature in VMM, the OS image must have a SQL Server deployment that was set up using the PrepareImage feature. This feature creates a partially completed SQL Server install that is completed at a later time using parameters specific to each VM configuration, much in the same fashion as the Sysprep process for the Windows operating system. The SQL Server profile feature within SCVMM, simply completes the SQL deployment (/CompleteImage) during VMM creation. This removes the need to use SQL Server setup and a SQL.ini answer file as you would need to do if you were completing the SQL deployment through the command line. SQL Profiles are created by going into VMM and right-clicking SQL Server Profiles and selecting Create SQL Server Profile. After naming the profile, click the SQL Server Configuration section, and then Add SQL Server Deployment. There are a few screens to configure here. In the first screen, the instance name and instance id must be specified. These are the same exact names that were used when running the SQL/PrepareImage install Note When deploying multiple SQL instances on the same VM, separate SQL Server Deployments are required for each instance. The product key can be inputted here as well. If a key is not entered, then it will be installed with an Eval license. Also, not specifying an Installation/Run as account will tell VMM to use the default VMM agent install account (local administrator). The main screen also contains two sub screens, Configuration and Service accounts. In the configuration screen, there is a field called Media source. This is the location of the SQL 2012 install files. In our case, we copied them locally to the OS disk in the \sqlsource directory. Additionally this screen has provisions for specifying admin to add to the SQL admins list within SQL Server. Figure 14 below depicts the settings for our DBCAM deployment. Figure 14. SQL Server Configuration The Service Accounts page contains the various Run as accounts that can be specified for the SQL Server service, the Agent service, and the SQL reporting service. 19

20 Preparing a virtual machine gold image Once everything is in place, the SQL gold image can be built. This will be used as the basis for the OS disk for all DBC VMs that are deployed. This VHDx should contain all the system disk software and settings that need to be in place for your VM deployment. The steps to build are as follows. Create new VM in SCVMM Create a new VM by clicking the Create New Virtual Machine button in the VMs and Services section of VMM. This will start the New Virtual Machine wizard. Give the VM a name and select the option to create a new VM using a blank Hard Drive. When selected for a hardware configuration, one of the configurations that we created earlier can be used; it s not that important, as we are using this VM only to create a template and it will be destroyed during that process. In our case, we changed the OS drive to have a size of 100GB and be a dynamic disk as shown in Figure 15. We must also create a DVD drive, by clicking the DVD icon in the New: bar at the top, and then by attaching the.iso file for Windows 2012 into the Virtual DVD drive, this will ensure that once the VM is deployed and started, it will boot from the DVD and the operating system install will begin. Figure 15. VM Wizard 20

21 The next screen will ask for a destination. The VM will be typically deployed to the Compute Nodes folder, and then any one of those hosts can be selected for deployment. The location for the VHDx file will be specified as shown in Figure 16 Figure 16. OS Disk Settings For the DBCAM, we stored the drive in the OS2 CSV and created a DBC-Gold directory. Click next through the remaining screens, and the VM deployment will begin. Connect to VM and install Windows Server 2012 Once the VM is deployed and started, we can connect to it and begin the operating system installation. Run through the OS installation process for your environment, install any required features or roles, and make any configuration changes. Sysprep does not need to be run. Once we create the VM template in VMM, sysprep/generalize will be run on this machine as the template is generated. Run SQL Server install with PrepareImage Once the operating system has been configured and customized, the next step is to prepare the SQL Server image for deployment. This process essentially performs a Sysprep-like operation on SQL Server so the SQL installation can be replicated as needed with the essential unique elements being changed at installation completion. This process is the same for both SQL Server 2012 and SQL Server The first step is to attach a SQL server.iso file to the virtual DVD drive in the VM we are configuring for the template. Then run the setup program, which will bring us to the SQL Server Installation Center screen. Select the Advanced screen from the list of options on the left. This will bring us to the advanced setup screen which has options to: Prepare a Stand Alone Instance of SQL Server This is what we use to set up SQL BEFORE the VM is made into a template. This can also be performed from the command line. Complete a Prepared Stand Alone Instance of SQL Server This is the process that is run AFTER the VM is deployed. It performs a few customizations and settings to make the SQL Server installation unique when the VM is being duplicated. 21

22 Figure 17 below depicts the SQL Server advanced setup screen. Figure 17. SQL Server Advanced Setup Clicking on the Image preparation link will start the process. After a few checks and license agreement screens, the feature selection page will be displayed, allowing you to select which features to install in the image. For SQL Server 2012 the options are limited to the Database Engine and SQL Reporting Services as shown in Figure 18. Figure 18. SQL Server Feature Selection 22

23 SQL Server 2014 offers more options to install into the image including SQL Server Analysis Services and more of the shared features and management tools as shown in Figure 19. Figure 19. SQL Server 2014 Feature Selection After clicking next, the only remaining choice to make is the SQL Server Instance ID. For our DBCAM configuration, we used the default SQL Server Instance ID MSSQLSERVER. Multiple instances of SQL Server can be prepared on the same VM using multiple instance IDs. Remember to note the instance ID that was used as it is needed during the image completion process during the VM deployment. Once the SQL PrepareImage operation completes, it generates a SQL.ini file with the settings. For the SQL 2014 install we copy this SQL.ini file to a location on the gold image disk such as c:\ so that we can utilize it in our SQL install PowerShell script. The last step is to patch the system by running Windows Update or installing other manual updates, etc. After the updates are complete, the system can be shut down and is ready for template creation. Note The template creation process will destroy the VM, so it s always a good practice to copy the OS VHDx file to a duplicate location just in case it s needed later on. In our configuration, we created two Gold Images, One with Windows 2012/SQL Server 2012, and then a separate one with Windows 2012/SQL Server Creating a new VM template Creating and configuring the VM template is the last step before creating the deployment service. Once the Gold Image VM has been created, the next step is to create our VM templates that will be used to deploy VMs in an automated fashion onto our DBCAM environment. Three separate templates are created for the DBCAM, one for each size of VM, Small/Medium/Large. The first step is to go into the VM Templates section of VMM, and click the Create New VM Template button; this will launch the New VM Template wizard. 23

24 When prompted for the source of the template select From an existing virtual machine that is deployed on a host:. Then browse to the Gold Image VM that was created and deployed earlier. Remember that the VM will be destroyed when the template is created. Give the VM a name and then click next to configure the hardware for the template. Now the Hardware templates that we created earlier will be accessible using the drop down box at the top. If we are building a small VM template as our first template, we would select the Small VM Hardware profile for example: Figure 20. VM Template Setup Note Our DBCAM configuration includes three additional VHDx drives that we deploy to the VMs using SCSI adapter 0. During initial template setup, the option to add the VHDx files is not available. We have to edit the template once it is complete and add them in. After clicking next we are presented with the Configure Operating System screen. Select the Operating System Profile that we created earlier; then click Next to select a library server in which to store the template. The final selection is to select a VMM Library share on the Library server, and optionally give it a folder name for storage. Once the template is completed, we need to go back and add in the extra disk drives for the VM, add in the SQL Server deployment that we created earlier (for the SQL 2012 templates only) and finally the Pre-install application scripts that we created earlier. 24

25 To add additional VHDx drives to the template, double click the template to edit it, and go to the Hardware Configuration section, then click the New: Disk button at the top to add in the new disk as shown in Figure 21. Figure 21. Adding Disk to Templates All the disks should go under the SCSI 0 adapter so make sure that the Channel ID for the disks is assigned starting with SCSI ID 0 and forward. Select Use an existing virtual hard disk and then browse to it and select it. Finally select the proper classification for the VHDx, from the classifications that we created earlier. Repeat for all the disk drives that we need to attach to the VM. Table 7 below depicts the additional VHDx files that we used for each size VM. Table 7. VHDx files used in Templates Template SCSI 0 Channel SCSI 1 Channel SCSI 2 Channel Small VM DBC-Template-SDB DBC-Template-SLOG DBC-Template-TempDB Medium VM DBC-Template-MDB DBC-Template-MLOG DBC-Template-TempDB Large VM DBC-Template-LDB DBC-Template-LLOG DBC-Template-TempDB 25

26 Next Click the Application Configuration section and in the Application profile drop down box, select the PrepareImage Scripts Application profile that we created (containing the scripts for the SQL 2012 VM or the SQL 2014 VM). Figure 22. Adding Application Profiles The final step in the template editing process is to assign a SQL Server configuration for the SQL 2012 VMs (SQL 2014 VMs install SQL through the Application profile scripts). 26

27 Click on the SQL Server Configuration section, then in the dropdown menu, select the SQL Server 2012 profile that we created in an earlier step. Figure 23. Adding SQL Server Configuration Click OK to save the Edit to the Template. Note Since our Gold Image VM was destroyed when the initial template was created, subsequent VM template creation for the other VMs (Medium/Large, etc.) can be created by selecting an existing VM template. The new template will then have the same disk drives as the initial template, so in the hardware configuration section, the existing SCSI 0 adapter can be deleted and then re-added. Once it s re-added, you can then go in and insert the new VHDx files for the template starting at ID SCSI 0. 27

28 Repeat the VM template process until there is a template for each of the different types of VMs. For our example DBCAM configuration we had a total of 6 templates, as listed in Table 8. Table 8. VM Templates for DBCAM Template OS SQL Disks Small SQL 12 VM Windows 2012 SQL 2012 Small SQL 14 VM Windows 2012 SQL 2014 Medium SQL 12 VM Windows 2012 SQL 2012 Medium SQL 14 VM Windows 2012 SQL 2014 Large SQL 12 VM Windows 2012 SQL 2012 Large SQL 14 VM Windows 2012 SQL 2014 Gold Image OS Small DB/Log/TempDB Gold Image OS Small DB/Log/TempDB Gold Image OS Medium DB/Log/TempDB Gold Image OS Medium DB/Log/TempDB Gold Image OS Large DB/Log/TempDB Gold Image OS Large DB/Log/TempDB Creating service templates The next step in the VM deployment process is to create a service template. Service templates define the properties of a service; in our case we are creating a service to deploy a virtual machine and to also install applications and scripts (such as SQL Server 2012). If we were just simply deploying a new virtual machine (without custom scripts and applications, etc., we could just deploy a new VM from the VM template. Service templates can be configured to deploy more complex multi-tier configurations, deploying all the VMs at the same time. For our example we will focus on deploying a single-tier VM. First go into the Service Templates section of VMM; then click the Create New Service Template button. This will open the Service Template Designer. Select Single-Tier and give the Service Template a Name. When the Template Designer Screen opens, simply drag the correct template from the left pane and drop it into the large box in the middle of the screen. 28