create_cluster
¶
create_cluster(
cluster_name: ClusterName,
scheduler: SchedulerRequest,
size: Size,
networking: NetworkingRequest,
*,
config_overrides: Optional[PCSClientConfig] = None,
slurm_configuration: Optional[ClusterSlurmConfigurationRequest] = None,
client_token: Optional[SBClientToken] = None,
tags: Optional[RequestTagMap] = None,
) -> CreateClusterResponse
Creates a cluster in your account. PCS creates the cluster controller in a service-owned account. The cluster controller communicates with the cluster resources in your account. The subnets and security groups for the cluster must already exist before you use this API action.
It takes time for PCS to create the cluster. The cluster is in a Creating state until it is ready to use. There can only be 1 cluster in a Creating state per Amazon Web Services Region per Amazon Web Services account. CreateCluster fails with a ServiceQuotaExceededException if there is already a cluster in a Creating state.
Parameters:
-
cluster_name(ClusterName) –A name to identify the cluster. Example:
MyCluster -
scheduler(SchedulerRequest) –The cluster management and job scheduling software associated with the cluster.
-
size(Size) –A value that determines the maximum number of compute nodes in the cluster and the maximum number of jobs (active and queued).
-
SMALL: 32 compute nodes and 256 jobs -
MEDIUM: 512 compute nodes and 8192 jobs -
LARGE: 2048 compute nodes and 16,384 jobs
-
-
networking(NetworkingRequest) –The networking configuration used to set up the cluster's control plane.
-
slurm_configuration(Optional[ClusterSlurmConfigurationRequest], default:None) –Additional options related to the Slurm scheduler.
-
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.
-
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.