Handy Powershell commands for Failover Cluster Manager

2017-12-11T15:59:29+00:00 March 10th, 2014|PowerShell|

 

Recently we had a customer have problems loading Failover Cluster Manager (FOCM) mmc. As a result the only way we could manage his Hyper-V environment was using powershell. I kept a note of some useful commands we used:

get-module –listavailable
Shows installed config files for modules that can be imported to the powershell session

import-module failoverclusters
Imports the required module.

get-clustergroup
Lists the resources in the cluster group (VMs in the cluster), shows host they are on and their state (online/offline)

get-clustergroup | findstr Failed
Shows failed resources only (VMs failed to start)

get-clustergroup | findstr <hostname>
Finds a specific resource (handy if you have a large cluster and a long list!)

Start-ClusterGroup -Name “<ResourceName>” –Verbose
We found this one particularly helpful, it gave us added insight into why a resource was failing to start

Move-ClusterVirtualMachineRole -Name “<ResourceName>” -node <HostName>
Performs a live migrate (or move if the machine is off) on a VM to a different node.

 

Hope they are of some use!