Set-VMHost
Configures a Hyper-V host.
Set-VMHost
[[-ComputerName] <String[]>]
[[-Credential] <PSCredential[]>]
[-MaximumStorageMigrations <UInt32>]
[-MaximumVirtualMachineMigrations <UInt32>]
[-VirtualMachineMigrationAuthenticationType <MigrationAuthenticationType>]
[-UseAnyNetworkForMigration <Boolean>]
[-VirtualMachineMigrationPerformanceOption <VMMigrationPerformance>]
[-ResourceMeteringSaveInterval <TimeSpan>]
[-VirtualHardDiskPath <String>]
[-VirtualMachinePath <String>]
[-MacAddressMaximum <String>]
[-MacAddressMinimum <String>]
[-FibreChannelWwnn <String>]
[-FibreChannelWwpnMaximum <String>]
[-FibreChannelWwpnMinimum <String>]
[-NumaSpanningEnabled <Boolean>]
[-EnableEnhancedSessionMode <Boolean>]
[-Passthru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-VMHost
[-CimSession] <CimSession[]>
[-MaximumStorageMigrations <UInt32>]
[-MaximumVirtualMachineMigrations <UInt32>]
[-VirtualMachineMigrationAuthenticationType <MigrationAuthenticationType>]
[-UseAnyNetworkForMigration <Boolean>]
[-VirtualMachineMigrationPerformanceOption <VMMigrationPerformance>]
[-ResourceMeteringSaveInterval <TimeSpan>]
[-VirtualHardDiskPath <String>]
[-VirtualMachinePath <String>]
[-MacAddressMaximum <String>]
[-MacAddressMinimum <String>]
[-FibreChannelWwnn <String>]
[-FibreChannelWwpnMaximum <String>]
[-FibreChannelWwpnMinimum <String>]
[-NumaSpanningEnabled <Boolean>]
[-EnableEnhancedSessionMode <Boolean>]
[-Passthru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
The Set-VMHost cmdlet configures a Hyper-V host.
PS C:\> Set-VMHost -MaximumVirtualMachineMigrations 10 -MaximumStorageMigrations 10
This example configures the local Hyper-V host to allow 10 simultaneous live migrations and storage migrations.
PS C:\> Set-VMHost -MacAddressMinimum 00155D020600 -MacAddressMaximum 00155D0206FF
This example configures a range of MAC addresses range for the local Hyper-V host.
PS C:\> Set-VMHost -UseAnyNetworkForMigration $true
This example enables the use of any network for incoming live migrations on the local Hyper-V host.
PS C:\> Set-VMHost -VirtualHardDiskPath "C:\Hyper-V\Virtual Hard Disks" -VirtualMachinePath "C:\Hyper-V"
This example specifies new default locations for virtual hard disks and virtual machines on the local Hyper-V host. In this case:
- Virtual machines are stored in "C:\Hyper-V\Virtual Machines" (not "C:\Hyper-V")
- Virtual hard disks are stored in "C:\Hyper-V\Virtual Hard Disks"
PS C:\> Set-VMHost -FibreChannelWwnn C003FF0000FFFF00 -FibreChannelWwpnMinimum C003FF661D200000 -FibreChannelWwpnMaximum C003FF661D200000
This example configures Fibre Channel host settings on the local Hyper-V host.
PS C:\> Set-VMHost -NumaSpanningEnabled $false
This example disables NUMA spanning on the local Hyper-V host.
PS C:\> Set-VMHost -ResourceMeteringSaveInterval 01:30:00
This example configures the local Hyper-V host to save data that tracks resource consumption every hour and a half.
PS C:\> Set-VMHost -VirtualMachineMigrationAuthenticationType Kerberos
The example configures the local Hyper-V host to use Kerberos to authenticate incoming live migrations.
Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.
Type: | CimSession[] |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies one or more Hyper-V hosts on which this cmdlet operates. NetBIOS names, IP addresses, and fully qualified domain names are allowable. The default is the local computer. Use localhost or a dot (.) to specify the local computer explicitly.
Type: | String[] |
Position: | 0 |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies one or more user accounts that have permission to perform this action. The default is the current user.
Type: | PSCredential[] |
Position: | 1 |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Indicates whether users can use enhanced mode when they connect to virtual machines on this server by using Virtual Machine Connection.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the default value of the World Wide Node Name on the Hyper-V host.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the maximum value that can be used to generate World Wide Port Names on the Hyper-V host. Use with the FibreChannelWwpnMinimum parameter to establish a range of WWPNs that the specified Hyper-V host can assign to virtual Fibre Channel adapters.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the minimum value that can be used to generate the World Wide Port Names on the Hyper-V host. Use with the FibreChannelWwpnMaximum parameter to establish a range of WWPNs that the specified Hyper-V host can assign to virtual Fibre Channel adapters.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the maximum MAC address using a valid hexadecimal value. Use with the MacAddressMinimum parameter to establish a range of MAC addresses that the specified Hyper-V host can assign to virtual machines configured to receive dynamic MAC addresses.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the minimum MAC address using a valid hexadecimal value. Use with the MacAddressMaximum parameter to establish a range of MAC addresses that the specified Hyper-V host can assign to virtual machines configured to receive dynamic MAC addresses.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the maximum number of storage migrations that can be performed at the same time on the Hyper-V host.
Type: | UInt32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the maximum number of live migrations that can be performed at the same time on the
Hyper-V host. If your host is part a Failover Cluster, the cluster property takes precedence any
values set by the MaximumVirtualMachineMigrations parameter. To check the cluster property,
you can run the PowerShell command (Get-Cluster).MaximumParallelMigrations
.
Type: | UInt32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies whether virtual machines on the Hyper-V host can use resources from more than one NUMA node.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies that a Microsoft.HyperV.PowerShell.Host is to be passed through to the pipeline representing the Hyper-V host to be configured.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies how often the Hyper-V host saves the data that tracks resource usage. The range is a minimum of 1 hour to a maximum of 24 hours. Time within that range can be specified using a format of hh:mm:ss, where hh indicates hours, mm indicates minutes, and ss indicates seconds. You also can use a Timespan object to specify the interval.
Type: | TimeSpan |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies how networks are selected for incoming live migration traffic. If set to $True, any available network on the host can be used for this traffic. If set to $False, incoming live migration traffic is transmitted only on the networks specified in the MigrationNetworks property of the host. The Get-VMMigrationNetwork cmdlet returns the list of networks that can be used for migration traffic.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the default folder to store virtual hard disks on the Hyper-V host. This is not a functional setting. The Hyper-V Manager snap-in and Windows Admin Center query it to offer you a default path, but the Hyper-V API (for example CreateFixedVirtualHardDisk
) and New-VHD
don't use it.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the type of authentication to be used for live migrations. The acceptable values for this parameter are: Kerberos and CredSSP.
Type: | MigrationAuthenticationType |
Accepted values: | CredSSP, Kerberos |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the performance option to use for live migration. The acceptable values for this parameter are:
- Compression. Compress data to speed up live migration on constrained networks.
- SMBTransport. Use server message block (SMB) to get the highest throughput possible.
- None. Perform standard live migration.
Type: | VMMigrationPerformance |
Accepted values: | TCPIP, Compression, SMB |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the default folder to store virtual machine configuration files on the Hyper-V host. This is a functional setting, meaning that if you do not supply a path to VM creation tools (for example New-VM
), Hyper-V will use this path. Hyper-V will create at least one subfolder in this path, called "Virtual Machines".
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
None
Default
Microsoft.HyperV.PowerShell.VMHost
If -PassThru is specified.