Skip to content

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:

Get-ClusterResource | Where-Object { $_.ResourceType -like "*Virtual Machine*" }
This returns VMs with their current state (Online, Offline, or Failed).

Resource Health and Logs

Verify resource health with Get-ClusterResourceHealth:

Get-ClusterResourceHealth -Cluster "ClusterName"
For detailed logs, use Get-ClusterLog to analyze cluster events:
Get-ClusterLog -Cluster "ClusterName" -OutputFolder "C:\ClusterLogs"

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:

Move-ClusterVirtualMachineRole -Name "VMName" -TargetNode "TargetNode"
This command moves the VM’s role to the specified node. Ensure the target node has sufficient resources (CPU, memory) to host the VM.

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:

Remove-ClusterResource -Name "VMName"
Ensure the VM is offline before removal.

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:

Set-VM -Name "VMName" -ProcessorCount 4 -MemoryStartupBytes 4294967296


Troubleshooting Common Issues

  • Resource Conflicts: Use Get-ClusterResource to 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:

Test-Cluster -Cluster "ClusterName"


Key takeaways

  • Use Get-ClusterResource and Get-ClusterResourceHealth to 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-Cluster and address dependencies before failover.
  • Automate VM configuration changes with PowerShell to reduce manual errors.