PowerShell and Windows Server 2008 Failover Clusters – Originally Posted Aug 28, 2009

One of the major changes moving forward into Windows Server 2008 R2 is that some of the tools are being deprecated (I love that word) in favor of PowerShell.

Some people just screamed, “Wooo hooo, fantastic!” while others screamed, “Great, now I have to learn another tool after investing all of those years in the tools of the past!”

I, personally, take the first view point in that this is great news. It now forces me to start using PowerShell more than just in Exchange Server 2007. PowerShell will be the main tool in the future, so it is important to learn it now.

So, this is the perfect time to start talking about the differences and how we will now use PowerShell in Windows Server 2008 R2 failover clustering. Let’s start from the beginning.

Get-WindowsFeature in PowerShell will provide a list of all features and a checkbox will show whether they are installed or not.

Add-WindowsFeature Failover-Clustering will add the failover clustering feature along with the Remote Server Administrative Tools (RSAT) for Failover Clustering Tools.

From here on, it is all down hill. We have the feature installed, and the PowerShell module is imported. Like all PowerShell commands, the list can be broken down into Add, Block, Clear, Get, Grant, Move, New, Remove, Resume, Set, Start, Stop, Suspend, Test, and Update verbs. If you want to see a setting, you will generally use a Get verb combined with the noun describing what you want to find. For example, the Get-Cluster cmdlet will provide information about the cluster such as the domain name, the name of the cluster, and the description of the cluster along with several other bits of information. The various cmdlets related to failover clustering can be found by using the Get-Command –module FailoverClusters cmdlet. The resulting cmdlets are broken out by verb below.

Add cmdlets include the following:

  • Add-ClusterDisk
  • Add-ClusterFileServerRole
  • Add-ClusterGenericApplicationRole
  • Add-ClusterGenericScriptRole
  • Add-ClusterGenericServiceRole
  • Add-ClusterGroup
  • Add-ClusterNode
  • Add-ClusterPrintServerRole
  • Add-ClusterResource
  • Add-ClusterResourceDependency
  • Add-ClusterResourceType
  • Add-ClusterServerRole
  • Add-ClusterSharedVolume
  • Add-ClusterVirtualMachineRole

There is only one block cmdlet for failover clustering, and it is used to block users from accessing the failover cluster.

  • Block-ClusterAccess

There are two Clear cmdlets for failover clustering. Clear-ClusterDiskReservation is used to clear the persistent reservation on a disk. The Clear-ClusterNode is used to forcibly remove the failover cluster feature from a node.

  • Clear-ClusterDiskReservation
  • Clear-ClusterNode

The Get cmdlets are probably the most used. Get verbs allow for the easy retrieval of information about a failover cluster

  • Get-Cluster
  • Get-ClusterAccess
  • Get-ClusterAvailableDisk
  • Get-ClusterGroup
  • Get-ClusterLog
  • Get-ClusterNetwork
  • Get-ClusterNetworkInterface
  • Get-ClusterNode
  • Get-ClusterOwnerNode
  • Get-ClusterParameter
  • Get-ClusterQuorum
  • Get-ClusterResource
  • Get-ClusterResourceDependency
  • Get-ClusterResourceDependencyReport
  • Get-ClusterResourceType
  • Get-ClusterSharedVolume

The Grant verb is basically the reverse of the block verb. With the Grant-ClusterAccess cmdlet, you can provide full access to the failover cluster, and with the –readonly parameter, read only access can be provided.

  • Grant-ClusterAccess

The Move verb can be used to move resources between failover cluster nodes.

  • Move-ClusterGroup
  • Move-ClusterResource
  • Move-ClusterSharedVolume
  • Move-ClusterVirtualMachineRole

The New-Cluster cmdlet does just what it says it does. It creates new failover clusters.

  • New-Cluster

The Remove verb is used to delete resources or to completely destroy the cluster by using the Remove-Cluster cmdlet.

  • Remove-Cluster
  • Remove-ClusterAccess
  • Remove-ClusterGroup
  • Remove-ClusterNode
  • Remove-ClusterResource
  • Remove-ClusterResourceDependency
  • Remove-ClusterResourceType
  • Remove-ClusterSharedVolume

The Resume verb is used to resume either the activity on a node after it has been suspended or to take a cluster disk or cluster shared volume out of maintenance mode.

  • Resume-ClusterNode
  • Resume-ClusterResource

The Set cmdlets are extremely powerful in that they can be used to make changes to the cluster resources and the cluster itself.

  • Set-ClusterLog
  • Set-ClusterOwnerNode
  • Set-ClusterParameter
  • Set-ClusterQuorum
  • Set-ClusterResourceDependency

The Start verb is used to start the cluster service, for example with the Start-Cluster cmdlet, or to start groups or resources.

  • Start-Cluster
  • Start-ClusterGroup
  • Start-ClusterNode
  • Start-ClusterResource

If there is a Start verb, then it makes sense that there is a Stop verb that does the exact opposite. For example, you can shut down the cluster by using the Stop-Cluster cmdlet or you can stop entire groups or individual resources by using the Stop cmdlets below.

  • Stop-Cluster
  • Stop-ClusterGroup
  • Stop-ClusterNode
  • Stop-ClusterResource

The Suspend verb does the opposite of the Resume verb. The Suspend verb is used to pause a node by using the Suspend-ClusterNode cmdlet, and the Suspend-ClusterResource cmdlet will turn on maintenance mode for a disk resource or a cluster shared volume.

  • Suspend-ClusterNode
  • Suspend-ClusterResource

The Test-Cluster cmdlet is used to run the Validate tool. At first glace, you would think it would have been named something like Validate-Cluster, but to make the cmdlet consistent with other features and applications, the Test verb is used.

  • Test-Cluster

Update-ClusterIPResource is used to release the DHCP lease for IP Address resources and Update-ClusterVirtualMachineConfiguration is used to refresh the configuration settings when adding a new network adapter or to refresh other settings such as the virtual memory configuration for VMs running in the failover cluster.

  • Update-ClusterIPResource
  • Update-ClusterVirtualMachineConfiguration

To learn more about each command, use the help that is built into PowerShell. You will find that a simple command like, Get-Help CmdletName will retrieve some basic information, but if you extend it with the –full parameter or the –example parameter, and you can get an easy grasp of what you can do with the Cmdlet.

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s