How to remove agents / clone images from a server that was decommissioned
Hi, we have a server that was decommissioned. The Agent was not removed from SQL Clone before the decom. As such, we have some areas where the server & images show up, but can't be removed through the powershell command line.
I received these errors:
Remove-SqlCloneImage : Agent on '<SERVER>' is not connected. Reconnect this agent and try again.
Remove-SqlCloneMachine : Cannot delete agent on <SERVER> because there are still images created by this agent
Does anyone have the proper way to remove sql clone images / agents that are no longer available to connect to?
solution:
To remove the sqlclone image: Remove-SqlCloneImage -Image $ImageToDelete -soft
To remove the sqlclone machine: Remove-SqlCloneMachine -Machine $AgentToDelete -force
I received these errors:
Remove-SqlCloneImage : Agent on '<SERVER>' is not connected. Reconnect this agent and try again.
Remove-SqlCloneMachine : Cannot delete agent on <SERVER> because there are still images created by this agent
Does anyone have the proper way to remove sql clone images / agents that are no longer available to connect to?
solution:
To remove the sqlclone image: Remove-SqlCloneImage -Image $ImageToDelete -soft
To remove the sqlclone machine: Remove-SqlCloneMachine -Machine $AgentToDelete -force
Tagged:
Answers
For the benefit of anyone else viewing this forum post, this was the solution I presented in the direct ticket:
In this case, I think you should use the -Force parameter for removing SqlCloneMachine: https://documentation.red-gate.com/clone/automation/powershell-cmdlet-reference/remove-sqlclonemachine
For removal of the image, the documentation mentions the -Soft parameter: https://documentation.red-gate.com/clone/automation/powershell-cmdlet-reference/remove-sqlcloneimage
-Soft <System.Management.Automation.SwitchParameter>
Kind regards
Dan Calver | Redgate Software
Have you visited our Help Center?