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

CloudPool.ResizeAsync 方法

定义

调整此池的大小。

public System.Threading.Tasks.Task ResizeAsync (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, System.Threading.CancellationToken cancellationToken = default);
member this.ResizeAsync : Nullable<int> * Nullable<int> * Nullable<TimeSpan> * Nullable<Microsoft.Azure.Batch.Common.ComputeNodeDeallocationOption> * seq<Microsoft.Azure.Batch.BatchClientBehavior> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function ResizeAsync (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, Optional cancellationToken As CancellationToken = Nothing) As Task

参数

targetDedicatedComputeNodes
Nullable<Int32>

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

targetLowPriorityComputeNodes
Nullable<Int32>

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

resizeTimeout
Nullable<TimeSpan>

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

deallocationOption
Nullable<ComputeNodeDeallocationOption>

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

additionalBehaviors
IEnumerable<BatchClientBehavior>

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

cancellationToken
CancellationToken

一个 CancellationToken ,用于控制异步操作的生存期。

返回

表示异步操作的 Task

注解

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

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

重设大小操作以异步方式运行。

适用于