Remove-AzureBatchComputeNode

Removes compute nodes from a pool.

Syntax

Remove-AzureBatchComputeNode
      [-PoolId] <String>
      [-Ids] <String[]>
      [-DeallocationOption <ComputeNodeDeallocationOption>]
      [-ResizeTimeout <TimeSpan>]
      [-Force]
      -BatchContext <BatchAccountContext>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-AzureBatchComputeNode
      [[-ComputeNode] <PSComputeNode>]
      [-DeallocationOption <ComputeNodeDeallocationOption>]
      [-ResizeTimeout <TimeSpan>]
      [-Force]
      -BatchContext <BatchAccountContext>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<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. If you use the Get-AzureRmBatchAccount cmdlet to get your BatchAccountContext, then Azure Active Directory authentication will be used when interacting with the Batch service. To use shared key authentication instead, use the Get-AzureRmBatchAccountKeys cmdlet to get a BatchAccountContext object with its access keys populated. When using shared key authentication, the primary access key is used by default. To change the key to use, set the BatchAccountContext.KeyInUse property.

Type:Microsoft.Azure.Commands.Batch.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:System.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:Microsoft.Azure.Commands.Batch.Models.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:System.Management.Automation.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:System.Nullable`1[Microsoft.Azure.Batch.Common.ComputeNodeDeallocationOption]
Parameter Sets:Requeue, Terminate, TaskCompletion, RetainedData
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
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:System.Management.Automation.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:System.Nullable`1[System.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:System.Management.Automation.SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

BatchAccountContext

Parameter 'BatchContext' accepts value of type 'BatchAccountContext' from the pipeline

Inputs

PSComputeNode

Parameter 'ComputeNode' accepts value of type 'PSComputeNode' from the pipeline