Mass Migrate Virtual Servers

Supported VersionsLast Updated
1.29.01 & higher2023/07/12
Note: This API function supports only KVM migration initially.
Actionvserver-mass-migrate
MethodGET, POST
Variables

nodeid [id of the destination node]

nodeidsource [id of the source node - migrate all virtual servers from the specified source node.] Do not use together with option vserverids. This variable is optional.

vserverids [ids of VPSes. 0 (default) - migrate all virtual servers to a single destination node | a comma separated list of virtual servers, e.g. 77,78.] Do not use together with option nodeidsource. This variable is optional.

Note: If neither nodeidsource nor vserverids are specified, VPSes from all KVM nodes will be migrated to the Destination Node.

parallelmigrationmode [1 - migrate all VPSes at once.] Do not use together with option consecutivemigrationmode. This variable is optional and being used by default.

consecutivemigrationmode [1 - migrate VPSes one by one.] Do not use together with option parallelmigrationmode. This variable is optional.

compress [0 (default) | 1 - compress the data being sent across the network.] This variable is optional.

transferspeed [0 (default)-1000 - maximum network speed you want this migration to use, Mbit/s. 0 - unlimited.] This variable is optional.

internalnetwork [0 (default) | 1 - transfer data over internal network.] This variable is optional.

automateonsuccess [0 (default) - finalize the migration manually in Admin UI | 1 - delete the source virtual server and boot on the destination if the migration is successful | 2 - do not delete the source virtual server and boot it on the destination if the migration is successful.] It is recommended to set this to 0 or 2 and delete it once you have checked the virtual server has been transferred successfully. This variable is optional.

rdtype [json] For json output specify json or for default output leave blank. This variable is optional.

Example Output

JSON

Success:

``` {"status":"success","statusmsg":"Migration of virtual server ID(s) 77,78 to node ID 6 has been started"} ```

Error:

``` {"status": "error","statusmsg": "ERROR MESSAGE"} ```

XML

Success:

``` successMigration of virtual server ID(s) 77,78 to node ID 6 has been started ```

Error:

``` errorERROR MESSAGE ```

Note: Response for the API call can take time depending on the amount of migrated VPSes. Adjust the parameter CURLOPT_TIMEOUT in the API call to meet your requirements and track logs in Admin UI > Log > API Log.