Veeam and SQL Clusters in Azure, Part 1: The Veeam Agent
// Table of Contents
Hello All and welcome back!
I’ll be honest, I’m not a SQL expert. I’m the backups guy ๐. I know enough about SQL to be dangerous, but I couldn’t answer a question from a customer, so I figured, hey, let’s get my hands dirty and lab it up to test, which of course always makes a good blog.
They run SQL Server failover cluster instances on Azure shared disks, and they wanted to see exactly how Veeam protects that.
Along the way I built a second SQL cluster, an Always On availability group, because it’s the other way people cluster SQL and I wanted to compare the two side by side. Then I protected both of them two ways, with the Veeam Agent and with the Veeam Plug-in for SQL.
This is a two-part series:
- Part 1: the Veeam Agent, with one cluster-aware job type that handles both clusters, failovers and all.
- Part 2: the Veeam Plug-in for SQL, which hands the DBA the keys from inside SSMS, and how to run both together.
Right, let’s get into it.
The Lab
Let’s start with what we’re protecting. Everything lives in Azure: Windows Server 2022, SQL Server 2022 Developer edition (it’s free for labs, which kept the bill friendly), and a Veeam Backup & Replication 13.1 server in its own network, peered into the lab.
There are two ways to cluster SQL here, and they work completely differently:
- The availability group (AG): two servers, and each one keeps its own full copy of the database. SQL keeps the copies in sync, and apps connect to a listener name that always points at the primary.
- The failover cluster instance (FCI): two servers, but only one copy of the database. It lives on a single Azure disk that’s attached to both VMs at the same time, and whichever node is active owns it.
I know you can do an AG on top of an FCI, but I’m not going to cover that here.
Proving the Shared Disk Is Real
Before we protect anything, let’s get the shared disk up and running and configured. An Azure shared disk is a normal managed disk with Max shares set above 1. Mine’s a Premium SSD P10 (128 GB) with Max shares set to 2, plus a tiny 4 GB P1 disk the cluster uses as its quorum witness. Shared disks work on Ultra Disk, Premium SSD v2, Premium SSD and Standard SSD, and host caching isn’t supported on them, so it’s set to None (Microsoft’s shared disk docs).
In the Azure portal:
- Open the disk and check Settings > Configuration: shared disk enabled, Max shares 2
- Open each VM’s Disks page: the same disk shows up on both, at the same LUN
Same disk, two VMs. Windows Failover Clustering decides which node is allowed to write to it at any moment. Simple as that.
Step 1: Add the Clusters with an Active Directory Protection Group
This is the step I got wrong first time, so learn from my mistake! I added the four SQL servers to an “Individual computers” protection group by IP, built a failover cluster job, and Veeam told me it was unable to process a standalone host with a failover cluster backup job.
So what does Veeam want instead? A failover cluster job needs the cluster itself, and the way Veeam finds a cluster is through Active Directory.
- In the Veeam console, go to Inventory > Physical Infrastructure > Create Protection Group
- Pick Microsoft Active Directory objects
- On the Active Directory step, click Change, enter your domain controller or domain name (port 389) and an account that can read AD
- Click Add, set the search type to Failover Cluster, and add your cluster names (mine are the AG’s cluster and the FCI’s cluster)
- On Exclusions, make sure All virtual machines isn’t ticked, because every one of these servers is a VM
- On Credentials, set an account that’s an admin on the nodes and a sysadmin in SQL
- On Options, tick Install backup agent. Ticking Install changed block tracking driver makes your incrementals much faster, but it needs a reboot
Once the rescan finishes, you’ll see every node of both clusters, with the Agent deployed to all of them. And you didn’t have to list a single server!
Step 2: Create a Failover Cluster Backup Job
Now let’s build the job.
- Go to Home > Backup Job > Windows computer
- On Job Mode, set the type to Failover cluster
- On Computers, add the cluster (one cluster per job keeps things tidy, so I made one job each)
- On Backup Mode, pick Entire computer (file-level backup isn’t available for clusters)
- Pick your repository on Storage
- On Guest Processing, tick Enable application-aware processing, then click Applications, select the cluster and click Edit
Now, the transaction log settings are where you choose who owns the logs:
- Process transaction logs with this job, then on the SQL tab, Backup logs periodically: the Agent backs up the logs itself (every 15 minutes by default, up to every 480 minutes), so you can restore to a point in time
- Perform copy only: the Agent leaves the logs alone, for when another tool is backing them up
I went with Perform copy only, because in Part 2 the plug-in takes over the logs. If the Agent is your only SQL protection, go with backing up the logs periodically.
So why bother with a cluster job at all, when you could back up each node as a normal server? Because Veeam’s docs are pretty clear about what happens if you don’t. Backed up node by node, the Agent isn’t cluster-aware: a failover starts a new full backup chain, the same data gets stored once per node, and transaction log backup is switched off completely on AG nodes. The cluster job fixes all three.
Failover Without a New Full
Here’s the test I really wanted to see. Veeam’s docs say that with a cluster job, the clustered disk stays in the same backup chain while it moves between nodes, so a failover doesn’t trigger a new full backup. Let’s put that to the test!
First, the baseline. The job’s first run was a full, with SQL running on sql04: it read 51.4 GB and took about 13 minutes.
Then I moved the FCI over to sql03 in Failover Cluster Manager:
- Open Failover Cluster Manager and go to Roles
- Right-click SQL Server (MSSQLSERVER) and pick Move > Select Node
- Pick the other node and click OK
In my lab that takes about 15 seconds, and the shared disk goes with it.
Now the moment of truth. I ran the job again:
See that? An incremental! Out of 56.4 GB in use across the nodes and the shared disks, it read 3.6 GB, sent 409 MB to the repository, and finished in 5 minutes 19 seconds. No new full in sight.
Digging into the session log, the shared SQL data disk was backed up through sql03 this time, where the run before the move had backed it up through sql04. Both nodes logged “Incremental backup created”. Same chain, different node, and Veeam didn’t miss a beat.
On a big database, not re-reading the whole thing after every failover is a very big deal.
Getting Data Back with Veeam Explorer for SQL
This is where image-level backups really earn their keep. In the Agent backup, right-click the node that was running SQL when the backup ran (sql03 for my latest restore point) and pick Restore application items > Microsoft SQL Server databases, and Veeam Explorer for SQL opens. From there you can:
- Restore a whole database, to the original server or somewhere else, under a new name if you like
- Restore just one table (schema and data), for the classic “someone dropped the wrong table” moment
- Publish a database straight from the backup for reporting or a quick look, which I wrote about back in 2020
- Instantly recover a database, running from the backup while it moves back in the background
- Export a database to files
So let’s try the classic: getting one table back. I restored SalesLT.Customer from the restore point taken just after the failover:
- In Veeam Explorer, select the database, then go to Database > Restore Schema > Restore database schema and data
- Pick the point in time of the selected image-level backup
- Set the target server (I sent it straight back to the FCI)
- Tick the table under both Object and Data
- On the names step, click Auto, so it comes back as
Customer_newbeside the original rather than over the top of it
About two minutes after Veeam mounted the restore point, SalesLT.Customer_new was sitting in the database with all 847 rows. Exactly what I wanted!
Restoring a single table needs a staging SQL server: Veeam Explorer mounts the restore point to it and reads the table from there. Set it in Veeam Explorer under General Options > Staging Server. Any edition works, Express included (as long as the database is under 10 GB), but it needs the same SQL version as the source or later, and it can’t be part of an FCI. I used one of my AG nodes’ own SQL instance. Veeam doesn’t recommend pointing it at an AG listener, so use the instance name, not the listener.
Let’s be honest, on a 50 TB database the publish and instant recovery options are the stars here: you’re using the data in minutes rather than waiting hours for it to copy back.
A Few Things Worth Knowing
A few things caught me out along the way, in the order you’re likely to hit them:
-
Your Veeam server has to resolve the cluster names, and the FCI’s SQL name too.
- Mine isn’t domain-joined and uses Azure DNS, so it couldn’t see the lab domain until I added hosts file entries.
- I added the nodes and both cluster names, and the backups were happy. Then my first table restore back to the FCI failed with “The network path was not found”, because the restore connects to the FCI’s own SQL name (sqlfci in my lab), and that wasn’t in the list.
- A multi-subnet FCI moves that name between two IP addresses on failover, so DNS beats a static hosts entry if you can use it.
-
Installing the Agent can restart your nodes, and a restart is a failover.
- During my first deployment, one node of each cluster restarted at the same moment, right as the Agent went on, and my AG failed over to its other node.
- Everything recovered on its own, but plan the first deployment for a maintenance window, and think twice about Perform reboot automatically if required on a cluster.
-
“SQL VSS Writer is missing” on a multi-subnet FCI. This one had me scratching my head!
- What I saw: my FCI’s nodes sit in two different Azure subnets, so its name has two IP addresses, one per subnet, and only one is live at a time. My first FCI job warned that the SQL VSS writer was missing, and I could make it happen again on demand.
- Why: the writer was looking up the FCI’s name, getting the offline address first, and stalling for 65 seconds before giving up. A packet capture showed it dialling the dead IP.
- The fix: a standard Microsoft setting for clients that can’t try both addresses. Register only the live IP in DNS, with a short TTL:
$nn = Get-ClusterResource 'SQL Network Name (sqlfci)' $nn | Set-ClusterParameter -Multiple @{ RegisterAllProvidersIP = 0; HostRecordTTL = 60 } Stop-ClusterResource $nn.Name Start-ClusterGroup 'SQL Server (MSSQLSERVER)'- Just a heads up: restarting the name takes SQL offline for a few seconds, and after a failover, clients take up to a minute to follow the new address.
- Credit to Veeam for flagging it, because this would quietly hurt any VSS-based backup, not just Veeam’s.
-
System databases don’t show up in Veeam Explorer from image-level backups.
- Restore master, model or msdb with a guest OS file restore instead.
Wrapping Up
One protection group, one job type, and you’ve got both kinds of SQL cluster protected, with failovers handled without a new full backup and restore options right down to a single table. Honestly, for a cluster running on Azure shared disks, that’s exactly the experience I hoped to show.
In Part 2, we hand the keys to the DBA: the Veeam Plug-in for SQL, backup policies for both clusters, restoring from inside SSMS, and how to run the plug-in and the Agent side by side without them fighting over the logs.
Thanks for reading, see you in Part 2 ๐