Share via


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

 

Resizes the specified pool.

Namespace:   Microsoft.Azure.Batch
Assembly:  Microsoft.Azure.Batch (in Microsoft.Azure.Batch.dll)

Syntax

public Task ResizePoolAsync(
    string poolId,
    int targetDedicated,
    Nullable<TimeSpan> resizeTimeout = null,
    Nullable<ComputeNodeDeallocationOption> deallocationOption = null,
    IEnumerable<BatchClientBehavior> additionalBehaviors = null
)
public:
Task^ ResizePoolAsync(
    String^ poolId,
    int targetDedicated,
    Nullable<TimeSpan> resizeTimeout = null,
    Nullable<ComputeNodeDeallocationOption> deallocationOption = null,
    IEnumerable<BatchClientBehavior^>^ additionalBehaviors = null
)
member ResizePoolAsync : 
        poolId:string *
        targetDedicated:int *
        resizeTimeout:Nullable<TimeSpan> = null *
        deallocationOption:Nullable<ComputeNodeDeallocationOption> = null *
        additionalBehaviors:IEnumerable<BatchClientBehavior> = null -> Task
Public Function ResizePoolAsync (
    poolId As String,
    targetDedicated As Integer,
    resizeTimeout As Nullable(Of TimeSpan),
    deallocationOption As Nullable(Of ComputeNodeDeallocationOption),
    additionalBehaviors As IEnumerable(Of BatchClientBehavior)
) As Task

Parameters

  • targetDedicated
    Type: System.Int32

    The desired number of compute nodes in the pool.

  • resizeTimeout
    Type: System.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 10 minutes.

Return Value

Type: System.Threading.Tasks.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.

The resize operation runs asynchronously.

See Also

PoolOperations Class
Microsoft.Azure.Batch Namespace

Return to top