How to Properly Shutdown a Failover Cluster or a Node

This blog will discuss the proper process for shutting down an individual node in a Windows Server 2012 R2 Failover Cluster or the entire cluster with all the nodes.  Note:  While the steps outlined will be specific to Windows Server 2012 R2, the process applies to a cluster of any OS version.


Shutting Down a Node

When shutting down or rebooting a node in a Failover Cluster, you first want to drain (move off) any roles running on that server (such as a virtual machine).  This ensures that the shutting down of a node is graceful to any applications running on that node.

  1. Open Failover Cluster Manager (CluAdmin.msc)
  2. Click on “Nodes
  3. Right-click on the node name and under ‘Pause’ click on ‘Drain Roles
  4. Under Status the node will appear as ‘Paused’.  At the bottom of the center pane click on the ‘Roles’ tab.  Once all roles have moved off this node, it is safe to shut down or reboot the node.

To resume the node after it has been restarted…

When the node is once again powered on and ready to be put back into service, use the Resume action to re-enable the node to host roles.

  1. Open Failover Cluster Manager (CluAdmin.msc)
  2. Click on “Nodes
  3. Right-click on the node name and select ‘Resume’, then select either:
    1. Fail Roles Back’ – This will resume the node and move any roles which were running on the node prior to the node back.  Caution:  This could incur downtime based on the role
    2. Do Not Fail Roles Back’ – This will resume the node and not move any roles back.

Shutting Down a Node with Windows PowerShell®

  1. Open a PowerShell window as Administrator and type:
    Suspend-ClusterNode -Drain
  2. Verify that there are no roles listed under “OwnerNode” for that node by running:
    Get-ClusterGroup
    1. This could be scripted with the following syntax:
      PS C:\> (Get-ClusterGroup).OwnerNode –eq "NodeBeingDrained"
  3. Shutdown or restart the computer by typing either:
    Stop-Computer
    Restart-Computer

To resume the node after it has been restarted…

  1. Open a PowerShell window as Administrator and type:
    Resume-ClusterNode

Or if you wish to fail back the roles which were previously running on this node type:

Resume-ClusterNode –Failback Immediate

Shutting Down a Cluster

Shutting down the entire cluster involves stopping all roles and then stopping the Cluster Service on all nodes.  While you can shut down each node in the cluster individually, using the cluster UI will ensure the shutdown is done gracefully.

  1. Open Failover Cluster Manager (CluAdmin.msc)
  2. Right-click on the cluster name, select ‘More Actions’, then “Shut Down Cluster…
  3. When prompted if you are sure you want to shut down the cluster, click “Yes

Shutting Down a Cluster with PowerShell

  1. Open a PowerShell window as Administrator and type:
    Stop-Cluster

Controlling VM Behavior on Shutdown

When the cluster is shut down, the VMs will be placed in a Saved state.  This can be controlled using the OfflineAction property.

To configure the shut down action for an individual VM (where “Virtual Machine” is the name of the VM):

Get-ClusterResource "Virtual Machine" | Set-ClusterParameter OfflineAction 1
 Value  Effect
 0  The VM is turned off
 1 (default)  The VM is saved
 2  The guest OS is shut down
 3  The guest OS is shut down forcibly

To start the cluster after it has been shut down

  1. To start the cluster type:
    Start-Cluster

Thanks!
Elden Christensen
Principal PM Manager
Clustering & High-Availability
Microsoft