Clustered VMs
Monitoring Clustered Virtual Machines¶
Regular monitoring ensures VMs remain online and the cluster operates as expected. Use the Failover Cluster Manager GUI or PowerShell cmdlets to check resource states, health, and performance.
Checking VM Status¶
Use the Get-ClusterResource cmdlet to list all clustered resources, including VMs:
Resource Health and Logs¶
Verify resource health with Get-ClusterResourceHealth:
Get-ClusterLog to analyze cluster events:Performance Monitoring¶
Use Performance Monitor (perfmon) to track metrics like CPU usage, memory, and network throughput for clustered VMs. For cloud environments, integrate with Azure Monitor (optional) or System Center for centralized metrics.
Managing Failovers¶
Failover clusters automatically migrate VMs when a node fails, but manual intervention may be required for planned maintenance or troubleshooting.
Manual Failover¶
To failover a VM to another node:
Automated Failover¶
Configure failover settings via Failover Cluster Manager:
1. Right-click the VM resource → Properties.
2. Under Failover Settings, specify the failover priority and enable Automated Failover.
3. Set the Failover Threshold (e.g., 30 seconds) to control how quickly the cluster attempts to failover.
Failover Dependencies¶
Some VMs depend on shared storage or other resources. Use Get-ClusterResourceDependency to identify dependencies and ensure they are properly configured for failover.
Cluster Configuration and Maintenance¶
Proper configuration ensures VMs function correctly within the cluster.
Adding/Removing VMs¶
To add a VM to the cluster:
1. Use Failover Cluster Manager → Add a Resource → Virtual Machine.
2. Specify the VM’s path and configure storage settings.
To remove a VM:
Storage and Network Requirements¶
- Shared Storage: Use SAN or NAS with SMB 3.0+ for clustered VMs.
- Network Configuration: Ensure all nodes have access to the same virtual switch and IP address pool.
Updating VM Settings¶
Modify VM settings (e.g., CPU cores, memory) via the Hyper-V Manager, but avoid changes during failover. Use Set-VM cmdlets for automation:
Troubleshooting Common Issues¶
- Resource Conflicts: Use
Get-ClusterResourceto identify conflicts. - Storage Connectivity: Check SMB client logs (
Get-SmbClientEvent) for connectivity issues. - Network Failures: Verify that virtual switches are configured correctly across nodes.
For persistent issues, review the Event Viewer logs on all cluster nodes and use Test-Cluster to validate cluster health:
Key takeaways¶
- Use
Get-ClusterResourceandGet-ClusterResourceHealthto monitor VM states and health. - Manually or automatically failover VMs using PowerShell or the Failover Cluster Manager.
- Ensure shared storage and network configurations are consistent across all cluster nodes.
- Regularly validate cluster health with
Test-Clusterand address dependencies before failover. - Automate VM configuration changes with PowerShell to reduce manual errors.