[BUG]VSS writer trigger event when for non configure folders

Dinesh Datir 0 Reputation points
2024-01-05T06:57:32.66+00:00

I am running windows server backup tool and vsswriter.exe

In vsswriter config I configured c:\writerData path and with windows server backup tool I backup D:\testfolder, here I am still getting Onfreeze and all other event on writer console Is that expected behaviour?

Why it trigger the event when I did not configure it for writter?

Added Component Filespec:
Path: c:\writerData
Filespec: *
Recursive: no
AlternatePath:
allBackupRequired
allSnapshotRequired

Received event: PrepareForBackup
the current backup type is not supported by the writer!  the backup will be considered a full backup
Received event: PrepareForSnapshot
Received event: Freeze
Received event: Thaw
Received event: PostSnapshot
Current context is appRollback
Received event: Identify
Backup schema: 768
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,516 questions
Windows Server Backup
Windows Server Backup
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Backup: A duplicate copy of a program, a disk, or data, made either for archiving purposes or for safeguarding valuable files from loss should the active copy be damaged or destroyed.
464 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 33,301 Reputation points Microsoft Vendor
    2024-01-17T06:18:38.5133333+00:00

    Hi Dinesh, Hope you're doing well. It is normal to see the "OnFreeze" event in the writer console when a shadow copy freeze is initiated. The "OnFreeze" event is triggered by the writer on receipt of a Freeze event at the start of a shadow copy freeze. The writer uses this event to perform operations needed to participate in the freeze or to veto the freeze. The "OnFreeze" event is a pure virtual method that must be implemented by derived classes. It is not implemented by the CVssWriter base class. In your case, you have configured the "vsswriter.exe" to use the "c:\writerData" path and are backing up the "D:\testfolder" using the "Windows Server Backup tool". However, the "OnFreeze" event is not related to the configuration of the writer. It is triggered by the writer on receipt of a Freeze event at the start of a shadow copy freeze. I hope this helps clarify your doubts. Best Regards, Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.


  2. Daniel Nashed 0 Reputation points
    2024-02-05T10:14:42.5233333+00:00

    Thanks for your reply. Let me clarify what we are looking for.
    I am working with Dinesh on this. And we have extended the VSSWriter class.

    The challenge here is to only perform backup operations when the disk the application is on, is part of the snapshot.

    Let's say the application data is in d:\data.
    On Notify the VSS writer of the application reports back that it is interested in d:\data only.
    We have not found a way to find out what the VSS back-end wants to backup.
    So we had the assumption VSS would only call the application writer when d:\data is included in the snapshot operations. In MyVSSWriter::OnIdentify the application is adding the components. And we assumed this would tell the VSS back-end to only ask for backup if d:\data is part of the snapshot. But the MyVSSWriter::OnFreeze(..) event is still called and we did not find any way to find out which part of the server is requested to be in the snapshot.

    The goal is either to tell VSS we are not interested or find out what VSS wants to snapshot and the VSS Writer could ignore it. See the example code below -- which is almost what is in the examples. There isn't much documentation available.

    Thanks for any tip

    Daniel

    STDMETHODIMP_(bool) VSSWriter::AddComponents (IVssCreateWriterMetadata *pMetadata)
    {
        bool    bResult = false;
        HRESULT hr      = S_OK;
    
        hr = pMetadata->AddComponent(
            VSS_CT_FILEGROUP,        // Component type
            m_wszDataDirectory,      // Logical path
            g_wszDataGroupName,      // Component name
            g_wszDataGroupName,      // Caption / Friendly name
            NULL,                    // Icon
            0,                       // Icon size
            false,                   // Restore metadata (reserved for future use)
            false,                   // Notify on backup complete (reserved for future use)
            false,                   // Selectable
            false,                   // Selectable for restore
    
            VSS_CF_BACKUP_RECOVERY); // dwComponentFlags: Signal that we want to update the snapshot
                                     // in OnPostSnapshot event to signal VSS_VOLSNAP_ATTR_AUTORECOVER
    
    
    0 comments No comments