Failover Clustering
Hyper-V failover clustering provides high availability for virtual machines by enabling automatic failover between cluster nodes. This section guides you through configuring a failover cluster for Hyper-V environments.
Prerequisites and Planning¶
Before configuring a failover cluster, ensure:
- Hardware: Nodes must meet Windows Server hardware requirements. Use shared storage (SAN, NAS, or Storage Spaces Direct).
- Network: Dedicated heartbeat network (isolated from production traffic) and shared storage network.
- Software: Windows Server 2016 or later with Hyper-V and Failover Clustering roles installed.
- Quorum: Configure quorum settings (majority-node, disk witness, or file share witness) based on cluster size.
Installing Failover Clustering¶
-
Install the feature:
Verify installation with:
-
Validate cluster configuration:
Address any warnings (e.g., network connectivity, firewall rules).
Use the Failover Cluster Manager GUI or PowerShell:
Creating the Cluster¶
- Open Failover Cluster Manager and select "Create a cluster".
- Add nodes: Enter the names of cluster nodes.
- Validate and create:
- Confirm network and storage settings.
- Complete the wizard to form the cluster.
PowerShell alternative:
Configuring Shared Storage¶
- Add storage:
- For Storage Spaces Direct: Format disks as a single storage pool.
- For SAN/NAS: Ensure LUNs are accessible to all nodes and formatted with NTFS.
- Create cluster disk:
- Right-click the cluster in Failover Cluster Manager > "Storage" > "Add Storage".
- Format the disk and assign it to the cluster.
Adding Virtual Machines to the Cluster¶
- Prepare VMs:
- Ensure VMs are configured with static IP addresses and proper network settings.
- Disable "Use Hyper-V Failover Clustering" in VM settings (if applicable).
- Add VMs to the cluster:
- In Failover Cluster Manager, navigate to "Virtual Machines" > "Add Virtual Machine".
- Select the VM’s VHD file and assign it to the cluster.
PowerShell example:
Configuring VM Failover Settings¶
- Set VM availability:
- Right-click the VM in the cluster > "Properties" > Set "Failover" to "Enabled".
- Define failover policies:
- Adjust priority for nodes (e.g., designate a primary node for critical VMs).
- Configure "Failover Threshold" and "Failover Delay" in the VM’s properties.
Testing and Monitoring¶
- Test failover:
- Manually trigger a failover via "Move Virtual Machine" in Failover Cluster Manager.
- Verify VM availability on the secondary node.
- Monitor health:
- Use "Cluster Health" in Failover Cluster Manager or:
- Check event logs for cluster-related alerts.
Troubleshooting Common Issues¶
- Network connectivity: Ensure all nodes can communicate over the heartbeat and storage networks.
- Storage access: Verify LUNs are online and accessible to all nodes.
- Quorum errors: Adjust quorum settings if nodes lose majority (e.g., add a disk witness).
- Permissions: Ensure the cluster service account has access to shared storage.
Key takeaways¶
- Prerequisites: Shared storage, dedicated networks, and compatible hardware are critical.
- Cluster creation: Use PowerShell or the GUI to form the cluster and validate settings.
- VM integration: Add VMs to the cluster and configure failover policies for reliability.
- Testing: Regularly test failover scenarios and monitor cluster health for proactive issues.
- Troubleshooting: Focus on network, storage, and quorum configuration for common failures.