All Products
Search
Document Center

Server Migration Center:CreateReplicationJob

Last Updated:Aug 20, 2026

Creates a migration task for a migration source by calling CreateReplicationJob.

Operation description

Operation description.

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 to which the migration source is to be migrated.

cn-hangzhou

ClientToken

string

No

Ensures the idempotency of the request. You can generate a parameter value of up to 64 ASCII characters from the client and assign the value to ClientToken to ensure the idempotency of retry requests. For more information, see How to ensure idempotency.

123e4567-e89b-12d3-a456-426655440000

Name

string

No

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

  • The task name must be unique.

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

testMigrationTaskName

Description

string

No

The description of the migration task.

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

This_is_a_migration_task

SourceId

string

Yes

The ID of the migration source.

s-bp1e2fsl57knvuug****

TargetType

string

No

The target type of the migration task. Valid values:

  • Image: After a successful migration, Server Migration Center (SMC) generates an Alibaba Cloud image for your migration source.

  • ContainerImage: After a successful migration, SMC generates a Docker container image for your migration source.

  • TargetInstance: After a successful migration, SMC migrates your migration source directly to the target instance. If you set this parameter to TargetInstance, you must also specify the InstanceId parameter.

Image

ScheduledStartTime

string

No

The execution time of the migration task. The value of this parameter must meet the following requirements:

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

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

Note

If this parameter is left empty, Server Migration Center (SMC) does not start the migration task. You must call StartReplicationJob to start the task.

2019-06-04T13:35:00Z

ValidTime

string

No

The expiration time of the migration task. Valid values: creation time of the migration task + 7 days to creation time of the migration task + 90 days.

2019-06-04T13:35:00Z

ImageName

string

No

The name of the destination Alibaba Cloud image delivered by the migration task. The image name must meet the following requirements:

  • The image name must be unique within 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 and cannot start with http:// or https://. It can contain digits, colons (:), underscores (_), or hyphens (-).

Note

During the migration task, if an image with the same name already exists in the current region, the system appends the migration task ID (JobId) as a suffix to the image name by default, such as ImageName_j-2zexxxxxxxxxxxxx.

testAliCloudImageName

InstanceId

string

No

The target instance ID.

i-bp1f1dvfto1sigz5****

SystemDiskSize

integer

No

The system cloud disk size of the destination Alibaba Cloud ECS instance. Unit: GiB. Valid values: 20 to 2048.

Note

The value of this parameter must be greater than the actual used space of the migration source system cloud disk. For example, if the source system cloud disk size is 500 GiB but the actual used space is 100 GiB, the value of this parameter must be greater than 100 GiB.

80

VpcId

string

No

The ID of the VPC for which Express Connect or VPN Gateway is configured.

vpc-bp1vwnn14rqpyiczj****

VSwitchId

string

No

The ID of the vSwitch in the specified VPC.

vsw-bp1ddbrxdlrcbim46****

ReplicationParameters

string

No

The parameter information of the replication driver. The parameter information is in JSON key-value pair format with fixed keys. Maximum length: 2048 characters.

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

NetMode

integer

No

The network mode for data transmission. Valid values:

  • 0: public network transmission mode. The migration source must have access to the Internet, and migration data is transmitted over the Internet.

  • 2: internal network transmission mode. If you select this mode, you must set the VSwitchId parameter. You do not need to set the VpcId parameter because the service can automatically obtain the VPC ID through internal API calls.

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 runs only once after it is created.

  • false: incremental migration task. After the task is created, it automatically runs on a periodic basis based on the value of the Frequency parameter. Incremental migration tasks allow you to synchronize incremental data from the migration source to Alibaba Cloud without pausing your business, and generate a full-data image of the migration source at the time the task runs.

Note

This parameter can be specified only when you create a migration task. After the value is specified, it cannot be changed.

true

Frequency

integer

No

The interval at which the incremental migration task runs. Unit: hours. Valid values: 1 to 168.

This parameter is required when RunOnce is set to false.

Default value: null.

12

MaxNumberOfImageToKeep

integer

No

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

This parameter is required when RunOnce is set to false.

Default value: null.

10

InstanceType

string

No

The instance type of the intermediate ECS instance.

Call DescribeInstanceTypes to query the instance types provided by Elastic Compute Service (ECS).

  • If you specify this parameter, the system creates the intermediate instance with 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 What instance types can be used for intermediate instances in SMC FAQ.

ecs.c6.large

LaunchTemplateId

string

No

The ID of the instance launch template.

lt-bp16jovvln1cgaaq****

LaunchTemplateVersion

string

No

The version of the instance launch template.

1

InstanceRamRole

string

No

The name of the instance RAM role.

SMCAdmin

ContainerNamespace

string

No

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

testNamespace

ContainerRepository

string

No

The Docker image repository. For more information about Docker container images, see Container Registry.

testRepository

ContainerTag

string

No

The Docker image tag. For more information about Docker container images, see Container Registry.

CentOS:v1

LicenseType

string

No

The license type. Valid values:

  • Empty value: no license.

  • BYOL: Bring Your Own License.

For more information, see SMC FAQ.

BYOL

DataDisk

array<object>

No

The list of data cloud disk information.

array<object>

No

The list of data cloud disk information.

Index

integer

No

The index of the data cloud disk on the destination Alibaba Cloud ECS instance. The initial value is 1. Valid values: 1 to 16.

Note

You can create destination data cloud disks only for data disks that exist on the migration source.

1

Part

array<object>

No

The partition list.

object

No

The partition list.

SizeBytes

integer

No

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

Note
  • The partition size cannot exceed the data cloud disk size, and the total size of all partitions on the same data cloud disk cannot exceed the data cloud disk size.

  • If DataDisk.N.Part.N.Device is not empty, this parameter cannot be empty either.

254803968

Block

boolean

No

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

true

Device

string

No

The device identifier of partition N on data cloud disk N. For the actual value of N, refer to the partition device identifier of the migration source.

Note

If DataDisk.N.Part.N.SizeBytes is not empty, this parameter cannot be empty either.

0_1

Size

integer

No

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

Note

The value of this parameter must be greater than the actual used space of the migration source data cloud disk. For example, if the source data cloud disk size is 500 GiB with 100 GiB actually used, the value of this parameter must be greater than 100 GiB.

100

Tag

array<object>

No

The list of tags.

object

No

The list of tags.

Key

string

No

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

TestKey

Value

string

No

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

TestValue

SystemDiskPart

array<object>

No

The partition information of the system cloud disk.

object

No

The list of system cloud disk partitions.

SizeBytes

integer

No

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

254803968

Block

boolean

No

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

true

Device

string

No

The device identifier of system disk partition N. For the actual value of N, refer to the partition device identifier of the migration source.

Note

If SystemDiskPart.N.SizeBytes is not empty, this parameter cannot be empty either.

0_1

JobType

integer

No

The type of the migration task. Valid values:

0

ResourceGroupId

string

No

The ID of the resource group.

rg-acfmw3ty5y7****

Disks

object

No

The disk information.

System

object

No

The system cloud disk information.

Size

integer

No

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

Note

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

100

LVM

boolean

No

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

  • true: Uses LVM.

  • false: Does not use LVM.

LVM cannot be enabled in the following scenarios:

  • The migration source runs a Windows operating system.

  • The system cloud disk does not have a boot partition.

After LVM is enabled, the feature does not take effect in the following scenarios:

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

  • The migration source runs a Debian 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 partition information of the system cloud disk.

object

No

The partition information of the system cloud disk.

SizeBytes

integer

No

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

254803968

Block

boolean

No

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

true

Path

string

No

The path of the system cloud disk partition.

/boot

Data

array<object>

No

The partition information of the data cloud disk.

array<object>

No

The partition information of the data cloud disk.

Size

integer

No

The size of the data cloud disk on the migration source. Unit: GiB.

80

LVM

boolean

No

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

DiskId

string

No

The ID of the data cloud disk.

d-2ze8hyowhdgd6ou2m5z6

Part

array<object>

No

The partition information of the data cloud disk.

object

No

The partition information of the data cloud disk.

SizeBytes

integer

No

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

21474836480

Block

boolean

No

Specifies whether block replication is enabled for the data cloud disk partition. Valid values:

  • true: Block replication is enabled for the data cloud disk partition.

  • false: Block replication is not enabled for the data cloud disk partition.

true

Path

string

No

The path of the data cloud 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.