VSS backup on Windows Server (Exchange Server)

Hi,
I hope this question hasen’t been solved earlier. If so, please leave a link. Thanks.

Well, we try to make consistent backups of a MS Exchange Server. restic does the VSS request and the Exchange Server does recognize it but fails shortly after trying to bring the database to a so called freezed state.

When we do a manual snapshot with the diskshadow tool, everything works fine.

Here is a diskshadow output, after restic performed VSS:

DISKSHADOW> list shadows all

Alle Schattenkopien auf dem Computer werden abgefragt...

        * Schattenkopiekennung = {f77f15ef-e33e-486e-b3ab-62fa99e2b667}         <No Alias>
                - Schattenkopiesatz: {bfee039b-138b-4966-97f7-e8eb083bc62a}     <No Alias>
                - Ursprüngliche Anzahl von Schattenkopien = 1
                - Ursprünglicher Volumename: \\?\Volume{b1537fc6-e3e3-4a64-8c52-010b1b5429d4}\ [C:\]
                - Erstellungszeit: 19.09.2022 11:41:38
                - Gerätename für Schattenkopien: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy55
                - Ursprungscomputer: ex01
                - Dienstcomputer: ex01
                - Nicht verfügbar gemacht
                - Anbieter-ID: {b5946137-7b9f-4925-af80-51abd60b20d5}
                - Attribute:  Auto_Release Differential


        * Schattenkopiekennung = {157061d2-4630-4e40-9259-2615785da532}         <No Alias>
                - Schattenkopiesatz: {8c54efd4-1056-43b1-9d5a-602cccb82fdf}     <No Alias>
                - Ursprüngliche Anzahl von Schattenkopien = 1
                - Ursprünglicher Volumename: \\?\Volume{1af94ff4-ba80-4892-b81f-01ab94e8162f}\ [E:\]
                - Erstellungszeit: 19.09.2022 11:42:18
                - Gerätename für Schattenkopien: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy56
                - Ursprungscomputer: ex01
                - Dienstcomputer: ex01
                - Nicht verfügbar gemacht
                - Anbieter-ID: {b5946137-7b9f-4925-af80-51abd60b20d5}
                - Attribute:  Auto_Release Differential


Anzahl der aufgeführten Schattenkopien: 2

DISKSHADOW>

And here after diskshadow itself did so:

DISKSHADOW> list shadows all

Alle Schattenkopien auf dem Computer werden abgefragt...


        * Schattenkopiekennung = {f06a232e-95ef-4e36-8cfc-dc4a51ca4d68}         %VSS_SHADOW_1%
                - Schattenkopiesatz: {9bfb5de7-05f3-43b7-839c-0467b8d2dc70}     %VSS_SHADOW_SET%
                - Ursprüngliche Anzahl von Schattenkopien = 2
                - Ursprünglicher Volumename: \\?\Volume{b1537fc6-e3e3-4a64-8c52-010b1b5429d4}\ [C:\]
                - Erstellungszeit: 19.09.2022 11:44:38
                - Gerätename für Schattenkopien: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy57
                - Ursprungscomputer: ex01
                - Dienstcomputer: ex01
                - Nicht verfügbar gemacht
                - Anbieter-ID: {b5946137-7b9f-4925-af80-51abd60b20d5}
                - Attribute:  Auto_Release Differential


        * Schattenkopiekennung = {d9e56d79-da31-474c-80a2-bac11b8ab8cd}         %VSS_SHADOW_2%
                - Schattenkopiesatz: {9bfb5de7-05f3-43b7-839c-0467b8d2dc70}     %VSS_SHADOW_SET%
                - Ursprüngliche Anzahl von Schattenkopien = 2
                - Ursprünglicher Volumename: \\?\Volume{1af94ff4-ba80-4892-b81f-01ab94e8162f}\ [E:\]
                - Erstellungszeit: 19.09.2022 11:44:38
                - Gerätename für Schattenkopien: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy58
                - Ursprungscomputer: ex01
                - Dienstcomputer: ex01
                - Nicht verfügbar gemacht
                - Anbieter-ID: {b5946137-7b9f-4925-af80-51abd60b20d5}
                - Attribute:  Auto_Release Differential

Anzahl der aufgeführten Schattenkopien: 2

DISKSHADOW>

As you can see, diskshadow does combine both drives (c: and e:) within one Schattenkopiesatz, while restic seems to do two independent snapshots.

I don’t know how VSS is done internally in restic, but are there any chances, that we miss some restic functions which would enable the same feature as diskshadow?

Thanks.

Hey,

I had a quick look through some of the VSS threads/PRs and found this from the original VSS PR (Support for Volume Shadow Copy Service (VSS) on windows by fgma · Pull Request #2274 · restic/restic · GitHub):

What is the expected behavior when backing up data from multiple volumes at once? Currently this create multiple independent snapshots. I’m not sure whether it would be better to create a complete snapshot of all backup paths?

This is currently not possible as one does not know all paths in advance at the necessary locations inside the code. Maybe we can add this as a new feature after this PR is done.

I can’t find any evidence of a later PR to alter this, and coupled with the behaviour you’re seeing, it sounds to me like restic unfortunately isn’t currently capable of generating a single shadow copy that includes multiple drives.

You can create multi volume snapshot only via volume mount points:
execute md C:\DriveE + mountvol C:\DriveE \\?\Volume{1af94ff4-ba80-4892-b81f-01ab94e8162f}\
and change all E:\ to C:\DriveE\ in you backup paths.

Good point.

We will give it a try. Thanks.