Powershell for failing over a cluster


so, worked out a command allow me remotely failover 2008 r2 cluster , works great first failover, on subsiquent failovers fails on , fails right before command completes, see below:

ps c:\> get-clustergroup -cluster c-test-ps-ab

name                                    ownernode                                                                 state
----                                    ---------                                                                 -----
test-vps-2008-a                         test-ps-2008-b                                                           online
cluster group                           test-ps-2008-b                                                           online
available storage                       test-ps-2008-b                                                           online


ps c:\> get-clusternode -cluster test-vps-2008-a | get-clustergroup | move-clustergroup

name                                    ownernode                                                                 state
----                                    ---------                                                                 -----
test-vps-2008-a                         test-ps-2008-a                                                           online
cluster group                           test-ps-2008-a                                                           online
available storage                       test-ps-2008-a                                                           online


ps c:\> get-clusternode -cluster test-vps-2008-a | get-clustergroup | move-clustergroup

name                                    ownernode                                                                 state
----                                    ---------                                                                 -----
test-vps-2008-a                         test-ps-2008-b                                                           online
cluster group                           test-ps-2008-b                                                           online
available storage                       test-ps-2008-b                                                           online
test-vps-2008-a                         test-ps-2008-a                                                           online
cluster group                           test-ps-2008-a                                                           online
available storage                       test-ps-2008-a                                                           online

any idea why happening or how prevent in future?

the problem not specifying value "get-clusternode" command parsing through both nodes. if want move groups 1 of nodes, command be: 

get-clusternode <nodename> -cluster <clustername> | get-clustergroup | move-cluster group

so using output, commands be:

get-clusternode test-vps-2008-a -cluster c-test-ps-ab  | get-clustergroup | move-clustergroup

or

get-clusternode test-vps-2008-b -cluster c-test-ps-ab  | get-clustergroup | move-clustergroup

if want swap groups between nodes in single commands, use:

get-clustergroup -cluster <cluster name> | move-clustergroup

if want move single group, command be: 

move-clustergroup -cluster <clustername> -name <groupname>

hope helps


visit blog multi-site clustering



Windows Server  >  High Availability (Clustering)



Comments

Popular posts from this blog

Edit Group Policy

Hyper-V VM not reaching OS 'Logon' screen

DNS question...