Skip to content

update_cluster

update_cluster(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    cluster_name: Optional[ClusterNameOrArn] = None,
    instance_groups: Optional[ClusterInstanceGroupSpecifications] = None,
    restricted_instance_groups: Optional[
        ClusterRestrictedInstanceGroupSpecifications
    ] = None,
    restricted_instance_groups_config: Optional[
        ClusterRestrictedInstanceGroupsConfig
    ] = None,
    tiered_storage_config: Optional[ClusterTieredStorageConfig] = None,
    node_recovery: Optional[ClusterNodeRecovery] = None,
    instance_groups_to_delete: Optional[ClusterInstanceGroupsToDelete] = None,
    node_provisioning_mode: Optional[ClusterNodeProvisioningMode] = None,
    cluster_role: Optional[RoleArn] = None,
    auto_scaling: Optional[ClusterAutoScalingConfig] = None,
    orchestrator: Optional[ClusterOrchestrator] = None,
) -> UpdateClusterResponse

Updates a SageMaker HyperPod cluster.

Parameters:

  • cluster_name (Optional[ClusterNameOrArn], default: None ) –

    Specify the name of the SageMaker HyperPod cluster you want to update.

  • instance_groups (Optional[ClusterInstanceGroupSpecifications], default: None ) –

    Specify the instance groups to update.

  • restricted_instance_groups (Optional[ClusterRestrictedInstanceGroupSpecifications], default: None ) –

    The specialized instance groups for training models like Amazon Nova to be created in the SageMaker HyperPod cluster.

  • restricted_instance_groups_config (Optional[ClusterRestrictedInstanceGroupsConfig], default: None ) –

    The configuration for the restricted instance groups (RIG) in the SageMaker HyperPod cluster.

  • tiered_storage_config (Optional[ClusterTieredStorageConfig], default: None ) –

    Updates the configuration for managed tier checkpointing on the HyperPod cluster. For example, you can enable or disable the feature and modify the percentage of cluster memory allocated for checkpoint storage.

  • node_recovery (Optional[ClusterNodeRecovery], default: None ) –

    The node recovery mode to be applied to the SageMaker HyperPod cluster.

  • instance_groups_to_delete (Optional[ClusterInstanceGroupsToDelete], default: None ) –

    Specify the names of the instance groups to delete. Use a single , as the separator between multiple names.

  • node_provisioning_mode (Optional[ClusterNodeProvisioningMode], default: None ) –

    Determines how instance provisioning is handled during cluster operations. In Continuous mode, the cluster provisions available instances incrementally and retries until the target count is reached. The cluster becomes operational once cluster-level resources are ready. Use CurrentCount and TargetCount in DescribeCluster to track provisioning progress.

  • cluster_role (Optional[RoleArn], default: None ) –

    The Amazon Resource Name (ARN) of the IAM role that HyperPod assumes for cluster autoscaling operations. Cannot be updated while autoscaling is enabled.

  • auto_scaling (Optional[ClusterAutoScalingConfig], default: None ) –

    Updates the autoscaling configuration for the cluster. Use to enable or disable automatic node scaling.

Raises:

  • ConflictException –

    There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded –

    You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound –

    Resource being access is not found.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def update_cluster(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    cluster_name: Optional[
        "capo_sagemaker.types.cluster_name_or_arn.ClusterNameOrArn"
    ] = None,
    instance_groups: Optional[
        "capo_sagemaker.types.cluster_instance_group_specifications.ClusterInstanceGroupSpecifications"
    ] = None,
    restricted_instance_groups: Optional[
        "capo_sagemaker.types.cluster_restricted_instance_group_specifications.ClusterRestrictedInstanceGroupSpecifications"
    ] = None,
    restricted_instance_groups_config: Optional[
        "capo_sagemaker.types.cluster_restricted_instance_groups_config.ClusterRestrictedInstanceGroupsConfig"
    ] = None,
    tiered_storage_config: Optional[
        "capo_sagemaker.types.cluster_tiered_storage_config.ClusterTieredStorageConfig"
    ] = None,
    node_recovery: Optional[
        "capo_sagemaker.types.cluster_node_recovery.ClusterNodeRecovery"
    ] = None,
    instance_groups_to_delete: Optional[
        "capo_sagemaker.types.cluster_instance_groups_to_delete.ClusterInstanceGroupsToDelete"
    ] = None,
    node_provisioning_mode: Optional[
        "capo_sagemaker.types.cluster_node_provisioning_mode.ClusterNodeProvisioningMode"
    ] = None,
    cluster_role: Optional["capo_sagemaker.types.role_arn.RoleArn"] = None,
    auto_scaling: Optional[
        "capo_sagemaker.types.cluster_auto_scaling_config.ClusterAutoScalingConfig"
    ] = None,
    orchestrator: Optional[
        "capo_sagemaker.types.cluster_orchestrator.ClusterOrchestrator"
    ] = None,
) -> "capo_sagemaker.types.update_cluster_response.UpdateClusterResponse":
    """<p>Updates a SageMaker HyperPod cluster.</p>

    Args:
        cluster_name: <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
        instance_groups: <p>Specify the instance groups to update.</p>
        restricted_instance_groups: <p>The specialized instance groups for training models like Amazon Nova to be created in the SageMaker HyperPod cluster.</p>
        restricted_instance_groups_config: <p>The configuration for the restricted instance groups (RIG) in the SageMaker HyperPod cluster.</p>
        tiered_storage_config: <p>Updates the configuration for managed tier checkpointing on the HyperPod cluster. For example, you can enable or disable the feature and modify the percentage of cluster memory allocated for checkpoint storage.</p>
        node_recovery: <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
        instance_groups_to_delete: <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
        node_provisioning_mode: <p>Determines how instance provisioning is handled during cluster operations. In <code>Continuous</code> mode, the cluster provisions available instances incrementally and retries until the target count is reached. The cluster becomes operational once cluster-level resources are ready. Use <code>CurrentCount</code> and <code>TargetCount</code> in <code>DescribeCluster</code> to track provisioning progress.</p>
        cluster_role: <p>The Amazon Resource Name (ARN) of the IAM role that HyperPod assumes for cluster autoscaling operations. Cannot be updated while autoscaling is enabled.</p>
        auto_scaling: <p>Updates the autoscaling configuration for the cluster. Use to enable or disable automatic node scaling.</p>

    Raises:
        capo_sagemaker.errors.conflict_exception.ConflictException: <p>There was a conflict when you attempted to modify a SageMaker entity such as an <code>Experiment</code> or <code>Artifact</code>.</p>
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.update_cluster_request.UpdateClusterRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.update_cluster_response.UpdateClusterResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.update_cluster

        output, http_response = (
            capo_sagemaker._operations.sage_maker.update_cluster.update_cluster(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateCluster")
    )
    input_: capo_sagemaker.types.update_cluster_request.UpdateClusterRequest = {}
    if cluster_name is not None:
        input_["cluster_name"] = cluster_name
    if instance_groups is not None:
        input_["instance_groups"] = instance_groups
    if restricted_instance_groups is not None:
        input_["restricted_instance_groups"] = restricted_instance_groups
    if restricted_instance_groups_config is not None:
        input_["restricted_instance_groups_config"] = (
            restricted_instance_groups_config
        )
    if tiered_storage_config is not None:
        input_["tiered_storage_config"] = tiered_storage_config
    if node_recovery is not None:
        input_["node_recovery"] = node_recovery
    if instance_groups_to_delete is not None:
        input_["instance_groups_to_delete"] = instance_groups_to_delete
    if node_provisioning_mode is not None:
        input_["node_provisioning_mode"] = node_provisioning_mode
    if cluster_role is not None:
        input_["cluster_role"] = cluster_role
    if auto_scaling is not None:
        input_["auto_scaling"] = auto_scaling
    if orchestrator is not None:
        input_["orchestrator"] = orchestrator

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output