Remove-​Azure​Batch​Compute​Node

Removes compute nodes from a pool.

Syntax

Remove-AzureBatchComputeNode
      [[-ComputeNode] <PSComputeNode>]
      -BatchContext <BatchAccountContext>
      [-DeallocationOption <ComputeNodeDeallocationOption>]
      [-Force]
      [-ResizeTimeout <TimeSpan>]
      [-Confirm]
      [-WhatIf]
      [<CommonParameters>]
Remove-AzureBatchComputeNode
      [-PoolId] <String>
      [-Ids] <String[]>
      -BatchContext <BatchAccountContext>
      [-DeallocationOption <ComputeNodeDeallocationOption>]
      [-Force]
      [-ResizeTimeout <TimeSpan>]
      [-Confirm]
      [-WhatIf]
      [<CommonParameters>]

Description

The Remove-AzureBatchComputeNode cmdlet removes Azure Batch compute nodes from a pool.

Examples

Example 1: Remove a compute node

PS C:\>Remove-AzureBatchComputeNode -PoolId "Pool07" -Ids "tvm-2316545714_1-20150725t213220z" -DeallocationOption Terminate -ResizeTimeout ([TimeSpan]::FromMinutes(10)) -BatchContext $Context

This command removes compute node that has the specified ID from pool that has the ID Pool07. The command specifies the Terminate deallocation option. The resize time-out is of 10 minutes.

Example 2: Remove a compute node by using the pipeline

PS C:\>Get-AzureBatchComputeNode -PoolId "Pool07" -Id "tvm-2316545714_1-20150725t213220z" -BatchContext $Context | Remove-AzureBatchComputeNode -Force -BatchContext $Context

This command gets the compute node that has the specified ID from pool that has the ID Pool07 by using the Get-AzureBatchComputeNode cmdlet. The command passes that node to the current cmdlet by using the pipeline. The current cmdlet removes the compute node. The command specifies the Force parameter. Therefore, the command does not prompt you for confirmation.

Example 3: Remove multiple nodes

PS C:\>Remove-AzureBatchComputeNode -PoolId "Pool07" @("tvm-1783593343_28-20151117t214257z","tvm-1783593343_29-20151117t214257z") -Force -BatchContext $Context

This command removes two compute nodes from the pool that has the ID Pool07. The command does not prompt you for confirmation.

Required Parameters

-BatchContext

Specifies the BatchAccountContext instance that this cmdlet uses to interact with the Batch service. To obtain a BatchAccountContext object that contains access keys for your subscription, use the Get-AzureRmBatchAccountKeys cmdlet.

Type:BatchAccountContext
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Ids

Specifies an array of IDs of compute nodes that this cmdlet removes from the pool.

Type:String[]
Aliases:Id
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PoolId

Specifies the ID of the pool that contains the compute nodes that this cmdlet removes.

Type:String
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-ComputeNode

Specifies the PSComputeNode object that represents the compute node that this cmdlet removes.

Type:PSComputeNode
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DeallocationOption

Specifies a deallocation option for the removal operation that this cmdlet starts. The default value is Requeue.

Type:ComputeNodeDeallocationOption
Parameter Sets:Requeue, Terminate, TaskCompletion, RetainedData
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResizeTimeout

Specifies the time-out interval for removal of the compute nodes from the pool. The default value is 10 minutes. The minimum value is 5 minutes.

Type:TimeSpan
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False