Challenge
Job using Application-Aware Image Processing fails during VSS processing with:
Unfreeze error: [Backup job failed. Cannot create a shadow copy of the volumes containing writer's data. A VSS critical writer has failed. Writer name: [SqlServerWriter]. Class ID: [{}]. Instance ID: [{}]. Writer's state: [VSS_WS_FAILED_AT_PREPARE_SNAPSHOT]. Error code: [0x800423f4].]
Cause
This is a known issue documented in this Microsoft KB: http://support2.microsoft.com/kb/2987610
Solution
Run this query to see if the issue is present:
SELECT 1 FROM SYS.AVAILABILITY_REPLICAS AS AR INNER JOIN SYS.DATABASES AS D ON DB_ID(N'xxxx') = D.DATABASE_ID AND AR.REPLICA_ID = D.REPLICA_ID INNER JOIN SYS.DM_HADR_AVAILABILITY_REPLICA_STATES ST ON AR.REPLICA_ID = ST.REPLICA_ID AND ST.ROLE = 2
If you receive the following, this confirms the issue.
Invalid object name 'SYS.AVAILABILITY_REPLICAS'.
This issue is resolved by the following Microsoft KB: http://support2.microsoft.com/kb/2983175