PoolOperations.ResizePoolAsync(String, Nullable<Int32>, Nullable<Int32>, Nullable<TimeSpan>, Nullable<ComputeNodeDeallocationOption>, IEnumerable<BatchClientBehavior>, CancellationToken) Method

Definition

Resizes the specified pool.

public System.Threading.Tasks.Task ResizePoolAsync (string poolId, Nullable<int> targetDedicatedComputeNodes = null, Nullable<int> targetLowPriorityComputeNodes = null, Nullable<TimeSpan> resizeTimeout = null, Nullable<Microsoft.Azure.Batch.Common.ComputeNodeDeallocationOption> deallocationOption = null, System.Collections.Generic.IEnumerable<Microsoft.Azure.Batch.BatchClientBehavior> additionalBehaviors = null, System.Threading.CancellationToken cancellationToken = null);
member this.ResizePoolAsync : string * Nullable<int> * Nullable<int> * Nullable<TimeSpan> * Nullable<Microsoft.Azure.Batch.Common.ComputeNodeDeallocationOption> * seq<Microsoft.Azure.Batch.BatchClientBehavior> * System.Threading.CancellationToken -> System.Threading.Tasks.Task

Parameters

poolId
String

The id of the pool.

targetDedicatedComputeNodes
Nullable<Int32>

The desired number of dedicated compute nodes in the pool. At least one of targetDedicatedComputeNodes and targetLowPriorityComputeNodes is required.

targetLowPriorityComputeNodes
Nullable<Int32>

The desired number of low-priority compute nodes in the pool. At least one of targetDedicatedComputeNodes and targetLowPriorityComputeNodes is required.

resizeTimeout
Nullable<TimeSpan>

The timeout for allocation of compute nodes to the pool or removal of compute nodes from the pool. If the pool has not reached the target size after this time, the resize is stopped. The default is 15 minutes.

deallocationOption
Nullable<ComputeNodeDeallocationOption>

Specifies how to handle tasks already running, and when the nodes running them may be removed from the pool, if the pool size is decreasing. The default is Requeue.

additionalBehaviors
IEnumerable<BatchClientBehavior>

A collection of BatchClientBehavior instances that are applied to the Batch service request after the CustomBehaviors.

cancellationToken
CancellationToken

A CancellationToken for controlling the lifetime of the asynchronous operation.

Returns

Task

A Task that represents the asynchronous operation.

Remarks

The resize operation requests that the pool be resized. The request puts the pool in the Resizing allocation state. The Batch service will perform the actual resize without any further client action, and set the allocation state to Steady once complete.

You can only resize a pool when its AllocationState is Steady. You cannot resize pools which are configured for automatic scaling (that is, the AutoScaleEnabled property of the pool is true). If you decrease the pool size, the Batch service chooses which nodes to remove. To remove specific nodes, call RemoveFromPoolAsync(String, IEnumerable<String>, Nullable<ComputeNodeDeallocationOption>, Nullable<TimeSpan>, IEnumerable<BatchClientBehavior>, CancellationToken).

The resize operation runs asynchronously.

Applies to