Use this when preparing Hyper-V hosts consistently with scripts.
Host Configuration
Hyper-V host configuration automation sets up hosts with Install-WindowsFeature Hyper-V, Set-VMHost for default paths and migration settings, NUMA spanning and live migration networks.
1. Host configuration: paths, migration settings, NUMA spanning, switches.
2. Apply consistently with DSC or scripts.
3. Compare hosts in a cluster.
4. Document.
5. Verify after changes.
desired host settings → apply → verify
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Get-VMHost | Format-List *Primary Commands
Configuration and operational commands for this Topic.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Command read-back and what it shows Verify boundary
For Hyper-V Automation → Host Configuration, read back with Get-VMHost | Format-List *. Success is discriminated by the intended host is identified, Hyper-V reports the expected host capabilities and policy values, and the original automation action succeeds on a bounded test VM without introducing host-level regression; failure remains when required capabilities are disabled/mismatched, automation targets the wrong host, or host read-back is correct while VM placement/configuration still fails on an adjacent dependency. Get-VMHost shows selected Hyper-V host configuration exposed by the local management plane, but it does not show cluster quorum, storage/network health or a guest workload.
Step 2 Observation-driven branch and next-check logic Narrow the fault
Start Hyper-V Automation → Host Configuration from one identified target/request/artifact and timestamp. Decision path: if host inventory is missing or stale, validate target discovery first; if Hyper-V state/capabilities differ from desired, isolate host configuration; if host matches policy but VM action fails, move to cluster, storage, network or guest-specific evidence.
Step 3 Common mistakes Narrow the fault
- Host settings configured by hand on some nodes only.
- Install the role and management tools.
- Set default VM and VHDX paths.
- Configure live migration networks.
Get-VMHost | fl VirtualMachinePath,VirtualHardDiskPath,MaximumVirtualMachineMigrations— settingsSet-VMHost -VirtualMachinePath D:\VMs -WhatIf— preview- DSC/HyperVDsc for host config — declarative
ReferenceWhy it matters1 section · depth on demand
Method
Hyper-V host configuration automation builds hosts consistently: roles, networking, storage, clustering and security settings.
1. Install roles: Install-WindowsFeature Hyper-V, Failover-Clustering -IncludeManagementTools -Restart.
2. Configure networking: SET switch, management/live migration/storage vNICs and VLANs.
3. Set host defaults: VM paths, live migration networks and authentication, NUMA spanning.
4. Join cluster and add CSVs.
5. Verify with Test-Cluster and a test VM migration.
New-VMSwitch -Name SET -NetAdapterName 'NIC1','NIC2' -EnableEmbeddedTeaming $true -AllowManagementOS $false
Add-VMNetworkAdapter -ManagementOS -SwitchName SET -Name Mgmt
Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName Mgmt -Access -VlanId 10
Set-VMHost -VirtualHardDiskPath C:\ClusterStorage\Volume1\VMs -VirtualMachinePath C:\ClusterStorage\Volume1\VMs
ReferenceHow it works1 section · depth on demand
How it works
Hyper-V Automation → Host Configuration owns Hyper-V host feature state, scheduler/resource capabilities, virtual switch exposure and the management policy that automation expects before placing or configuring VMs. Host automation reads and changes a virtualization substrate whose effective capabilities come from Hyper-V service state, NUMA/memory/processor policy, migration settings and switch/storage integration. Keep these adjacent boundaries separate: cluster membership, storage paths, networking, domain/authentication and hardware/firmware compatibility remain separate dependencies. A key diagnostic distinction is that a reachable Windows host can still be unsuitable for VM placement, and Hyper-V enabled does not show required migration, switch or resource policy is correct.
ReferenceImportant terms & boundaries1 section · depth on demand
Mechanics
Hyper-V Automation → Host Configuration is owned at runtime by Hyper-V VMMS/hypervisor services invoked through the Hyper-V PowerShell/API surface. The linked authority for bounded mechanics is Microsoft Learn — Hyper-V PowerShell module; documentation support is separate from observed lab/production Evidence.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Hyper-V Automation > Host Configuration. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/powershell/module/hyper-v/?view=windowsserver2025-ps · confidence 94%