Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
James Serra
Implement SQL Server on an
Azure VM
About Me
 Microsoft, Big Data Evangelist
 In IT for 30 years, worked on many BI and DW projects
 Worked as desktop/web/...
Agenda
 Azure VMs
 Migrating data
 Scaling VMs
 SQL Server VM features
 VM storage
 HA/DR architectures
 Best pract...
Who manages what?
Infrastructure
as a Service
Storage
Servers
Networking
O/S
Middleware
Virtualization
Data
Applications
R...
Virtual Machine components
Flexible,
Scalable CPU
and memory
Standard and
Premium
Storage tiers
Internal/External
Networki...
 VM hosted on Microsoft Azure Infrastructure (“IaaS”)
• From Microsoft images (gallery) or your own images (custom)
SQL 2...
Windows Azure virtual machine tiers
Basic Standard
A0 – A4
1 – 8 CPU cores
768 MB – 14 GB RAM
Max 16 datadisks w/300 IOPS ...
Compare compute performance




 DS-Series: Same CPU and memory as D-Series. Support Premium Storage (good for Data, Log, and TempDB!!)

 GS-Se...
• Premium Storage
 High throughput
 Low latency
 SSD disks in the backend
 Uses local SSD disk as read cache
 Avg 1ms...
VM Gallery Images via Azure Marketplace
Certified pre-configured software images (1087)
Azure Quickstart Templates
Free community contributed templates (417)
Storage configuration
Automatically creates
one Windows storage
space (virtual drive)
across all disks
Services by region
Hyper scale Infrastructure is the enabler
34 Regions Worldwide, 30 Generally Available…
 100+ datacenters
 Top 3 network...
Migrating Data
Migrate from on-prem SQL server to Azure VM IaaS:
• Use the Deploy a SQL Server Database to a Microsoft Azu...
Scale VMs
Scale VMs
PowerShell script
Automated Patching
• Predictable solution for patching (Windows & SQL)
• Simple: just specify a time window
• Uses SQL Age...
Automated Backup
• For all DBs in the SQL instance
• Simple: just specify a retention period
• Supports Compression and En...
Licensing/bring your own license
Connecting to Azure VMs
Virtual Network
VPN
GW
Frontend
10.1/16
Mid-tier
10.2/16
Backend
10.3/16
Internet
On Premises
10.0...
Connectivity options and hybrid offerings
Secure site-to-site
VPN connectivity
• SMB, Enterprises
• Connect to Azure compu...
Virtual Machine storage architecture
C:
OS disk (127 GB)
Usually 115 GB free
E:, F:, etc.
Data disks (1 TB)
Attach SSD/HDD...
Azure Default Blob Storage
 Azure Storage Page Blobs, 3 copies
 Storage high durability built-in (like have RAID)
 VHD ...
Geo-storage replication
 3 copies locally, another 3 copies in different region
 Disable for SQL Server VM disk (consist...
Blog Storage Replication Options
HA/DR pieces
HA/DR deployment architectures
Azure Only
Availability replicas
running across
multiple datacenters
in Azure VMs for
disas...
RPO/RTO
RTO – Recover Time Objective. How much time after a failure until we have to be up
and running again?
RPO – Recove...
AlwaysOn Availability Groups
Azure Only
Availability replicas
running across
multiple datacenters
in Azure VMs for
disaste...
AlwaysOn between Azure Regions
• Configure AlwaysOn between VMs in different geographic regions (asynchronous)
• Over secu...
AlwaysOn Failover Cluster Instances (FCI)
An FCI on a two-node WSFC running in Azure VMs with remote
iSCSI Target shared b...
AlwaysOn FCI vs AlwaysOn AG
Database Mirroring
Azure Only
Principal and mirror
and servers running
in different
datacenters for
disaster recovery.
Pri...
Block blobs
Reduced storage costs
Significantly improved
restore performance
More granular control
over Azure Storage
Azur...
SQL Server in Azure VM Best Practices
https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-sql-server...
© 2016 Microsoft Corporation. All rights reserved.
Upcoming SlideShare
Loading in …5
×

Implement SQL Server on an Azure VM

4,909 views

Published on

This presentation is for those of you who are interested in moving your on-prem SQL Server databases and servers to Azure virtual machines (VM’s) in the cloud so you can take advantage of all the benefits of being in the cloud. This is commonly referred to as a “lift and shift” as part of an Infrastructure-as-a-service (IaaS) solution. I will discuss the various Azure VM sizes and options, migration strategies, storage options, high availability (HA) and disaster recovery (DR) solutions, and best practices.

Published in: Technology
  • Be the first to comment

Implement SQL Server on an Azure VM

  1. 1. James Serra Implement SQL Server on an Azure VM
  2. 2. About Me  Microsoft, Big Data Evangelist  In IT for 30 years, worked on many BI and DW projects  Worked as desktop/web/database developer, DBA, BI and DW architect and developer, MDM architect, PDW/APS developer  Been perm employee, contractor, consultant, business owner  Presenter at PASS Business Analytics Conference, PASS Summit, Enterprise Data World conference  Certifications: MCSE: Data Platform, Business Intelligence; MS: Architecting Microsoft Azure Solutions, Design and Implement Big Data Analytics Solutions, Design and Implement Cloud Data Platform Solutions  Blog at JamesSerra.com  Former SQL Server MVP  Author of book “Reporting with Microsoft SQL Server 2012”
  3. 3. Agenda  Azure VMs  Migrating data  Scaling VMs  SQL Server VM features  VM storage  HA/DR architectures  Best practices
  4. 4. Who manages what? Infrastructure as a Service Storage Servers Networking O/S Middleware Virtualization Data Applications Runtime ManagedbyMicrosoft Youscale,make resilient&manage Platform as a Service Scale,Resilienceand managementbyMicrosoft Youmanage Storage Servers Networking O/S Middleware Virtualization Applications Runtime Data On Premises Physical / Virtual Youscale,makeresilientandmanage Storage Servers Networking O/S Middleware Virtualization Data Applications Runtime Software as a Service Storage Servers Networking O/S Middleware Virtualization Applications Runtime Data Scale,Resilienceand managementbyMicrosoft Windows Azure Virtual Machines Windows Azure Cloud Services
  5. 5. Virtual Machine components Flexible, Scalable CPU and memory Standard and Premium Storage tiers Internal/External Networking
  6. 6.  VM hosted on Microsoft Azure Infrastructure (“IaaS”) • From Microsoft images (gallery) or your own images (custom) SQL 2008R2 / 2012 / 2014 / 2016 Web / Standard / Enterprise Images refreshed with latest version, SP, CU • Fast provisioning (~10 minutes). • Accessible via RDP and Powershell •  Pay per use • Per minute (only when running) • Cost depends on size and licensing • EA customers can use existing SQL licenses (BYOL) • Network: only outgoing (not incoming) • Storage: only used (not allocated)  Elasticity • 1 core / 2 GB mem / 1 TB   32 cores / 448 GB mem / 64 TB
  7. 7. Windows Azure virtual machine tiers Basic Standard A0 – A4 1 – 8 CPU cores 768 MB – 14 GB RAM Max 16 datadisks w/300 IOPS per disk For dev/test workloads or applications that don’t require load-balancing, auto-scaling, or memory-intensive VM’s. G series (G1 – G5) 2 – 32 CPU cores 28 GB – 448 GB RAM Up to 64 datadisks with 500 IOPS/disk GS Series (GS1 – GS5) 2 – 32 CPU cores 28 GB – 448 GB RAM Up to 64 datadisks with 5000 – 80000 IOPS/disk F Series Web/Application servers H Series Modeling/Simulation servers N Series Graphics workloadshttps://azure.microsoft.com/en-us/documentation/articles/virtual-machines-size-specs/ A0 – A11 1 – 16 CPU cores 768 MB – 112 GB RAM Max 16 datadisks with 500 IOPS/disk D1 – D14 & D1_v2 – D15_v2 1 – 20 CPU cores 768 MB – 140 GB RAM Max 16 datadisks with 500 IOPS/disk DS1 – DS14 Up to 50,000 IOPS 32 – 512 MB second
  8. 8. Compare compute performance
  9. 9.      DS-Series: Same CPU and memory as D-Series. Support Premium Storage (good for Data, Log, and TempDB!!)   GS-Series: Fastest CPU, most memory. Support Premium Storage    Azure calculator: https://azure.microsoft.com/en-us/pricing/calculator/
  10. 10. • Premium Storage  High throughput  Low latency  SSD disks in the backend  Uses local SSD disk as read cache  Avg 1ms read latency  Cache hits not part of max IOPs/bandwidth VM Size CPU cores Memory Cache size Max. IOPS Max. Storage Bandwidth DS1 1 3.5 GB 43 GB 3,200 32 MB/s DS2 2 7 GB 86 GB 6,400 64 MB/s DS3 4 14 GB 172 GB 12,800 128 MB/s DS4 8 28 GB 344 GB 25,600 256 MB/s DS11 2 14 GB 72 GB 6,400 64 MB/s DS12 4 28 GB 144 GB 12,800 128 MB/s DS13 8 56 GB 288 GB 25,600 256 MB/s DS14 16 112 GB 576 GB 50,000 512 MB/s Disk Type Disk Size Storage IOPS Storage Bandwidth (MB/s) P10 128 GB 500 100 P20 512 GB 2300 150 P30 1024 GB 5000 200 GS5 32 448 GB 4,608 GB 100,000 2048 MB/s
  11. 11. VM Gallery Images via Azure Marketplace Certified pre-configured software images (1087)
  12. 12. Azure Quickstart Templates Free community contributed templates (417)
  13. 13. Storage configuration Automatically creates one Windows storage space (virtual drive) across all disks
  14. 14. Services by region
  15. 15. Hyper scale Infrastructure is the enabler 34 Regions Worldwide, 30 Generally Available…  100+ datacenters  Top 3 networks in the world  2.5x AWS, 7x Google DC Regions  G Series – Largest VM in World, 32 cores, 448GB Ram, SSD… Operational Announced/Not Operational Central US Iowa West US California East US Virginia US Gov Virginia North Central US Illinois US Gov Iowa South Central US Texas Brazil South Sao Paulo State West Europe Netherlands China North * Beijing China South * Shanghai Japan East Tokyo, Saitama Japan West Osaka India South Chennai East Asia Hong Kong SE Asia Singapore Australia South East Victoria Australia East New South Wales India Central Pune Canada East Quebec City Canada Central Toronto India West Mumbai Germany North East ** Magdeburg Germany Central ** Frankfurt North Europe Ireland East US 2 Virginia United Kingdom Regions (south & west) US DoD East TBD US DoD West TBD * Operated by 21Vianet ** Data Stewardship by Deutsche Telekom Korea (Seoul & South) West US 2 West Central US
  16. 16. Migrating Data Migrate from on-prem SQL server to Azure VM IaaS: • Use the Deploy a SQL Server Database to a Microsoft Azure VM wizard. Recommended method for migrating an on-premises user database when the compressed database backup file is less than 1 TB. Use on SQL Server 2005 or greater to SQL Server 2014 or greater • Perform on-premises backup using compression and manually copy the backup file into the Azure virtual machine and then do a restore (only if you cannot use the above wizard or the database backup size is larger than 1 TB). Use on SQL Server 2005 or greater to SQL Server 2005 or greater • Perform a backup to URL and restore into the Azure virtual machine from the URL. Use on SQL Server 2012 SP1 CU2 or greater to SQL Server 2012 SP1 CU2 or greater • Detach and then copy the data and log files to Azure blob storage and then attach to SQL Server in Azure VM from URL. Use on SQL Server 2005 or greater to SQL Server 2014 or greater • Convert on-premises physical machine to Hyper-V VHD, upload to Azure Blob storage, and then deploy as new VM using uploaded VHD. Use when bringing your own SQL Server license, when migrating a database that you will run on an older version of SQL Server, or when migrating system and user databases together as part of the migration of database dependent on other user databases and/or system databases. Use on SQL Server 2005 or greater to SQL Server 2005 or greater • Ship hard drive using Windows Import/Export Service. Use when manual copy method is too slow, such as with very large databases. Use on SQL Server 2005 or greater to SQL Server 2005 or greater • If you have an AlwaysOn deployment on-premises and want to minimize downtime, use the Add Azure Replica Wizard to create a replica in Azure and then failover, pointing users to the Azure database instance. Use on SQL Server 2012 or greater to SQL Server 2012 or greater • If you do not have an AlwaysOn deployment on-premises and want to minimize downtime, use SQL Server transactional replication to configure the Azure SQL Server instance as a subscriber and then disable replication, pointing users to the Azure database instance. Use on SQL Server 2005 or greater to SQL Server 2005 or greater • Others: data-tier application, transact-SQL scripts, sql server import and export wizard, SSIS, copy database wizard
  17. 17. Scale VMs
  18. 18. Scale VMs PowerShell script
  19. 19. Automated Patching • Predictable solution for patching (Windows & SQL) • Simple: just specify a time window • Uses SQL Agent Extension and MS Update • Portal and Powershell • It relies on the Windows Update and the Microsoft Update infrastructure and installs any update that matches the ‘Important’ category for the machine
  20. 20. Automated Backup • For all DBs in the SQL instance • Simple: just specify a retention period • Supports Compression and Encryption • Portal and Powershell • Full database and transaction log backups • Configure at database level or SQL Server instance level In SQL Server 2016: • Full, bulk-logged and simple recovery models are all supported • System databases can be configured for backups • Backup striping can be used to support backup sizes of up to 12 TB • Customer backup schedules can be specified to ensure your backups are created when it is best for your workload
  21. 21. Licensing/bring your own license
  22. 22. Connecting to Azure VMs Virtual Network VPN GW Frontend 10.1/16 Mid-tier 10.2/16 Backend 10.3/16 Internet On Premises 10.0/16 VPN & ExpressRoute Azure Direct Internet Connectivity Virtual Machine networking • Create subnets with private or public IP addresses • Bring your own DNS or use Azure-provided DNS • Secure with Network Security Groups ACLs • Control traffic with user-defined routes
  23. 23. Connectivity options and hybrid offerings Secure site-to-site VPN connectivity • SMB, Enterprises • Connect to Azure compute Secure point-to-site connectivity • Developers • POC Efforts • Small scale deployments • Connect from anywhere ExpressRoute private connectivity • SMB, Enterprises • Mission critical workloads • Backup/DR, media, HPC • Connect to Microsoft services Internet connectivity • Consumers • Access over public IP • DNS resolution • Connect from anywhere
  24. 24. Virtual Machine storage architecture C: OS disk (127 GB) Usually 115 GB free E:, F:, etc. Data disks (1 TB) Attach SSD/HDD up to 1TB. These are .vhd files D: Temporary disk (Contents can be lost) SSD/HDD and size depends on VM chosenDisk Cache
  25. 25. Azure Default Blob Storage  Azure Storage Page Blobs, 3 copies  Storage high durability built-in (like have RAID)  VHD disks, up to 1 TB per disk (64 TB total)
  26. 26. Geo-storage replication  3 copies locally, another 3 copies in different region  Disable for SQL Server VM disk (consistent write order across multiple disks is not guaranteed). Instead use DR techniques in this deck Defend against regional disasters Geo replication
  27. 27. Blog Storage Replication Options
  28. 28. HA/DR pieces
  29. 29. HA/DR deployment architectures Azure Only Availability replicas running across multiple datacenters in Azure VMs for disaster recovery. Cross-region solution protects against complete site outage. Hybrid Some availability replicas running in Azure VMs and other replicas running on- premises for cross- site disaster recovery. HA only, not DR FCI on a two-node WSFC running in Azure VMs with storage supported by a third-party clustering solution. FCI on a two-node WSFC running in Azure VMs with remote iSCSI Target shared block storage via ExpressRoute. Azure Only Principal and mirror and servers running in different datacenters for disaster recovery. Principal, Mirror, and Witness run within same Azure data center, deployed using a DC or server certificates for HA. Hybrid One partner running in an Azure VM and the other running on- premises for cross- site disaster recovery using server certificates. For DR only / Hybrid only One server running in an Azure VM and the other running on- premises for cross- site disaster recovery. Log shipping depends on Windows file sharing, so a VPN connection between the Azure virtual network and the on- premises network is required. Requires AD deployment on DR site. On-prem or Azure production databases backed up directly to Azure blob storage for disaster recovery. SQL 2016: Backup to Azure with file snapshots Simpler BCDR story Site Recovery makes it easy to handle replication, failover and recovery for your on-premises workloads and applications (not data!). Flexible replication You can replicate on- premises servers, Hyper-V virtual machines, and VMware virtual machines. Eliminate the need for secondary Native support for SQL Server data files stored as Azure blobs
  30. 30. RPO/RTO RTO – Recover Time Objective. How much time after a failure until we have to be up and running again? RPO – Recover Point Objective. How much data can we lose? • HA – High Availability • RTO: seconds to minutes • RPO: Zero to seconds • Automatic failover • Well tested (maybe with each patch or release) • DR – Disaster Recovery • RTO: minutes to hours • RPO: seconds to minutes • Manual failover into prepared environment • Tested from time to time How long does it take to fail over: • Backup-Restore: Hours • Log Shipping: Minutes • AlwaysOn FCI: Seconds to minutes • AlwaysOn AG/Mirroring: Seconds
  31. 31. AlwaysOn Availability Groups Azure Only Availability replicas running across multiple datacenters in Azure VMs for disaster recovery. Cross-region solution protects against complete site outage. Hybrid Some availability replicas running in Azure VMs and other replicas running on- premises for cross- site disaster recovery. Availability replicas running across multiple datacenters in Azure VMs for disaster recovery. This cross-region solution protects against complete site outage. Within a region, all replicas should be within the same cloud service and the same VNet. Because each region will have a separate VNet, these solutions require VNet to VNet connectivity. For more information, see Configure a Site-to-Site VPN in the Azure classic portal. All availability replicas running in Azure VMs for high availability within the same region. You need to configure a domain controller VM, because Windows Server Failover Clustering (WSFC) requires an Active Directory domain. For more information, see Configure AlwaysOn Availability Groups in Azure (GUI).
  32. 32. AlwaysOn between Azure Regions • Configure AlwaysOn between VMs in different geographic regions (asynchronous) • Over secure tunnel • Manual Failover (~15 seconds) in case of a regional failure • Test it at any time • Use closest secondary for read workloads • Region 1: AG used instead of FCI (synchronous)
  33. 33. AlwaysOn Failover Cluster Instances (FCI) An FCI on a two-node WSFC running in Azure VMs with remote iSCSI Target shared block storage via ExpressRoute. For example, NetApp Private Storage (NPS) exposes an iSCSI target via ExpressRoute with Equinix to Azure VMs. For third-party shared storage and data replication solutions, you should contact the vendor for any issues related to accessing data on failover. Note that using FCI on top of Azure File storage is not supported yet, because this solution does not utilize Premium Storage. We are working to support this soon. HA only, not DR FCI on a two-node WSFC running in Azure VMs with storage supported by a third-party clustering solution. FCI on a two-node WSFC running in Azure VMs with remote iSCSI Target shared block storage via ExpressRoute. You can use FCI to host an availability replica for an availability group FCI on a two-node WSFC running in Azure VMs with storage supported by a third-party clustering solution.
  34. 34. AlwaysOn FCI vs AlwaysOn AG
  35. 35. Database Mirroring Azure Only Principal and mirror and servers running in different datacenters for disaster recovery. Principal, Mirror, and Witness run within same Azure data center, deployed using a DC or server certificates for HA. Hybrid One partner running in an Azure VM and the other running on-premises for cross-site disaster recovery using server certificates. Principal and mirror and servers running in different datacenters for disaster recovery. You must deploy using server certificates because an Active Directory domain cannot span multiple datacenters. Principal, mirror, and witness servers all running in the same Azure datacenter for high availability. You can deploy using a domain controller. You can also deploy the same database mirroring configuration without a domain controller by using server certificates instead.
  36. 36. Block blobs Reduced storage costs Significantly improved restore performance More granular control over Azure Storage Azure Storage snapshot backup Fastest method for creating backups and running restores Support of SQL Server database files on Azure Blob Storage Backup to Azure Managed backup On-prem to Azure Granular control of the backup schedule Local staging for faster recovery and greater network resiliency System database support Simple recovery mode support On-prem or Azure production databases backed up directly to Azure blob storage for disaster recovery. SQL 2016: Backup to Azure with file snapshots Production databases backed up directly to blob storage in a different datacenter for disaster recovery On-premises production databases backed up directly to Azure blob storage for disaster recovery.
  37. 37. SQL Server in Azure VM Best Practices https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-sql-server-performance-best-practices/
  38. 38. © 2016 Microsoft Corporation. All rights reserved.

×