Cleanly uninstall an agent

BenethorBenethor Posts: 22 Bronze 1
edited October 6, 2017 3:20PM in SQL Clone
Hello,

My environments are very dynamic. I can pop and delete multiple SQL Clone agents in a day. How to I make sure my agent are cleanly uninstalled? I see my agents status as "offline".

I know it's possible to "logically delete it" from [Clones] table when inserting a timestamp in the [DeletedOn] column.

However, I did corrupt the database somehow after reinstalling an agent a second time. I am not yet certain why however.

What is the best way to do it. Do you have a plan to add an API support to unregister an agent?

thank you
David
Tagged:

Best Answers

  • BenethorBenethor Posts: 22 Bronze 1
    I could reproduce the corruption problem.

    Here my error on PowerShell screen when I try cloning a database. Not much detail though. I also attached the event log. Seems to occurs at the same time.

    I play with the same environment and VM snapshot. I go back to a blank server install, then reinstall. I believe this may cause some confusion. I can ship you the SQLClone database if it helps.

    +++

    New-SqlClone : InternalServerError received from server when performing POST /api/clones: An error has occurred.
    At C:\TEMP\create-clone-esb.ps1:12 char:14
    + ... $image | New-SqlClone -Name $database -Location $sqlServerInstance ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [New-SqlClone], HttpRequestFailedException
    + FullyQualifiedErrorId : RedGate.SqlClone.PowerShell.Commands.NewSqlCloneCommand

    +++
  • Dan BDan B Posts: 287 Gold 5
    Hi Benethor,

    The latest release of SQL Clone has a -force option.

    Normally, you will want to call Remove-SqlCloneMachine -Force after destroying a VM, before starting the new VM.

    If the new VM with the new agent has already been created/installed, call Remove-SqlCloneMachine -Force on the old, offline agent, and restart the agent service on the new VM.
    Kind regards,
    Dan Bainbridge
    Product Support Engineer | Redgate Software

Answers

Sign In or Register to comment.