Recently, while refreshing our images in SQLClone, we attempted to delete an image that had a clone associated with the image. When we tried to deleted the clone, we received the error "Deletion Failed". To fix this issue, we logged onto the sqlclone machine and stopped the agent, and then we were able to delete the clone.
In the event viewer on both the sqlclone server and the server with the sqlclone agent, the same error appeared :
An error was reported by "SSQLMTL8291" (AGENT, RateLimited): RaygunErrorMessage { InnerError: RaygunErrorMessage { InnerError: null, InnerErrors: null, Data: [], ClassName: "System.ComponentModel.Win32Exception", Message: "Could not detach virtual disk

\data\MSSQL12.MSSQLSERVER\MSSQL\DATA\clones\monitoring_00010891_op2\disk.vhd. Error message: The device is not ready", StackTrace: [RaygunErrorStackTraceLineMessage { LineNumber: 117, ClassName: "RedGate.SqlClone.Unmanaged.Vhd", FileName: null, MethodName: "UnmountVhdFromFile(String vhdFile)", Raw: null }, RaygunErrorStackTraceLineMessage { LineNumber: 6, ClassName: "RedGate.SqlClone.Core.Vhd.VhdService", FileName: null, MethodName: "UnmountDiskImage(String diskImagePath)", Raw: null }, RaygunErrorStackTraceLineMessage { LineNumber: 0, ClassName: "RedGate.SqlClone.Core.Vhd.ExceptionHandlingVhdService", FileName: null, MethodName: "Try(String attemptedOperation, Action action, String possibleResolutions)", Raw: null }] }, InnerErrors: null, Data: [], ClassName: "VhdException", Message: "Error while unmounting VHD 'D:\data\MSSQL12.MSSQLSERVER\MSSQL\DATA\clones\monitoring_00010891_op2\disk.vhd':
Could not detach virtual disk

\data\MSSQL12.MSSQLSERVER\MSSQL\DATA\clones\monitoring_00010891_op2\disk.vhd. Error message: The device is not ready", StackTrace: [RaygunErrorStackTraceLineMessage { LineNumber: 17, ClassName: "RedGate.SqlClone.Core.Vhd.ExceptionHandlingVhdService", FileName: null, MethodName: "Try(String attemptedOperation, Action action, String possibleResolutions)", Raw: null }, RaygunErrorStackTraceLineMessage { LineNumber: 55, ClassName: "RedGate.SqlClone.Core.Vhd.ExceptionHandlingVhdService", FileName: null, MethodName: "UnmountDiskImage(String diskImagePath)", Raw: null }, RaygunErrorStackTraceLineMessage { LineNumber: 55, ClassName: "RedGate.SqlClone.Core.Vhd.VhdMountDropper", FileName: null, MethodName: "<Drop>b__5_0()", Raw: null }, RaygunErrorStackTraceLineMessage { LineNumber: 16, ClassName: "System.Threading.Tasks.Task", FileName: null, MethodName: "Execute()", Raw: null }, RaygunErrorStackTraceLineMessage { LineNumber: 12, ClassName: "System.Runtime.ExceptionServices.ExceptionDispatchInfo", FileName: null, MethodName: "Throw()", Raw: null }, RaygunErrorStackTraceLineMessage { LineNumber: 354, ClassName: "RedGate.SqlClone.Agent.CloneDropper+<DropClone>d__5", FileName: null, MethodName: "MoveNext()", Raw: null }, RaygunErrorStackTraceLineMessage { LineNumber: 12, ClassName: "System.Runtime.ExceptionServices.ExceptionDispatchInfo", FileName: null, MethodName: "Throw()", Raw: null }, RaygunErrorStackTraceLineMessage { LineNumber: 46, ClassName: "System.Runtime.CompilerServices.TaskAwaiter", FileName: null, MethodName: "HandleNonSuccessAndDebuggerNotification(Task task)", Raw: null }, RaygunErrorStackTraceLineMessage { LineNumber: 139, ClassName: "RedGate.SqlClone.Agent.Drivers.CloneDriver+<DeleteClone>d__8", FileName: null, MethodName: "MoveNext()", Raw: null }, RaygunErrorStackTraceLineMessage { LineNumber: 12, ClassName: "System.Runtime.ExceptionServices.ExceptionDispatchInfo", FileName: null, MethodName: "Throw()", Raw: null }, RaygunErrorStackTraceLineMessage { LineNumber: 46, ClassName: "System.Runtime.CompilerServices.TaskAwaiter", FileName: null, MethodName: "HandleNonSuccessAndDebuggerNotification(Task task)", Raw: null }, RaygunErrorStackTraceLineMessage { LineNumber: 457, ClassName: "RedGate.SqlClone.Agent.AgentCloneService+<DropClone>d__9", FileName: null, MethodName: "MoveNext()", Raw: null }] }
We have encountered this case on four different clones, over a span of multiple days. Is there a different fix possible so that we don't have to log onto the sqlclone machine each time to stop the sqlclone agent? Sometimes we don't have direct access to the machine and have to ask the user to stop their agents which becomes a long arduous process.
We are currently using v2.6.0.10030
In the event viewer on both the sqlclone server and the server with the sqlclone agent, the same error appeared :
An error was reported by "SSQLMTL8291" (AGENT, RateLimited): RaygunErrorMessage { InnerError: RaygunErrorMessage { InnerError: null, InnerErrors: null, Data: [], ClassName: "System.ComponentModel.Win32Exception", Message: "Could not detach virtual disk
We have encountered this case on four different clones, over a span of multiple days. Is there a different fix possible so that we don't have to log onto the sqlclone machine each time to stop the sqlclone agent? Sometimes we don't have direct access to the machine and have to ask the user to stop their agents which becomes a long arduous process.
We are currently using v2.6.0.10030