Migrating Nodes in Batches
Function
This API is used to batch migrate nodes between resource pools. Nodes are migrated from one resource pool to another. Use this API when nodes in a resource pool are unevenly distributed, during cluster maintenance, or for service expansion. It allows you to move specific nodes between resource pools. Make sure the resource pool has at least two nodes and enough resources like IP addresses before migrating them with this API. The API returns an error if the resource pool has only one node, lacks sufficient cluster resources, the node cannot migrate, or you lack operation permissions.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.
URI
POST /v2/{project_id}/pools/{pool_name}/nodes/batch-migrate
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition: User project ID. For details, see Obtaining a Project ID and Name. Constraints: N/A Range: N/A Default Value: N/A |
|
pool_name |
Yes |
String |
Resource pool name. The value is the same as the metadata.name value of the resource pool. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
migrateNodeNames |
No |
Array of strings |
Names of the nodes to be migrated. |
|
fromClusterName |
Yes |
String |
Name of the source cluster. |
|
toClusterName |
Yes |
String |
Name of the destination cluster. |
|
toPoolName |
No |
String |
Name of the target resource pool. |
|
resourceSpec |
No |
MigrateResourceSpec object |
Configurations of the node to be migrated in the target resource pool. This parameter is mandatory when a node is migrated across resource pools. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
flavor |
Yes |
String |
Resource flavor name. This parameter is mandatory for cross-resource-pool migration. |
|
creatingStep |
No |
CreatingStep object |
Resource step information. When the entire cabinet or supernode is migrated, the step information needs to be specified. |
|
nodePool |
No |
String |
Name of the target node pool to which resources are migrated. |
|
rootVolume |
No |
RootVolume object |
System disk information of the target node pool. This parameter is valid only when a node pool is created. |
|
dataVolumes |
No |
Array of DataVolumeItem objects |
Data disk information of the target node pool. This parameter is valid only when a node pool is created. |
|
volumeGroupConfigs |
No |
Array of VolumeGroupConfig objects |
Advanced disk configurations. This parameter is mandatory when a custom data disk exists. This parameter is valid when a node pool is created. |
|
labels |
No |
Map<String,String> |
Kubernetes label, in the format of a key-value pair. This parameter cannot be specified for a non-privileged pool. This parameter is valid when a node pool is created. |
|
taints |
No |
Array of Taints objects |
Taints to be added to nodes to set anti-affinity. This parameter cannot be specified for a non-privileged pool. This parameter is valid when a node pool is created. |
|
tags |
No |
Array of UserTags objects |
Resource tag. This parameter is valid when a node pool is created. |
|
network |
No |
NodeNetwork object |
Network configuration. This parameter cannot be specified for a non-privileged pool. This parameter is valid when a node pool is created. |
|
extendParams |
No |
ResourceExtendParams object |
Custom configuration, for example, setting dockerSize for the node. This parameter is valid when a node pool is created. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
step |
No |
Integer |
Definition: Step of a supernode. Constraints: N/A Range: Only the step contained in the resource specification details is supported. Default Value: N/A |
|
type |
No |
String |
Definition: Batch creation type. Constraints: N/A Range: Default Value: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
volumeType |
Yes |
String |
Definition: Disk type.. Range: |
|
size |
Yes |
String |
Definition: Disk size, in GiB. Range: N/A. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
volumeType |
Yes |
String |
Definition: Disk type.. Range: |
|
size |
Yes |
String |
Definition: Disk size, in GiB. Range: N/A. |
|
count |
No |
Integer |
Definition: Number of disks. Range: N/A. |
|
extendParams |
Yes |
VolumeExtendParams object |
Definition: Custom disk configuration. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
volumeGroup |
Yes |
String |
Definition: Disk group name. Index of the volume group in the dataVolumes. Range: N/A. |
|
dockerThinPool |
No |
Integer |
Definition: Percentage of data disks designated as container disks. This parameter can be specified only when volumeGroup is vgpaas (container disk). Range: N/A. |
|
lvmConfig |
No |
LvmConfig object |
Definition: LVM configuration management. |
|
types |
No |
Array of strings |
Definition: Storage type. Options: |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
lvType |
Yes |
String |
Definition: LVM write mode. Range: |
|
path |
No |
String |
Definition: Disk mount path. This parameter takes effect only in user configuration. The value is an absolute path. Digits, letters, periods (.), hyphens (-), and underscores (_) are allowed. Range: N/A. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
Yes |
String |
Definition: Key. Range: N/A |
|
value |
No |
String |
Value. |
|
effect |
Yes |
String |
Effect. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
Yes |
String |
Definition: Key. The value cannot start with CCE- or __type_baremetal. Range: N/A |
|
value |
Yes |
String |
Value. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
vpc |
No |
String |
Range: N/A. |
|
subnet |
No |
String |
Definition: Subnet ID. Range: N/A. |
|
securityGroups |
No |
Array of strings |
Definition: Security group ID set. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
job_id |
String |
Definition: ID of an asynchronous task. Range: N/A |
Status code: 404
Example Requests
POST /v2/{project_id}/pools/{pool_name}/nodes/batch-migrate
{
"migrateNodeNames" : [ "os-node-created-zrxm7" ],
"fromClusterName" : "lite-cluster-1dc682c4-e04d-11ee-bda6-0255ac1001ba",
"toClusterName" : "lite-cluster-d3a65087-38e4-11ef-a12c-0255ac100b03",
"toPoolName" : "pool-9d3f-6f5da086876d4cd084d36f8bd3346036",
"resourceSpec" : {
"flavor" : "modelarts.vm.2u4g"
}
}
Example Responses
Status code: 200
Request succeeded.
{
"job_id" : "66798666-6778-443f-9f8a-56c9ea6d719c"
}
Status code: 404
Not found.
{
"error_code" : "ModelArts.50015001",
"error_msg" : "pool not found"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Request succeeded. |
|
404 |
Not found. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot