HVDRS
1.5.1
Hyper-V Distributed Resource Scheduler — VM Happiness-based compute and storage load balancing for Failover Clusters, with affinity/anti-affinity rule enforcement
Minimum PowerShell version
5.1
Installation Options
Owners
Copyright
(c) 2026 Jason Huebel. Licensed under the MIT License.
Package Details
Author(s)
- Jason Huebel
Tags
Hyper-V HyperV DRS FailoverCluster LoadBalancing VirtualMachine VM LiveMigration StorageMigration CSV ClusterSharedVolume Affinity WindowsServer Automation
Functions
Invoke-HvDRS Get-HvDRSCluster Enable-HvDRSMaintenance Disable-HvDRSMaintenance Get-HvDRSMaintenanceStatus Add-HvDRSAffinityRule Get-HvDRSAffinityRule Remove-HvDRSAffinityRule Set-HvDRSAffinityRule Test-HvDRSAffinityCompliance Test-HvDRSStorageAffinityCompliance Invoke-HvStorageDRS
Dependencies
This module has no dependencies.
Release Notes
## 1.5.1
- Fixed three latent bugs where a zero-match result collapsed to $null instead
of an empty array/collection at a function or switch-expression output
boundary: Find-MigrationCandidates (no migrations recommended),
Get-HvDRSAffinityRule (no rules match a filter), and an internal switch-to-
variable assignment in the same function. These were silently tolerated by
PowerShell's default null.Count convenience behavior but threw under
Set-StrictMode, which the publish pipeline enables — surfaced while
preparing this release. No behavior change for non-strict-mode callers.
## 1.5.0
- Added -PassThru to Invoke-HvDRS: emits each migration recommendation as a structured
object (ClusterName, VMName, VMId, SourceNode, DestinationNode, scores, ComplianceReason)
in addition to the existing console output, for programmatic consumers. Fully additive
and backward compatible — omitting the switch preserves prior behavior.
- Fixed internal Format-Table calls leaking formatting objects onto the function's output
stream when callers capture Invoke-HvDRS's return value; they now render to the console
only via Out-Host.
## 1.4.0
- Added Get-HvDRSCluster: lightweight, read-only discovery of cluster nodes, VMs, and
Cluster Shared Volumes, with no performance-counter collection and no migrations proposed
## 1.3.0
- CRITICAL FIX: the module manifest was missing RootModule, so Import-Module HVDRS
never loaded HVDRS.psm1 and exported zero functions in every prior published
version. RootModule = 'HVDRS.psm1' is now set and the module works correctly.
- Fixed Get-AffinityRuleSet returning $null instead of an empty array on a fresh
rules store, which broke adding the very first affinity rule
- Added storage-specific affinity/anti-affinity rules: VmVmCsvAffinity, VmVmCsvAntiAffinity,
VmCsvAffinity, VmCsvAntiAffinity
- Add-HvDRSAffinityRule / Set-HvDRSAffinityRule accept -CSVs (and -AddCSVs/-RemoveCSVs)
- Invoke-HvStorageDRS now loads storage rules, runs a compliance pass ahead of the
happiness pass, and applies soft-rule penalties / compliance bonuses to candidate scoring
- Added Test-HvDRSStorageAffinityCompliance for live VM-to-CSV placement auditing
## 1.2.1
- Documentation only: promoted PowerShell Gallery install to the recommended option in INSTALL.md
- Updated README Quick Start to use Install-Module instead of Copy-Item
## 1.2.0
- Added per-cluster scoping for affinity/anti-affinity rules
- Rules stored in shared JSON file are now filtered by ClusterName at load time
- Add-HvDRSAffinityRule, Get-HvDRSAffinityRule, Remove-HvDRSAffinityRule all accept -ClusterName
- Same rule name may now exist independently across different clusters
## 1.1.0
- Added Storage DRS (Invoke-HvStorageDRS): CSV space and latency happiness scoring,
greedy storage migration planner, Move-VMStorage execution
- Added affinity/anti-affinity rules (VmVmAffinity, VmVmAntiAffinity, VmHostAffinity,
VmHostAntiAffinity) with hard (enforced) and soft enforcement modes
- Added two-pass migration planner: compliance pass fixes hard violations first,
happiness pass applies rule impact scoring
- Added Test-HvDRSAffinityCompliance for live placement auditing
## 1.0.0
- Initial release: VM Happiness scoring, compute DRS, Network-Aware destination
filtering, aggression levels 1–5, maintenance mode
FileList
- HVDRS.nuspec
- TESTS.md
- LICENSE
- INSTALL.md
- HVDRS.psm1
- HVDRS.psd1
- Functions\Public\Maintenance.ps1
- Functions\Public\Invoke-HvStorageDRS.ps1
- Functions\Public\Invoke-HvDRS.ps1
- Functions\Public\Get-HvDRSCluster.ps1
- Functions\Public\AffinityRules.ps1
- Functions\Private\Test-StorageAffinityCompliance.ps1
- Functions\Private\Test-AffinityCompliance.ps1
- Functions\Private\Measure-VmHappiness.ps1
- Functions\Private\Measure-CsvHappiness.ps1
- Functions\Private\Get-StorageSnapshot.ps1
- Functions\Private\Get-StorageMigrationRuleImpact.ps1
- Functions\Private\Get-MigrationRuleImpact.ps1
- Functions\Private\Get-HvDRSDataRoot.ps1
- Functions\Private\Get-ClusterSnapshot.ps1
- Functions\Private\Get-ClusterInventory.ps1
- Functions\Private\Get-AffinityRuleSet.ps1
- Functions\Private\Find-StorageMigrationCandidates.ps1
- Functions\Private\Find-MigrationCandidates.ps1
- README.md
- USAGE.md
Version History
| Version | Downloads | Last updated |
|---|---|---|
| 1.5.1 (current version) | 5 | 6/25/2026 |
| 1.4.0 | 5 | 6/22/2026 |
| 1.3.0 | 4 | 6/22/2026 |
| 1.2.1 | 6 | 6/19/2026 |
| 1.2.0 | 4 | 6/19/2026 |