Get-​Azure​Batch​Compute​Node

Gets Batch compute nodes from a pool.

Syntax

Get-AzureBatchComputeNode
   -BatchContext <BatchAccountContext>
   [-Filter <String>]
   [-MaxCount <Int32>]
   -PoolId <String>
   [-Select <String>]
   [<CommonParameters>]
Get-AzureBatchComputeNode
   [[-Pool] <PSCloudPool>]
   -BatchContext <BatchAccountContext>
   [-Filter <String>]
   [-MaxCount <Int32>]
   [-Select <String>]
   [<CommonParameters>]
Get-AzureBatchComputeNode
   [[-Id] <String>]
   -BatchContext <BatchAccountContext>
   -PoolId <String>
   [-Select <String>]
   [<CommonParameters>]

Description

The Get-AzureBatchComputeNode cmdlet gets Azure Batch compute nodes from a pool. Specify either the PoolID or Pool parameter. Specify the Id parameter to get a single compute node. Specify the Filter parameter to get the compute nodes that match an Open Data Protocol (OData) filter.

Examples

Example 1: Get a compute node by ID

PS C:\>Get-AzureBatchComputeNode -PoolId "Pool06" -Id "tvm-2316545714_1-20150725t213220z" -BatchContext $Context
Id                    : tvm-2316545714_1-20150725t213220z
Url                   : https://cmdletexample.westus.batch.azure.com/pools/MyPool/nodes/tvm-2316545714_1-20150725t213220z
State                 : Idle
StateTransitionTime   : 7/25/2015 9:36:53 PM
LastBootTime          : 7/25/2015 9:36:53 PM
AllocationTime        : 7/25/2015 9:32:20 PM
IPAddress             : 10.14.121.1
AffinityId            : TVM:tvm-2316545714_1-20150725t213220z
VirtualMachineSize    : small
TotalTasksRun         : 1
StartTaskInformation  : 
RecentTasks           : {}
StartTask             : 
CertificateReferences : 
Errors                :

This command gets the compute node that has the ID tvm-2316545714_1-20150725t213220z from the pool that has the ID Pool06. Use the Get-AzureRmBatchAccountKeys cmdlet to assign a context to the $Context variable.

Example 2: Get all idle compute nodes from a pool

PS C:\>Get-AzureBatchComputeNode -PoolId "Pool06" -Filter "state eq 'idle'" -BatchContext $Context
Id                    : tvm-2316545714_1-20150725t213220z
Url                   : https://cmdletexample.westus.batch.azure.com/pools/MyPool/nodes/tvm-2316545714_1-20150725t213220z
State                 : Idle
StateTransitionTime   : 7/25/2015 9:36:53 PM
LastBootTime          : 7/25/2015 9:36:53 PM
AllocationTime        : 7/25/2015 9:32:20 PM
IPAddress             : 10.14.121.1
AffinityId            : TVM:tvm-2316545714_1-20150725t213220z
VirtualMachineSize    : small
TotalTasksRun         : 1
StartTaskInformation  : 
RecentTasks           : {}
StartTask             : 
CertificateReferences : 
Errors                : 

Id                    : tvm-2316545714_2-20150726t172920z
Url                   : https://cmdletexample.westus.batch.azure.com/pools/MyPool/nodes/tvm-2316545714_2-20150726t172920z
State                 : Idle
StateTransitionTime   : 7/26/2015 5:33:58 PM
LastBootTime          : 7/26/2015 5:33:58 PM
AllocationTime        : 7/26/2015 5:29:20 PM
IPAddress             : 10.14.121.38
AffinityId            : TVM:tvm-2316545714_2-20150726t172920z
VirtualMachineSize    : small
TotalTasksRun         : 0
StartTaskInformation  : 
RecentTasks           : 
StartTask             : 
CertificateReferences : 
Errors                :

This command gets all idle compute nodes that are contained in the pool that has the ID Pool06. The command specifies the idle state by using the Filter parameter.

Example 3: Get all compute nodes in a specified pool

PS C:\>Get-AzureBatchPool -Id "Pool07" -BatchContext $Context | Get-AzureBatchComputeNode -BatchContext $Context
Id                    : tvm-2316545714_1-20150725t213220z
Url                   : https://cmdletexample.westus.batch.azure.com/pools/MyPool/nodes/tvm-2316545714_1-20150725t213220z
State                 : Idle
StateTransitionTime   : 7/25/2015 9:36:53 PM
LastBootTime          : 7/25/2015 9:36:53 PM
AllocationTime        : 7/25/2015 9:32:20 PM
IPAddress             : 10.14.121.1
AffinityId            : TVM:tvm-2316545714_1-20150725t213220z
VirtualMachineSize    : small
TotalTasksRun         : 1
StartTaskInformation  : 
RecentTasks           : {}
StartTask             : 
CertificateReferences : 
Errors                : 


Id                    : tvm-2316545714_2-20150726t172920z
Url                   : https://cmdletexample.westus.batch.azure.com/pools/MyPool/nodes/tvm-2316545714_2-20150726t172920z
State                 : Idle
StateTransitionTime   : 7/26/2015 5:33:58 PM
LastBootTime          : 7/26/2015 5:33:58 PM
AllocationTime        : 7/26/2015 5:29:20 PM

IPAddress             : 10.14.121.38
AffinityId            : TVM:tvm-2316545714_2-20150726t172920z
VirtualMachineSize    : small
TotalTasksRun         : 0
StartTaskInformation  : 
RecentTasks           : 
StartTask             : 
CertificateReferences : 
Errors                :

This command gets the pool that has the ID Pool07 by using the Get-AzureBatchPool cmdlet. The command passes that pool to the current cmdlet by using the pipeline operator. That cmdlet gets all compute nodes from that pool.

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
-PoolId

Specifies the ID of the pool that contains the compute nodes.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-Filter

Specifies an OData filter clause. This cmdlet returns compute nodes that match the filter that this parameter specifies. If you do not specify a filter, this cmdlet returns all compute nodes for the pool.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Id

Specifies the ID of the compute node that this cmdlet gets from the pool. You cannot specify wildcard characters.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-MaxCount

Specifies the maximum number of compute nodes to return. If you specify a value of zero (0) or less, the cmdlet does not use an upper limit. The default value is 1000.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Pool

Specifies the pool, as a PSCloudPool object, that contains the compute nodes. To obtain a PSCloudPool object, use the Get-AzureBatchPool cmdlet.

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

Specifies an OData select clause. Specify a value for this parameter to get specific properties rather than all object properties.

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

Outputs

PSComputeNode