Share via


PoolOperations.ResizePool Method

Definition

Resizes the specified pool.

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)

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.

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 RemoveFromPool(String, IEnumerable<String>, Nullable<ComputeNodeDeallocationOption>, Nullable<TimeSpan>, IEnumerable<BatchClientBehavior>).

This is a blocking operation. For a non-blocking equivalent, see ResizePoolAsync(String, Nullable<Int32>, Nullable<Int32>, Nullable<TimeSpan>, Nullable<ComputeNodeDeallocationOption>, IEnumerable<BatchClientBehavior>, CancellationToken).

Applies to