ParallelComputingService / Client / create_compute_node_group

create_compute_node_group#

ParallelComputingService.Client.create_compute_node_group(**kwargs)#

Creates a managed set of compute nodes. You associate a compute node group with a cluster through 1 or more Amazon Web Services PCS queues or as part of the login fleet. A compute node group includes the definition of the compute properties and lifecycle management. Amazon Web Services 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 Amazon Web Services 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

response = client.create_compute_node_group(
    clusterIdentifier='string',
    computeNodeGroupName='string',
    amiId='string',
    subnetIds=[
        'string',
    ],
    purchaseOption='ONDEMAND'|'SPOT',
    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'
    }
)
Parameters:
  • clusterIdentifier (string) –

    [REQUIRED]

    The name or ID of the cluster to create a compute node group in.

  • computeNodeGroupName (string) –

    [REQUIRED]

    A name to identify the cluster. Example: MyCluster

  • amiId (string) – The ID of the Amazon Machine Image (AMI) that Amazon Web Services PCS uses to launch compute nodes (Amazon EC2 instances). If you don’t provide this value, Amazon Web Services PCS uses the AMI ID specified in the custom launch template.

  • subnetIds (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) –

  • purchaseOption (string) – Specifies how EC2 instances are purchased on your behalf. Amazon Web Services PCS supports On-Demand and Spot instances. For more information, see Instance purchasing options in the Amazon Elastic Compute Cloud User Guide. If you don’t provide this option, it defaults to On-Demand.

  • customLaunchTemplate (dict) –

    [REQUIRED]

    An Amazon EC2 launch template Amazon Web Services 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.

  • iamInstanceProfileArn (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 pcs:RegisterComputeNodeGroupInstance permissions attached in order to provision instances correctly. The resource identifier of the ARN must start with AWSPCS. For example, arn:aws:iam:123456789012:instance-profile/AWSPCSMyComputeNodeInstanceProfile.

  • scalingConfiguration (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.

  • instanceConfigs (list) –

    [REQUIRED]

    A list of EC2 instance configurations that Amazon Web Services PCS can provision in the compute node group.

    • (dict) –

      An EC2 instance configuration Amazon Web Services PCS uses to launch compute nodes.

      • instanceType (string) –

        The EC2 instance type that Amazon Web Services 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.

  • 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) – [REQUIRED]

          Amazon Web Services PCS supports configuration of the following Slurm parameters: Prolog, Epilog, and SelectTypeParameters.

        • parameterValue (string) – [REQUIRED]

          The values for the configured Slurm settings.

  • clientToken (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.

  • tags (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) –

Return type:

dict

Returns:

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',
        'amiId': 'string',
        'subnetIds': [
            'string',
        ],
        'purchaseOption': 'ONDEMAND'|'SPOT',
        '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.

        Note

        The provisioning status doesn’t indicate the overall health of the compute node group.

      • amiId (string) –

        The ID of the Amazon Machine Image (AMI) that Amazon Web Services PCS uses to launch instances. If not provided, Amazon Web Services 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. Amazon Web Services PCS supports On-Demand and Spot instances. For more information, see Instance purchasing options in the Amazon Elastic Compute Cloud User Guide. If you don’t provide this option, it defaults to On-Demand.

      • customLaunchTemplate (dict) –

        An Amazon EC2 launch template Amazon Web Services 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 pcs:RegisterComputeNodeGroupInstance permissions attached to provision instances correctly.

      • 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 Amazon Web Services PCS can provision in the compute node group.

        • (dict) –

          An EC2 instance configuration Amazon Web Services PCS uses to launch compute nodes.

          • instanceType (string) –

            The EC2 instance type that Amazon Web Services 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.

      • 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) –

              Amazon Web Services PCS supports configuration of the following Slurm parameters: Prolog, Epilog, and SelectTypeParameters.

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

Exceptions

  • ParallelComputingService.Client.exceptions.ServiceQuotaExceededException

  • ParallelComputingService.Client.exceptions.ThrottlingException

  • ParallelComputingService.Client.exceptions.ValidationException

  • ParallelComputingService.Client.exceptions.ConflictException

  • ParallelComputingService.Client.exceptions.ResourceNotFoundException

  • ParallelComputingService.Client.exceptions.InternalServerException

  • ParallelComputingService.Client.exceptions.AccessDeniedException