Set-SCPlacementConfiguration
设置主机组的放置配置设置。
语法
Set-SCPlacementConfiguration
-PlacementConfiguration <PlacementConfigurationSettings>
-Inherit <Boolean>
[-VMMServer <ServerConnection>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-SCPlacementConfiguration
-PlacementConfiguration <PlacementConfigurationSettings>
[-Off]
[-DVDDriveRequirement]
[-LoadBalancerRequirement]
[-NetworkRequirement]
[-PassthroughDiskRequirement]
[-VMQueueAvailability]
[-VMMServer <ServerConnection>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-SCPlacementConfiguration
-PlacementConfiguration <PlacementConfigurationSettings>
[-Favor]
[-DVDDriveRequirement]
[-LoadBalancerRequirement]
[-NetworkRequirement]
[-PassthroughDiskRequirement]
[-VMQueueAvailability]
[-VMMServer <ServerConnection>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-SCPlacementConfiguration
-PlacementConfiguration <PlacementConfigurationSettings>
[-ShouldMeet]
[-DVDDriveRequirement]
[-LoadBalancerRequirement]
[-NetworkRequirement]
[-PassthroughDiskRequirement]
[-VMQueueAvailability]
[-VMMServer <ServerConnection>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-SCPlacementConfiguration
-PlacementConfiguration <PlacementConfigurationSettings>
[-MustMeet]
[-DVDDriveRequirement]
[-LoadBalancerRequirement]
[-NetworkRequirement]
[-PassthroughDiskRequirement]
[-VMQueueAvailability]
[-VMMServer <ServerConnection>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Set-SCPlacementConfiguration cmdlet 设置主机组的放置配置设置。 若要更新主机组的设置,该主机组不得从父主机组继承其设置。
示例
示例 1:设置主机组必须满足的放置设置
PS C:\> $HostGroup = Get-SCVMHostGroup "HostGroup01"
PS C:\> $PlacementConfig = Get-SCPlacementConfiguration -VMHostGroup $HostGroup
PS C:\> Set-SCPlacementConfiguration -PlacementConfiguration $PlacementConfig -MustMeet -ClusterReserveRequirement -HighAvailabilityRequirement -IPAddressAvailabilityRequirement
第一个命令获取名为 HostGroup01 的主机组对象,并将对象存储在$HostGroup变量中。
第二个命令获取存储在$HostGroup中的主机组的放置配置对象,并将对象存储在$PlacementConfig变量中。
最后一个命令更新存储在$PlacementConfig中的放置配置的设置。
示例 2:重置主机组从父主机组继承的放置设置
PS C:\> $HostGroup = Get-SCVMHostGroup "HostGroup01"
PS C:\> $PlacementConfig = Get-SCPlacementConfiguration -VMHostGroup $HostGroup
PS C:\> Set-SCPlacementConfiguration -PlacementConfiguration $PlacementConfig -Inherit $True
第一个命令获取名为 HostGroup01 的主机组对象,并将对象存储在$HostGroup变量中。
第二个命令获取存储在$HostGroup中的主机组的放置配置对象,并将对象存储在$PlacementConfig变量中。
最后一个命令将存储在$PlacementConfig中的放置配置设置为从其父主机组继承其放置设置。
示例 3:关闭主机组的放置设置
PS C:\> $HostGroup = Get-SCVMHostGroup "HostGroup01"
PS C:\> $PlacementConfig = Get-SCPlacementConfiguration -VMHostGroup $HostGroup
PS C:\> Set-SCPlacementConfiguration -PlacementConfiguration $PlacementConfig -Off -ClusterReserveRequirement -HighAvailabilityRequirement -IPAddressAvailabilityRequirement
第一个命令获取名为 HostGroup01 的主机组对象,并将对象存储在$HostGroup变量中。
第二个命令获取存储在$HostGroup中的主机组的放置配置对象,并将对象存储在$PlacementConfig变量中。
最后一个命令关闭存储在$PlacementConfig中的放置配置的指定放置设置。
参数
-Confirm
提示你在运行 cmdlet 之前进行确认。
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DVDDriveRequirement
指示目标主机必须具有虚拟机所需的物理 DVD 驱动器数才能放置。 如果在虚拟机上配置了特定的 DVD 驱动器号,主机必须具有使用该同一驱动器号的 DVD 驱动器。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Favor
指示即使主机不满足所有要求,放置过程也会选择主机;不会向用户显示任何警告消息。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Inherit
指示是否从父主机组继承设置。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
指定跟踪作业进度,并将其存储在此参数命名的变量中。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LoadBalancerRequirement
指示目标主机必须有权访问负载均衡器进行放置。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MustMeet
指示如果主机不符合要求,放置过程将不会选择主机。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-NetworkRequirement
指示目标主机必须具有连接到虚拟机所需的每个逻辑网络的虚拟交换机才能放置。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Off
指示放置检查已关闭,因此在确定目标主机是否满足放置指标时,放置不会考虑该指标。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PassthroughDiskRequirement
指示目标主机必须支持放置传递磁盘。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PlacementConfiguration
指定放置配置对象。
Type: | PlacementConfigurationSettings |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-PROTipID
指定触发此操作 (PRO 提示) 的性能和资源优化提示的 ID。 此参数允许审核 PRO 提示。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
指示作业异步运行,以便控件立即返回到命令 shell。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ShouldMeet
指示即使主机不满足所有要求,放置过程也会选择主机;向用户显示警告消息。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
指定VMM 服务器对象。
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VMQueueAvailability
指示目标主机必须支持网络优化进行放置。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
显示在此 cmdlet 运行的情况下将会发生什么。 此 cmdlet 未运行。
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
输出
PlacementConfiguration
此 cmdlet 返回 PlacementConfiguration 对象。