CloudPool Class

A Pool in the Azure Batch service.

Variables are only populated by the server, and will be ignored when sending a request.

Inheritance
msrest.serialization.Model
CloudPool

Constructor

CloudPool(*, id: str = None, display_name: str = None, url: str = None, e_tag: str = None, last_modified=None, creation_time=None, state=None, state_transition_time=None, allocation_state=None, allocation_state_transition_time=None, vm_size: str = None, cloud_service_configuration=None, virtual_machine_configuration=None, resize_timeout=None, resize_errors=None, current_dedicated_nodes: int = None, current_low_priority_nodes: int = None, target_dedicated_nodes: int = None, target_low_priority_nodes: int = None, enable_auto_scale: bool = None, auto_scale_formula: str = None, auto_scale_evaluation_interval=None, auto_scale_run=None, enable_inter_node_communication: bool = None, network_configuration=None, start_task=None, certificate_references=None, application_package_references=None, application_licenses=None, task_slots_per_node: int = None, task_scheduling_policy=None, user_accounts=None, metadata=None, stats=None, mount_configuration=None, identity=None, target_node_communication_mode=None, upgrade_policy=None, resource_tags=None, **kwargs)

Parameters

Name Description
id
Required
str

The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case).

display_name
Required
str

The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.

url
Required
str
e_tag
Required
str

This is an opaque string. You can use it to detect whether the Pool has changed between requests. In particular, you can be pass the ETag when updating a Pool to specify that your changes should take effect only if nobody else has modified the Pool in the meantime.

last_modified
Required

This is the last time at which the Pool level data, such as the targetDedicatedNodes or enableAutoscale settings, changed. It does not factor in node-level changes such as a Compute Node changing state.

creation_time
Required
state
Required

Possible values include: 'active', 'deleting'

state_transition_time
Required
allocation_state
Required

Possible values include: 'steady', 'resizing', 'stopping'

allocation_state_transition_time
Required
vm_size
Required
str

For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes).

cloud_service_configuration
Required

The cloud service configuration for the Pool. This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch Account was created with its poolAllocationMode property set to 'UserSubscription'.

virtual_machine_configuration
Required

The virtual machine configuration for the Pool. This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified.

resize_timeout
Required
<xref:timedelta>

This is the timeout for the most recent resize operation. (The initial sizing when the Pool is created counts as a resize.) The default value is 15 minutes.

resize_errors
Required

This property is set only if one or more errors occurred during the last Pool resize, and only when the Pool allocationState is Steady.

current_dedicated_nodes
Required
int

The number of dedicated Compute Nodes currently in the Pool.

current_low_priority_nodes
Required
int

The number of Spot/Low-priority Compute Nodes currently in the Pool. Spot/Low-priority Compute Nodes which have been preempted are included in this count.

target_dedicated_nodes
Required
int

The desired number of dedicated Compute Nodes in the Pool.

target_low_priority_nodes
Required
int

The desired number of Spot/Low-priority Compute Nodes in the Pool.

enable_auto_scale
Required

Whether the Pool size should automatically adjust over time. If false, at least one of targetDedicatedNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula property is required and the Pool automatically resizes according to the formula. The default value is false.

auto_scale_formula
Required
str

This property is set only if the Pool automatically scales, i.e. enableAutoScale is true.

auto_scale_evaluation_interval
Required
<xref:timedelta>

This property is set only if the Pool automatically scales, i.e. enableAutoScale is true.

auto_scale_run
Required

The results and errors from the last execution of the autoscale formula. This property is set only if the Pool automatically scales, i.e. enableAutoScale is true.

enable_inter_node_communication
Required

Whether the Pool permits direct communication between Compute Nodes. This imposes restrictions on which Compute Nodes can be assigned to the Pool. Specifying this value can reduce the chance of the requested number of Compute Nodes to be allocated in the Pool.

network_configuration
Required

The network configuration for the Pool.

start_task
Required

A Task specified to run on each Compute Node as it joins the Pool.

certificate_references
Required

For Windows 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. Warning: This property is deprecated and will be removed after February, 2024. Please use the Azure KeyVault Extension instead.

application_package_references
Required

Changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Package references on any given Pool.

application_licenses
Required

The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, Pool creation will fail.

task_slots_per_node
Required
int

The number of task slots that can be used to run concurrent tasks on a single compute node in the pool. The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256.

task_scheduling_policy
Required

How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread.

user_accounts
Required
metadata
Required
stats
Required

Utilization and resource usage statistics for the entire lifetime of the Pool. This property is populated only if the CloudPool was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes.

mount_configuration
Required

This supports Azure Files, NFS, CIFS/SMB, and Blobfuse.

identity
Required

The identity of the Batch pool, if configured. The list of user identities associated with the Batch pool. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

target_node_communication_mode
Required

The desired node communication mode for the pool. If omitted, the default value is Default. Possible values include: 'default', 'classic', 'simplified'

upgrade_policy
Required

The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, or rolling.

resource_tags
Required

The user-defined tags to be associated with the Azure Batch Pool. When specified, these tags are propagated to the backing Azure resources associated with the pool. This property can only be specified when the Batch account was created with the poolAllocationMode property set to 'UserSubscription'.

Keyword-Only Parameters

Name Description
id
Required
display_name
Required
url
Required
e_tag
Required
last_modified
Required
creation_time
Required
state
Required
state_transition_time
Required
allocation_state
Required
allocation_state_transition_time
Required
vm_size
Required
cloud_service_configuration
Required
virtual_machine_configuration
Required
resize_timeout
Required
resize_errors
Required
current_dedicated_nodes
Required
current_low_priority_nodes
Required
target_dedicated_nodes
Required
target_low_priority_nodes
Required
enable_auto_scale
Required
auto_scale_formula
Required
auto_scale_evaluation_interval
Required
auto_scale_run
Required
enable_inter_node_communication
Required
network_configuration
Required
start_task
Required
certificate_references
Required
application_package_references
Required
application_licenses
Required
task_slots_per_node
Required
task_scheduling_policy
Required
user_accounts
Required
metadata
Required
stats
Required
mount_configuration
Required
identity
Required
target_node_communication_mode
Required
upgrade_policy
Required
resource_tags
Required

Variables

Name Description
current_node_communication_mode

The current state of the pool communication mode. Possible values include: 'default', 'classic', 'simplified'

Methods

as_dict

Return a dict that can be JSONify using json.dump.

Advanced usage might optionally use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains 'type' with the msrest type and 'key' with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

deserialize

Parse a str using the RestAPI syntax and return a model.

enable_additional_properties_sending
from_dict

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

is_xml_model
serialize

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

validate

Validate this model recursively and return a list of ValidationError.

as_dict

Return a dict that can be JSONify using json.dump.

Advanced usage might optionally use a callback as parameter:

Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains 'type' with the msrest type and 'key' with the RestAPI encoded key. Value is the current value in this object.

The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.

See the three examples in this file:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

If you want XML serialization, you can pass the kwargs is_xml=True.

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

Parameters

Name Description
key_transformer
<xref:function>

A key transformer function.

keep_readonly
default value: True

Returns

Type Description

A dict JSON compatible object

deserialize

Parse a str using the RestAPI syntax and return a model.

deserialize(data, content_type=None)

Parameters

Name Description
data
Required
str

A str using RestAPI structure. JSON by default.

content_type
str

JSON by default, set application/xml if XML.

default value: None

Returns

Type Description

An instance of this model

Exceptions

Type Description
DeserializationError if something went wrong

enable_additional_properties_sending

enable_additional_properties_sending()

from_dict

Parse a dict using given key extractor return a model.

By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)

from_dict(data, key_extractors=None, content_type=None)

Parameters

Name Description
data
Required

A dict using RestAPI structure

content_type
str

JSON by default, set application/xml if XML.

default value: None
key_extractors
default value: None

Returns

Type Description

An instance of this model

Exceptions

Type Description
DeserializationError if something went wrong

is_xml_model

is_xml_model()

serialize

Return the JSON that would be sent to azure from this model.

This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).

If you want XML serialization, you can pass the kwargs is_xml=True.

serialize(keep_readonly=False, **kwargs)

Parameters

Name Description
keep_readonly

If you want to serialize the readonly attributes

default value: False

Returns

Type Description

A dict JSON compatible object

validate

Validate this model recursively and return a list of ValidationError.

validate()

Returns

Type Description

A list of validation error