Comments
1 comment
-
Official commentHi Adrian,
Thanks for reaching out to Redgate Support, sorry to hear you are having a little trouble with your SQL Clone installation. Given your description, this sounds like a potential file-lock/sharing violation on the VHD.
To clear the current stuck image/clone:
1. Identify the machine that created the image/clone.
2. Open Disk Management on that machine.
3. Find the row for the Database VHD matching the stuck image/clone (it'll be in the image folder, with a sanitized version of the image name, ending in .vhd).
4. Right-click it and select Detach VHD.
5. Retry the delete via the GUI or PowerShell module.
- If you can't locate it in Disk Management, restarting the machine that stores or created the image will also release the lock.
When you are deleting the images, are you utilizing Remove-SqlCloneImage -Soft or what powershell syntax are you utilizing? Remove-SqlCloneImage -Soft should remove the image from SQL Clones internal tracking without touching the file, you can then queue the leftover file for manual deletion. For clones however, there is no soft-delete, so you would have to do the steps above.
Give the above steps a shot and let me know if you still cannot remove the images/clones from your application.
Add comment
Please sign in to leave a comment.
Image and clones are created and deleted using the PowerShell module in a nightly automation. Every now and then one of the images fails to delete “because it's being used by another process”. Restarting the clone agent service and trying to remove the image via the PoSh module doesn't work. There aren't any logs I could find to help give more detail on the issue to prevent it from happening in the future.
The image isn't associated with any clones according to the GUI and database backend (clone report as deleting fine in the GUI and backend db - but related clone dir and disk.vhd exists). I was unable to drop this either parent or clone image. From what I've gathered so far, this appears to be related to clone image corruption (only 1 clone of dozens affected and prohibiting db image from deleting).
Note:
- AV exclusions applied against all services, executables, dirs, extensions, and files related to SQL Clone. No other software or scanning is reading these files and confirmed via ProcMon.
- Tried to remove the clone vhd both ignoring and respecting the parent image. Both methods fails with the same error. GUI and PoSh module also fail.
Version: v5.6.21.8347 (would upgrade, but release notes don't mention anything specific and if this is resolved)
Any idea if this will be resolved soon and if not a workaround that could be built into the scripts we used to automate this to ensure the clone creation/deletion process is bulletproof? We've included a lot of error handling and retries where we can but there isn't a reliable way to handle these stuck images.