create_compute_node_group
¶
create_compute_node_group(
cluster_identifier: ClusterIdentifier,
compute_node_group_name: ComputeNodeGroupName,
subnet_ids: StringList,
custom_launch_template: CustomLaunchTemplate,
iam_instance_profile_arn: InstanceProfileArn,
scaling_configuration: ScalingConfigurationRequest,
instance_configs: InstanceList,
*,
config_overrides: Optional[PCSClientConfig] = None,
ami_id: Optional[AmiId] = None,
purchase_option: Optional[PurchaseOption] = None,
spot_options: Optional[SpotOptions] = None,
slurm_configuration: Optional[ComputeNodeGroupSlurmConfigurationRequest] = None,
node_lifecycle_actions: Optional[NodeLifecycleActionsRequest] = None,
client_token: Optional[SBClientToken] = None,
tags: Optional[RequestTagMap] = None,
) -> CreateComputeNodeGroupResponse
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.
Parameters:
-
cluster_identifier(ClusterIdentifier) –The name or ID of the cluster to create a compute node group in.
-
compute_node_group_name(ComputeNodeGroupName) –A name to identify the cluster. Example:
MyCluster -
ami_id(Optional[AmiId], default:None) –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.
-
subnet_ids(StringList) –The list of subnet IDs where the compute node group launches instances. Subnets must be in the same VPC as the cluster.
-
purchase_option(Optional[PurchaseOption], default:None) –Specifies how EC2 instances are purchased on your behalf. PCS supports On-Demand Instances, Spot Instances, Interruptible Capacity Reservations, On-Demand Capacity Reservations, 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. For more information about PCS support for interruptible capacity reservations, see Using I-ODCRs with PCS in the PCS User Guide. Choose On-Demand if you plan to use an On-Demand Capacity Reservation (ODCR). For more information, see Using ODCRs with PCS. If you don't provide this option, it defaults to On-Demand.
-
iam_instance_profile_arn(InstanceProfileArn) –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:RegisterComputeNodeGroupInstancepermission and the role name must start withAWSPCSor must have the path/aws-pcs/. For more information, see IAM instance profiles for PCS in the PCS User Guide. -
scaling_configuration(ScalingConfigurationRequest) –Specifies the boundaries of the compute node group auto scaling.
-
instance_configs(InstanceList) –A list of EC2 instance configurations that PCS can provision in the compute node group.
-
slurm_configuration(Optional[ComputeNodeGroupSlurmConfigurationRequest], default:None) –Additional options related to the Slurm scheduler.
-
node_lifecycle_actions(Optional[NodeLifecycleActionsRequest], default:None) –The lifecycle actions to run on compute nodes in the compute node group. Use lifecycle actions to run custom scripts at defined stages of a compute node's lifecycle, such as when a compute node finishes bootstrapping or becomes ready to accept jobs.
-
client_token(Optional[SBClientToken], default:None) –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.
-
tags(Optional[RequestTagMap], default:None) –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.
Raises:
-
AccessDeniedException–You don't have permission to perform the action.
Examples
-
The launch template instance profile doesn't pass
iam:PassRoleverification. -
There is a mismatch between the account ID and cluster ID.
-
The cluster ID doesn't exist.
-
The EC2 instance isn't present.
-
-
ConflictException–Your request has conflicting operations. This can occur if you're trying to perform more than 1 operation on the same resource at the same time.
Examples
-
A cluster with the same name already exists.
-
A cluster isn't in
ACTIVEstatus. -
A cluster to delete is in an unstable state. For example, because it still has
ACTIVEnode groups or queues. -
A queue already exists in a cluster.
-
-
InternalServerException–PCS can't process your request right now. Try again later.
-
ResourceNotFoundException–The requested resource can't be found. The cluster, node group, or queue you're attempting to get, update, list, or delete doesn't exist.
Examples
-
ServiceQuotaExceededException–You exceeded your service quota. Service quotas, also referred to as limits, are the maximum number of service resources or operations for your Amazon Web Services account. To learn how to increase your service quota, see Requesting a quota increase in the Service Quotas User Guide
Examples
-
The max number of clusters or queues has been reached for the account.
-
The max number of compute node groups has been reached for the associated cluster.
-
The total of
maxInstancesacross all compute node groups has been reached for associated cluster.
-
-
ThrottlingException–Your request exceeded a request rate quota. Check the resource's request rate quota and try again.
-
ValidationException–The request isn't valid.
Examples
-
Your request contains malformed JSON or unsupported characters.
-
The scheduler version isn't supported.
-
There are networking related errors, such as network validation failure.
-
AMI type is
CUSTOMand the launch template doesn't define the AMI ID, or the AMI type is AL2 and the launch template defines the AMI.
-
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_pcs/_services/pcs.py
750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 | |