# # Show loaded modules # Get-Module # # Install the Failover Clustering features # Use Add-WindowsFeature cmdlet or Server Manager UI # Import-Module ServerManager # # ... then run: # Add-WindowsFeature Failover-Clustering # Get-WindowsFeature # # Load the FailoverClusters module # Import-Module FailoverClusters Get-Module # # List the cluster cmdlets # Get-Command -Module FailoverClusters Get-Command -Module FailoverClusters | measure # # Rich in-box help content with examples and online # Get-Help New-Cluster -Online # Get-Help Test-Cluster -Full Get-Help New-Cluster -Examples # # List the validation tests # Test-Cluster -Node ahmedbc1-n1,ahmedbc1-n2 -list # # Validate the cluster # Test-Cluster -Node ahmedbc1-n1,ahmedbc1-n2 # Test-Cluster -Node ahmedbc1-n1,ahmedbc1-n2 -Include "Validate All Drivers Signed" # # Create the cluster # New-Cluster -Node ahmedbc1-n1,ahmedbc1-n2 -Name ahmedbclus # # # Get the local cluster # Get-Cluster # # Get the local cluster # Get-Cluster | Get-Member # # Get the cluster nodes # Get-ClusterNode Get-ClusterNode | Get-Member # # Get the cluster resources # Get-ClusterResource # # Get the cluster resource groups # Get-ClusterGroup # # Get the cluster resource types # Get-ClusterResourceType # # Get the cluster networks # Get-ClusterNetwork # # Get the cluster network interfaces # Get-ClusterNetworkInterface # # Who has access to the cluster? # Get-ClusterAccess # # The power of the pipeline # Get-Cluster | fl Name,Domain Get-ClusterResource | ft Name,State Get-ClusterResource | ?{ $_.ResourceType.Name -eq "Virtual Machine" } Get-ClusterGroup | ft -auto Name,OwnerNode,@{ Label="Resource Count"; Expression={ ( $_ | Get-ClusterResource ).Count }} # # Get resources on a specific node # Get-ClusterNode ahmedbc1-n1 | Get-ClusterResource Get-ClusterNode ahmedbc1-n2 | Get-ClusterResource # # Get the quorum type # Get-ClusterQuorum # # Set the quorum type to node majority # Set-ClusterQuorum -NodeMajority # # Use node and file share witness majority # Set-ClusterQuorum -NodeAndFileShareMajority \\ahmedb-iscsi\fsw # # Easily create highly available workloads # Get-Command Add-Cluster*Role # # Is CSV enabled? # Enabling it is easy: # ( Get-Cluster ).EnableSharedVolumes = "Enabled" # Get-Cluster | fl EnableSharedVolumes # # Get the Cluster Shared Volumes # Get-ClusterSharedVolume # # Add to Cluster Shared Volumes # Add-ClusterSharedVolume "Cluster Disk 7" # # Create a highly available Virtual Machine # Add-ClusterVirtualMachineRole -VM VM2 # # Show the created group # Get-ClusterGroup VM2 Get-ClusterGroup VM2 | Get-ClusterResource # # Start the highly available Virtual Machine # Start-ClusterGroup VM2 # # Quick migrate the highly available Virtual Machine # Get-ClusterResource "Virtual Machine VM2" | Get-ClusterParameter OfflineAction Move-ClusterGroup VM2 -Node ahmedbc1-n1 # # Live migrate the highly available Virtual Machine # Move-ClusterVirtualMachineRole VM2 -Node ahmedbc1-n2