Error Handling in Shadow Copy Providers

VSS allows many shadow copies to exist at once, but it only allows one shadow copy set creation to be in-progress between the call to IVssBackupComponents::StartSnapshotSet and the return from the call to IVssBackupComponents::DoSnapshotSet.

No Partial Commit

If any provider fails a shadow copy on any volume or LUN in the shadow copy set, then the creation of the entire shadow copy set fails. This is by design. This design simplifies the behavioral issues associated with partial failure semantics and maintains a consistent point-in-time across all shadow copies in the set.

Reporting Fault Conditions

If a provider error or fault condition occurs, the provider must log an error to the Application event log. This includes, but is not limited to, any provider-specific errors when creating or importing a Shadow Copy Set, or resource allocation failure for copy-on-write shadow copy after creation. This logging must not take place during the time the volumes in the shadow copy set are in a frozen state.

Valid Provider Return Values

The following table lists the valid return codes for provider methods and their meanings.

Value Description
S_OK
The method was successful.
E_OUTOFMEMORY
The provider is out of memory or other system resources.
E_INVALIDARG
One of the parameter values is not valid.
E_ACCESSDENIED
A non-privileged client has tried to call into the provider.
VSS_E_BAD_STATE
Either no provider supports the requested operation, or the operation cannot be performed on the object because the object is not in the correct state.
VSS_E_OBJECT_NOT_FOUND
A parameter refers to an object that was not found (such as a shadow copy ID, shadow copy set ID, or volume.)
VSS_E_INSUFFICIENT_STORAGE
The provider cannot perform the operation because there is not enough disk space.
VSS_E_VOLUME_NOT_SUPPORTED
No provider on this computer supports the requested operation on the volume.
VSS_E_VOLUME_NOT_SUPPORTED_BY_PROVIDER
The provider does not support the volume.
VSS_E_MAXIMUM_NUMBER_OF_SNAPSHOTS_REACHED
The provider has reached the maximum number of shadow copies that it can support.
VSS_E_PROVIDER_VETO
The provider has encountered an internal run-time error that does not map to another return value. The provider must also write an event into the Application event log providing the user with information on how to resolve this problem.
VSS_E_CANNOT_REVERT_DISKID
The MBR signature or GPT ID for one or more disks could not be set to the requested value. Check the Application event log for more information.

 

The provider should not attempt to return any other error codes.

If the provider returns an error code that is not expected (for example S_FALSE, E_FAIL, E_UNEXPECTED, or E_ABORT), VSS writes an event into the event log mentioning the provider and failed method and translates the error to VSS_E_UNEXPECTED_PROVIDER_ERROR before returning to the requester. This is not done for any returns from IVssProviderCreateSnapshotSet::AbortSnapshots or IVssProviderNotifications::OnUnload.