EDN Admin
Well-known member
Hi,
I dont know which forum is best to ask a VSS (Volume Shadow Services) API question, but here it goes. I have a single drive with Windows server and Exchange server 2010 that I want to backup using VSS and have the Exchange transactions
logs deleted. Everything I read says you simply start VSS and prepare for a full backup, add the volume, and at the end send backup complete and exchange is supposed to delete its log files, but I dont see that happening. I do see the event log
has:<br/>
<br/>
<span lang="FR-CA" style="font-size:11.0pt; font-family:Calibri,sans-serif Log Name: Application
<br/>
Source: MSExchangeIS <br/>
Event ID: 9609 <br/>
Task Category: Exchange VSS Writer <br/>
Level: Error <br/>
Keywords: Classic <br/>
User: N/A <br/>
Computer: APPS1<br/>
Description: Exchange VSS Writer (<span lang="FR-CA" style="font-size:9.0pt; font-family:Segoe UI,sans-serif instance 339055d9-f1c5-48fa-a99e-cd310ce9eb8c:1<span lang="FR-CA" style="font-size:11.0pt; font-family:Calibri,sans-serif )
failed with error code -2147221233 when preparing for Snapshot
Or you get something like:
<span lang="EN-GB" style="font-size:7.5pt Log Name: Error<br/>
Event Source: MSExchangeIS<br/>
Event Category: Exchange VSS <br/>
Writer Event ID: 9607 <br/>
User: N/A <br/>
Computer: APPS1<br/>
Description: Error code 0x8004010f when preparing for backup. <br/>
For more information, click http://www.microsoft.com/contentredirect.asp
http://www.microsoft.com/contentredirect.asp . <br/>
Data: <br/>
0000: 41 20 63 6f 6d 70 6f 6e A compon <br/>
0008: 65 6e 74 20 62 65 69 6e ent bein <br/>
0010: 67 20 62 61 63 6b 65 64 g backed <br/>
0018: 20 75 70 20 69 73 20 6e up is n <br/>
0020: 6f 74 20 6f 6e 6c 69 6e ot onlin <br/>
0028: 65 00 e.
However, if using Windows Server backup - it backs up okay and deletes the transaction files. The overview of what is done - What is missing to cause VSS to lock for exchange okay and to delete its transaction files after the backup of the C: volume?:<br/>
<br/>
// Create an IVssBackupComponents interface object<br/>
m_hResult = m_fnCreateVssBackupComponents(&m_pVssObject);<br/>
if (FAILED(m_hResult)) {<br/>
_ASSERT(m_pVssObject==NULL);<br/>
return false;<br/>
}<br/>
<br/>
// Initialize instance to manage a backup<br/>
_ASSERT(m_pVssObject!=NULL);<br/>
m_hResult = m_pVssObject->InitializeForBackup();<br/>
if (FAILED(m_hResult)) {<br/>
return false;<br/>
}<br/>
<br/>
// setup the context the user wants<br/>
m_hResult = m_pVssObject->SetContext(context);<br/>
if (FAILED(m_hResult)) {<br/>
return false;<br/>
}<br/>
<br/>
// docs say this step is required<br/>
IVssAsync *pasync = NULL;<br/>
m_hResult = m_pVssObject->GatherWriterMetadata(&pasync);<br/>
if (FAILED(m_hResult)) {<br/>
_ASSERT(pasync==NULL);<br/>
return false;<br/>
}<br/>
// wait for async object (and free it)<br/>
m_hResult=AsyncWaitAndCleanup(&pasync);<br/>
if (FAILED(m_hResult)) {<br/>
return false;<br/>
}<br/>
// create snapshot set if not already created<br/>
if (m_idSnapshotSet==GUID_NULL) {<br/>
// Create a new, empty shadow copy set<br/>
m_hResult = m_pVssObject->StartSnapshotSet(&m_idSnapshotSet);<br/>
if (FAILED(m_hResult)) {<br/>
_ASSERT(m_idSnapshotSet==GUID_NULL);<br/>
return false;<br/>
}<br/>
}<br/>
<br/>
// Add specified volume to snapshot set<br/>
VSS_ID idsnapshot = GUID_NULL;<br/>
m_hResult = m_pVssObject->AddToSnapshotSet(L"C:", GUID_NULL, &idsnapshot);<br/>
<br/>
if (FAILED(m_hResult)) {<br/>
return false;<br/>
}<br/>
// Configure the backup<br/>
m_hResult = m_pVssObject->SetBackupState(FALSE, TRUE, VSS_BT_FULL, FALSE);<br/>
if (FAILED(m_hResult)) {<br/>
return false;<br/>
}<br/>
<br/>
// notify writes of backup operation<br/>
IVssAsync *pasync = NULL;<br/>
m_hResult = m_pVssObject->PrepareForBackup(&pasync);<br/>
if (FAILED(m_hResult)) {<br/>
_ASSERT(pasync==NULL);<br/>
return false;<br/>
}<br/>
// wait for async operation to complete<br/>
m_hResult=AsyncWaitAndCleanup(&pasync);<br/>
if (FAILED(m_hResult)) {<br/>
return false;<br/>
}<br/>
<br/>
// Do the snapshot set<br/>
m_hResult=m_pVssObject->DoSnapshotSet(&pasync);<br/>
<br/>
if (FAILED(m_hResult)) {<br/>
_ASSERT(pasync==NULL);<br/>
return false;<br/>
}<br/>
// Wait until snapshot has been initialized<br/>
m_hResult=AsyncWaitAndCleanup(&pasync);<br/>
if (FAILED(m_hResult)) {<br/>
return false;<br/>
}<br/>
<br/>
****************** NOW BACKUP - CONTINUE AFTER BACKUP ************************
IVssAsync *pasync = NULL;<br/>
m_hResult=m_pVssObject->BackupComplete(&pasync);<br/>
if (FAILED(m_hResult)) {<br/>
_ASSERT(pasync==NULL);<br/>
return false;<br/>
}<br/>
// wait for completion<br/>
m_hResult=AsyncWaitAndCleanup(&pasync);<br/>
if (FAILED(m_hResult)) {<br/>
return false;<br/>
}<br/>
<br/>
// Looks like no errors<br/>
return true;<br/>
<br/>
View the full article
I dont know which forum is best to ask a VSS (Volume Shadow Services) API question, but here it goes. I have a single drive with Windows server and Exchange server 2010 that I want to backup using VSS and have the Exchange transactions
logs deleted. Everything I read says you simply start VSS and prepare for a full backup, add the volume, and at the end send backup complete and exchange is supposed to delete its log files, but I dont see that happening. I do see the event log
has:<br/>
<br/>
<span lang="FR-CA" style="font-size:11.0pt; font-family:Calibri,sans-serif Log Name: Application
<br/>
Source: MSExchangeIS <br/>
Event ID: 9609 <br/>
Task Category: Exchange VSS Writer <br/>
Level: Error <br/>
Keywords: Classic <br/>
User: N/A <br/>
Computer: APPS1<br/>
Description: Exchange VSS Writer (<span lang="FR-CA" style="font-size:9.0pt; font-family:Segoe UI,sans-serif instance 339055d9-f1c5-48fa-a99e-cd310ce9eb8c:1<span lang="FR-CA" style="font-size:11.0pt; font-family:Calibri,sans-serif )
failed with error code -2147221233 when preparing for Snapshot
Or you get something like:
<span lang="EN-GB" style="font-size:7.5pt Log Name: Error<br/>
Event Source: MSExchangeIS<br/>
Event Category: Exchange VSS <br/>
Writer Event ID: 9607 <br/>
User: N/A <br/>
Computer: APPS1<br/>
Description: Error code 0x8004010f when preparing for backup. <br/>
For more information, click http://www.microsoft.com/contentredirect.asp
http://www.microsoft.com/contentredirect.asp . <br/>
Data: <br/>
0000: 41 20 63 6f 6d 70 6f 6e A compon <br/>
0008: 65 6e 74 20 62 65 69 6e ent bein <br/>
0010: 67 20 62 61 63 6b 65 64 g backed <br/>
0018: 20 75 70 20 69 73 20 6e up is n <br/>
0020: 6f 74 20 6f 6e 6c 69 6e ot onlin <br/>
0028: 65 00 e.
However, if using Windows Server backup - it backs up okay and deletes the transaction files. The overview of what is done - What is missing to cause VSS to lock for exchange okay and to delete its transaction files after the backup of the C: volume?:<br/>
<br/>
// Create an IVssBackupComponents interface object<br/>
m_hResult = m_fnCreateVssBackupComponents(&m_pVssObject);<br/>
if (FAILED(m_hResult)) {<br/>
_ASSERT(m_pVssObject==NULL);<br/>
return false;<br/>
}<br/>
<br/>
// Initialize instance to manage a backup<br/>
_ASSERT(m_pVssObject!=NULL);<br/>
m_hResult = m_pVssObject->InitializeForBackup();<br/>
if (FAILED(m_hResult)) {<br/>
return false;<br/>
}<br/>
<br/>
// setup the context the user wants<br/>
m_hResult = m_pVssObject->SetContext(context);<br/>
if (FAILED(m_hResult)) {<br/>
return false;<br/>
}<br/>
<br/>
// docs say this step is required<br/>
IVssAsync *pasync = NULL;<br/>
m_hResult = m_pVssObject->GatherWriterMetadata(&pasync);<br/>
if (FAILED(m_hResult)) {<br/>
_ASSERT(pasync==NULL);<br/>
return false;<br/>
}<br/>
// wait for async object (and free it)<br/>
m_hResult=AsyncWaitAndCleanup(&pasync);<br/>
if (FAILED(m_hResult)) {<br/>
return false;<br/>
}<br/>
// create snapshot set if not already created<br/>
if (m_idSnapshotSet==GUID_NULL) {<br/>
// Create a new, empty shadow copy set<br/>
m_hResult = m_pVssObject->StartSnapshotSet(&m_idSnapshotSet);<br/>
if (FAILED(m_hResult)) {<br/>
_ASSERT(m_idSnapshotSet==GUID_NULL);<br/>
return false;<br/>
}<br/>
}<br/>
<br/>
// Add specified volume to snapshot set<br/>
VSS_ID idsnapshot = GUID_NULL;<br/>
m_hResult = m_pVssObject->AddToSnapshotSet(L"C:", GUID_NULL, &idsnapshot);<br/>
<br/>
if (FAILED(m_hResult)) {<br/>
return false;<br/>
}<br/>
// Configure the backup<br/>
m_hResult = m_pVssObject->SetBackupState(FALSE, TRUE, VSS_BT_FULL, FALSE);<br/>
if (FAILED(m_hResult)) {<br/>
return false;<br/>
}<br/>
<br/>
// notify writes of backup operation<br/>
IVssAsync *pasync = NULL;<br/>
m_hResult = m_pVssObject->PrepareForBackup(&pasync);<br/>
if (FAILED(m_hResult)) {<br/>
_ASSERT(pasync==NULL);<br/>
return false;<br/>
}<br/>
// wait for async operation to complete<br/>
m_hResult=AsyncWaitAndCleanup(&pasync);<br/>
if (FAILED(m_hResult)) {<br/>
return false;<br/>
}<br/>
<br/>
// Do the snapshot set<br/>
m_hResult=m_pVssObject->DoSnapshotSet(&pasync);<br/>
<br/>
if (FAILED(m_hResult)) {<br/>
_ASSERT(pasync==NULL);<br/>
return false;<br/>
}<br/>
// Wait until snapshot has been initialized<br/>
m_hResult=AsyncWaitAndCleanup(&pasync);<br/>
if (FAILED(m_hResult)) {<br/>
return false;<br/>
}<br/>
<br/>
****************** NOW BACKUP - CONTINUE AFTER BACKUP ************************
IVssAsync *pasync = NULL;<br/>
m_hResult=m_pVssObject->BackupComplete(&pasync);<br/>
if (FAILED(m_hResult)) {<br/>
_ASSERT(pasync==NULL);<br/>
return false;<br/>
}<br/>
// wait for completion<br/>
m_hResult=AsyncWaitAndCleanup(&pasync);<br/>
if (FAILED(m_hResult)) {<br/>
return false;<br/>
}<br/>
<br/>
// Looks like no errors<br/>
return true;<br/>
<br/>
View the full article