I've been working with the Veeam support team on this on and off for about 6 weeks with zero luck. Case Number: 07072471 - Here's the situation:
I have a Cisco UCS B2000-M5 server blade running Windows Server 2019 and Microsoft SQL 2019 Always On with version 5 of the Veeam Agent for Microsoft Windows on it.
We have three nodes on this Always On group, and Nodes 1 and 3 fail at every attempt at a backup. Node 2 is able to backup successfully. Node 3 is at a different geographical location with similar hardware.
I've been doing the testing on the 3rd Node because it's the farthest removed from our Production activity.
I'll ping support management to ask for an update of the case.
MSSQL VSS writer are managed and run by the Microsoft SQL application. Have you considered to open a case with Microsoft?
At one point in time the Veeam support tech was talking about bringing Microsoft into this issue, but nothing ever came of this.
Bringing Microsoft in from our side doesn't really make sense because the SQL server itself is functioning normally, it's the Veeam Agent for Windows that is failing.
I would say that the issue is related to SQL Server VSS writer, I doubt that the issue comes from our code. Veeam Agent for Windows just sends a request to create a shadow copy while the shadow copy creation process is managed by VSS framework. Also, the state VSS_WS_FAILED_AT_PREPARE_SNAPSHOT usually indicates an issue at the OS level (check VSSADMIN LIST WRITERS output).
You may ask our engineer to help you with manual testing of VSS framework according to the instructions in this KB. If the diskshadow tool fails with the same error, it will be a good starting point for communication with Microsoft support. Also, you may collect vsstrace output and Windows event logs so that our support engineers can review them.