You need to enable JavaScript to run this app.
导航

CreateMigrationJob - 创建迁移任务

最近更新时间2024.05.23 10:12:41

首次发布时间2023.07.18 10:22:41

调用 CreateMigrationJob 接口,创建迁移任务。

请求说明

如需进行增量数据迁移,请设置SyncConfig.TriggerLastSync参数为false,并通过SyncConfig.SyncInterval参数指定同步增量数据的间隔时间。

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

参数
类型
是否必填
示例值
描述
Action
String

CreateMigrationJob

要执行的操作,取值:CreateMigrationJob。

Version
String

2020-04-01

API的版本,取值:2020-04-01。

DestinationConfig.AutoInstallBlkNone
Boolean

false

是否自动为目标实例或目标镜像安装blk-none。取值:

  • true:自动安装。
  • false:默认,不自动安装。

说明

仅迁移至Linux云服务器实例、Linux云服务镜像时有效。

DestinationConfig.AutoInstallVirtio11
Boolean

false

是否自动为目标实例或目标镜像安装Virtio1.1驱动。取值:

  • true:自动安装。
  • false:默认,不自动安装。

说明

仅迁移至Linux云服务器实例、Linux云服务镜像时有效。

DestinationConfig.DestinationSystem
String

VeLinux10Centos

目标操作系统。取值:

  • Unknown:未知。
  • VeLinux10Centos:表示迁移为veLinux 1.0 CentOS兼容版操作系统。

说明

DestinationConfig.DestinationTypeECSSystem时,本参数必填。

DestinationConfig.DestinationType
String

ECSInstance

目标类型,取值:

  • ECSInstance:云服务器实例。
  • ECSImage:云服务器镜像。
  • ECSSystem:云服务器操作系统。
DestinationConfig.ImageName
String

image-1

镜像名称。

  • 必须以字母、汉字开头。
  • 只能包含中文、字母、数字、下划线“_”、中划线“-”、英文句号“.”。
  • 长度限制为1 ~ 128个字符。

说明

迁移到云服务器镜像时,本参数必填。

DestinationConfig.InstanceId
String

i-3teco18f1w5a71****

目标实例ID。您可以调用DescribeInstances接口查询获取。

说明

迁移到云服务器实例时,本参数必填。

DestinationConfig.Region
String

cn-beijing

目标地域。

DiskConfigs.N.DiskIndex
Array of Integer

0

磁盘下标,从0开始。

DiskConfigs.N.DiskSize
Array of Integer

10

磁盘容量,单位GB。

MigrationJobDescription
String

迁移本地虚拟机

任务描述。

  • 必须以字母或中文开头。
  • 只能包含中文、字母、数字、点号“.”、空格、下划线“_”、中划线“-”、等号“=”、英文逗号“,”、中文逗号“,”和中文句号“。”
  • 长度限制在255个字符以内。
MigrationJobName
String

VM迁移至ECS

任务名称。

  • 以字母或中文开头。
  • 只能包含中文、字母、数字、下划线“_”、中划线“-”和点号“.”。
  • 长度限制为1~128个字符。
MigrationSourceId
String

s-iegs1y963vj0******

迁移源ID。您可以调用DescribeMigrationSources接口查询获取。

NetworkConfig.BandwidthLimit
Integer

5

传输限速,单位Mbps。最小值(默认)为0,表示不限速。

NetworkConfig.NetworkTransitionMode
String

PublicNetwork

网络模式,取值:

  • PublicNetwork:公网传输。
  • VPC:内网传输。
NetworkConfig.SubnetId
String

subnet-h49ihs*****

子网ID。您可以调用DescribeSubnets接口查询获取。

说明

迁移到云服务器镜像,且通过内网传输时必填。

NetworkConfig.VpcId
String

vpc-bp15zkdt37pq72zv****

私有网络ID。您可以调用DescribeVpcs接口查询获取。
迁移到云服务器镜像,且通过内网传输时必填。

ProjectName
String

project_a

迁移任务所属项目,一个任务只能归属于一个项目。

  • 只能包含字母、数字、下划线“_”、点“.”和中划线“-”。
  • 长度限制在64个字符以内。
SyncConfig.SyncInterval
Integer

2

增量同步时间间隔,单位小时。
取值范围:1~168。

说明

SyncConfig.TriggerLastSyncfalse,本参数必填。

SyncConfig.SyncTimes
Integer

3

增量同步次数。取值:

  • 最大值:30
  • 默认值:0
  • 最小值:0

说明

仅“一键迁移”支持使用本参数。

SyncConfig.SyncType
String

File

复制类型,取值:

  • File(默认):文件复制。
  • Block:块复制。
SyncConfig.TriggerLastSync
Boolean

true

是否只进行一次全量同步。取值:

  • true(默认):表示仅进行一次全量数据同步,不进行增量数据同步。
  • false:表示进行一次全量数据同步后,还将按SyncConfig.SyncInterval参数指定的间隔进行增量数据同步。
Tags.N.Key
Array of String

Tags.1.Key=k1&Tags.2.Key=k2

用户标签的标签键。

  • 参数 - N:表示标签键的序号,取值范围:1~20。
  • 多个标签键之间用&分隔。
  • 命名规则如下:
    • 不能以volc:sys:的任意大小写组合开头。
    • 只能包含语言字符、数字、空格和英文符号“_”、“.”、“:”、“/”、“=”、“+”、“-”、“@”。
    • 长度限制在1~128个字符之间。

说明

同一资源的标签键不允许重复。

Tags.N.Value
Array of String

Tags.1.Value=v1&Tags.2.Value=v2

用户标签的标签值。

  • 参数 - N:表示标签值的序号,取值范围:1~20。
  • 多个标签值之间用&分隔。
  • 命名规则如下:
    • 只能包含语言字符、数字、空格和英文符号“_”、“.”、“:”、“/”、“=”、“+”、“-”、“@”。
    • 允许为空,长度限制在0~256个字符之间。

说明

如果传入该参数,则必须先传入Tags.N.Key

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
MigrationJobId
String

job-3tiegs1y963vj0******

迁移任务ID。

请求示例

GET /?Action=CreateMigrationJob&Version=2020-04-01&DestinationConfig.DestinationType
=ECSInstance&DestinationConfig.Region=cn-beijing&MigrationJobName=VM迁移至ECS&MigrationSourceId=s-iegs1y963vj0******&NetworkConfig.NetworkTransitionMode=PublicNetwork&SyncConfig.SyncType=File&SyncConfig.TriggerLastSync=true HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
Service: smc

返回示例

{
    "ResponseMetadata":{
        "RequestId":"202306021637410F150Dxxxxx",
        "Action":"CreateMigrationJob",
        "Version":"2020-04-01",
        "Service":"smc",
        "Region":"cn-beijing"
    },
    "Result":{
        "MigrationJobId": "job-3tiegs1y963vj0******"
    }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
400
MissingParameter.NetworkConfig
The required parameter NetworkConfig is not supplied.

参数NetworkConfig不能为空。

400
MissingParameter.Region
The required parameter Region is not supplied.

参数Region不能为空。

400
MissingParameter.SubnetId
The required parameter SubnetId is not supplied.

参数子网Id不能为空。

400
MissingParameter.SyncConfig
The required parameter SyncConfig is not supplied.

参数SyncConfig不能为空。

400
MissingParameter.VpcId
The required parameter VpcId is not supplied.

参数vpcId不能为空。

400
QuotaExceeded.Common
You've reached the limit of cpu, volume and general cpu that you can create, please submit ticket to request an increase in quota.

已达到可创建的cpu、云盘和通用性cpu和数量上限,迁移服务到镜像会在目的地区创建云盘和云服务器,请确保目的地区至少存在一个可用区的云盘和cpu余额能满足迁移服务要求。

400
QuotaExceeded.Cpu
You've reached the limit of cpu that you can create, please submit ticket to request an increase in quota.

已达到可创建的cpu数量上限,迁移服务会创建临时实例,请确保目的可用区cpu数目未达到上限。

400
QuotaExceeded.Eip
You've reached the limit on the number of eip that you can create, please submit ticket to request an increase in quota.

已达到可申请公网IP数量上限,迁移服务会创建临时公网IP,请确保目的地区公网IP数目未达到上限。

400
QuotaExceeded.GeneralCpu
You've reached the limit of general cpu that you can create, please submit ticket to request an increase in quota.

已达到可创建的通用性cpu数量上限,迁移服务会创建临时实例,请确保目的可用区通用性cpu数目未达到上限。

400
QuotaExceeded.MaximumMigrationJob
You've reached the limit on the number of migration jobs that you can create, please submit ticket to request an increase in quota.

迁移任务数量配额不足,请提工单申请提高配额。

400
QuotaExceeded.MaximumRunningMigrationJob
You've reached the limit on the number of running migration jobs that you can create, please submit ticket to request an increase in quota.

运行迁移任务数量配额不足,请提工单申请提高配额。

400
QuotaExceeded.SecurityGroup
You've reached the limit on the number of SecurityGroup that you can create, please submit ticket to request an increase in quota.

已达到可创建安全组的数量上限,迁移服务会创建临时安全组,请确保目的地区安全组数目未达到上限。

400
QuotaExceeded.SelfImage
You've reached the limit on the number of image that you can create, please submit ticket to request an increase in quota.

已达到可创建自定义镜像的数量上限,迁移服务会创建临时自定义镜像,请确保自定义镜像数目未达到上限。

400
QuotaExceeded.Volume
You've reached the limit of volume that you can create, please submit ticket to request an increase in quota.

已达到可创建的云盘容量上限,迁移服务会创建临时云盘,请确保目的地区该类型云盘容量未达到上限。

400
QuotaExceeded.Vpc
You've reached the limit on the number of vpc that you can create, please submit ticket to request an increase in quota.

已达到可创建私有网络的数量上限,迁移服务会创建临时私有网络,请确保目的地区私有网络数目未达到上限。

400
MissingParameter.MigrationSourceId
The required parameter MigrationSourceId is not supplied.

参数MigrationSourceId不能为空。

400
InvalidTagKey.Malformed
The specified TagKey is malformed.

指定的标签的键不合法。

400
InvalidFilesystemType.Unsupported
The file system type does not support file sync type.

源环境使用的文件系统不支持文件复制。

400
InvalidInstanceChargeTypeForMigration.Unsupported
The destination instance charge type does not support migration.

目的实例计费方式不支持迁移。

400
InvalidInstanceStatusForMigration.Unsupported
The specified destination instance does not support migration.

指定的目的实例不支持迁移。

400
InvalidLVMStatus.Unsupported
The lvm status does not support file sync type.

源环境存在LVM,不支持文件复制。

400
InvalidMigrationCheckResult.Unsupported
The specified migration source check result is invalid, please make sure that completing migration source check before creating an migration job.

迁移预检结果未通过,请创建迁移任务之前先确保迁移预检完成。

400
InvalidMigrationJobDescription.Malformed
The specified MigrationJobDescription is malformed.

指定的MigrationJobDescription不合法。

400
InvalidMigrationJobName.Malformed
The specified MigrationJobName is malformed.

指定的MigrationJobName不合法。

400
InvalidMigrationSourceStatus
The status of the specified migration source does not support this request.

指定的迁移源状态不支持此操作。

400
InvalidProjectName.Malformed
The specified ProjectName is malformed.

指定的ProjectName不合法。

400
InvalidRegion.Malformed
The specified Region is malformed.

指定的Region不合法。

400
InvalidRsyncStatus.Unsupported
The rsync status does not support file sync type.

源环境Rsync不满足文件复制要求,请确保Rsync存在且版本不小于3.1。

400
InvalidSecurityGroupPermission.Conflict
The security group permission is invalid.

迁移服务需要目的实例开启8080、22以及5986端口,请检查目的实例安全组规则。

400
InvalidSubnetIdStatus
The specified subnet status error.

指定的子网状态有误。

400
InvalidSyncTypeForMigration.Unsupported
The specified migration job sync type does not support migration.

指定迁移任务的复制类型不支持迁移。

400
Insufficient.Balance
The request is denied due to the lack of balance.

账户余额不足。

400
InvalidTagValue.Malformed
The specified TagValue is malformed.

指定的标签的值不合法。

400
LimitExceeded.MaximumDiskSize
The size of disk exceeds the maximum limit.

指定的迁移源盘大小超过最大限制。

400
LimitExceeded.MaximumImageCount
You've reached the limit on the number of image that you can create.

可创建的自定义镜像个数超过限制。

400
LimitExceeded.MaximumSyncInterval
The number of specified SyncInterval exceeds the maximum limit.

指定的SyncInterval超过最大限制。

400
LimitExceeded.MaximumSyncTimes
The number of specified SyncTimes exceeds the maximum limit.

指定的SyncTimes超过最大限制。

400
LimitExceeded.MaximumSystemDiskSize
The size of specified system disk exceeds the maximum limit

指定的系统盘大小超过最大限制。

400
LimitExceeded.MaximumTags
You've reached the limit on the number of tags that you can create.

指定的标签数量超过最大限制。

400
LimitExceeded.MinimumBandwidthLimit
The number of specified BandwidthLimit exceeds the minimum limit.

指定的BandwidthLimit超过最小限制。

400
LimitExceeded.MinimumPartitionSize
The number of specified PartitionSize exceeds the minimum limit.

指定的PartitionSize超过最小限制。

400
LimitExceeded.MinimumSyncInterval
The number of specified SyncInterval exceeds the minimum limit.

指定的SyncInterval超过最小限制。

400
LimitExceeded.MinimumSyncTimes
The number of specified SyncTimes exceeds the minimum limit.

指定的SyncTimes超过最小限制。

400
MissingParameter.DestinationConfig
The required parameter DestinationConfig is not supplied.

参数DestinationConfig不能为空。

400
MissingParameter.InstanceId
The required parameter InstanceId is not supplied.

参数实例Id不能为空。

400
MissingParameter.MigrationJobName
The required parameter MigrationJobName is not supplied.

参数MigrationJobName不能为空。

404
InvalidActionOrVersion
Could not find operation %s for version %s.

请求接口不存在。

404
InvalidDestinationRegion.NotFound
The specified destination region does not exist.

指定的迁移区域不存在。

404
InvalidMigrationSource.NotFound
The specified migration source does not exist.

指定的迁移源不存在。

404
InvalidSourceTransferEip.NotFound
The specified source instance does not associate eip.

指定的源实例没有绑定EIP。

404
InvalidSourceTransferPrivateIp.NotFound
The specified source instance private ip does not exist.

指定的源实例没有内网ip。

404
InvalidSubnetId.NotFound
The specified subnet id does not exist.

指定的子网Id不存在。

404
InvalidTransferEip.NotFound
The specified destination instance does not associate eip.

指定的目标实例没有绑定EIP。

409
InvalidTagKey.Conflict
The specified TagKey already exists.

指定的标签键已存在。

412
InvalidArchitecture.MisMatch
The source, destination architecture does not match.

源、目的实例架构不匹配。

412
InvalidMigrationSource.InUse
The specified migration source is in use.

指定的迁移源有迁移任务在执行。

412
InvalidVolumeConfig.MisMatch
The source, destination volume config does not match.

源、目的实例磁盘配置不匹配。

412
InvalidVpcId.SubnetIdMismatch
The specified VpcId does not match subnetId.

vpcId和子网Id不匹配。

412
OperationDenied.AgentNeedUpgrade
The specified migration agent need upgrade

请升级迁移客户端。

412
OperationDenied.SnapshotServiceUnavailable
The specified operation is denied as Snapshot service is unavailable.

指定的操作被拒绝,因为快照服务未开通。

500
Insufficient.InstanceTypeCapacity
There is not enough capacity to fulfill your request.

实例规格资源不足。