Set-VMHost
Configures a Hyper-V host.
语法
Parameter Set: CimSession
Set-VMHost [-CimSession] <Microsoft.Management.Infrastructure.CimSession[]> [-EnableEnhancedSessionMode <Nullable [System.Boolean]> ] [-FibreChannelWwnn <System.String> ] [-FibreChannelWwpnMaximum <System.String> ] [-FibreChannelWwpnMinimum <System.String> ] [-MacAddressMaximum <System.String> ] [-MacAddressMinimum <System.String> ] [-MaximumStorageMigrations <System.UInt32> ] [-MaximumVirtualMachineMigrations <System.UInt32> ] [-NumaSpanningEnabled <Nullable [System.Boolean]> ] [-Passthru] [-ResourceMeteringSaveInterval <Nullable [System.TimeSpan]> ] [-UseAnyNetworkForMigration <System.Boolean> ] [-VirtualHardDiskPath <System.String> ] [-VirtualMachineMigrationAuthenticationType <Microsoft.HyperV.PowerShell.MigrationAuthenticationType> {CredSSP | Kerberos} ] [-VirtualMachineMigrationPerformanceOption <Microsoft.HyperV.PowerShell.VMMigrationPerformance> {TCPIP | Compression | SMB} ] [-VirtualMachinePath <System.String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: ComputerName
Set-VMHost [[-ComputerName] <System.String[]> ] [[-Credential] <System.Management.Automation.PSCredential[]> ] [-EnableEnhancedSessionMode <Nullable [System.Boolean]> ] [-FibreChannelWwnn <System.String> ] [-FibreChannelWwpnMaximum <System.String> ] [-FibreChannelWwpnMinimum <System.String> ] [-MacAddressMaximum <System.String> ] [-MacAddressMinimum <System.String> ] [-MaximumStorageMigrations <System.UInt32> ] [-MaximumVirtualMachineMigrations <System.UInt32> ] [-NumaSpanningEnabled <Nullable [System.Boolean]> ] [-Passthru] [-ResourceMeteringSaveInterval <Nullable [System.TimeSpan]> ] [-UseAnyNetworkForMigration <System.Boolean> ] [-VirtualHardDiskPath <System.String> ] [-VirtualMachineMigrationAuthenticationType <Microsoft.HyperV.PowerShell.MigrationAuthenticationType> {CredSSP | Kerberos} ] [-VirtualMachineMigrationPerformanceOption <Microsoft.HyperV.PowerShell.VMMigrationPerformance> {TCPIP | Compression | SMB} ] [-VirtualMachinePath <System.String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
详细说明
The Set-VMHost cmdlet configures a Hyper-V host.
参数
-CimSession<Microsoft.Management.Infrastructure.CimSession[]>
在远程会话中或远程计算机上运行该 cmdlet。输入计算机名或会话对象,如 New-cimsession 或 Get-cimsession cmdlet 的输出。默认为本地计算机上的当前会话。
别名 |
none |
是否必需? |
true |
在哪里? |
1 |
默认值 |
none |
是否接受管道输入? |
true(ByPropertyName) |
是否接受通配符? |
false |
-ComputerName<System.String[]>
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.
别名 |
none |
是否必需? |
false |
在哪里? |
1 |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-Credential<System.Management.Automation.PSCredential[]>
Specifies one or more user accounts that have permission to perform this action. The default is the current user.
别名 |
none |
是否必需? |
false |
在哪里? |
2 |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-EnableEnhancedSessionMode<Nullable [System.Boolean]>
Indicates whether users can use enhanced mode when they connect to virtual machines on this server by using Virtual Machine Connection.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-FibreChannelWwnn<System.String>
Specifies the default value of the World Wide Node Name on the Hyper-V host.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-FibreChannelWwpnMaximum<System.String>
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.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-FibreChannelWwpnMinimum<System.String>
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.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-MacAddressMaximum<System.String>
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.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-MacAddressMinimum<System.String>
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.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-MaximumStorageMigrations<System.UInt32>
Specifies the maximum number of storage migrations that can be performed at the same time on the Hyper-V host.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-MaximumVirtualMachineMigrations<System.UInt32>
Specifies the maximum number of live migrations that can be performed at the same time on the Hyper-V host.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-NumaSpanningEnabled<Nullable [System.Boolean]>
Specifies whether virtual machines on the Hyper-V host can use resources from more than one NUMA node.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-Passthru
Specifies that a Microsoft.HyperV.PowerShell.Host is to be passed through to the pipeline representing the Hyper-V host to be configured.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-ResourceMeteringSaveInterval<Nullable [System.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.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-UseAnyNetworkForMigration<System.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 cmdlet returns the list of networks that can be used for migration traffic.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-VirtualHardDiskPath<System.String>
Specifies the default folder to store virtual hard disks on the Hyper-V host.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-VirtualMachineMigrationAuthenticationType<Microsoft.HyperV.PowerShell.MigrationAuthenticationType>
Specifies the type of authentication to be used for live migrations. 此参数的可接受值是: Kerberos and CredSSP.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-VirtualMachineMigrationPerformanceOption<Microsoft.HyperV.PowerShell.VMMigrationPerformance>
Specifies the performance option to use for live migration. 此参数的可接受值是:
-- 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.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-VirtualMachinePath<System.String>
Specifies the default folder to store virtual machine configuration files on the Hyper-V host.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-Confirm
在运行 cmdlet 前提示你进行确认。
是否必需? |
false |
在哪里? |
named |
默认值 |
false |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-WhatIf
显示在 cmdlet 运行时将发生的情况。该 cmdlet 不运行。
是否必需? |
false |
在哪里? |
named |
默认值 |
false |
是否接受管道输入? |
false |
是否接受通配符? |
false |
<CommonParameters>
此 cmdlet 支持常见的参数:-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer 和 -OutVariable。有关详细信息,请参阅 TechNet 上的 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
输入
输入类型是可以传送到 cmdlet 的对象的类型。
输出
输出类型是 cmdlet 发出的对象的类型。
- None by default; Microsoft.HyperV.PowerShell.Host if –PassThru is specified.
示例
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