vSphere + SQL 2012 + AlwaysON

Over the weekend, one of my ex-colleagues reached out to me for my input on running SQL in a 2 node Microsoft Cluster. Of course, these servers were supposed to be VMs and all that. Now my initial reaction was, yeah sure you can do all this but there are restrictions that are placed on VMs that are part of MSCS. This included, affinity rules, exceptions in DRS, limited to two nodes only and all the other stuff that goes along with it.

Below are some of the limitations or stuff that you CANNOT do on VMs that are part of the MSCS. This is straight from the install guide:

  • Mixed environments, such as configurations where one cluster node is running a different version of ESXi than another cluster node.
  • Use of MSCS in conjunction with vSphere Fault Tolerance (FT).
  • Migration with vSphere vMotion of clustered virtual machines.
  • N-Port ID Virtualization (NPIV)

As I was going over the caveats, I was reminded that this will be running SQL 2012 using AlwaysON Availability Groups, and the VMs need to be in a cluster however there will bo no need for shared storage, even the quorum can be windows share somewhere on a fileserver etc. When I heard that, I was confused and asked for some time to do research. I read a few articles online, talked to folks on twitter, posted input on the secret vExpert community (which btw was very helpful and prompt) and came back with a totally different mindset to approach this.

Based on the feedback I got from everyone, from the articles I read and of course the AlwaysON intro my ex-colleague gave me I came to the following conclusion. VMs running SQL 2012 AAG in a Microsoft Cluster with no shared disk should be treated like any other VM. Which means, you can have more than 2 nodes and the limitations of  a typical MSCS VM does not apply. Why so?

To start off, what in the world is AAG? You can get some good detailed info on that here. But to put it simply, AAG is the new and improved HA and DR solution for SQL, kinda like database mirroring (the orignal database mirroring still exists but its probably on it’s way out).

It’s like mirroring, but we get multiple mirrors for many more databases that we can fail over in groups, and we can shed load by querying the mirrors.

It relies on Windows Failover Clustering and the file synchronization happens at the application layer. This means that all those contraints that are usually placed on MSCS VMs due to RDMs, dont exist here. This also means, you can vMotion the box and do everything that you would to most other VMs. To put it simply, it’s not a special VM anymore.

How is AAG better than database mirroring? Below is a list of some of the improvements extracted from this article:

  • Supports one primary database replica and allows up to 4 secondary database replicas targets.
  • Asynchronous-commit mode. This availability mode is a DR solution that works great when the availability replica copies are distributed with not so stable connection.
  • Synchronous-commit mode. This availability mode put emphasis on high availability and allows data protection over performance, con is transaction latency.
  • Allows automatic page restoration against page corruption.
  • Backupable and Read-only access to the secondary databases
  • Fast application failover is provided by availability group listeners.
  • The greater failover control is achieved by Flexible failover policy.

Of course there are a few things to consider when you run this all virtually (thanks to the VMTN feedback I received), even though you may be able to vMotion these boxes, keep in mind the Windows Failover Cluster (WFC) heartbeat is very sensitive and and the small stun time maybe enough for your cluster to assume a node has failed. So adjusting your heartbeat timeout maybe something to consider. Matt shows here how to do that here, though he is doing that on a Database Availability Group (DAG), it still relies on WFC like AAG.

Now how do you set this up? I was thinking about doing a step by step but I found someone else who already beat me to that. So here are the steps that cover setting up WFC to enabling AAG on SQL. Denny Cherry also plans to have a session around this topic at VMworld.

In the end, I think SQL 2012 with AAG will certainly help to better the relationship of SQL and virtualization. With the restrictions relaxed on this type of a setup, you can now have bigger WFC clusters within a HA/DRS cluster. With HA/DRS you get the protection from hardware related incidents and with AAG,  your application becomes intelligent. In the end you look good and find more time to do more important things in life. :)

PS : Lastly, we will still be doing a proof of concept to see how well this all holds up. I will encourage you to do your independent testing before introducing this in production. In paper this sounds perfect. I plan to keep this post updated with what we find / learn or at least a link to the updated post depending on how this goes. Good luck!

vBaby Alert!! Finally :)

For those of you who dont know, my wife and I had our first child earlier this year who is exactly 3 months old today. Aleena Marie Hashmi was born on Feb 10th 2012. So the one thing I wanted to get her was of course a VMware outfit, but considering how my luck has treated me over the years, Aleena was a very tiny baby who took 3 months to fit in the outfit her daddy got her.

It’s still a little big on her and her mommy kept saying she would look too fat bla bla bla you know how that goes. Anyways, I figured what better way to introduce a vBaby wearing a vShirt than posting it on a blog full of all kinds of vStuff!! Who says geeks don’t know how to have fun. We just do it a little differently.

 

SMTP and vCenter Ops Mgr

I have had a few people ask me how are SMTP alerts set in Ops Manager, so I figured I would do a little post on that in case there are more people confused on how to set this up.

First of all, this info is available in the install guide but I will try and clarify what I think may be confusing to some. If you click on “Notifications” from the Ops Manager portal you may be greeted by the message below if you have not set your SMTP settings yet.

Ok that is simple enough, go ahead and enter your settings. But soon you will realize that there is nohere to enter these settings. Right? Wrong!! You are looking in the wrong place. This is a excerpt from the install guide:

Prerequisites

  • Verify that the vCenter Operations Manager vApp is powered on.
  • Verify that you have administrator privileges to access the Administration portal and log in to the portal.

Notice it says “Administration Portal”. Your Ops Manager portal is usually https://UI VM IP however your “Administration Portal” is https://UI VM IP/admin. This is where you need to be. Once you log in there the instructions in the install guide listed below start making sense.

Again the following is an excerpt from the install guide, as you can also tell this is the place where you need to be in order to set up SNMP as well.

  1. On the SMTP tab, select the Enable report email service check box.
  2. Type the SMTP server address and port number.
  3. Type the name and email address to use when sending alerts or reports.
  4. If the SMTP server uses an encrypted connection, select the Server requires an encrypted connection check box and select the encryption protocol.
  5. If the email service needs to authenticate with the SMTP server when sending alerts, select the Outgoing SMTP server requires authentication check box and type the credentials.
  6. Select the Enable SNMP check box and type the destination host, port, and community information.
  7. Click Update to apply your settings.

vCenter Operations can send email notifications and scheduled reports.

Hope the above helps you in getting started with receiving those valuable notifications via email. One small suggestion, try not to go crazy with the email notifications because after sometime they may get treated like spam. You spent tons of money for Ops Mgr, make sure when it sends out a notification, its important.

vSphere 5 Lab Automation

I must admit the last few weeks have been super crazy which is why I havent been able to post as often as I would like. The other day, Alastair Cooke and company posted a nice automation tool that will enable you to build your lab in a snap.

I have personally not tried it out myself due to my crazy schedule but I know these guys are a group of very smart individuals. In a nut shell this tool lets you deploy your lab setup in a single laptop/dekstop with just 8GB of memory. Once deployed the tool will leave you with 2 ESXi hosts, 1 vCenter, 1 domian controler, 1 Freenas and 1 FreeSCO for you to test/learn etc. Keep in mind only free/open source software are distributed with the tool, you will need the installers and licenses for whats not considered free.

So, if you are new to vSphere and dont know were to begin, this will certainly help, you can also be a veteran and simply use this for testing purposes. The rest of the details are here.

vExperts 2012 announced

This morning while packing my stuff for a trip tomorrow, I came across the tweet that lead me to the announcement of the 2012 vExperts. It was a bit sneaky because I didn’t see it coming back this early, but hey it’s great! John, Alex and team did an awesome job for the fast turnaround.

Here is the announcement and here is the temp list of all vExperts 2012. This is a temp list because not all vExperts have been added to the list yet. So if you don’t see your name in there, don’t feel let down. It might get added soon.

Congrats to all new and returning vExperts, last year was great and seems like this year will be even better. Last year the total count for vExperts was 281, lets see how many more were added to the list. The more the merrier.

Ops Manager does not show up under Assets in vSphere Client

Ok so I just went through some very painful hours and I hope nobody else has to ever go through this. Thats the reason fro this post. So I am sort of rearranging parts of my lab which really started the whole mess. I had to redeploy Operations Manager. Sounds pretty simple right? Read on..

Everything went great as far as registering Ops Mgr to my vCenter etc but then something odd really happened. I wasn’t able to apply the license for Ops Mgr. Keep in mind, you can only apply the license for Ops Mgr using the vSphere-Client under Home –>Administration –> Licensing, when there click on the “Asset” radio button and there you would see your unlicensed Ops Mgr waiting for your license key.

Only in my case, I saw both my hosts and the vCenter but no Ops Mgr. I tried everything under the sun from un-registering, re-registering but nothing really worked. I power cycled the vApp, restarted by vCenter service in hopes for it to start seeing things. Interestingly I could see “vCenter Operations Manager” in my home screen under “Solutions and Applications” but clicking it came back with a message saying you are not licensed you idiot. Well not quite but you know what I mean.

I was inches away from re-deploying the vApp when I figured well lets try one more thing. I looked around and noticed people had more luck with launching the vSphere client from the vCenter Server and that seem to have worked for a few folks. I figured well why not. So far I was accessing all this from the vSphere client installed on my laptop. So I logged into my vCenter (Mr. Hades) and launched the vSphere client there to see if that made a difference.


I was pleasantly surprised to see that this time around I did see Ops Mgr under Assets in licensing. Why did this work and the other didn’t? I have no clue but if I have to take a guess I would say it must have something to do with the vSphere client and not really Ops Mgr, but I am not sure. Now I did deploy Ops Mgr a few months ago and don’t recall having this issue before (I do have bad memory so its possible that I just forgot). But this is really for someone else out there who happens to see the same issue as I did, try accessing your vCenter from the vSphere client installed on the vCenter server itself and see if you have any luck.

From here onwards, you should be able to license your Ops Mgr and finally log in. For the record I am running vSphere 5 U1 and I am NOT running the vCSA. Getting the license applied in Ops Mgr is really important because basically you can’t really login to the Ops Mgr portal if its not licensed. If you are having the same issue as described above, hopefully you found this blog before you ruined your entire day like I did.