All Products
Search
Document Center

Server Migration Center:CreateReplicationJob

Last Updated:Nov 13, 2025

Creates a migration task for a source server.

Operation description

Description

  • You can create migration tasks only for source servers that are in the Available state.

  • A source server can be associated with only one migration task in an incomplete state, such as Ready, Running, Stopped, Waiting, InError, or Expired.

  • Each Alibaba Cloud account can create up to 1,000 migration tasks.

  • If the migration target is an image, the ImageName, SystemDiskSize, and DataDisk parameters are required.

  • For migrations over a VPC internal network, the VSwitchId parameter is required and the VpcId parameter is optional.

  • You can migrate a source server to a Docker container image for low-cost application containerization.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

smc:CreateReplicationJob

create

*ReplicationJob

acs:smc:{#regionId}:{#accountId}:replicationjob/*

*SourceServer

acs:smc:{#regionId}:{#accountId}:sourceserver/{#SourceServerId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the destination Alibaba Cloud region.

For example, if you want to migrate a source server to the China (Hangzhou) region, set this parameter to cn-hangzhou. You can call the DescribeRegions operation to query the latest list of Alibaba Cloud regions.

cn-hangzhou

ClientToken

string

No

A client token to ensure the idempotence of the request. Generate a string of up to 64 ASCII characters and assign it to this parameter. For more information, see How to ensure idempotence.

123e4567-e89b-12d3-a456-426655440000

Name

string

No

The name of the migration task. The name must meet the following requirements:

  • The name must be unique.

  • The name must be 2 to 128 characters in length. It must start with a letter or a Chinese character. It cannot start with http:// or https://. It can contain digits, colons (:), underscores (_), and hyphens (-).

testMigrationTaskName

Description

string

No

The description of the migration task.

The description must be 2 to 128 characters in length. It must start with a letter or a Chinese character. It cannot start with http:// or https://. It can contain digits, colons (:), underscores (_), and hyphens (-).

This_is_a_migration_task

SourceId

string

Yes

The ID of the migration source.

s-bp1e2fsl57knvuug****

TargetType

string

No

The type of the migration target. Valid values:

  • Image: SMC generates an Alibaba Cloud image from the migration source.

  • ContainerImage: SMC generates a Docker container image from the migration source.

  • TargetInstance: SMC migrates the source server to a destination instance. If you set this parameter to TargetInstance, you must also specify the InstanceId parameter.

Image

ScheduledStartTime

string

No

The time when you want to start the migration task. The time must meet the following requirements:

  • The time must follow the ISO 8601 standard and be in UTC. The format is YYYY-MM-DDThh:mm:ssZ. For example, 2018-01-01T12:00:00Z specifies 20:00:00 on January 1, 2018 (UTC+8).

  • The time must be later than the current time and within 30 days.

Note

If you leave this parameter empty, the migration task is not automatically started. You must call the StartReplicationJob operation to start the task.

2019-06-04T13:35:00Z

ValidTime

string

No

The time when the migration task expires. The value must be between 7 and 90 days after the task is created.

  • The time must follow the ISO 8601 standard and be in UTC. The format is YYYY-MM-DDThh:mm:ssZ. For example, 2018-01-01T12:00:00Z specifies 20:00:00 on January 1, 2018 (UTC+8).

  • If you leave this parameter empty, the task does not expire.

  • After a task expires, it is marked as `Expired`. Expired tasks are retained for 7 days and then automatically deleted.

Default value: 30 days after the task is created.

2019-06-04T13:35:00Z

ImageName

string

No

The name of the destination Alibaba Cloud image. The name must meet the following requirements:

  • The image name must be unique in the same Alibaba Cloud region.

  • The name must be 2 to 128 characters in length. It must start with a letter or a Chinese character. It cannot start with http:// or https://. It can contain digits, colons (:), underscores (_), and hyphens (-).

Note

If an image with the same name already exists in the current region when the migration task is running, the system adds the migration task ID (JobId) to the image name as a suffix. For example: `ImageName_j-2zexxxxxxxxxxxxx`.

testAliCloudImageName

InstanceId

string

No

The ID of the destination instance.

i-bp1f1dvfto1sigz5****

SystemDiskSize

integer

No

The system disk size of the destination Elastic Compute Service (ECS) instance. Unit: GiB. Valid values: 20 to 2048.

Note

The value must be greater than the used space of the source system disk. For example, if the source system disk is 500 GiB and 100 GiB of space is used, set this parameter to a value greater than 100.

80

VpcId

string

No

The ID of the VPC that is configured with an Express Connect circuit or a VPN Gateway.

vpc-bp1vwnn14rqpyiczj****

VSwitchId

string

No

The ID of the virtual switch in the specified VPC.

This parameter is required for migrations over a VPC internal network.

vsw-bp1ddbrxdlrcbim46****

ReplicationParameters

string

No

The parameters for the replication driver. The parameters are a JSON key-value pair. The keys are fixed. The value can be up to 2,048 characters in length.

The replication driver is the tool used to copy data from the source server to the intermediate instance. The supported parameters vary based on the replication driver. The SMT replication driver supports the following parameters:

  • bandwidth_limit: The bandwidth limit for data transmission.

  • compress_level: The compression ratio for data transmission.

  • checksum: Specifies whether to enable checksum verification.

To obtain the value of the replication driver, see the SourceServers.ReplicationDriver response parameter in DescribeSourceServers.

{"bandwidth_limit":0,"compress_level":1,"checksum":true}

NetMode

integer

No

The network mode for data transmission. Valid values:

  • 0: Internet. Data is transmitted over the Internet. The source server must be able to access the Internet.

  • 2: Internal network. If you select this mode, you must set the VSwitchId parameter. The VpcId parameter is optional because the service can automatically query the VPC ID.

Default value: 0.

0

RunOnce

boolean

No

Specifies whether to create a one-time migration task or an incremental migration task. Valid values:

  • true (default): One-time migration task. The task is executed only once after it is created.

  • false: Incremental migration task. After the task is created, it is automatically executed at the interval specified by the Frequency parameter. An incremental migration task lets you synchronize incremental data from a source server to Alibaba Cloud without interrupting your services and generate a full data image of the source server at the time the task is running.

Note

You can specify this parameter only when you create a migration task. You cannot change the value after the task is created.

true

Frequency

integer

No

The interval at which an incremental migration task is run. Unit: hours. Valid values: 1 to 168.

This parameter is required if you set the RunOnce parameter to `false`.

Default value: None.

12

MaxNumberOfImageToKeep

integer

No

The maximum number of images to retain for an incremental migration task. Valid values: 1 to 10.

This parameter is required if you set the RunOnce parameter to `false`.

Default value: None.

10

InstanceType

string

No

The instance type of the intermediate instance.

You can call the DescribeInstanceTypes operation to query the instance types provided by ECS.

  • If you specify this parameter, the system creates an intermediate instance of the specified instance type. If the specified instance type is out of stock, the migration task fails to be created.

  • If you do not specify this parameter, the system selects an instance type in a specific order to create the intermediate instance. For more information, see the "What instance types are used for intermediate instances?" section in SMC FAQ.

ecs.c6.large

LaunchTemplateId

string

No

The ID of the launch template.

lt-bp16jovvln1cgaaq****

LaunchTemplateVersion

string

No

The version of the launch template.

1

InstanceRamRole

string

No

The name of the RAM role for the instance.

SMCAdmin

ContainerNamespace

string

No

The namespace of the Docker container. For more information, see Container Registry.

testNamespace

ContainerRepository

string

No

The image repository for the Docker container. For more information, see Container Registry.

testRepository

ContainerTag

string

No

The image tag for the Docker container. For more information, see Container Registry.

CentOS:v1

LicenseType

string

No

The license type. Valid values:

  • Leave this parameter empty to indicate no license.

  • BYOL: Bring Your Own License (BYOL).

For more information, see SMC FAQ.

BYOL

DataDisk

array<object>

No

The list of data disks.

array<object>

No

The list of data disks.

Index

integer

No

The sequence number of the data disk on the destination ECS instance. The sequence starts from 1. Valid values: 1 to 16.

Note

You can create a destination data disk only for a data disk that exists on the migration source.

1

Part

array<object>

No

The list of partitions.

object

No

The list of partitions.

SizeBytes

integer

No

The size of partition N on data disk N. Unit: bytes. Default value: the size of the source data disk partition.

Note
  • The partition size cannot exceed the data disk size. The total size of all partitions on a data disk cannot exceed the data disk size.

  • This parameter cannot be empty if DataDisk.N.Part.N.Device is not empty.

254803968

Block

boolean

No

Specifies whether to enable block replication for partition N on data disk N. Valid values:

  • true

  • false

Default value: `true`.

true

Device

string

No

The device ID of partition N on data disk N. The value of N must be the same as the value of N in the device ID of the source partition.

Note

This parameter cannot be empty if DataDisk.N.Part.N.SizeBytes is not empty.

0_1

Size

integer

No

The size of the data disk on the destination ECS instance. Unit: GiB. Valid values: 20 to 32768.

Note

The value must be greater than the used space of the source data disk. For example, if the source data disk is 500 GiB and 100 GiB of space is used, set this parameter to a value greater than 100.

100

Tag

array<object>

No

The list of tags.

object

No

The list of tags.

Key

string

No

The key of tag N for the migration task. Valid values of N: 1 to 20.

The tag key cannot be an empty string. It can be up to 128 characters in length. It cannot start with aliyun, acs:, http://, or https://.

TestKey

Value

string

No

The value of tag N for the migration task. Valid values of N: 1 to 20.

The tag value can be an empty string. It can be up to 128 characters in length. It cannot start with aliyun, acs:, http://, or https://.

TestValue

SystemDiskPart

array<object>

No

The information about the system disk partitions.

object

No

The list of system disk partitions.

SizeBytes

integer

No

The size of system disk partition N. Unit: bytes. Default value: the size of the source system disk partition.

Note
  • The partition size cannot exceed the system disk size. The total size of all partitions on the system disk cannot exceed the system disk size.

  • This parameter cannot be empty if SystemDiskPart.N.Device is not empty.

254803968

Block

boolean

No

Specifies whether to enable block replication for system disk partition N. Valid values:

  • true

  • false

Default value: `true`.

true

Device

string

No

The device ID of system disk partition N. The value of N must be the same as the value of N in the device ID of the source partition.

Note

This parameter cannot be empty if SystemDiskPart.N.SizeBytes is not empty.

0_1

JobType

integer

No

The type of the migration task. Valid values:

  • 0: Server migration.

  • 1: Operating system migration.

  • 2: Cross-zone migration.

  • 3: Agentless migration for VMware.

0

ResourceGroupId

string

No

The ID of the resource group.

rg-acfmw3ty5y7****

Disks

object

No

The disk information.

System

object

No

The system disk information.

Size

integer

No

The size of the source system disk. Unit: GiB. Valid values: 20 to 32768.

Note

The value must be greater than the used space of the source system disk. For example, if the source system disk is 500 GiB and 100 GiB of space is used, set this parameter to a value greater than 100.

100

LVM

boolean

No

Specifies whether to use Logical Volume Management (LVM). Valid values:

  • true: Use LVM.

  • false: Do not use LVM.

LVM is not supported in the following scenarios:

  • The source server runs a Windows operating system.

  • The system disk does not have a boot partition.

If you enable LVM, the feature does not take effect in the following scenarios:

  • The source server does not support lvm2 or does not have the lvm2 package installed.

  • The source server runs a Debian operating system with a kernel version of 3.x or earlier and has a disk with an XFS file system mounted.

true

Part

array<object>

No

The information about the system disk partitions.

object

No

The information about the system disk partitions.

SizeBytes

integer

No

The size of the system disk partition. Unit: bytes.

254803968

Block

boolean

No

Specifies whether to enable block replication for the system disk partition.

true

Path

string

No

The path of the system disk partition.

/boot

Data

array<object>

No

The information about the data disk partitions.

array<object>

No

The information about the data disk partitions.

Size

integer

No

The size of the source data disk. Unit: GiB.

80

LVM

boolean

No

Specifies whether to use LVM for the data disk. Valid values:

  • true: Use LVM.

  • false: Do not use LVM.

DiskId

string

No

The ID of the data disk.

d-2ze8hyowhdgd6ou2m5z6

Part

array<object>

No

The information about the data disk partitions.

object

No

The information about the data disk partitions.

SizeBytes

integer

No

The size of the data disk partition. Unit: bytes.

21474836480

Block

boolean

No

Specifies whether to enable block replication for the data disk partition. Valid values:

  • true: Enable block replication for the data disk partition.

  • false: Disable block replication for the data disk partition.

true

Path

string

No

The path of the data disk partition.

/home/date

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

C8B26B44-0189-443E-9816-D951F59623A9

JobId

string

The ID of the migration task.

j-bp17bclvg344jlyt****

Examples

Success response

JSON format

{
  "RequestId": "C8B26B44-0189-443E-9816-D951F59623A9",
  "JobId": "j-bp17bclvg344jlyt****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 ReplicationJobDataDiskIndex.Invalid The specified replication job contains data disk index not found in source server. The specified replication job contains data disk indexes that do not exist in the source server.
400 VSwitchIdVpcId.Mismatch The specified VSwitchId and VpcId does not match. The specified VSwitchId and VpcId does not match.
400 InvalidSecurityGroupId.IncorrectNetworkType The network type of the specified security group does not support this action. The network type of the specified security group does not support this action.
400 InvalidSecurityGroupId.VPCMismatch The specified security group and the specified virtual switch are not in the same VPC. The specified security group and the specified virtual switch are not in the same VPC.
400 QuotaExceeded.ReplicationJob The maximum number of replication jobs is exceeded. Please submit a ticket to raise the quota. The maximum number of replication jobs is exceeded. Please submit a ticket to raise the quota.
400 ReplicationJobName.Duplicate The specified replication job name already exists. The specified replication job name already exists.
400 SourceServerState.Invalid The specified source server status: %s is invalid. This operation can only be performed in the following status: %s. The specified source server status: %s is invalid. This operation can only be performed in the following status: %s.
400 ImageName.UsedByReplicationJob The specified imageName: "%s" was used by another replication job in the current region. The specified imageName: "%s" was used by another replication job in the current region.
400 InvalidOsMigrationType.NotMatched The SourceOsType: %s and TargetOsType: %s are not matched. The supported TargetOsType list is: %s. The SourceOsType: %s and TargetOsType: %s are not matched. The supported TargetOsType list is: %s.
500 InternalError An error occurred while processing your request. Please try again. If the problem still exists, please submit a ticket. An error occurred while processing your request. Please try again. If the problem still exists, please submit a ticket.
403 EntityNotExist.Role The account is unauthorized. Please assign the role AliyunServiceRoleForSMC to your account. The account does not have the operation permission, please assign the account AliyunServiceRoleForSMC role.
403 RealNameAuthenticationError You must perform real-name verification for your account. The account does not have real-name authentication. Please perform real-name authentication first.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.