Upload
huy
View
100
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Consolidation and Virtualization with SQL Server . Melbourne User Group September 10, 2009. Rob Reinauer Product Unit Manager SQL Server Engine. Agenda. SQL Server Consolidation Today Virtualization and Microsoft Hyper-V Architecture Capabilities with SQL Server - PowerPoint PPT Presentation
Citation preview
Consolidation and Virtualizationwith SQL Server
Rob ReinauerProduct Unit ManagerSQL Server Engine
Melbourne User GroupSeptember 10, 2009
AgendaSQL Server Consolidation Today
Virtualization and Microsoft Hyper-V ArchitectureCapabilities with SQL Server
Managing virtualized environments
Performance of SQL Server with Hyper-VScalability across multiple VMs on a systemIO Performance
Achieving Scalability with VirtualizationCPU, Memory, Network and Disk subsystems
Microsoft IT Case Study
Questions
Forces Driving ConsolidationHardware Utilization Efficiency
Datacenter deployment efficiency
Power Utilization
Hardware standardization initiatives
Management EfficiencyFewer physical servers to manage and maintain
Centralized management of multiple/many servers
Infrastructure AgilityLoad Balancing
Lowered cost and complexity for High Availability
Power Sav-ings18%
Hardware Uti-lization
25%
Rack Space Savings18%
Ease of Manage-
ment21%
Licensing Costs18%
SQL Server Consolidation TodayHi
gher
Isol
ation
, Hig
her C
osts Higher Density, Low
er Costs
MyServer
Databases InstancesIT ManagedEnvironment
VirtualMachines
Schemas
Microsoft Confidential
Sales_1Marketing_1Online_SalesERP_10ERP_10
DB_1DB_2DB_3
Consolidate_1
Currently a variety of consolidation strategies exist and are utilized.
Typically, as isolation goes up, density goes down and cost goes up.
Schema level consolidation Multiple databases are collapsed into a single database
Forces common security model on all applicationsTypically requires changes to application and scriptsMany opportunities for subtle cross interactions
Namespace collisions and conflictsUnexpected dependencies / performance contentions
SQL Server Consolidation TodayHi
gher
Isol
ation
, Hig
her C
osts Higher Density, Low
er Costs
Microsoft Confidential
Database level consolidation Multiple databases hosted on a single instance
Common security, manageability and compatibility models requiredMight require changes to existing applications and scriptsLower manageability costsBetter resource isolation and allocation capabilities through Resource Governor.
SQL Server Consolidation TodayHi
gher
Isol
ation
, Hig
her C
osts Higher Density, Low
er Costs
Microsoft Confidential
Instance level consolidation Multiple Instances running on one system
Full schema and security isolationPartial system resource & management isolationPotential conflicts in namespace, resources and system rolesSystem Memory and CPU are typical density limiters
SQL Server Consolidation TodayHi
gher
Isol
ation
, Hig
her C
osts Higher Density, Low
er Costs
Microsoft Confidential
SQL Server Consolidation TodayHi
gher
Isol
ation
, Hig
her C
osts Higher Density, Low
er Costs
Microsoft Confidential
Virtual Machine consolidationStrong isolation between applicationsEase of capturing and moving execution loadsOut of the box High Availability configurationFlexible storage managementFewer systems, but just as many OS images to manageIncreased resource usage
What is Virtualization?Multiple operating systems images supporting separate independent applications running simultaneously on the same computer system.Strong hardware enforced isolation between the VMs
Server
Child Partition
Root Partition
Devices Processors Memory
Hypervisor
Hardware
One Physical Server
Server
Child Partition
SP2 RC
Server
Child Partition
Virtualization Scenario:Windows Server 2008 is installed on the bare system, Hyper-V enabled
Devices Processors MemoryHardware
Hypervisor
One Physical Server
Running one application on one OS
Root Partition
Virtualization Scenario:Windows Server 2008 is installed on the bare system, Hyper-V enabled
Devices Processors Memory
Hypervisor
Hardware
One Physical Server
Server
Child Partition
Running one application on one OS
Windows Server 2008 and SQL Server 2008 are installed or imaged into a child partition.
Root Partition
We would like to try out our application running against SQL Server 2008 running on Windows Server 2008 SP2 RC.But… we need to keep our existing application online and running.
Devices Processors Memory
Hypervisor
Hardware
One Physical Server
Server
Child Partition
SP2 RC
Server
Child Partition
Virtualization Scenario: Deploying Test Bed Environments
New OS and SQL Server installed or imaged into new child partition
Root Partition
Server
Child Partition
We would like to retire old hardware serversBut… we don’t want to purchase new hardware or go through a re-verification on new operating system and SQL Server versions.
Devices Processors Memory
Hypervisor
Hardware
One Physical Server
Server
Child Partition
SP2 RC
Server
Child Partition
Virtualization Scenario: Consolidating Legacy Applications
System Center VMM migrates a physical server image to a Hyper-V partition.
Root Partition
Hyper-V Architectural overviewThe Hyper-V Hypervisor runs directly on the hardwareProvides virtualized execution environment for operating systemsOperating systems and applications run in partitions on top of the HypervisorEnlightenments provide fast paths to mitigate overhead
Windows Server 08 R2 Hyper-V Improvements
Virtualization Feature WS08 Hyper-V RTM WS08 Hyper-V SP2Windows Server 2008 R2 Hyper-V
(Windows 7)
Logical Processor Support 16 24 64
Physical Socket Support 4 4 8
Total number of running VMs 128 192 384
Address Space Management Software Emulation Software Emulation Hardware(SLAT / IOMMU)
Effective Core Parking Limited Limited Yes
Zero Down Time Load Migration No (Quick Migration) No (Quick Migration) Yes (Live Migration)
Cluster Shared Volumes (CSV) No No Yes
Network stack offloading No No Yes
Online storage provisioning No No Yes
High Availability for SQL ServerIn Virtualized Environments
Consolidation Increases the importance of High Availability FeaturesConsolidation serves to increase cost for a single system failure Increasing focus on planned outages vs. unplanned outages
Microsoft Confidential
Shared Disk Environments - SANs, iSCSI, NAS,Windows Fail-Over Clustering
Host based ClusteringChild partition based Clustering
Non-Shared Disk EnvironmentsSQL Server MirroringTransactional and Peer-to-Peer replicationLog Shipping
Resource IsolationHyper-V ManagerSCVMMSQL Server Resource Manager
High Availability In Virtualized EnvironmentsWindows Fail-Over Clustering - Host Level Clustering
One complete system fails over to another system All VMs on the source system fail overEach VM can target different physical systems for fail-over.Each VM is re-started on fail-over target system WFC migrates LUNs to target system(s)Enables Live Migration in Windows 2008 R2
ChildPartition 1SQL 2008
ChildPartition 2SQL S005
Parent Partition
Lun1->E:
Hypervisor
D1.VHD->S:E:\D1.VHD
E:\D2.VHD
F:\D1.VHD
F:\D2.VHD
D2.VHD->S:
D1.VHD->T: D2.VHD->T:
System 1
SAN FiberChannel or iSCSI
System 2
Lun2->F:
LUN 1
Windows Failover Clustering
No Child PartitionsIn Existence.
SQL Server High Availability with Hyper-VHost Level Clustering - Partition movement, Drive routings
Pre-Failover
LUN 2
ChildPartition 1SQL 2008
ChildPartition 2SQL S005
Parent Partition
Lun1->E:
Hypervisor
D1.VHD->S:E:\D1.VHD
E:\D2.VHD
F:\D1.VHD
F:\D2.VHD
D2.VHD->S:
D1.VHD->T: D2.VHD->T:
System 1
SAN FiberChannel or iSCSI
System 2
Lun2->F:
LUN 1
Windows Failover Clustering
SQL Server High Availability with Hyper-VHost Level Clustering - Partition movement, Drive routings
After-Failover
LUN 2
System Failure
High Availability In Virtualized EnvironmentsWindows Fail-Over Clustering - Guest Level Clustering
Clustering applied at the individual VM level A single VM on the source system fails over to another VMEach VM can target different physical systems for fail-over. WFC does not migrate LUNs to target system(s)iSCSI typically required
ChildPartition 1SQL 2008
ChildPartition 2SQL S005
Parent Partition
Hypervisor
D1.VHD->S: D2.VHD->S:
System 1
SAN iSCSI
System 2
LUN 1
Windows Failover Clustering
SQL Server High Availability with Hyper-VGuest Partition Clustering - Partition movement, Drive routings
Pre-Failover
LUN 2
ChildPartition 1
ChildPartition 2Parent Partition
Hypervisor
D1.VHD->T: D2.VHD->T:
ChildPartition 1SQL 2008
ChildPartition 2SQL S005
Parent Partition
Hypervisor
D1.VHD->S: D2.VHD->S:
System 1
SAN iSCSI
System 2
LUN 1
Windows Failover Clustering
SQL Server High Availability with Hyper-VGuest Partition Clustering - Partition movement, Drive routings
After-Failover
LUN 2
ChildPartition 2Parent Partition
Hypervisor
D1.VHD->T: D2.VHD->T:
ChildPartition 1SQL 2008
D1.VHD->S:
D1.VHD->T:
PartitionFailure
Delivered in Windows 2008 R2Migrates a running VM with essentially zero down timeActually, several seconds of downtime, but connections are maintainedAllows essentially zero down time:
Hardware maintenancePatching and servicing of host OS
Currently does not allow zero down time;Patching and servicing of guest OSPatching and servicing of applications within guest VMs
Hyper-V Live Migration
Root Partition
HypervisorHardware
Physical Server Source Child Partition
Partition Memory
Network Connections
HypervisorHardware
Changed Pages
Storage Connections
Root Partition
Physical ServerDestination Child Partition
Step 1: Snapshot VM memoryCopy partition memory from source VM to Destination
Partition Memory
Shared StorageLUN 2LUN 1
Network Connections
Hyper-V Live MigrationHow it works: step by step
Step 2: Copy changed pages from source VM to destination
Root Partition
HypervisorHardware
Physical Server Source Child Partition
Partition Memory
Network Connections
HypervisorHardware
Changed Pages
Storage Connections
Root Partition
Physical ServerDestination Child Partition
Partition Memory
Shared StorageLUN 2LUN 1
Network Connections
Changed Pages
Hyper-V Live MigrationHow it works: step by step
Step 3: Storage connections are migrated from the source VM to the destination VM.
Root Partition
HypervisorHardware
Physical Server Source Child Partition
Partition Memory
Network Connections
HypervisorHardware
Changed Pages
Storage Connections
Root Partition
Physical ServerDestination Child Partition
Partition Memory
Shared StorageLUN 1
Network Connections
Changed Pages
Storage Connections
LUN 2
Hyper-V Live MigrationHow it works: step by step
Step 4: Network connections are migrated from source VM to destination VM
Root Partition
HypervisorHardware
Physical Server Source Child Partition
Partition Memory
Network Connections
HypervisorHardware
Changed Pages
Storage Connections
Root Partition
Physical ServerDestination Child Partition
Partition Memory
Shared StorageLUN 1
Changed Pages
Storage Connections
Network Connections
Network ConnectionsLUN 2
Hyper-V Live MigrationHow it works: step by step
Source Child Partition
Step 5: Destination VM is brought online, Source VM is taken off line
Root Partition
HypervisorHardware
Physical Server Destination Child Partition
HypervisorHardware
Root Partition
Physical Server
Partition Memory
Shared StorageLUN 1
Changed Pages
Storage Connections
Network Connections
Network ConnectionsLUN 2
Hyper-V Live MigrationHow it works: step by step
Centralized management of Virtual Machine creation, configuration and provisioning
Provides wizards for creation and provisioning of VMs and devices
Provides tools for creation and provisioning of Virtual Hard Drives (VHDs)Limited import capabilities
Creating and managing Virtual MachinesHyper-V Role in Windows 2008 Server Manager
System Center Virtual Machine Manager 2008 Creating and managing Virtual Machines
Physical to Virtual and Virtual to Virtual image creationIn place physical systems can be provisioned to VMsVMWare VMs can be translated to Hyper-V
Rapid Virtual Machine Provisioning – Virtual Machine LibraryMulti-machine management across system and VMsPRO - Performance and Resource Optimization and automation
System Center VMM Multi-Machine Monitoring and Management
System Center Virtual Machine Manager 2008 Creating and managing Virtual Machines
Evaluating Virtual Machine EfficiencyWe wanted to address the following questions:
Hypervisor
Hardware
SQL running in 8 Separate virtual machines running on a single system
HardwareR2
8 Separate SQL Instances running on a single system
If Consolidating Servers: 1. Is it more efficient to utilize multiple instances (Scenario 1 below) or
multiple virtual machines (Scenario 2)
2. How much overhead develops with larger numbers of instances and Virtual Machines?
Scenario 1 Scenario 2
Hyper-V + Processor virtualization support = Huge Win! SLAT (second level address translation) 1% - 2% overhead per Virtual Machine
1VM 2VM 3VM 4VM 5VM 6VM 7VM 8VM0
10
20
30
40
50
60
70
80
0
500
1000
1500
2000
2500
3000
3500
Batch req/sec %CPU Relative Throughput
Virtual Instances Scalability Measurement Configuration
AMD Shanghai CPUs SLAT support No IOMMU
HP DL585 16 CoresHP EVA8000 SANWindows 2008 R2 RCVM Configurations
4 Virtual Processors 7GB RAM
Fixed VHDs Approximately 10%
CPU utilization / VM Relative Throughput
is normalized per VM
Batch
Requests
/
Sec
Total
CPU
Utilizztion
Evaluating Virtual Machine Efficiency
Achieving Scalability With Virtualization
CPU UtilizationThe sum of the CPU utilizations of consolidated applications should not exceed the capacity of the target systemCPU cores can be explicitly allocated to Virtual MachinesCPU reserves, limits and relative priorities can be specifiedCPU cores can be over committed
For example:
- On an 8 core system 4 VMs can each be allocated 4 virtual CPUs- System scheduling provides load balancing across the VMs - The administrator could specify limits and reserves across the VMs
Scalability requires balanced system capabilities CPU, Memory, Network and Disk subsystem bandwidth
Achieving Scalability With VirtualizationScalability requires balanced system capabilities CPU, Memory, Network and Disk subsystem bandwidth
Memory Allocation and UtilizationMemory is allocated to virtual machines in fixed amountsAssume ~1.5 GB consumed by Operating System and SQL Server instance code pagesRemaining memory utilized for data caching, mostly for SQL Server
Network subsystem bandwidthSufficient bandwidth must be provided for the sum total of the consolidated applicationsTask Manager and Perfmon can provide statistics on application network utilization
Achieving Scalability With VirtualizationScalability requires balanced system capabilities CPU, Memory, Network and Disk subsystem bandwidth
Disk subsystem bandwidthI/O Bandwidth is typically gated on number of random I/Os not MB/Sec. throughput
Throughput typically scales with number of drives not with the speed of the attach busThroughput essentially never scales with the space of the storage subsystem
Disk attach bus bandwidth may become significant when:The work loads generate significant percentages of sequential I/OMultiple I/O intensive applications generate large numbers of I/OsSolid State storage is being utilized
Perfmon can provide statistics on number of I/Os, latency and bandwidth utilization.
Evaluating Virtual Machine EfficiencyQlogic Fiber Channel SAN Performance Benchmark
FiberChannel Reads
Infrastructure Workload
IO Intensive Application
iSCSI Reads0
20,000
40,000
60,000
80,000
100,000
120,000
140,000
160,000
180,000
200,000
NativeHyper-V
Windows Server 2008 with fiber channel SAN achieves more than 200,000 I/O operations per second.On a range of tests, Hyper-V based I/O workloads were between 88% and 99% of native performance
90%88%
97%
99%
Hyper-V I/O operations per second compared to Native OSIOPS
Non-IOMMUEnabled CPUs
Case Study – MSIT SQL Consolidation
Pre-Consolidation State~2,700 Applications in MSIT Portfolio~4797 SQL Server Instances~100,000 databases~20% end-of-life hosts/year~10% CPU utilization across hosts
Consolidation ApproachMicrosoft IT evaluated database, instance and host based consolidation
Resource Management ApproachResource Management effectiveness considered critical issueInstance based would utilize WSRM Hyper-V allows explicit allocation of CPU and IO channels
Microsoft IT Infrastructure Overview
Case Study – MSIT SQL Consolidation
Consolidation StrategyHost Consolidation utilizing Hyper-VTarget of 6 to 1 consolidation ratioFixed Virtual Drives (VHDs) over Dynamic and Pass Through
Consolidation ApproachDecision starting point was instance based consolidationEvaluation led to decision change: Hyper-V based host consolidation
WSRM vs. Hyper-V
Microsoft IT evaluated WSRM vs. Hyper-V & ultimately chose Hyper-V
Microsoft IT Consolidation Conclusions
Case Study - Microsoft IT Consolidation
0500,000
1,000,0001,500,0002,000,0002,500,0003,000,0003,500,0004,000,000
Power and Cooling at 6:1 Consolidation
Legacy Consolidated$0
$5,000$10,000$15,000$20,000$25,000$30,000$35,000$40,000$45,000$50,000
Annual Recycle Cost at 6:1 Consolidation
Legacy Consolidated
$0$2,000,000$4,000,000$6,000,000$8,000,000
$10,000,000$12,000,000$14,000,000$16,000,000$18,000,000
Annual Operating Cost at 6:1 Consolidation
Legacy Consolidated
Operational Results
Summary Hyper-V based virtualization is an effective server consolidation platform for SQL Server
Modern CPUs easily achieve efficient SQL Server scalability out beyond 8 virtual machines.
The Microsoft Hyper-V platform and SQL Server work together to implement robust high availability environments.
Windows 2008 R2 Live Migration offers effectively zero down time load migration between two systems.
Microsoft IT has documented a successful server consolidation strategy utilizing Hyper-V.
The System Center Virtual Machine Manager provides powerful tools to manage Virtual Machines
Migrating existing native system images to Hyper-V imagesAdministration and monitoring for multiple Virtual MachinesPRO - Performance and load balancing automation
SQL Server Community Resources
Become a FREE PASS Member: www.sqlpass.org/RegisterforSQLPASS.aspxLearn more about the PASS organization www.sqlpass.org/
Additional Community ResourcesSQL Server Community Center www.microsoft.com/sqlserver/2008/en/us/community-center.aspxTechNet Community for IT Professionalshttp://technet.microsoft.com/en-us/sqlserver/bb671048.aspxDeveloper Center http://msdn.microsoft.com/en-us/sqlserver/bb671064.aspxSQL Server 2008 Learning Portalhttp://www.microsoft.com/learning/sql/2008/default.mspx
The Professional Association for SQL Server (PASS) is an independent, not-for-profit association, dedicated to supporting, educating, and promoting the Microsoft SQL Server community.
ReferencesRunning SQL 2008 in Hyper-V Environment
http://sqlcat.com/whitepapers/archive/2008/10/03/running-sql-server-2008-in-a-hyper-v-environment-best-practices-and-performance-recommendations.aspx
Microsoft IT virtualization case studyhttp://technet.microsoft.com/en-us/library/dd557540.aspx
Green IT in Practices: SQL Server Consolidation in Microsoft IThttp://msdn.microsoft.com/en-us/library/dd393309.aspx
Qlogic Hyper-V IO performance benchmarkshttp://www.qlogic.com/promos/products/hyper-v.aspx
Windows Server Hyper-V site
• http://www.microsoft.com/windowsserver2008/en/us/virtualization-consolidation.aspx
System Center Virtual Machine Manager 2008 R2 site• http://www.microsoft.com/systemcenter/virtualmachinemanager/en/us/default.aspx
Hyper-V Technet center http://technet2.microsoft.com/windowsserver2008/en/servermanager/virtualization.mspx
SQL Server 2008 Business Value Calculator:http://www.microsoft.com/sqlserver/2008/en/us/value-calc.aspx
Questions?