SQL Clone 2

"Could not create virtual disk" ... "The process cannot access the file because it is being used by another process"

This error may occur when creating a clone. It has been seen when a clone is made of an image where the image destination folder path has a forward slash ( / ) in it, instead of the Windows backslash ( \ ).

For example, this error may occur with this path:

C:\Storage/Images

But would not occur with this equivalent path:

C:\Storage\Images

Try recreating the image with no forward slashes in its paths.

If you have difficulty deleting the malfunctioning image, you can either restart the machine that is storing the image, restart the machine that created the image, or follow this procedure to detach the image:

  1. Identify which machine created the image.
    1. For a live database copy, this will be the machine that contains the original database. For an image from backup, this will be the machine that hosts the temporary instance that was used to create the image.
    2. A SQL Clone agent will have been installed on this machine.
  2. On that machine, open Disk Management.
  3. In the lower section, for each row named 'Database VHD', right-click on the left-hand section of the row and select Detach VHD (but don't click OK yet). See image below.
    1. Disk Management will then confirm the virtual hard disk location with you.
    2. Use this information to find the Database VHD row for the image VHD. This will be identifiable by the following:
      1. It will be in the image destination folder.
      2. It will contain a sanitized version of the full image name.
      3. It will end with just 'vhd', not 'disk.vhd'.
    3. If the VHD is not the image VHD, then cancel out and move to the next.
  4. Detach the located image VHD.

Now retry deleting the image.


An example of detaching a VHD.


Didn't find what you were looking for?