Set-VMHost

Set-VMHost

Configures a Hyper-V host.

Syntax

Parameter Set: Default
Set-VMHost [[-ComputerName] <String[]> ] [-FibreChannelWwnn <String> ] [-FibreChannelWwpnMaximum <String> ] [-FibreChannelWwpnMinimum <String> ] [-MacAddressMaximum <String> ] [-MacAddressMinimum <String> ] [-MaximumStorageMigrations <UInt32> ] [-MaximumVirtualMachineMigrations <UInt32> ] [-NumaSpanningEnabled <Boolean> ] [-Passthru] [-ResourceMeteringSaveInterval <TimeSpan> ] [-UseAnyNetworkForMigration <Boolean> ] [-VirtualHardDiskPath <String> ] [-VirtualMachineMigrationAuthenticationType <MigrationAuthenticationType> ] [-VirtualMachinePath <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Set-VMHost cmdlet configures a Hyper-V host.

Parameters

-ComputerName<String[]>

Specifies one or more Hyper-V hosts to be configured. 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.

Aliases

none

Required?

false

Position?

1

Default Value

.

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-MacAddressMaximum<String>

Specifies the maximum MAC address using a valid hexadecimal value. Use with MacAddressMinimum to establish a range of MAC addresses that the specified Hyper-V host can assign to virtual machines configured to receive dynamic MAC addresses.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MacAddressMinimum<String>

Specifies the minimum MAC address using a valid hexadecimal value. Use with MacAddressMaximum to establish a range of MAC addresses that the specified Hyper-V host can assign to virtual machines configured to receive dynamic MAC addresses.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Passthru

Specifies that a Microsoft.Virtualization.Powershell.Host is to be passed through to the pipeline representing the Hyper-V host to be configured.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UseAnyNetworkForMigration<Boolean>

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 returns the list of networks that can be used for migration traffic.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VirtualHardDiskPath<String>

Specifies the default folder to store virtual hard disks on the Hyper-V host.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VirtualMachinePath<String>

Specifies the default folder to store virtual machine configuration files on the Hyper-V host.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-FibreChannelWwnn<String>

Specifies the default value of the World Wide Node Name on the Hyper-V host.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-FibreChannelWwpnMaximum<String>

Specifies the maximum value that can be used to generate World Wide Port Names on the Hyper-V host. Use with FibreChannelWwpnMinimum to establish a range of WWPNs that the specified Hyper-V host can assign to virtual Fibre Channel adapters.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-FibreChannelWwpnMinimum<String>

Specifies the minimum value that can be used to generate the World Wide Port Names on the Hyper-V host. Use with FibreChannelWwpnMaximum to establish a range of WWPNs that the specified Hyper-V host can assign to virtual Fibre Channel adapters.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MaximumStorageMigrations<UInt32>

Specifies the maximum number of storage migrations that can be performed at the same time on the Hyper-V host.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MaximumVirtualMachineMigrations<UInt32>

Specifies the maximum number of live migrations that can be performed at the same time on the Hyper-V host.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NumaSpanningEnabled<Boolean>

Specifies whether virtual machines on the Hyper-V host can use resources from more than one NUMA node.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ResourceMeteringSaveInterval<TimeSpan>

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VirtualMachineMigrationAuthenticationType<MigrationAuthenticationType>

Specifies the type of authentication to be used for live migrations. Allowed values are Kerberos or CredSSP.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • None by default; Microsoft.Virtualization.Powershell.Host if –PassThru is specified.

Examples

Example 1

This example configures the local Hyper-V host to allow 10 simultaneous live migrations and storage migrations.

PS C:\> Set-VMHost -MaximumVirtualMachineMigrations 10 –MaximumStorageMigrations 10

Example 2

This example configures a range of MAC addresses range for the local Hyper-V host.

PS C:\> Set-VMHost -MacAddressMinimum 00155D020600 -MacAddressMaximum 00155D0206FF

Example 3

This example enables the use of any network for incoming live migrations on the local Hyper-V host.

PS C:\> Set-VMHost –UseAnyNetworkForMigration $true 

Example 4

This example specifies new default locations for virtual hard disksand virtual machines on the local Hyper-V host.

PS C:\> Set-VMHost –VirtualHardDiskPath “C:\Hyper-V\Virtual Hard Disks” –VirtualMachinePath “C:\Hyper-V\Configuration Files”

Example 5

This example configures Fibre Channel host settings on the local Hyper-V host.

PS C:\> Set-VMHost -FibreChannelWwnn C003FF0000FFFF00 -FibreChannelWwpnMinimum C003FF661D200000 -FibreChannelWwpnMaximum C003FF661D200000

Example 6

This example disables NUMA spanning on the local Hyper-V host.

PS C:\> Set-VMHost –NumaSpanningEnabled $false

Example 7

This example configures the local Hyper-V host to save data that tracks resource consumption every hour and a half.

PS C:\> Set-VMHost -ResourceMeteringSaveInterval 01:30:00

Example 8

The example configures the local Hyper-V host to use Kerberos to authenticate incoming live migrations.

PS C:\> Set-VMHost –VirtualMachineMigrationAuthenticationType Kerberos