Share via


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

CloudPool.Resize 方法

定义

调整此池的大小。

public void Resize (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.Resize : Nullable<int> * Nullable<int> * Nullable<TimeSpan> * Nullable<Microsoft.Azure.Batch.Common.ComputeNodeDeallocationOption> * seq<Microsoft.Azure.Batch.BatchClientBehavior> -> unit
Public Sub Resize (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)

参数

targetDedicatedComputeNodes
Nullable<Int32>

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

targetLowPriorityComputeNodes
Nullable<Int32>

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

resizeTimeout
Nullable<TimeSpan>

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

deallocationOption
Nullable<ComputeNodeDeallocationOption>

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

additionalBehaviors
IEnumerable<BatchClientBehavior>

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

注解

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

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

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

适用于