Sdílet prostřednictvím


PoolOperationsExtensions.ResizeAsync Method

Definition

Changes the number of Compute Nodes that are assigned to a Pool.

public static System.Threading.Tasks.Task<Microsoft.Azure.Batch.Protocol.Models.PoolResizeHeaders> ResizeAsync (this Microsoft.Azure.Batch.Protocol.IPoolOperations operations, string poolId, Microsoft.Azure.Batch.Protocol.Models.PoolResizeParameter poolResizeParameter, Microsoft.Azure.Batch.Protocol.Models.PoolResizeOptions poolResizeOptions = default, System.Threading.CancellationToken cancellationToken = default);
static member ResizeAsync : Microsoft.Azure.Batch.Protocol.IPoolOperations * string * Microsoft.Azure.Batch.Protocol.Models.PoolResizeParameter * Microsoft.Azure.Batch.Protocol.Models.PoolResizeOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Batch.Protocol.Models.PoolResizeHeaders>
<Extension()>
Public Function ResizeAsync (operations As IPoolOperations, poolId As String, poolResizeParameter As PoolResizeParameter, Optional poolResizeOptions As PoolResizeOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of PoolResizeHeaders)

Parameters

operations
IPoolOperations

The operations group for this extension method.

poolId
String

The ID of the Pool to resize.

poolResizeParameter
PoolResizeParameter

The parameters for the request.

poolResizeOptions
PoolResizeOptions

Additional parameters for the operation

cancellationToken
CancellationToken

The cancellation token.

Returns

Remarks

You can only resize a Pool when its allocation state is steady. If the Pool is already resizing, the request fails with status code 409. When you resize a Pool, the Pool's allocation state changes from steady to resizing. You cannot resize Pools which are configured for automatic scaling. If you try to do this, the Batch service returns an error 409. If you resize a Pool downwards, the Batch service chooses which Compute Nodes to remove. To remove specific Compute Nodes, use the Pool remove Compute Nodes API instead.

Applies to