To work around this issue, use one of these workaround steps:
- Mount these virtual disks read/write so that the system has a chance to repair them.
- Create a writable redo log locally on the proxy. The redo log has the read-only base disk as a parent (the disk that was just backed up). This allows the Operating System (OS) to repair the disk to avoid any errors. This redo log is then mounted with VixMntapi and files are accessed. After that, the redo log is unlinked from the parent and discarded, leaving the parent disk unchanged.
Note: These extra steps add no measurable overhead and therefore, it does not affect the overall backup time.
To create a writable redo log locally on the proxy:
Note: Take a backup of the disk, excluding mounting the disk with VixMntapi.
- Run this command to create a local connection:
VixDiskLib_Connect(NULL, &localConnection)
- With the backed up disk still open (called as parent disk), run this command:
VixDiskLib_CreateChild(parentHandle, "C:\temp.vmdk", VIXDISKLIB_DISK_MONOLITHIC_SPARSE, NULL, NULL)
Note: The preceding command fails if the file already exists. The file can be created in any existing folder and can have any name.
- Run this command to open the temp redo log:
VixDiskLib_Open(localConnection, "C:\temp.vmdk", VIXDISKLIB_FLAG_OPEN_SINGLE_LINK, &redoHandle)
- Run this command to attach the redo log to the parent disk:
VixDiskLib_Attach(parentHandle, redoHandle)
- Run this command to open the disk set, get volume handles and mount the volumes etc:
VixMntApi_OpenDiskSet(redoHandle (put this in an array), 1, 0, &diskSetHandle)
...
...
DefineDosDevice(...)
After creating a writable redo log locally on the proxy, perform these steps to clean up:
- Run this command to remove the definition for each volume:
DefineDosDevice(...DDD_REMOVE_DEFINITION...)
- Run this command to unmount each volume:
VixMntapi_DismountVolume(handle[i], false)
- Run this command to close the disk set:
VixMntapi_CloseDiskSet(diskSetHandle)
- Run this command to close the redo log.
VixDiskLib_Close(redoHandle)
Note: This automatically closes the parent disks.
- Run this command to unlink the redo log from the parent disk:
VixDiskLib_Unlink(localConnection, "C:\temp.vmdk")
- Run this command to delete the redo log:
DeleteFile("C:\temp.vmdk");
- Run this command to disconnect from the local connection:
VixDiskLib_Disconnect(localConnection)
Note: After completing the preceding cleanup procedure, perform the usual cleanup steps (such as disconnect from virtual machines etc).