< Back

Get-AzureBatchComputeNode

Tue Jan 29, 2019 9:35 pm

NAME Get-AzureBatchComputeNode



SYNOPSIS

Gets Batch compute nodes from a pool.





SYNTAX

Get-AzureBatchComputeNode [-PoolId] <String> -BatchContext <BatchAccountContext> [-DefaultProfile <IAzureContextContainer>] [-Filter <String>]

[-MaxCount <Int32>] [-Select <String>] [<CommonParameters>]



Get-AzureBatchComputeNode [[-Pool] <PSCloudPool>] -BatchContext <BatchAccountContext> [-DefaultProfile <IAzureContextContainer>] [-Filter

<String>] [-MaxCount <Int32>] [-Select <String>] [<CommonParameters>]



Get-AzureBatchComputeNode [-PoolId] <String> [[-Id] <String>] -BatchContext <BatchAccountContext> [-DefaultProfile <IAzureContextContainer>]

[-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.





PARAMETERS

-BatchContext <BatchAccountContext>

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.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Filter <String>

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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Id <String>

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



Required? false

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-MaxCount <Int32>

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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Pool <PSCloudPool>

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

cmdlet.



Required? false

Position? 0

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-PoolId <String>

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



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Select <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

BatchAccountContext

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



PSCloudPool

Parameter 'Pool' accepts value of type 'PSCloudPool' from the pipeline





OUTPUTS

PSComputeNode







NOTES









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.azur ... 25t213220z

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.azur ... 25t213220z

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.azur ... 26t172920z

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.azur ... 25t213220z

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.azur ... 26t172920z

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.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... omputenode

Get-AzureBatchComputeNode

Get-AzureBatchNodeFile

Get-AzureBatchNodeFileContent

Get-AzureBatchPool

Reset-AzureBatchComputeNode

Restart-AzureBatchComputeNode

Azure Batch Cmdlets