Forum Discussion
Hyper-V external Virtual Switch
Hello,
I´ve a problem with external Virtual Switches and FailoverCluster(LiveMigration) configured.
What is the recommended configuration for that? We have dropped SCVMM.
old Hosts via SCVMM2022:
BandwidthReservationMode : Weight
BandwidthPercentage : 100 or 9 or 6 ...
DefaultFlowMinimumBandwidthAbsolute : 0
DefaultFlowMinimumBandwidthWeight : 1
new Hosts via PS (W2022Server):
BandwidthReservationMode : Absolute
BandwidthPercentage : 10
DefaultFlowMinimumBandwidthAbsolute : 1000000000
DefaultFlowMinimumBandwidthWeight : 0
kind regards
- kyazaferrIron Contributor
Hyper-V Virtual Switch and Failover Clustering Configuration
- External Virtual Switch:
- For Live Migration to work effectively, especially in a clustered environment, the External Virtual Switch should be configured to allow virtual machines (VMs) to communicate with the physical network and also enable migration traffic.
- The External Virtual Switch binds the VMs to the physical NIC (Network Interface Controller). For Failover Clustering, Live Migration traffic should ideally be segregated from general network traffic. If possible, use a dedicated network (or VLAN) for Live Migration traffic to avoid congestion from other network activities.
- Bandwidth Management: The BandwidthReservationMode and related parameters you’ve mentioned are related to how Hyper-V controls the bandwidth for different flows, including Live Migration. The transition from SCVMM (which was managing bandwidth reservation) to PowerShell-managed configuration can result in differences in how bandwidth is allocated.
- BandwidthReservationMode: This defines the mode of bandwidth reservation:
- Weight: This mode is more flexible, where you allocate relative bandwidth between different network flows (e.g., management, storage, live migration, etc.) based on weight.
- Absolute: In this mode, you define absolute bandwidth values in bits per second for each flow.
- BandwidthPercentage: The percentage of bandwidth that should be reserved for a particular flow. When using Absolute, you can specify the bandwidth in terms of Mbps or Gbps. When using Weight, you specify relative weights between flows.
- For example, setting BandwidthPercentage : 10 means that 10% of the available bandwidth will be reserved for this specific flow.
- DefaultFlowMinimumBandwidthAbsolute: This defines the absolute minimum bandwidth (in bits per second) for a given flow. For Live Migration, this is critical to ensure that migration traffic has guaranteed bandwidth, avoiding delays during migrations.
- For example, setting 1000000000 (which is 1 Gbps) ensures that the Live Migration process will always have at least 1 Gbps of bandwidth available, even if other traffic is competing for bandwidth.
- DefaultFlowMinimumBandwidthWeight: This defines the weight of the flow. The higher the weight, the more bandwidth that flow will receive relative to other flows. Setting this to 0 means no additional weight is given.
- BandwidthReservationMode: This defines the mode of bandwidth reservation:
- Here are the specific parameters you've referenced, and their configurations:
Recommended Configuration
- Virtual Switch Configuration:
- Dedicated NIC for Live Migration: Ideally, use a separate physical NIC or VLAN for Live Migration traffic. This ensures that migration traffic doesn’t compete with regular VM traffic or management traffic.
- If using SR-IOV (Single Root I/O Virtualization), make sure that the SR-IOV capabilities of the NICs are compatible with the virtual switches.
- Bandwidth Reservation:
- Absolute Reservation for Live Migration: Since you’ve configured BandwidthReservationMode : Absolute, ensure that you have enough bandwidth allocated for Live Migration. For example, if you set DefaultFlowMinimumBandwidthAbsolute to 1000000000 (1 Gbps), Live Migration will always have at least 1 Gbps of bandwidth, which should be sufficient for most environments.
- Adjust Bandwidth Percentage: If you're using Weight, adjust the BandwidthPercentage for the Live Migration traffic to ensure it doesn’t take more than necessary from the available bandwidth. For example, you could reserve 10% of the total bandwidth for Live Migration, and the rest can be allocated to management or other flows.
- Failover Cluster Network Considerations:
- Ensure that your Failover Cluster’s networks are correctly configured in the Cluster Validation Wizard. The validation checks if the Live Migration network is accessible and has the appropriate bandwidth available.
- Make sure that the Live Migration traffic is properly isolated and does not interfere with other cluster-related traffic. Ideally, dedicate one or more networks exclusively for Live Migration.
- Live Migration over SMB (if applicable):
- If you are using SMB-based Live Migration, ensure that the SMB share is accessible over the network with sufficient bandwidth. If SMB is used for Live Migration, also ensure that this flow is optimized and has adequate bandwidth and isolation.
- Monitoring and Tuning:
- After configuring the settings, monitor the performance of your Live Migrations using tools like PerfMon, Resource Monitor, or Network Performance Counters.
- Tuning the bandwidth settings and adjusting them based on the performance of your Live Migrations can help to optimize the process.
Example Configuration
Let’s say you want to allocate 10% of the total bandwidth to Live Migration with an absolute minimum of 1 Gbps (1000000000 bps). You could configure the virtual switch and the Failover Cluster settings like this:
- External Virtual Switch:
- kyazaferrIron Contributor
# Set the bandwidth reservation mode for Live Migration to Absolute
Set-VMHostNetworkAdapter -VMHost $VMHost -Name "vEthernet (External)" -BandwidthReservationMode Absolute# Set the absolute minimum bandwidth for Live Migration to 1 Gbps
Set-VMHostNetworkAdapter -VMHost $VMHost -Name "vEthernet (External)" -DefaultFlowMinimumBandwidthAbsolute 1000000000Set the bandwidth percentage reserved for Live Migration (e.g., 10%)
Set-VMHostNetworkAdapter -VMHost $VMHost -Name "vEthernet (External)" -BandwidthPercentage 10This configuration ensures that Live Migration will always have at least 1 Gbps of bandwidth, with up to 10% of the total network bandwidth reserved for migration operations. The rest of the bandwidth will be available for other VM and cluster traffic.
Conclusion
- Use Absolute for Live Migration to guarantee bandwidth.
- Set the DefaultFlowMinimumBandwidthAbsolute to a value that ensures adequate performance for Live Migration (e.g., 1 Gbps).
- Use BandwidthPercentage or Weight to manage relative bandwidth for other network flows in your Hyper-V environment.
- Test the configuration in a staging environment and monitor the performance of Live Migration to adjust the settings if necessary.