How to apply Windows or SQL Server patches to failover MS SQL Server cluster with AlwaysOn – Step by Step

High-level SQL cluster patching: Best practices
- Apply patches to lower environment servers first. This is DEV, QA, UA, etc. Use the lowest environment in the release cycle.
- Let the new change “burn in” for a while. What a “while” means, will depend on your situation. Some wait a week, some wait a month. The duration of “burn-in” depends on how rigorous and active QA testing is on those lower environment servers. If there is a ton of automated testing running daily, or there is an army of Quality Assurance staff – then 1 week may be sufficient.
- Often clients will deploy a change to DEV, wait two weeks. Then deploy the change to the next environment, wait two weeks. Do this until Production environment is reached.
- Once Production environment is reached, the way patches are deployed on SQL Server AlwaysOn environments is this:
- Reboot inactive node (AlwaysOn failover cluster instance FCI) – not a must, but you can. That way you know the environment you about to patch is fresh.
- Apply SQL Server Cumulative Update or Service Pack to the SQL Server.
- Reboot the node again. Reboot is not a must. But since we about to point all SQL production workload to here, this steps makes a lot of sense.
- Failover SQL AlwaysOn workload to the inactive node (wait failover period).
- Now do same process on that node.
- Repeat until all nodes are complete.

One caveat. If you using AlwaysOn in SQL Server properly, you have pointed all apps to use AlwaysOn Listener.
We have seen some environments, where hostname, and not AlwaysOn Listener or ClusterName is continuous to be used. THIS IS BAD. You simply going to have some problems with outages or application being unreachable until you do your DNS changes or re-deploy connection strings. And you aren’t using AlwaysOn it is supposed to be used.
How do you failover SQL AlwaysOn?
You have three choices:
- SSMS Wizard
- T-SQL
- PowerShell
This is how you patch your High Availability Windows Fail-over clusters (WFC) running MS SQL Server with AlwaysOn.
Step-by-step guide
Now let’s dive in and do this step by step:
- Check the SQL Backups
- We need to have a backup available
- Ensure backup jobs have been running without issues
- Do extra DB backup for safety
- Start with the passive node first. For this example, let’s assume it’s Node2
- Move all Roles/Resources out of Node2 (it should already be empty)

- Pause Node2 on FCI

- Install the SQL patches on Node2
- Install the Win updates on Node2 (if applicable)
- Reboot VM/Node2
- Resume Node2 in FCI

- Failback SQL instance to Node1 (If it was the primary node before the patching)
- Double check all resources are Online
- Check SQL Server that all databases are back Online, try running a few
SELECT
queries on any database to verify that they are all working - Pause Node1 on FCI

- Install the SQL patches on Node1
- Install the Win updates on Node1 (if applicable)
- Reboot the VM/Node1
- Resume Node1 in FCI

- Failback SQL instance to Node1 (If it was the primary node before the patching)
- Double check all resources are Online
- Check SQL Server that all databases are back Online, try running a few
SELECT
queries on any database to verify that they are all working
That’s how to do SQL Server failover cluster and AlwaysOn patching properly with the smallest outage window.