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

CreateMigrationJob

最近更新时间2024.03.26 14:17:57

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

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

说明

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

请求参数

名称类型是否必填示例值描述
ActionStringCreateMigrationJob要执行的操作,取值: CreateMigrationJob。
VersionString2020-04-01API的版本,取值: 2020-04-01。

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.AutoInstallVirtio11

Boolean

true

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

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

说明

迁移到Linux云服务器实例、Linux云服务镜像时支持使用。

DestinationConfig.AutoInstallBlkNone

Boolean

true

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

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

说明

迁移到Linux云服务器实例、Linux云服务镜像时支持使用。

DestinationConfig.InstanceId

String

i-3teco18f1w5a71****

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

迁移到云服务器实例时必填。

DestinationConfig.RegionStringcn-beijing目标地域。
DiskConfigs.N.DiskIndexString0磁盘下标,系统盘为 0,数据盘从1开始。
DiskConfigs.N.DiskSizeString10磁盘容量,单位GB。

MigrationJobDescription

String

用于迁移本地虚拟机

任务描述。

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

MigrationJobName

String

VM迁移至ECS

任务名。

  • 以字母或中文开头。
  • 只能包含中文、字母、数字、下划线“_”、中划线“-”和点号“.”。
  • 长度限制为1~128个字符。
MigrationSourceIdStrings-iegs1y963vj0****迁移源ID。您可以调用DescribeMigrationSources接口查询获取。
NetworkConfig.BandwidthLimitInteger5传输限速,单位Mbps。最小值(默认)为0,表示不限速。

NetworkConfig.NetworkTransitionMode

String

PublicNetwork

网络模式,取值:

  • PublicNetwork:公网传输
  • VPC:内网传输

NetworkConfig.SubnetId

String

subnet-****

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

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

NetworkConfig.VpcId

String

vpc-bp15zkdt37pq72zv****

私有网络ID。您可以调用DescribeVpcs接口查询获取。

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

ProjectName

String

project_a

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

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

SyncConfig.SyncInterval

Integer

2

增量同步时间间隔,单位小时。

  • 最大值:168
  • 最小值:0

说明

SyncConfig.TriggerLastSyncfalse,本参数必填。

SyncConfig.SyncType

String

File

复制类型,取值:

  • File(默认):文件复制
  • Block:块复制

SyncConfig.TriggerLastSync

Boolean

true

是否开启最后一次增量同步。取值:

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

Tags.N.Key

String

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

用户标签的标签键。

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

说明

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

Tags.N.Value

String

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

用户标签的标签值。

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

说明

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

返回数据

名称类型示例值描述
MigrationJobIdStringjob-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******"
    }
}

错误码

HttpCode错误码错误信息描述
400Insufficient.BalanceThe request is denied due to the lack of balance.账户余额不足。
400InvalidInstanceChargeTypeForMigration.UnsupportedThe destination instance charge type does not support migration.目的实例计费方式不支持迁移。
400InvalidInstanceStatusForMigration.UnsupportedThe specified destination instance does not support migration.指定的目的实例不支持迁移。
400InvalidMigrationJobDescription.MalformedThe specified MigrationJobDescription is malformed.指定的MigrationJobDescription不合法。
400InvalidMigrationJobName.MalformedThe specified MigrationJobName is malformed.指定的MigrationJobName不合法。
400InvalidMigrationSourceStatusThe status of the specified migration source does not support this request.指定的迁移源状态不支持此操作。
400InvalidRegion.MalformedThe specified Region is malformed.指定的Region不合法。
400InvalidSubnetIdStatusThe specified subnet status error.指定的子网状态有误。
400LimitExceeded.MaximumImageCountYou've reached the limit on the number of image that you can create.可创建的自定义镜像个数超过限制。
400LimitExceeded.MaximumSyncIntervalThe number of specified SyncInterval exceeds the maximum limit.指定的SyncInterval超过最大限制。
400LimitExceeded.MaximumSystemDiskSizeThe size of specified system disk exceeds the maximum limit指定的系统盘大小超过最大限制。
400LimitExceeded.MinimumBandwidthLimitThe number of specified BandwidthLimit exceeds the minimum limit.指定的BandwidthLimit超过最小限制。
400LimitExceeded.MinimumSyncIntervalThe number of specified SyncInterval exceeds the minimum limit.指定的SyncInterval超过最小限制。
400MissingParameter.DestinationConfigThe required parameter DestinationConfig is not supplied.参数DestinationConfig不能为空。
400MissingParameter.InstanceIdThe required parameter InstanceId is not supplied.参数实例Id不能为空。
400MissingParameter.MigrationJobNameThe required parameter MigrationJobName is not supplied.参数MigrationJobName不能为空。
400MissingParameter.MigrationSourceIdThe required parameter MigrationSourceId is not supplied.参数MigrationSourceId不能为空。
400MissingParameter.NetworkConfigThe required parameter NetworkConfig is not supplied.参数NetworkConfig不能为空。
400MissingParameter.RegionThe required parameter Region is not supplied.参数Region不能为空。
400MissingParameter.SubnetIdThe required parameter SubnetId is not supplied.参数子网Id不能为空。
400MissingParameter.SyncConfigThe required parameter SyncConfig is not supplied.参数SyncConfig不能为空。
400MissingParameter.VpcIdThe required parameter VpcId is not supplied.参数vpcId不能为空。
400QuotaExceeded.MaximumMigrationJobYou've reached the limit on the number of migration jobs that you can create, please submit ticket to request an increase in quota.迁移任务数量配额不足,请提工单申请提高配额。
400InvalidProjectName.MalformedThe specified ProjectName is malformed.指定的ProjectName不合法。
400InvalidSyncTypeForMigration.UnsupportedThe specified migration job sync type does not support migration.指定迁移任务的复制类型不支持迁移。
400QuotaExceeded.MaximumRunningMigrationJobYou've reached the limit on the number of running migration jobs that you can create, please submit ticket to request an increase in quota.运行迁移任务数量配额不足,请提工单申请提高配额。
400InvalidTagKey.MalformedThe specified TagKey is malformed.指定标签的键不合法。
400InvalidTagValue.MalformedThe specified TagValue is malformed.指定的标签的值不合法。
400LimitExceeded.MaximumTagsYou've reached the limit on the number of tags that you can create.指定的标签数量超过最大限制。
404InvalidActionOrVersionCould not find operation %s for version %s.请求接口不存在。
404InvalidDestinationRegion.NotFoundThe specified destination region does not exist.指定的迁移区域不存在。
404InvalidMigrationSource.NotFoundThe specified migration source does not exist.指定的迁移源不存在。
404InvalidSourceTransferEip.NotFoundThe specified source instance does not associate eip.指定的源实例没有绑定EIP。
404InvalidSourceTransferPrivateIp.NotFoundThe specified source instance private ip does not exist.指定的源实例没有内网ip。
404InvalidSubnetId.NotFoundThe specified subnet id does not exist.指定的子网Id不存在。
404InvalidTransferEip.NotFoundThe specified destination instance does not associate eip.指定的目标实例没有绑定EIP。
409InvalidTagKey.ConflictThe specified TagKey already exists.指定的标签键已存在。
412InvalidArchitecture.MisMatchThe source, destination architecture does not match.源、目的实例架构不匹配。
412InvalidMigrationSource.InUseThe specified migration source is in use.指定的迁移源有迁移任务在执行。
412InvalidVolumeConfig.MisMatchThe source, destination volume config does not match.源、目的实例磁盘配置不匹配。
412InvalidVpcId.SubnetIdMismatchThe specified VpcId does not match subnetId.vpcId和子网Id不匹配。
412OperationDenied.AgentNeedUpgradeThe specified migration agent need upgrade请升级迁移客户端。
412OperationDenied.SnapshotServiceUnavailableThe specified operation is denied as Snapshot service is unavailable.指定的操作被拒绝,因为快照服务未开通。
500Insufficient.InstanceTypeCapacityThere is not enough capacity to fulfill your request.实例规格资源不足。