SageMaker / Client / move_cluster_nodes

move_cluster_nodes

SageMaker.Client.move_cluster_nodes(**kwargs)

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.

Warning

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.

Note

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.

See also: AWS API Documentation

Request Syntax

response = client.move_cluster_nodes(
    SourceClusterArn='string',
    SourceInstanceGroupName='string',
    TargetClusterArn='string',
    TargetInstanceGroupName='string',
    InstanceCount=123,
    NodeIds=[
        'string',
    ],
    NodeLogicalIds=[
        'string',
    ],
    ClientToken='string'
)
Parameters:
  • SourceClusterArn (string) –

    [REQUIRED]

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

  • SourceInstanceGroupName (string) –

    [REQUIRED]

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

  • TargetClusterArn (string) –

    [REQUIRED]

    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.

  • TargetInstanceGroupName (string) –

    [REQUIRED]

    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.

  • InstanceCount (integer) – 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.

  • NodeIds (list) –

    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.

    • (string) –

  • NodeLogicalIds (list) –

    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.

    • (string) –

  • ClientToken (string) –

    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.

    This field is autopopulated if not provided.

Return type:

dict

Returns:

Response Syntax

{
    'Successful': [
        'string',
    ],
    'Failed': [
        {
            'Code': 'NodeIdNotFound'|'InvalidNodeStatus'|'NodeIdInUse'|'NodeInstanceTypeMismatch',
            'Message': 'string',
            'NodeId': 'string'
        },
    ],
    'SuccessfulNodeLogicalIds': [
        'string',
    ],
    'FailedNodeLogicalIds': [
        {
            'Code': 'NodeIdNotFound'|'InvalidNodeStatus'|'NodeIdInUse'|'NodeInstanceTypeMismatch',
            'Message': 'string',
            'NodeLogicalId': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    • Successful (list) –

      This list contains the instance IDs of the nodes that were accepted for the move. The response includes this list when you specify NodeIds or InstanceCount.

      • (string) –

    • Failed (list) –

      The instance IDs that could not be moved, each with an error code and message. The response includes this list when you specify NodeIds. If none of the specified nodes can be moved, the request fails and no nodes are moved.

      • (dict) –

        Describes why a node, identified by its instance ID, could not be moved in a MoveClusterNodes request. Contains the instance ID, an error code, and an error message.

        • Code (string) –

          The error code associated with the error encountered when moving the node. The error code is one of the following values:

          • NodeIdNotFound: The node does not exist in the source instance group.

          • InvalidNodeStatus: The node is not in a state that allows the move. For example, the node is not Running, is not in a subnet of the target instance group, or has an attached Amazon EBS volume that you must detach first.

          • NodeIdInUse: Another operation is already in progress for this node. Wait for the operation to complete before retrying.

          • NodeInstanceTypeMismatch: The target instance group does not support the node’s instance type.

        • Message (string) –

          A human-readable message describing the error encountered when moving the node.

        • NodeId (string) –

          The instance ID of the node that could not be moved.

    • SuccessfulNodeLogicalIds (list) –

      The NodeLogicalIds of the nodes that were accepted for the move. The response includes this list when you specify NodeLogicalIds.

      • (string) –

    • FailedNodeLogicalIds (list) –

      The NodeLogicalIds that could not be moved, each with an error code and message. The response includes this list when you specify NodeLogicalIds. If none of the specified nodes can be moved, the request fails and no nodes are moved.

      • (dict) –

        Describes why a node, identified by its NodeLogicalId, could not be moved in a MoveClusterNodes request. Contains the NodeLogicalId, an error code, and an error message.

        • Code (string) –

          The error code associated with the error encountered when moving the node. The error code is one of the following values:

          • NodeIdNotFound: The node does not exist in the source instance group.

          • InvalidNodeStatus: The node is not in a state that allows the move. For example, the node is not Running, is not in a subnet of the target instance group, or has an attached Amazon EBS volume that you must detach first.

          • NodeIdInUse: Another operation is already in progress for this node. Wait for the operation to complete before retrying.

          • NodeInstanceTypeMismatch: The target instance group does not support the node’s instance type.

        • Message (string) –

          A human-readable message describing the error encountered when moving the node.

        • NodeLogicalId (string) –

          The NodeLogicalId of the node that could not be moved.

Exceptions

  • SageMaker.Client.exceptions.ResourceNotFound