你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

PoolOperations.ResizePool 方法

定义

调整指定池的大小。

public void ResizePool (string poolId, int? targetDedicatedComputeNodes = default, int? targetLowPriorityComputeNodes = default, TimeSpan? resizeTimeout = default, Microsoft.Azure.Batch.Common.ComputeNodeDeallocationOption? deallocationOption = default, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = default);
member this.ResizePool : string * Nullable<int> * Nullable<int> * Nullable<TimeSpan> * Nullable<Microsoft.Azure.Batch.Common.ComputeNodeDeallocationOption> * seq<Microsoft.Azure.Batch.BatchClientBehavior> -> unit
Public Sub ResizePool (poolId As String, Optional targetDedicatedComputeNodes As Nullable(Of Integer) = Nothing, Optional targetLowPriorityComputeNodes As Nullable(Of Integer) = Nothing, Optional resizeTimeout As Nullable(Of TimeSpan) = Nothing, Optional deallocationOption As Nullable(Of ComputeNodeDeallocationOption) = Nothing, Optional additionalBehaviors As IEnumerable(Of BatchClientBehavior) = Nothing)

参数

poolId
String

池的 id。

targetDedicatedComputeNodes
Nullable<Int32>

池中所需专用计算节点数。 至少需要 和 之targetDedicatedComputeNodestargetLowPriorityComputeNodes一。

targetLowPriorityComputeNodes
Nullable<Int32>

池中所需的低优先级计算节点数。 至少需要 和 之targetDedicatedComputeNodestargetLowPriorityComputeNodes一。

resizeTimeout
Nullable<TimeSpan>

将计算节点分配到池或从池中删除计算节点的超时。 如果池在此时间之后尚未达到目标大小,则会停止调整大小。 默认值为 15 分钟。

deallocationOption
Nullable<ComputeNodeDeallocationOption>

指定如何处理已运行的任务,以及运行这些任务的节点何时可能从池中删除(如果池大小正在减小)。 默认为 Requeue

additionalBehaviors
IEnumerable<BatchClientBehavior>

在 之后应用于 Batch 服务请求的实例集合BatchClientBehaviorCustomBehaviors

注解

调整大小操作请求调整池的大小。 请求将池置于 Resizing 分配状态。 Batch 服务将执行实际调整大小,而无需执行任何进一步的客户端操作,并在完成后将分配状态设置为 Steady

仅当池为 Steady时,才能重AllocationState设池大小。 不能调整为自动缩放 (池的大小, AutoScaleEnabled 即池的 属性为 true) 。 如果减小池大小,Batch 服务将选择要删除的节点。 若要删除特定节点,请调用 RemoveFromPool(String, IEnumerable<String>, Nullable<ComputeNodeDeallocationOption>, Nullable<TimeSpan>, IEnumerable<BatchClientBehavior>)

这是一个阻止操作。 有关非阻塞等效项,请参阅 ResizePoolAsync(String, Nullable<Int32>, Nullable<Int32>, Nullable<TimeSpan>, Nullable<ComputeNodeDeallocationOption>, IEnumerable<BatchClientBehavior>, CancellationToken)

适用于