Skip to content

move_cluster_nodes async

move_cluster_nodes(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    source_cluster_arn: Optional[ClusterArn] = None,
    source_instance_group_name: Optional[ClusterInstanceGroupName] = None,
    target_cluster_arn: Optional[ClusterArn] = None,
    target_instance_group_name: Optional[ClusterInstanceGroupName] = None,
    instance_count: Optional[MoveClusterNodesInstanceCount] = None,
    node_ids: Optional[MoveClusterNodeIds] = None,
    node_logical_ids: Optional[MoveClusterNodeLogicalIds] = None,
    client_token: Optional[String] = None,
) -> MoveClusterNodesResponse

Moves running nodes from one instance group to another instance group. The target instance group can be in the same HyperPod cluster or in a different HyperPod cluster in the same account and Region. The underlying instances aren't terminated.

Each node keeps its instance ID, its NodeLogicalId, its network interfaces and IP addresses, and its capacity. The node then joins the target instance group with the target's configuration and lifecycle scripts.

The move replaces the node's root Amazon Elastic Block Store (Amazon EBS) volume and secondary EBS volume, which deletes any data stored on them. Back up any data that you need before you move the node.

Specify the nodes to move with exactly one of NodeIds, NodeLogicalIds, or InstanceCount. The operation is asynchronous and returns after it accepts the nodes for the move. While a node moves, its status is DetachInProgress and then AttachInProgress. The node appears in the source cluster while it detaches. After HyperPod hands the node off to the target instance group, the node appears in the target cluster. To track the node, call DescribeClusterNode or ListClusterNodes on the source or target cluster.

Both clusters must be InService, use Amazon EKS orchestration, and use Continuous as the NodeProvisioningMode.

The source and target instance groups must also use compatible configurations.

Parameters:

  • source_cluster_arn (Optional[ClusterArn], default: None ) –

    The Amazon Resource Name (ARN) of the HyperPod cluster that the nodes are moved from.

  • source_instance_group_name (Optional[ClusterInstanceGroupName], default: None ) –

    The name of the instance group in the source cluster that the nodes are moved from.

  • target_cluster_arn (Optional[ClusterArn], default: None ) –

    The Amazon Resource Name (ARN) of the HyperPod cluster that the nodes are moved to. The target cluster must be in the same account and Region as the source cluster, and can be the same cluster as the source.

  • target_instance_group_name (Optional[ClusterInstanceGroupName], default: None ) –

    The name of the instance group in the target cluster that the nodes are moved to. If the target cluster is the same as the source cluster, the target instance group must be different from the source instance group.

  • instance_count (Optional[MoveClusterNodesInstanceCount], default: None ) –

    The number of nodes to move, from 1 to 50. HyperPod selects the nodes from the source instance group. If fewer than this number of nodes are eligible to move, the request fails and no nodes are moved. Specify exactly one of NodeIds, NodeLogicalIds, or InstanceCount.

  • node_ids (Optional[MoveClusterNodeIds], default: None ) –

    A list of instance IDs of the nodes to move. You can specify up to 50 instance IDs. Each node is evaluated separately, so some nodes can be moved while others fail. The request fails if moving the eligible nodes would reduce the source instance group below its minimum instance count. Specify exactly one of NodeIds, NodeLogicalIds, or InstanceCount.

  • node_logical_ids (Optional[MoveClusterNodeLogicalIds], default: None ) –

    A list of NodeLogicalIds of the nodes to move. You can specify up to 50 NodeLogicalIds. Each node is evaluated separately, so some nodes can be moved while others fail. The request fails if moving the eligible nodes would reduce the source instance group below its minimum instance count. Specify exactly one of NodeIds, NodeLogicalIds, or InstanceCount.

  • client_token (Optional[String], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If you retry the request with the same client token and the same parameters within 8 hours, the service returns the original response. It doesn't start a new move. If you reuse a client token with different parameters, the request fails.

Raises:

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def move_cluster_nodes(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    source_cluster_arn: Optional[
        "capo_sagemaker.types.cluster_arn.ClusterArn"
    ] = None,
    source_instance_group_name: Optional[
        "capo_sagemaker.types.cluster_instance_group_name.ClusterInstanceGroupName"
    ] = None,
    target_cluster_arn: Optional[
        "capo_sagemaker.types.cluster_arn.ClusterArn"
    ] = None,
    target_instance_group_name: Optional[
        "capo_sagemaker.types.cluster_instance_group_name.ClusterInstanceGroupName"
    ] = None,
    instance_count: Optional[
        "capo_sagemaker.types.move_cluster_nodes_instance_count.MoveClusterNodesInstanceCount"
    ] = None,
    node_ids: Optional[
        "capo_sagemaker.types.move_cluster_node_ids.MoveClusterNodeIds"
    ] = None,
    node_logical_ids: Optional[
        "capo_sagemaker.types.move_cluster_node_logical_ids.MoveClusterNodeLogicalIds"
    ] = None,
    client_token: Optional["capo_sagemaker.types.string.String"] = None,
) -> "capo_sagemaker.types.move_cluster_nodes_response.MoveClusterNodesResponse":
    """<p>Moves running nodes from one instance group to another instance group. The target instance group can be in the same HyperPod cluster or in a different HyperPod cluster in the same account and Region. The underlying instances aren't terminated.</p> <p>Each node keeps its instance ID, its <code>NodeLogicalId</code>, its network interfaces and IP addresses, and its capacity. The node then joins the target instance group with the target's configuration and lifecycle scripts.</p> <important> <p>The move replaces the node's root Amazon Elastic Block Store (Amazon EBS) volume and secondary EBS volume, which deletes any data stored on them. Back up any data that you need before you move the node.</p> </important> <p>Specify the nodes to move with exactly one of <code>NodeIds</code>, <code>NodeLogicalIds</code>, or <code>InstanceCount</code>. The operation is asynchronous and returns after it accepts the nodes for the move. While a node moves, its status is <code>DetachInProgress</code> and then <code>AttachInProgress</code>. The node appears in the source cluster while it detaches. After HyperPod hands the node off to the target instance group, the node appears in the target cluster. To track the node, call <code>DescribeClusterNode</code> or <code>ListClusterNodes</code> on the source or target cluster.</p> <note> <p>Both clusters must be <code>InService</code>, use Amazon EKS orchestration, and use <code>Continuous</code> as the <code>NodeProvisioningMode</code>.</p> <p>The source and target instance groups must also use compatible configurations.</p> </note>

    Args:
        source_cluster_arn: <p>The Amazon Resource Name (ARN) of the HyperPod cluster that the nodes are moved from.</p>
        source_instance_group_name: <p>The name of the instance group in the source cluster that the nodes are moved from.</p>
        target_cluster_arn: <p>The Amazon Resource Name (ARN) of the HyperPod cluster that the nodes are moved to. The target cluster must be in the same account and Region as the source cluster, and can be the same cluster as the source.</p>
        target_instance_group_name: <p>The name of the instance group in the target cluster that the nodes are moved to. If the target cluster is the same as the source cluster, the target instance group must be different from the source instance group.</p>
        instance_count: <p>The number of nodes to move, from 1 to 50. HyperPod selects the nodes from the source instance group. If fewer than this number of nodes are eligible to move, the request fails and no nodes are moved. Specify exactly one of <code>NodeIds</code>, <code>NodeLogicalIds</code>, or <code>InstanceCount</code>.</p>
        node_ids: <p>A list of instance IDs of the nodes to move. You can specify up to 50 instance IDs. Each node is evaluated separately, so some nodes can be moved while others fail. The request fails if moving the eligible nodes would reduce the source instance group below its minimum instance count. Specify exactly one of <code>NodeIds</code>, <code>NodeLogicalIds</code>, or <code>InstanceCount</code>.</p>
        node_logical_ids: <p>A list of <code>NodeLogicalIds</code> of the nodes to move. You can specify up to 50 <code>NodeLogicalIds</code>. Each node is evaluated separately, so some nodes can be moved while others fail. The request fails if moving the eligible nodes would reduce the source instance group below its minimum instance count. Specify exactly one of <code>NodeIds</code>, <code>NodeLogicalIds</code>, or <code>InstanceCount</code>.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If you retry the request with the same client token and the same parameters within 8 hours, the service returns the original response. It doesn't start a new move. If you reuse a client token with different parameters, the request fails.</p>

    Raises:
        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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.move_cluster_nodes_request.MoveClusterNodesRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.move_cluster_nodes_response.MoveClusterNodesResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.move_cluster_nodes

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.move_cluster_nodes.async_move_cluster_nodes(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("MoveClusterNodes")
    )
    input_: capo_sagemaker.types.move_cluster_nodes_request.MoveClusterNodesRequest = {}
    if source_cluster_arn is not None:
        input_["source_cluster_arn"] = source_cluster_arn
    if source_instance_group_name is not None:
        input_["source_instance_group_name"] = source_instance_group_name
    if target_cluster_arn is not None:
        input_["target_cluster_arn"] = target_cluster_arn
    if target_instance_group_name is not None:
        input_["target_instance_group_name"] = target_instance_group_name
    if instance_count is not None:
        input_["instance_count"] = instance_count
    if node_ids is not None:
        input_["node_ids"] = node_ids
    if node_logical_ids is not None:
        input_["node_logical_ids"] = node_logical_ids
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output