2025/09/17 - AWS Parallel Computing Service - 3 updated api methods
Changes Add support for Amazon EC2 Capacity Blocks for ML
{'purchaseOption': {'CAPACITY_BLOCK'}}Response
{'computeNodeGroup': {'purchaseOption': {'CAPACITY_BLOCK'}}}
Creates a managed set of compute nodes. You associate a compute node group with a cluster through 1 or more PCS queues or as part of the login fleet. A compute node group includes the definition of the compute properties and lifecycle management. PCS uses the information you provide to this API action to launch compute nodes in your account. You can only specify subnets in the same Amazon VPC as your cluster. You receive billing charges for the compute nodes that PCS launches in your account. You must already have a launch template before you call this API. For more information, see Launch an instance from a launch template in the Amazon Elastic Compute Cloud User Guide for Linux Instances.
See also: AWS API Documentation
Request Syntax
client.create_compute_node_group( clusterIdentifier='string', computeNodeGroupName='string', amiId='string', subnetIds=[ 'string', ], purchaseOption='ONDEMAND'|'SPOT'|'CAPACITY_BLOCK', customLaunchTemplate={ 'id': 'string', 'version': 'string' }, iamInstanceProfileArn='string', scalingConfiguration={ 'minInstanceCount': 123, 'maxInstanceCount': 123 }, instanceConfigs=[ { 'instanceType': 'string' }, ], spotOptions={ 'allocationStrategy': 'lowest-price'|'capacity-optimized'|'price-capacity-optimized' }, slurmConfiguration={ 'slurmCustomSettings': [ { 'parameterName': 'string', 'parameterValue': 'string' }, ] }, clientToken='string', tags={ 'string': 'string' } )
string
[REQUIRED]
The name or ID of the cluster to create a compute node group in.
string
[REQUIRED]
A name to identify the cluster. Example: MyCluster
string
The ID of the Amazon Machine Image (AMI) that PCS uses to launch compute nodes (Amazon EC2 instances). If you don't provide this value, PCS uses the AMI ID specified in the custom launch template.
list
[REQUIRED]
The list of subnet IDs where the compute node group launches instances. Subnets must be in the same VPC as the cluster.
(string) --
string
Specifies how EC2 instances are purchased on your behalf. PCS supports On-Demand Instances, Spot Instances, and Amazon EC2 Capacity Blocks for ML. For more information, see Amazon EC2 billing and purchasing options in the Amazon Elastic Compute Cloud User Guide. For more information about PCS support for Capacity Blocks, see Using Amazon EC2 Capacity Blocks for ML with PCS in the PCS User Guide. If you don't provide this option, it defaults to On-Demand.
dict
[REQUIRED]
An Amazon EC2 launch template PCS uses to launch compute nodes.
id (string) -- [REQUIRED]
The ID of the EC2 launch template to use to provision instances.
Example: lt-xxxx
version (string) -- [REQUIRED]
The version of the EC2 launch template to use to provision instances.
string
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM instance profile used to pass an IAM role when launching EC2 instances. The role contained in your instance profile must have the pcs:RegisterComputeNodeGroupInstance permission and the role name must start with AWSPCS or must have the path /aws-pcs/. For more information, see IAM instance profiles for PCS in the PCS User Guide.
dict
[REQUIRED]
Specifies the boundaries of the compute node group auto scaling.
minInstanceCount (integer) -- [REQUIRED]
The lower bound of the number of instances allowed in the compute fleet.
maxInstanceCount (integer) -- [REQUIRED]
The upper bound of the number of instances allowed in the compute fleet.
list
[REQUIRED]
A list of EC2 instance configurations that PCS can provision in the compute node group.
(dict) --
An EC2 instance configuration PCS uses to launch compute nodes.
instanceType (string) --
The EC2 instance type that PCS can provision in the compute node group.
Example: t2.xlarge
dict
Additional configuration when you specify SPOT as the purchaseOption for the CreateComputeNodeGroup API action.
allocationStrategy (string) --
The Amazon EC2 allocation strategy PCS uses to provision EC2 instances. PCS supports lowest price, capacity optimized, and price capacity optimized. For more information, see Use allocation strategies to determine how EC2 Fleet or Spot Fleet fulfills Spot and On-Demand capacity in the Amazon Elastic Compute Cloud User Guide. If you don't provide this option, it defaults to price capacity optimized.
dict
Additional options related to the Slurm scheduler.
slurmCustomSettings (list) --
Additional Slurm-specific configuration that directly maps to Slurm settings.
(dict) --
Additional settings that directly map to Slurm settings.
parameterName (string) -- [REQUIRED]
PCS supports configuration of the following Slurm parameters:
For clusters
For compute node groups
parameterValue (string) -- [REQUIRED]
The values for the configured Slurm settings.
string
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate 1 for you.
This field is autopopulated if not provided.
dict
1 or more tags added to the resource. Each tag consists of a tag key and tag value. The tag value is optional and can be an empty string.
(string) --
(string) --
dict
Response Syntax
{ 'computeNodeGroup': { 'name': 'string', 'id': 'string', 'arn': 'string', 'clusterId': 'string', 'createdAt': datetime(2015, 1, 1), 'modifiedAt': datetime(2015, 1, 1), 'status': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATE_FAILED'|'DELETE_FAILED'|'UPDATE_FAILED'|'DELETED'|'SUSPENDING'|'SUSPENDED', 'amiId': 'string', 'subnetIds': [ 'string', ], 'purchaseOption': 'ONDEMAND'|'SPOT'|'CAPACITY_BLOCK', 'customLaunchTemplate': { 'id': 'string', 'version': 'string' }, 'iamInstanceProfileArn': 'string', 'scalingConfiguration': { 'minInstanceCount': 123, 'maxInstanceCount': 123 }, 'instanceConfigs': [ { 'instanceType': 'string' }, ], 'spotOptions': { 'allocationStrategy': 'lowest-price'|'capacity-optimized'|'price-capacity-optimized' }, 'slurmConfiguration': { 'slurmCustomSettings': [ { 'parameterName': 'string', 'parameterValue': 'string' }, ] }, 'errorInfo': [ { 'code': 'string', 'message': 'string' }, ] } }
Response Structure
(dict) --
computeNodeGroup (dict) --
A compute node group associated with a cluster.
name (string) --
The name that identifies the compute node group.
id (string) --
The generated unique ID of the compute node group.
arn (string) --
The unique Amazon Resource Name (ARN) of the compute node group.
clusterId (string) --
The ID of the cluster of the compute node group.
createdAt (datetime) --
The date and time the resource was created.
modifiedAt (datetime) --
The date and time the resource was modified.
status (string) --
The provisioning status of the compute node group.
amiId (string) --
The ID of the Amazon Machine Image (AMI) that PCS uses to launch instances. If not provided, PCS uses the AMI ID specified in the custom launch template.
subnetIds (list) --
The list of subnet IDs where instances are provisioned by the compute node group. The subnets must be in the same VPC as the cluster.
(string) --
purchaseOption (string) --
Specifies how EC2 instances are purchased on your behalf. PCS supports On-Demand Instances, Spot Instances, and Amazon EC2 Capacity Blocks for ML. For more information, see Amazon EC2 billing and purchasing options in the Amazon Elastic Compute Cloud User Guide. For more information about PCS support for Capacity Blocks, see Using Amazon EC2 Capacity Blocks for ML with PCS in the PCS User Guide. If you don't provide this option, it defaults to On-Demand.
customLaunchTemplate (dict) --
An Amazon EC2 launch template PCS uses to launch compute nodes.
id (string) --
The ID of the EC2 launch template to use to provision instances.
Example: lt-xxxx
version (string) --
The version of the EC2 launch template to use to provision instances.
iamInstanceProfileArn (string) --
The Amazon Resource Name (ARN) of the IAM instance profile used to pass an IAM role when launching EC2 instances. The role contained in your instance profile must have the pcs:RegisterComputeNodeGroupInstance permission and the role name must start with AWSPCS or must have the path /aws-pcs/. For more information, see IAM instance profiles for PCS in the PCS User Guide.
scalingConfiguration (dict) --
Specifies the boundaries of the compute node group auto scaling.
minInstanceCount (integer) --
The lower bound of the number of instances allowed in the compute fleet.
maxInstanceCount (integer) --
The upper bound of the number of instances allowed in the compute fleet.
instanceConfigs (list) --
A list of EC2 instance configurations that PCS can provision in the compute node group.
(dict) --
An EC2 instance configuration PCS uses to launch compute nodes.
instanceType (string) --
The EC2 instance type that PCS can provision in the compute node group.
Example: t2.xlarge
spotOptions (dict) --
Additional configuration when you specify SPOT as the purchaseOption for the CreateComputeNodeGroup API action.
allocationStrategy (string) --
The Amazon EC2 allocation strategy PCS uses to provision EC2 instances. PCS supports lowest price, capacity optimized, and price capacity optimized. For more information, see Use allocation strategies to determine how EC2 Fleet or Spot Fleet fulfills Spot and On-Demand capacity in the Amazon Elastic Compute Cloud User Guide. If you don't provide this option, it defaults to price capacity optimized.
slurmConfiguration (dict) --
Additional options related to the Slurm scheduler.
slurmCustomSettings (list) --
Additional Slurm-specific configuration that directly maps to Slurm settings.
(dict) --
Additional settings that directly map to Slurm settings.
parameterName (string) --
PCS supports configuration of the following Slurm parameters:
For clusters
For compute node groups
parameterValue (string) --
The values for the configured Slurm settings.
errorInfo (list) --
The list of errors that occurred during compute node group provisioning.
(dict) --
An error that occurred during resource creation.
code (string) --
The short-form error code.
message (string) --
The detailed error information.
{'computeNodeGroup': {'purchaseOption': {'CAPACITY_BLOCK'}}}
Returns detailed information about a compute node group. This API action provides networking information, EC2 instance type, compute node group status, and scheduler (such as Slurm) configuration.
See also: AWS API Documentation
Request Syntax
client.get_compute_node_group( clusterIdentifier='string', computeNodeGroupIdentifier='string' )
string
[REQUIRED]
The name or ID of the cluster.
string
[REQUIRED]
The name or ID of the compute node group.
dict
Response Syntax
{ 'computeNodeGroup': { 'name': 'string', 'id': 'string', 'arn': 'string', 'clusterId': 'string', 'createdAt': datetime(2015, 1, 1), 'modifiedAt': datetime(2015, 1, 1), 'status': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATE_FAILED'|'DELETE_FAILED'|'UPDATE_FAILED'|'DELETED'|'SUSPENDING'|'SUSPENDED', 'amiId': 'string', 'subnetIds': [ 'string', ], 'purchaseOption': 'ONDEMAND'|'SPOT'|'CAPACITY_BLOCK', 'customLaunchTemplate': { 'id': 'string', 'version': 'string' }, 'iamInstanceProfileArn': 'string', 'scalingConfiguration': { 'minInstanceCount': 123, 'maxInstanceCount': 123 }, 'instanceConfigs': [ { 'instanceType': 'string' }, ], 'spotOptions': { 'allocationStrategy': 'lowest-price'|'capacity-optimized'|'price-capacity-optimized' }, 'slurmConfiguration': { 'slurmCustomSettings': [ { 'parameterName': 'string', 'parameterValue': 'string' }, ] }, 'errorInfo': [ { 'code': 'string', 'message': 'string' }, ] } }
Response Structure
(dict) --
computeNodeGroup (dict) --
A compute node group associated with a cluster.
name (string) --
The name that identifies the compute node group.
id (string) --
The generated unique ID of the compute node group.
arn (string) --
The unique Amazon Resource Name (ARN) of the compute node group.
clusterId (string) --
The ID of the cluster of the compute node group.
createdAt (datetime) --
The date and time the resource was created.
modifiedAt (datetime) --
The date and time the resource was modified.
status (string) --
The provisioning status of the compute node group.
amiId (string) --
The ID of the Amazon Machine Image (AMI) that PCS uses to launch instances. If not provided, PCS uses the AMI ID specified in the custom launch template.
subnetIds (list) --
The list of subnet IDs where instances are provisioned by the compute node group. The subnets must be in the same VPC as the cluster.
(string) --
purchaseOption (string) --
Specifies how EC2 instances are purchased on your behalf. PCS supports On-Demand Instances, Spot Instances, and Amazon EC2 Capacity Blocks for ML. For more information, see Amazon EC2 billing and purchasing options in the Amazon Elastic Compute Cloud User Guide. For more information about PCS support for Capacity Blocks, see Using Amazon EC2 Capacity Blocks for ML with PCS in the PCS User Guide. If you don't provide this option, it defaults to On-Demand.
customLaunchTemplate (dict) --
An Amazon EC2 launch template PCS uses to launch compute nodes.
id (string) --
The ID of the EC2 launch template to use to provision instances.
Example: lt-xxxx
version (string) --
The version of the EC2 launch template to use to provision instances.
iamInstanceProfileArn (string) --
The Amazon Resource Name (ARN) of the IAM instance profile used to pass an IAM role when launching EC2 instances. The role contained in your instance profile must have the pcs:RegisterComputeNodeGroupInstance permission and the role name must start with AWSPCS or must have the path /aws-pcs/. For more information, see IAM instance profiles for PCS in the PCS User Guide.
scalingConfiguration (dict) --
Specifies the boundaries of the compute node group auto scaling.
minInstanceCount (integer) --
The lower bound of the number of instances allowed in the compute fleet.
maxInstanceCount (integer) --
The upper bound of the number of instances allowed in the compute fleet.
instanceConfigs (list) --
A list of EC2 instance configurations that PCS can provision in the compute node group.
(dict) --
An EC2 instance configuration PCS uses to launch compute nodes.
instanceType (string) --
The EC2 instance type that PCS can provision in the compute node group.
Example: t2.xlarge
spotOptions (dict) --
Additional configuration when you specify SPOT as the purchaseOption for the CreateComputeNodeGroup API action.
allocationStrategy (string) --
The Amazon EC2 allocation strategy PCS uses to provision EC2 instances. PCS supports lowest price, capacity optimized, and price capacity optimized. For more information, see Use allocation strategies to determine how EC2 Fleet or Spot Fleet fulfills Spot and On-Demand capacity in the Amazon Elastic Compute Cloud User Guide. If you don't provide this option, it defaults to price capacity optimized.
slurmConfiguration (dict) --
Additional options related to the Slurm scheduler.
slurmCustomSettings (list) --
Additional Slurm-specific configuration that directly maps to Slurm settings.
(dict) --
Additional settings that directly map to Slurm settings.
parameterName (string) --
PCS supports configuration of the following Slurm parameters:
For clusters
For compute node groups
parameterValue (string) --
The values for the configured Slurm settings.
errorInfo (list) --
The list of errors that occurred during compute node group provisioning.
(dict) --
An error that occurred during resource creation.
code (string) --
The short-form error code.
message (string) --
The detailed error information.
{'purchaseOption': {'CAPACITY_BLOCK'}}Response
{'computeNodeGroup': {'purchaseOption': {'CAPACITY_BLOCK'}}}
Updates a compute node group. You can update many of the fields related to your compute node group including the configurations for networking, compute nodes, and settings specific to your scheduler (such as Slurm).
See also: AWS API Documentation
Request Syntax
client.update_compute_node_group( clusterIdentifier='string', computeNodeGroupIdentifier='string', amiId='string', subnetIds=[ 'string', ], customLaunchTemplate={ 'id': 'string', 'version': 'string' }, purchaseOption='ONDEMAND'|'SPOT'|'CAPACITY_BLOCK', spotOptions={ 'allocationStrategy': 'lowest-price'|'capacity-optimized'|'price-capacity-optimized' }, scalingConfiguration={ 'minInstanceCount': 123, 'maxInstanceCount': 123 }, iamInstanceProfileArn='string', slurmConfiguration={ 'slurmCustomSettings': [ { 'parameterName': 'string', 'parameterValue': 'string' }, ] }, clientToken='string' )
string
[REQUIRED]
The name or ID of the cluster of the compute node group.
string
[REQUIRED]
The name or ID of the compute node group.
string
The ID of the Amazon Machine Image (AMI) that PCS uses to launch instances. If not provided, PCS uses the AMI ID specified in the custom launch template.
list
The list of subnet IDs where the compute node group provisions instances. The subnets must be in the same VPC as the cluster.
(string) --
dict
An Amazon EC2 launch template PCS uses to launch compute nodes.
id (string) -- [REQUIRED]
The ID of the EC2 launch template to use to provision instances.
Example: lt-xxxx
version (string) -- [REQUIRED]
The version of the EC2 launch template to use to provision instances.
string
Specifies how EC2 instances are purchased on your behalf. PCS supports On-Demand Instances, Spot Instances, and Amazon EC2 Capacity Blocks for ML. For more information, see Amazon EC2 billing and purchasing options in the Amazon Elastic Compute Cloud User Guide. For more information about PCS support for Capacity Blocks, see Using Amazon EC2 Capacity Blocks for ML with PCS in the PCS User Guide. If you don't provide this option, it defaults to On-Demand.
dict
Additional configuration when you specify SPOT as the purchaseOption for the CreateComputeNodeGroup API action.
allocationStrategy (string) --
The Amazon EC2 allocation strategy PCS uses to provision EC2 instances. PCS supports lowest price, capacity optimized, and price capacity optimized. For more information, see Use allocation strategies to determine how EC2 Fleet or Spot Fleet fulfills Spot and On-Demand capacity in the Amazon Elastic Compute Cloud User Guide. If you don't provide this option, it defaults to price capacity optimized.
dict
Specifies the boundaries of the compute node group auto scaling.
minInstanceCount (integer) -- [REQUIRED]
The lower bound of the number of instances allowed in the compute fleet.
maxInstanceCount (integer) -- [REQUIRED]
The upper bound of the number of instances allowed in the compute fleet.
string
The Amazon Resource Name (ARN) of the IAM instance profile used to pass an IAM role when launching EC2 instances. The role contained in your instance profile must have the pcs:RegisterComputeNodeGroupInstance permission and the role name must start with AWSPCS or must have the path /aws-pcs/. For more information, see IAM instance profiles for PCS in the PCS User Guide.
dict
Additional options related to the Slurm scheduler.
slurmCustomSettings (list) --
Additional Slurm-specific configuration that directly maps to Slurm settings.
(dict) --
Additional settings that directly map to Slurm settings.
parameterName (string) -- [REQUIRED]
PCS supports configuration of the following Slurm parameters:
For clusters
For compute node groups
parameterValue (string) -- [REQUIRED]
The values for the configured Slurm settings.
string
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate 1 for you.
This field is autopopulated if not provided.
dict
Response Syntax
{ 'computeNodeGroup': { 'name': 'string', 'id': 'string', 'arn': 'string', 'clusterId': 'string', 'createdAt': datetime(2015, 1, 1), 'modifiedAt': datetime(2015, 1, 1), 'status': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATE_FAILED'|'DELETE_FAILED'|'UPDATE_FAILED'|'DELETED'|'SUSPENDING'|'SUSPENDED', 'amiId': 'string', 'subnetIds': [ 'string', ], 'purchaseOption': 'ONDEMAND'|'SPOT'|'CAPACITY_BLOCK', 'customLaunchTemplate': { 'id': 'string', 'version': 'string' }, 'iamInstanceProfileArn': 'string', 'scalingConfiguration': { 'minInstanceCount': 123, 'maxInstanceCount': 123 }, 'instanceConfigs': [ { 'instanceType': 'string' }, ], 'spotOptions': { 'allocationStrategy': 'lowest-price'|'capacity-optimized'|'price-capacity-optimized' }, 'slurmConfiguration': { 'slurmCustomSettings': [ { 'parameterName': 'string', 'parameterValue': 'string' }, ] }, 'errorInfo': [ { 'code': 'string', 'message': 'string' }, ] } }
Response Structure
(dict) --
computeNodeGroup (dict) --
A compute node group associated with a cluster.
name (string) --
The name that identifies the compute node group.
id (string) --
The generated unique ID of the compute node group.
arn (string) --
The unique Amazon Resource Name (ARN) of the compute node group.
clusterId (string) --
The ID of the cluster of the compute node group.
createdAt (datetime) --
The date and time the resource was created.
modifiedAt (datetime) --
The date and time the resource was modified.
status (string) --
The provisioning status of the compute node group.
amiId (string) --
The ID of the Amazon Machine Image (AMI) that PCS uses to launch instances. If not provided, PCS uses the AMI ID specified in the custom launch template.
subnetIds (list) --
The list of subnet IDs where instances are provisioned by the compute node group. The subnets must be in the same VPC as the cluster.
(string) --
purchaseOption (string) --
Specifies how EC2 instances are purchased on your behalf. PCS supports On-Demand Instances, Spot Instances, and Amazon EC2 Capacity Blocks for ML. For more information, see Amazon EC2 billing and purchasing options in the Amazon Elastic Compute Cloud User Guide. For more information about PCS support for Capacity Blocks, see Using Amazon EC2 Capacity Blocks for ML with PCS in the PCS User Guide. If you don't provide this option, it defaults to On-Demand.
customLaunchTemplate (dict) --
An Amazon EC2 launch template PCS uses to launch compute nodes.
id (string) --
The ID of the EC2 launch template to use to provision instances.
Example: lt-xxxx
version (string) --
The version of the EC2 launch template to use to provision instances.
iamInstanceProfileArn (string) --
The Amazon Resource Name (ARN) of the IAM instance profile used to pass an IAM role when launching EC2 instances. The role contained in your instance profile must have the pcs:RegisterComputeNodeGroupInstance permission and the role name must start with AWSPCS or must have the path /aws-pcs/. For more information, see IAM instance profiles for PCS in the PCS User Guide.
scalingConfiguration (dict) --
Specifies the boundaries of the compute node group auto scaling.
minInstanceCount (integer) --
The lower bound of the number of instances allowed in the compute fleet.
maxInstanceCount (integer) --
The upper bound of the number of instances allowed in the compute fleet.
instanceConfigs (list) --
A list of EC2 instance configurations that PCS can provision in the compute node group.
(dict) --
An EC2 instance configuration PCS uses to launch compute nodes.
instanceType (string) --
The EC2 instance type that PCS can provision in the compute node group.
Example: t2.xlarge
spotOptions (dict) --
Additional configuration when you specify SPOT as the purchaseOption for the CreateComputeNodeGroup API action.
allocationStrategy (string) --
The Amazon EC2 allocation strategy PCS uses to provision EC2 instances. PCS supports lowest price, capacity optimized, and price capacity optimized. For more information, see Use allocation strategies to determine how EC2 Fleet or Spot Fleet fulfills Spot and On-Demand capacity in the Amazon Elastic Compute Cloud User Guide. If you don't provide this option, it defaults to price capacity optimized.
slurmConfiguration (dict) --
Additional options related to the Slurm scheduler.
slurmCustomSettings (list) --
Additional Slurm-specific configuration that directly maps to Slurm settings.
(dict) --
Additional settings that directly map to Slurm settings.
parameterName (string) --
PCS supports configuration of the following Slurm parameters:
For clusters
For compute node groups
parameterValue (string) --
The values for the configured Slurm settings.
errorInfo (list) --
The list of errors that occurred during compute node group provisioning.
(dict) --
An error that occurred during resource creation.
code (string) --
The short-form error code.
message (string) --
The detailed error information.