---
title: "Lists the compute nodes in the specified pool."
method: GET
path: "/pools/{poolId}/nodes"
tags: ["ComputeNodes"]
---

# Lists the compute nodes in the specified pool.

`GET /pools/{poolId}/nodes`

## Path parameters

- `poolId` string, required

## Query parameters

- `$filter` string
- `$select` string
- `maxresults` integer
- `timeout` integer
- `api-version` string, required

## Headers

- `client-request-id` string, uuid
- `return-client-request-id` boolean
- `ocp-date` string, date-time-rfc1123

## Response `200`

A response containing the list of nodes.

- ComputeNodeListResult
  - `value` ComputeNode[]
    - `id` string — Every node that is added to a pool is assigned a unique ID. Whenever a node is removed from a pool, all of its local files are deleted, and the ID is reclaimed and could be reused for new nodes.
    - `url` string
    - `state` 'idle' | 'rebooting' | 'reimaging' | 'running' | 'unusable' | 'creating' | 'starting' | 'waitingForStartTask' | 'startTaskFailed' | 'unknown' | 'leavingPool' | 'offline' | 'preempted' — Values are: idle - The node is not currently running a task. rebooting - The node is rebooting. reimaging - The node is reimaging. running - The node is running one or more tasks (other than a start task). unusable - The node cannot be used for task execution due to errors. creating - The Batch service has obtained the underlying virtual machine from Azure Compute, but it has not yet started to join the pool. starting - the Batch service is starting on the underlying virtual machine. waitingforstarttask - The start task has started running on the compute node, but waitForSuccess is set and the start task has not yet completed. starttaskfailed - The start task has failed on the compute node (and exhausted all retries), and waitForSuccess is set. The node is not usable for running tasks. unknown - The Batch service has lost contact with the node, and does not know its true state. leavingpool - The node is leaving the pool, either because the user explicitly removed it or because the pool is resizing or autoscaling down. offline - The node is not currently running a task, and scheduling of new tasks to the node is disabled. preempted - The low-priority node has been preempted. Tasks which were running on the node when it was preempted will be rescheduled when another node becomes available.
    - `schedulingState` 'enabled' | 'disabled' — Values are: enabled - Tasks can be scheduled on the node. disabled - No new tasks will be scheduled on the node. Tasks already running on the node may still run to completion. All nodes start with scheduling enabled.
    - `stateTransitionTime` string, date-time
    - `lastBootTime` string, date-time — This property may not be present if the node state is unusable.
    - `allocationTime` string, date-time
    - `ipAddress` string — Every node that is added to a pool is assigned a unique IP address. Whenever a node is removed from a pool, all of its local files are deleted, and the IP address is reclaimed and could be reused for new nodes.
    - `affinityId` string — Note that this is just a soft affinity. If the target node is busy or unavailable at the time the task is scheduled, then the task will be scheduled elsewhere.
    - `vmSize` string — For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).
    - `totalTasksRun` integer
    - `runningTasksCount` integer
    - `totalTasksSucceeded` integer
    - `recentTasks` TaskInformation[] — This property is present only if at least one task has run on this node since it was assigned to the pool.
      - `taskUrl` string
      - `jobId` string
      - `taskId` string
      - `subtaskId` integer
      - `taskState` 'active' | 'preparing' | 'running' | 'completed', required — Values are: active - The task is queued and able to run, but is not currently assigned to a compute node. A task enters this state when it is created, when it is enabled after being disabled, or when it is awaiting a retry after a failed run. preparing - The task has been assigned to a compute node, but is waiting for a required Job Preparation task to complete on the node. If the Job Preparation task succeeds, the task will move to running. If the Job Preparation task fails, the task will return to active and will be eligible to be assigned to a different node. running - The task is running on a compute node. This includes task-level preparation such as downloading resource files or deploying application packages specified on the task - it does not necessarily mean that the task command line has started executing. completed - The task is no longer eligible to run, usually because the task has finished successfully, or the task has finished unsuccessfully and has exhausted its retry limit. A task is also marked as completed if an error occurred launching the task, or when the task has been terminated.
      - `executionInfo` TaskExecutionInformation
        - `startTime` string, date-time — 'Running' corresponds to the running state, so if the task specifies resource files or application packages, then the start time reflects the time at which the task started downloading or deploying these. If the task has been restarted or retried, this is the most recent time at which the task started running. This property is present only for tasks that are in the running or completed state.
        - `endTime` string, date-time — This property is set only if the task is in the Completed state.
        - `exitCode` integer — This property is set only if the task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the task (due to timeout, or user termination via the API) you may see an operating system-defined exit code.
        - `failureInfo` TaskFailureInformation
          - `category` 'userError' | 'serverError', required
          - `code` string
          - `message` string
          - `details` NameValuePair[]
            - `name` string
            - `value` string
        - `retryCount` integer, required — Task application failures (non-zero exit code) are retried, pre-processing errors (the task could not be run) and file upload errors are not retried. The Batch service will retry the task up to the limit specified by the constraints.
        - `lastRetryTime` string, date-time — This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not.
        - `requeueCount` integer, required — When the user removes nodes from a pool (by resizing/shrinking the pool) or when the job is being disabled, the user can specify that running tasks on the nodes be requeued for execution. This count tracks how many times the task has been requeued for these reasons.
        - `lastRequeueTime` string, date-time — This property is set only if the requeueCount is nonzero.
        - `result` 'success' | 'failure' — Values are: success - The task ran successfully. failure - There was an error during processing of the task. The failure may have occurred before the task process was launched, while the task process was executing, or after the task process exited.
    - `startTask` StartTask
      - `commandLine` string, required — The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
      - `resourceFiles` ResourceFile[] — Files listed under this element are located in the task's working directory.
        - `blobSource` string, required — This URL must be readable using anonymous access; that is, the Batch service does not present any credentials when downloading the blob. There are two ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the blob, or set the ACL for the blob or its container to allow public access.
        - `filePath` string, required
        - `fileMode` string — This property applies only to files being downloaded to Linux compute nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows node. If this property is not specified for a Linux node, then a default value of 0770 is applied to the file.
      - `environmentSettings` EnvironmentSetting[]
        - `name` string, required
        - `value` string
      - `userIdentity` UserIdentity — Specify either the userName or autoUser property, but not both.
        - `username` string — The userName and autoUser properties are mutually exclusive; you must specify one but not both.
        - `autoUser` AutoUserSpecification
          - `scope` 'task' | 'pool' — Values are: pool - specifies that the task runs as the common auto user account which is created on every node in a pool. task - specifies that the service should create a new user for the task. The default value is task.
          - `elevationLevel` 'nonAdmin' | 'admin' — Values are: nonAdmin - The user is a standard user without elevated access. admin - The user is a user with elevated access and operates with full Administrator permissions.
      - `maxTaskRetryCount` integer — The Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit.
      - `waitForSuccess` boolean — If true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and failure info details. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is false.
    - `startTaskInfo` StartTaskInformation
      - `state` 'running' | 'completed', required — Values are: running - The start task is currently running. completed - The start task has exited with exit code 0, or the start task has failed and the retry limit has reached, or the start task process did not run due to task preparation errors (such as resource file download failures).
      - `startTime` string, date-time, required — This value is reset every time the task is restarted or retried (that is, this is the most recent time at which the start task started running).
      - `endTime` string, date-time — This is the end time of the most recent run of the start task, if that run has completed (even if that run failed and a retry is pending). This element is not present if the start task is currently running.
      - `exitCode` integer — This property is set only if the start task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the start task (due to timeout, or user termination via the API) you may see an operating system-defined exit code.
      - `failureInfo` TaskFailureInformation
        - `category` 'userError' | 'serverError', required
        - `code` string
        - `message` string
        - `details` NameValuePair[]
          - `name` string
          - `value` string
      - `retryCount` integer, required — Task application failures (non-zero exit code) are retried, pre-processing errors (the task could not be run) and file upload errors are not retried. The Batch service will retry the task up to the limit specified by the constraints.
      - `lastRetryTime` string, date-time — This element is present only if the task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the task has been restarted for reasons other than retry; for example, if the compute node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not.
      - `result` 'success' | 'failure' — Values are: success - The task ran successfully. failure - There was an error during processing of the task. The failure may have occurred before the task process was launched, while the task process was executing, or after the task process exited.
    - `certificateReferences` CertificateReference[] — For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
      - `thumbprint` string, required
      - `thumbprintAlgorithm` string, required
      - `storeLocation` 'currentUser' | 'localMachine' — The default value is currentUser. This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
      - `storeName` string — This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). Common store names include: My, Root, CA, Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any custom store name can also be used. The default value is My.
      - `visibility` string[] — Values are: starttask - The user account under which the start task is run. task - The accounts under which job tasks are run. remoteuser - The accounts under which users remotely access the node. You can specify more than one visibility in this collection. The default is all accounts.
    - `errors` ComputeNodeError[]
      - `code` string
      - `message` string
      - `errorDetails` NameValuePair[]
        - `name` string
        - `value` string
    - `isDedicated` boolean
    - `endpointConfiguration` ComputeNodeEndpointConfiguration
      - `inboundEndpoints` InboundEndpoint[], required
        - `name` string, required
        - `protocol` 'tcp' | 'udp', required
        - `publicIPAddress` string, required
        - `publicFQDN` string, required
        - `frontendPort` integer, required
        - `backendPort` integer, required
  - `odata.nextLink` string

## Other responses

- `default` — The error from the Batch service.

---

[API](https://skmtc.dev/azure/apis/batch-batch.md) · [All operations](https://skmtc.dev/azure/apis/batch-batch/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/batch-batch/revisions/c132dc281e07/schema)
