Normal Termination

Microsoft SQL Server Virtual Backup

Microsoft SQL Server Virtual Backup Device Specification

Normal Termination

When the operation is complete, Microsoft® SQL Server™ invokes IServerVirtualDevice::CloseDevice for each device. This results in the IClientVirtualDevice::GetCommand returning a VD_E_CLOSE status code. The client responds by terminating its GetCommand loop.

After all devices are closed, the completion agent is terminated and the virtual device set enters the Normally Terminated state. The client invokes IClientVirtualDeviceSet2::Close and the server invokes IServerVirtualDeviceSet2::Close to release any resources used by the virtual device set.

The client does not need to wait for the completion agent to terminate. The client can issue IClientVirtualDeviceSet2::Close as soon as all of the devices have received a Close status code.

The server is permitted to call IServerVirtualDeviceSet2::Close without freeing any allocated buffers. The Close function will free them. It is permissible to invoke FreeBuffer as part of the cleanup processing in the server.

The backup history written for VDI backups is the same as for non-VDI backups. The only distinction is that msdb..backupmediafamily.device_type is set to 7.

Note on "sp_addumpdevice": VDI devices should not be added as backup devices. This is not prevented in SQL Server 2005, but is deprecated. Since VDI devices should use unique names, it does not make sense to add persistent names to the catalog. GUIDs are recommended for names.