Trigger Manual failover via script/command

  • Case: windows 2019 cluster with 2 nodes and 2 sql server 2019 instances (FCI- NOT  Always On)                                                                       As a result of weekly automated patching both sql instances running on the same node.                                                            Task: validate if both sql instances run on the same cluster node and initiate failover of 1 instance to another node.          Question: how to initiate manual failover via script/command ?                                                                                                                                  Final goal- create scheduled job to run weekly (after patching completed) to have each sql instance runs on dedicated node.

    As far as validation part- seems sys.dm_os_cluster_nodes can help

    but cannot find script/command to trigger manual failover of one sql instance to another node.

    Thanks

  • As it's an FCI the failover is controlled at the WSFC level not SQL, so you will need to write something in PowerShell, using Move-ClusterGroup to move the resource between the needed hosts.

  • Thanks- looks like PS "Move-ClusterGroup" can do the trick

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply