Tag Archive: virtualization

Blogs About Virtualization for DBAs

It’s hard for DBAs to find good virtualization information.

We end up reading brochures and whitepapers trying to figure out the best way to virtualize our database servers.  We don’t have the time to sift through the entire blogosphere to figure out what’s relevant for DBAs.

pass_logoAt the Virtualization Virtual Chapter of the Professional Association for SQL Server (PASS), we’re working to change that, and we’ve got some fantastic people helping.  These are some of the top bloggers in the virtualization world today:

These guys blog about virtualization in general, and their material can get pretty technical. I love reading about how Cisco’s new blade system works, for example, but I know most of you don’t have the time to sift through that much information.  That’s why I contacted these guys and asked if they’d be willing to syndicate their beginner-level virtualization stuff and their DBA-related posts in one place.

Starting today, you can get the latest DBA-focused virtualization news, tips and tricks in whatever way works best for you:

One more thing – I know this first group of bloggers (including me and Jorge Segarra) is pretty VMware-focused, but I couldn’t find any Hyper-V blogs outside of the official Microsoft one!  If you know of one, or if you’ve got a favorite virtualization blog, let me know.  We’re open to syndicating any high-quality virtualization blog that will help the DBA community.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

SQL Server 2008 R2: Think Virtualization

How are my servers doing?

How are my databases doing?

If my boss came in and asked which servers needed more horsepower or which ones could be consolidated together, how would I come up with an answer?

I’ve always found it funny that DBAs and sysadmins don’t have good answers to these questions.  We roll our own monitoring solutions, cobble things together from a bunch of parts, or fork over money to third party vendors to get a picture of how our environment’s doing.

Virtualization admins, on the other hand, have fantastic answers to these questions.  Take this screenshot from VMware vSphere’s management console:

Host Server Utilization Rates

Host Server Utilization Rates

The sysadmin can see a lot of relevant information at a glance: how utilized the host server CPUs are, how utilized the server memory is, each server’s status, and more.  Wouldn’t it be nice to get a simple report like that for SQL Server?  Check out this screenshot from the new SQL Server 2008 R2 CTP:

SQL Server 2008 R2 Utility Explorer

SQL Server 2008 R2 Utility Explorer

The first thing to notice is the two pie charts: Managed Instance Health and Data-tier Application Health.

Not servers and databases – instances and applications.  That’s your first hint that things are going to be different long-term.

Virtualization Changed Everything, But Took Time

Looking ahead, Microsoft wants us to start thinking of databases as being less connected to physical servers, and to think of our physical servers as a resource pool.  Imagine if databases were self-contained packages that could be moved from server to server – just like virtual servers can be moved from host to host today.

The virtualization push took years to accomplish because there were so many things that had to be handled.  We had to figure out how to handle drivers, how to handle resource sharing, how network segregation and storage throughput would work, and even systems management had to be rethought from the ground up.  It took a long time to get it right, and today virtualization is pushing into enterprises everywhere.

Today, SQL Server faces struggles not unlike the early days of virtualization. There are several factors that cloud the Utopian vision of moving databases around seamlessly:

  • Connection strings – our apps call for their data by a specific server name.  If we’re going to abstract servers away, then we need a way to find our data.
  • Logins – logins are set at the server level, yet are tied into databases.  If we move a database from one server to another, we have to make sure that the login exists on the new server, has the same password, and has the same level of access rights.  If the application frequently uses a specific login to call the TRUNCATE TABLE command, for example, we need to know it’ll have that same level of permissions on the new server.
  • SSIS/DTS packages – these techniques can be used to pipe data in and out of our database servers, and they’re often tied in with local servers.
  • Scheduled jobs – as much as I fight developers who want to put jobs on their servers, reality is that I don’t always win.  (Schedulers belong in applications, not databases.)
  • Anal retentive DBAs – we know best, right?  We finely tune some of our applications so that the data lives on one set of disks, logs live on another set of disks, and maybe indexes or partitioned data live on yet another set of disks.  If we start shuffling databases around, we’re going to need to abandon that level of control.

Abstracting all of this stuff out of the database architecture isn’t going to be easy, but SQL Server 2008 R2 is starting to take the first step.

The SQL Server Utility: Virtualization for Databases

SQL Server 2008 R2 introduces the concept of the SQL Server Utility: a pool of resources (instances) that host applications (databases).

The Utility is managed by a Utility Control Point: a single SQL Server instance that gathers configuration and performance data.

All of this is visualized through SQL Server Management Studio’s Utility Explorer:

SSMS 2008R2 Utility Explorer

SSMS 2008R2 Utility Explorer

This dashboard shows some basic metrics about CPU use and storage use at both the instance level and the application level.

Down the road – years down the road – this might provide DBAs with the same level of fast reaction times that virtualization admins currently enjoy.  Got a database running out of space?  Move it to a server with more space.  Got an application burning up too much CPU power?  Slide it over to one that’s got the latest and greatest processors.

In order for this concept to work, though, we need to do more than just think differently about our databases; we’re going to need to deploy them differently.  SQL Server 2008 R2 introduces the concept of the Data-tier Application (DAC), a self-contained package with everything our applications need in order to store and process their data.  It’s not going to work for everyone, and in my next post, I’ll talk about what SQL Server 2008 R2′s DACPack means for DBAs.

Continue to Part 2: What the DAC Means for DBAs

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

Virtualization Isn’t The Answer To Sprawl

Denis Gobo (BlogTwitter) wrote an article yesterday about SQL Server sprawl – the problem of database servers popping up from under desks, datacenter corners, and developer cubicles.  Part of the problem stems from SQL Server 2005 and earlier not requiring a license key, so they didn’t need a keygen hack or fake serial number.  Simply pop in the SQL Server CD, and next thing you know, there’s a new mission-critical part of the infrastructure.

SQL Server 2008 helps to slow down sprawl by requiring an installation key.  There’s still a free 180-day evaluation version of SQL Server that anyone can download, and it comes with built-in temporary registration numbers.  That doesn’t stop SQL Server sprawl altogether, but rather turns the problem into SQL Server time bombs.

Virtualization might seem like a solution because we can take these rogue instances out from under desks and put them in the datacenter.  Systems management software companies (Quest included) provide Physical-To-Virtual (P2V) converters that will make the process easier, and I’ve blogged about how to kill the dinosaurs with P2Vs.

When your company becomes really successful with virtualization, however, it turns out that virtualization makes the problem even worse!  Virtualization empowers sysadmins to quickly roll out new virtual machines based on templates.  In a matter of minutes, you can have a completely new Windows machine ready – perfect for use as a development server, testbed server, or proof-of-concept server.  Heck – it’s even easier than slapping SQL Server on a leftover machine under your desktop!

And that right there sums up the problem.

Suddenly it’s even easier to provision all-new servers.  Be careful with that licensing….

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

SQL Server and Cloud Links for the Week of 6/5/2009

SQL Server Links

Bacon Gumballs

Bacon Gumballs

How to generate a random number in T-SQL – it’s not as easy as you think.

But it wasn’t my job to do the backups! – Learn this lesson from Jason Strate before you learn it the hard way, like I did.  The backup guy swore our tapes were going offsite every day.  Not so much.

How to find triggers using T-SQL – list all of the triggers in a database.  Great idea for troubleshooting – before you scratch your head wondering why something’s not working the way you think, make sure there’s not a trigger behind the scenes.

SQL 2008 Database Compression whitepaper – best practices for configuring and using Enterprise Edition’s slick new feature.

Advanced SSIS interview questions – always hard to find good technical interview questions.

Get your learn on in June – Jeremiah Peschka lists upcoming free training events, plus I’ve got a bunch on my upcoming events page.  I’m workin’ my tail off this month.  As opposed to most months, where I sit by the water and drink champagne.  Sorta.

DBCC with Repair_Allow_Data_Loss really does – Gail Shaw explains that yes, you can actually cut your fingers when you use scissors.  Don’t point that tool around casually.

The simplest performance tuning tip ever – it’s really good, but I’d say it’s not the simplest because it requires building your queries right in the first place.  The really simplest one is to drop those bazillion indexes you’re not using. Had another case this week with an OLTP table with over 40 indexes, 38 of which had never been used.  Hello, McFly.

Building a SQL Server cluster for testing – Jonathan Kehayias, one of the coauthors on the book I’ve been working on, starts a series on how to build a virtual cluster to help learn SQL Server.

Your testbed needs to be as big as production – been there, done that.  “But it worked on my machine!” Denis Gobo drives the point home with example code.

Why DBAs are paranoid control freaks – Mike Walsh explains it.

Cloud and Virtualization Links

What do you wanna know about virtualization? – Ken Simmons, a member of the PASS Hypervisors, wants to know what you want to know.  We’re building content about virtualization, and we want to know what kinds of questions you’re looking to get answered.  Take a minute to head over there and give him your comments.

Backing up your Windows Home Server to Amazon S3 – PASS VP of Marketing Bill Graziano shows how to do it.  I just love Amazon Web Services – I published a video this week on datamining, and I got thousands of people watching the video in a matter of hours.  My site stayed up fine because the thick content is all cached on Amazon S3 and Amazon CloudFront.  Total cost to survive the Reddit effect with video on my site: around $10.  Awesome.

Junk Drawer

Ken Block is a driving deity – watch this and your mouth will hang wide open for seven minutes straight.  He’s that good. Jump to one minute into the film for the action. To see a man with a huge amount of testicular fortitude, jump to four minutes in and watch the senseless paintball violence. Think about being confident enough in somebody’s driving to stand there while this happens. Wow. I won’t even ride shotgun with some bozos, let alone stand in front of their car like that.

Microsoft updates install a Firefox extension – because, you know, it’s a good idea. What, you disagree? Try uninstalling it. Good luck with that.

From Finger to Bung – wherein Tom LaRock uses the Bing search engine to find someone and then says out loud, “I Banged him.”

Calvinball Projects – remember the Calvin and Hobbes comic series, and how they played Calvinball, a game where the rules kept changing?

Why joint ventures fail so often – when there’s not one person in the driver’s seat, don’t be surprised if you don’t end up at the right destination.  From Rob Boek’s shared items.

Jobs at StackOverflow – StackOverflow and ServerFault are adding job boards.  The thing I like about this is that the types of people who understand enough to advertise in these places are aleady a cut above typical headhunters.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

Meet the #SQLPass Hypervisors

I got an awesome group of responses for the initial PASS Virtualization Virtual Chapter.  I wish I could have taken everybody, but you know what happens when you have a committee with too many people: nothing gets done.  (Come to think of it, nothing gets done on committees period…)

Meet the Hypervisors, also known as the founding members:

Here’s what we’re working on first:

Work with Blythe Morrow to set up our web site. PASS uses DotNetNuke to host their site, and we’ll get our own subdomain with our own look & feel.  We get to pick what we want on the site and how it works.  Blythe’s got ideas on how to help, and she’s got experience from working with the other virtual chapters.  We need to work with her to figure out what we can put on there.

Build a schedule for meetings. We need to pick dates for monthly chapter-wide meetings.  These are not status meetings with just us, but chapter-wide meetings where someone talks about a virtualization/SQL topic and lots of people fall asleep listening.  We’ll need to recruit speakers.  I’ll speak at the first one to talk about what we’re doing, and that’ll buy us some time.

Figure out how to record & web-enable LiveMeetings. The PASS virtual chapters use LiveMeeting to hold their meetings, and I want to start recording ours and putting the archives up on the web site.  I want them to be playable through the web browser like I do with my SQLServerPedia tutorials and I want users to be able to comment on the videos & ask questions.  I also want sharks with friggin’ laser beams on their heads.

Build a policy for working with virtualization vendors. The virtualization market is rough-and-tumble right now.  There’s a lot of nasty subliminal marketing going on with vendors slinging mud at each other.  I want to make sure we don’t get dirty, but at the same time, I want to us to be the gatekeepers for the SQL community.  We can help each vendor get training material out to DBAs on the right way to configure virtualization for performance.  Before we let them get to first base, though, we need a list of what we’re willing to do and what we’re not gonna do.

I’ve really appreciated the work Andy Warren‘s put into keeping PASS transparent by blogging status updates, and I’ll do my best to keep up that same level of transparency with us too.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

PASS Virtualization Virtual Chapter

The Professional Association for SQL Server has a few Virtual Chapters.  Formerly known as Special Interest Groups (SIGs), these are groups where people with similar interests can get together and talk shop.  It’s like that Furry group you belong to, only different.  Or maybe not so different.

i-want-you-for-blog-duty-uncle-samI’m starting up a Virtualization Virtual Chapter: a group dedicated to helping database administrators manage SQL Servers that live in virtual environments like Microsoft Hyper-V and VMware vSphere.

The group will be responsible for:

  • Helping the community by producing things like monthly webcasts, a centralized list of helpful virtualization-savvy administrators, and an annual report of what’s working well under virtualization and what isn’t quite there yet.
  • Helping PASS management by increasing membership, building assets that PASS can leverage (like a library of training content), and showing that PASS solves real DBA problems.
  • Helping virtualization vendors by getting training and configuration information out to the right people who need it and helping them build a better product with our feedback.  I almost see the group as Consumer Reports for virtualization – there’s so much crappy hype going back and forth, and the DBA community needs an unbiased group to give real answers.

I’m not just looking for virtualization cheerleaders or seasoned pros, either.  In order for this to work, I need a balanced group of people from all over the virtualization spectrum, like:

  • DBAs from enterprise shops with hundreds of SQL Servers that have deployed virtualization successfully
  • DBAs from small to midsize shops that have only dabbled in virtualization
  • At least one doubter: somebody who isn’t convinced that SQL Server will ever work in virtual environments

My community will be made up of people all over the technological map, but they’ll have a few things in common:

  • Experience with SQL Server (even if they’re just junior DBAs)
  • A keen interest in virtualization (whether it’s seeing it succeed or seeing it fail, I just want some passion)
  • An online presence (Twitter, blog, etc)
  • A willingness to spend 4 hours a week putting up with me

If this sounds like you, take the Virtualization Virtual Chapter Steering Committee Screening Survey, also known as the VVCSCSSV1.

Update 5/27 – thanks for your interest, and I’ve closed the survey.  We’ve got our founding committee members.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

Virtualization Survey

Are you devoted to virtualization?  Are you avoiding it like the plague?  Or somewhere in the middle?

Jay Grieves, the author of Big Swinging Developer and one of the uber-cool Houstonians I met back at the Caroline Collective, emailed me about doing a survey to find out some truths from people who’ve been managing large servers like SQL Server, data warehouses, Exchange and so on.  Everybody focuses on performance, but if you set that aside, how’s the experience going?

The survey’s around 20 questions long, takes about 5-10 minutes, and you should take it regardless of whether you’re using virtualization or not.  If you’re reading this blog, you’re the target audience.  You can take the survey now without giving us a shred of personal information.

After the results are in, Jay will post some of the results (participants can get the full report) and we’ll talk about the reasoning behind the original set of questions.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

Day with the Experts slide decks online

Last Friday, I did a series of presentations with Jason Hall (Twitter) and Geoff Hiten (TwitterBlog) on performance tuning SQL Server.  The slide decks are online at SlideShare along with a few other SQLServerPedia presentations:

Here’s the links we discussed:

The archived video/audio copy of the webcast should be online this week, and I’ll let you know when those are up.  In the meantime, here’s a recap of some of the questions that came up outside of the decks:

How do Perfmon memory guidelines change between 32-bit and 64-bit OS’s?

In my presentation, I note that if you’re averaging less than 250mb of free memory, you need to ease off SQL Server’s maximum memory settings.  That guideline holds for both 32 and 64 bit systems.  One of the attendees noted that he wants to see a much higher number (like 1gb free) and I agree, that’s fantastic.  The 250mb is a fire alarm number, though, and the presentation focuses on things that you need to focus right away when you see them.

How do Performance Monitor guidelines change for virtual systems?

Perfmon numbers are nearly meaningless under virtualization.  100% CPU use doesn’t mean that your virtual SQL Server is actually using 100% of the possible CPU power – it means 100% of the available CPU power.  Instead, it might mean:

  • You’re hitting the CPU limit that the virtualization sysadmin assigned to your virtual server (yes, they can limit you, and you’ll never know).
  • Another guest is using a lot of available CPU power, leaving less for you, and you’re using 100% of what’s available to you.
  • And if you’re looking at yesterday’s numbers, you were hitting the CPU limit of the physical CPUs you were on at the time, but you might be on different CPUs now.  The virtualization sysadmin or the virtualization software can magically move your virtual server to another physical host without you knowing.  (It’s called vMotion for VMware, or Live Migration for Microsoft Hyper-V.)

Instead of using percentage metrics, I recommend that DBAs focus on time-focused metrics and (some) queue-length metrics for virtual servers.  For storage monitoring, focus on seconds per read and seconds per write, because those tell you if the storage is responding fast enough.  For processor and memory, focus on queue length metrics, because those tell you how many things are waiting on those types of resources in order to execute.

Should TempDB be placed on local disk or on the SAN?

If it’s currently on local disk, use the Perfmon monitoring to determine if that disk is currently a bottleneck.  If it is, and if you’ve got free performance (not just space, but performance) available on the SAN arrays, then yes, you should consider moving it to the SAN.

Keep in mind that if you’re doing SAN-to-SAN replication, you don’t want to put TempDB on the same replicated array that you’re copying to a remote datacenter.  Use a different array that isn’t being replicated.

In VMware, how many CPUs should I use for SQL Server?

As few as you can get away with.  If the virtual server is set up with 4 virtual CPUs, then VMware will wait until there are four available cores before it gives any CPU time to the guest OS – even if the guest OS only needs a single thread.  I’ve personally experienced faster performance when turning down the number of virtual cores assigned to a server, and that lines up with what’s been seen by VMware forum users.  Avoid using 4 virtual CPUs unless you’re actually saturating 2 virtual CPUs, and don’t try running too many 4-virtual-cpu guests on a single host.

This is counter-intuitive for us power-hungry DBAs, who like to assign every server 4 virtual CPUs just because we can.  Ease off, though.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

Reasons Why You Shouldn’t Virtualize SQL Server

I’ve blogged about why you should virtualize SQL Server, but it’s not all unicorns and rainbows.  Today we’re going to talk about some of the pitfalls and problems.

When Virtualization Goes Right

When Virtualization Goes Right

It’s Tougher to Get More Storage Throughput

Servers connect to Storage Area Networks (SANs) with Host Bus Adapters (HBAs).  They’re like fancypants network cards, and they come in either fiberoptic (FC) or iSCSI varieties.  These components are the place to focus when thinking about virtualization.

If your SQL Server:

  • Has 2 or more HBAs connected to the SAN
  • Uses active/active load balancing software like EMC’s PowerPath to get lots of storage throughput
  • Actually takes advantage of that throughput

Then you’ll be dissatisfied with the current state of storage access in virtualization.  Generally speaking, without doing some serious voodoo, you’re only going to get one HBA worth of throughput to each virtual machine, and that’s the best case scenario.

If you’re running multiple servers on the same virtual host, the IO situation gets worse: it becomes even more important to carefully manage how many SQL Servers end up on a single physical host, and more difficult to balance the IO requirements of each server.

Never mind how much more complex this whole thing gets when we throw in shared storage: a single raid array might have virtual server drives for several different servers, and they can all compete for performance at the same time.  Think about what happens on Friday nights when the antivirus software kicks off a scheduled scan across every server in the shop – goodbye, performance.

No-Good Liar

No-Good Liar

It’s Tougher to Get Good Performance Reporting

Let’s look at the very simplest performance indicator: Task Manager.  On a virtual server, Task Manager doesn’t really show how busy the CPUs are.  The CPU percentages are a function of several things, and none of them are transparent or detectable to the database administrator.

Other virtual servers might be using up all of the CPU.

The virtualization admin might have throttled your virtual server.  They can set limits on how much CPU power you actually get.

Your host’s CPU can change.  Your server can get moved from a 2ghz box to a 3ghz box without warning.

And even if you dig into the underlying causes to find out what’s going on, there’s no reporting system that will give you a dashboard view of this activity over time.  You can’t look at a report and say, “Well, last Thursday my production SQL Server was hitting 100% CPU, but it’s because it was on a slow shared box, and on Thursday night at 5:00 PM it was migrated live over to a faster box, and that’s why pressure eased off.”

Not Everything Works As Advertised

Virtualization vendors have some amazing features.  We talked about vMotion and Live Migration, the ability to move virtual servers from one physical host to another on the fly without downtime.  While that does indeed work great, it doesn’t necessarily work great for every server in every shop.  If you’ve got a heavily saturated network, and your SQL Server’s memory is changing very fast (like in high-transaction environments or doing huge queries), these features may not be able to copy data over the network as fast as it’s changing in memory.  In situations like this, the live migration will fail.  I’ve never seen it bring the virtual server down, but I’ve seen it slow performance while it attempted the migration.

New features and new versions of virtualization software come out at a breakneck pace, and like any other software, it’s got bugs.  A particularly nasty bug surfaced in VMware ESX v3.5 Update 2 – on a certain date, VMware users couldn’t power on their servers because the licensing was expired – even if it wasn’t.  Imagine shutting down a server to perform maintenance, then trying to turn it back on and getting denied.  “Sorry, boss, I can’t turn the server back on. I just can’t.”  It took VMware days to deploy a fixed version, and in that time span, those servers just couldn’t come back on.

That’s an extreme case, but whenever more complexity is introduced into the environment, risk is introduced too.  Injecting virtualization between the hardware and the OS is a risk.

It’s Not Always Cost-Effective

All of the virtualization vendors have a free version of their software, but the free version lacks the management tools and/or performance features that I touted in my earlier articles about why sysadmins want to virtualize your servers.  The management tools and power-up editions cost money, typically on a per-CPU basis, and there’s maintenance costs involved as well.  If your virtualization strategy requires isolating each SQL Server on its own physical host server, then you’ll be facing a cost increase, not a cost savings.

Combining multiple guest servers onto less physical servers still doesn’t always pay off: run the numbers for all of your virtualization tool licenses, and you may end up being better served by a SQL Server consolidation project.  I did a webcast last year with Kevin Kline and Ron Talmage about choosing between consolidation and virtualization.  That information is still relevant today.

My Virtualization Recommendations for SQL Server

My recommendations are:

  • Virtualize only when it’s going to solve a problem, and you don’t have a better solution for that problem.
  • Get good at performance monitoring before you virtualize, because it’s much tougher afterwards.
  • Start by virtualizing the oldest, slowest boxes with local storage because they’ll likely see a performance gain instead of a penalty.
  • Avoid virtualizing servers that have (and utilize) more than 2 HBAs.

If you’ve virtualized production SQL Servers, I’d love to hear about your experiences.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

Why Would You Virtualize SQL Server?

I talked about why sysadmins want to virtualize servers, and today it’s time to talk about why you as a DBA or developer might want to virtualize some of your SQL Servers.

Virtualization Means Cheap High Availability

Yo momma was an early adopter.

Yo momma was an early adopter. That's right - you're adopted.

In a perfect world, every SQL Server would be a cluster on a SAN with instant failover.  This isn’t a perfect world, and we can’t afford to implement that level of protection for every server in the shop.

Virtual SQL Servers provide a level of high availability without the expense and hassle of clustering.  In my last post, I explained that sysadmins love virtualization because they can easily move guest servers around from one piece of hardware to another.  As a DBA, I love it for that same reason: suddenly, if the underlying hardware fails, I’m not sweating bullets.  If the RAID card fails, if the motherboard fails, if the memory fails, if the network card blows chunks, you name it, it’s not my problem.  The sysadmin simply boots up my SQL Server on another virtual host, and I don’t have to deal with screaming users.

I especially like this option for development and QA servers.  Management is rarely willing to implement expensive high-availability setups for development environments, but when the dev server goes down, the developers and project managers are kicking my door down.  The PM’s scream about how there’s so many expensive developers sitting around idle waiting for the server to come back up.  Virtualization avoids this problem altogether.

Virtual SQL Servers can React Quickly to Changing Needs

Capacity planning is hard work.  How much speed do we really need for a new application?  What happens if our estimates are wrong, and we suddenly need a whole lot more oomph?  What happens if we overbought, and we’ve got all this expensive hardware sitting around idle because the application never caught on with end users?

Virtual servers can be easily scaled up or scaled down.  Simply shut the virtual machine down, change the number of CPUs and memory it has with a few mouse clicks, and boot it back up again.  Presto change-o.

We can even move storage around.  Say we initially decided to put the server’s data on a cheap RAID 5 SATA array, and now our users have fallen in love with the application and they’re adopting it like crazy.  We can shut it down, move the virtual hard drives over to a faster RAID 10 SAS array, and boot it back up again.  Presto change-o, rapid storage performance improvements without long downtime windows to backup/restore.

I loved this approach because it let me keep old SQL Servers around as long as necessary.  For example, we decommissioned an old help desk database server, but I told the help desk folks they could keep it around as long as they wanted.  It hardly used any resources at all, because nobody queried it unless they had a question about an old help desk ticket that didn’t get transitioned correctly to the new system.  I set the server up with one virtual CPU, 1gb of memory, and put it on cheap RAID 5 SATA.  The end users loved me because I could provide the service for no cost.

Virtual Server Performance Isn’t That Bad

Virtualization has a really bad reputation because in the beginning, the software really did suck and admins didn’t understand how to use it.  Raise your hand if you installed VMware Workstation on your desktop years ago, and you tried to run multiple operating systems on a machine that barely had the horsepower to run Internet Explorer.  I was there, and I know how it was.

Things have changed: the software’s gotten much better, memory became absurdly cheap, and there’s resources to help use it better.

Busted!

Busted!

The 2008 book Oracle on VMware by Bert Scalzo is a good example.  Bert’s one of the Oracle experts at Quest, and he wrote this to help DBAs understand how to implement database servers in a virtual environment.  It does a good job of explaining enough about virtualization to make a DBA comfortable with the technology and avoid some common pitfalls.  Years ago, books like this weren’t available because the technology was changing so fast that best practices were wrong as fast as they were written.

You can still get really bad performance with virtualization, just as you can get really bad performance with SQL Server on native hardware.  But follow a few basic guidelines like avoiding oversubscription, properly configuring networking & storage, and using the right OS configurations, and you can get perfectly acceptable performance.  Yes, you’re still going to lose a few percent of overhead – but with today’s redonkulously fast CPUs and memory, I’m more concerned about optimizing T-SQL code than I’m concerned with losing 5% of my CPU speed due to virtualization.  It’s all about priorities, and that small performance loss is just one piece of the picture.

Virtualization is All About Give and Take

The economy has gone down the toilet.

To make matters worse, it’s one of those pay toilets, and US Treasury Secretary Timothy Geithner has run out of quarters.

Invisible Quarters

Invisible Quarters

Until he’s willing to go through the Oval Office couch looking for more change – and I don’t blame him for being hesitant, because Bill Clinton left some disgusting stuff in that couch – we’re going to have to buckle down and find ways to save money.  As I mentioned in my last post, we can either cut hardware costs, or we can cut people costs.

Virtualizing non-mission-critical SQL Servers gives us the chance to cut costs without cutting service levels, and furthermore, gives us the chance to show management that we’ve got skin in the game.  If we insist that every single SQL Server is too important to be virtualized, and that there’s no way we can save money, then management just might look at us as part of the problem.  Be part of the solution: be proactive, find SQL Servers with low utilization levels, and offer them up as the first phase.

My approach was to start with the SQL Servers that I frankly didn’t really want to survive on their own anyway.  I had one particular application that had always demanded its own standalone SQL Server with no other applications on it.  The server was barely used, and it was a completely out-of-date and unsupported version of SQL Server.  The application manager wouldn’t allow me to patch it, wouldn’t upgrade to a newer version, and didn’t have the budget to move to newer hardware.

Virtualization administrators have slick tools like VMware Converter and Vizioncore vConverter to automate the physical-to-virtual (P2V) process.  These solutions take a backup of the physical server and clone it into a brand-new virtual server.  When the virtual server starts up, the new virtualization drivers are installed automatically, and the server is up and running smoothly without time-intensive application reinstalls.  I’ve blogged about virtualizing SQL Servers with P2V and I’ve performed it many a time – it’s a great way to get rid of hardware dinosaurs.

Even better, this whole process doesn’t require work from the DBA.  The time and effort is all put in by the virtualization administrator.  If your sysadmin is dying to try virtualizing a SQL Server, you can point them at your newly chosen dinosaur and tell ‘em to have at it – you don’t have to be involved.  That’s the best of both worlds: management will see you as a part of the solution, but you won’t actually have to do any work.

Sounds Great! Let’s Virtualize SQL Server Today!

Well, it’s not all unicorns and rainbows: there’s some reasons why you might not want to virtualize SQL Server, and I’ll talk through those next.

Continued: Why You Shouldn’t Virtualize SQL Server

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube