跳转到主要内容
计算管理/虚拟机相关接口
POSTVM Related Interfaces起始版本 3.9.0同步需要认证

创建FT虚拟机

创建FT虚拟机

调试可用性

在线调试

使用当前认证信息和示例参数提交 Mock 请求。

请求参数

请求体字段

  • nameString必填

    资源名称。

  • instanceOfferingUuidString

    实例offering UUID。

  • cpuNumInteger

    暂无描述。

  • memorySizeLong

    内存大小。

  • imageUuidString必填

    镜像UUID。

响应状态

200 OK

该 API 成功时返回以下响应结构。

  • successboolean必填

    请求是否成功

  • errorErrorCode必填

    详情参考error

    • codeString必填

      错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001

    • descriptionString必填

      错误的概要描述

    • detailsString必填

      错误的详细信息

    • elaborationString必填

      保留字段,默认为null

    • opaqueLinkedHashMap必填

      保留字段,默认为null

    • causeErrorCode必填

      根错误,引发当前错误的源错误,若无原错误,该字段为null

  • primaryVmInventoryVmInstanceInventory必填

    详情参考primaryVmInventory

    • uuidString必填

      资源的UUID,唯一标示该资源

    • nameString必填

      资源名称

    • descriptionString必填

      资源的详细描述

    • zoneUuidString必填

      数据中心 UUID

    • clusterUuidString必填

      集群 UUID

    • imageUuidString必填

      镜像 UUID

    • hostUuidString必填

      主机 UUID

    • lastHostUuidString必填

      上一次启动的主机 UUID

    • instanceOfferingUuidString必填

      计算规格 UUID, 已废弃

    • rootVolumeUuidString必填

      根硬盘 UUID

    • platformString必填

      虚拟机的平台, 是 Windows / Linux 还是其它

    • architectureString必填

      虚拟机架构, 是 x86_64 / aarch64 还是其它

    • defaultL3NetworkUuidString必填

      默认使用的分布式端口组 UUID

    • typeString必填

      虚拟机类型, 是用户使用虚拟机还是平台特殊用途的虚拟机

    • hypervisorTypeString必填

      虚拟机虚拟化类型, 一般为 KVM

    • memorySizeLong必填

      内存大小

    • cpuNumInteger必填

      CPU 数量

    • cpuSpeedLong必填

      CPU 速度

    • allocatorStrategyString必填

      虚拟机分配策略

    • createDateTimestamp必填

      创建时间

    • lastOpDateTimestamp必填

      最后一次修改时间

    • stateString必填

      虚拟机是否启用的状态

    • guestOsTypeString必填

      虚拟机宿主操作系统类型

    • vmNicsList必填

      详情参考vmNics

      • uuidString必填

        资源的UUID,唯一标示该资源

      • vmInstanceUuidString必填

        虚拟机UUID

      • l3NetworkUuidString必填

        分布式端口组UUID

      • ipString必填

        来源IP地址。

      • macString必填

        暂无描述。

      • hypervisorTypeString必填

        暂无描述。

      • netmaskString必填

        暂无描述。

      • gatewayString必填

        暂无描述。

      • metaDataString必填

        元数据。

      • ipVersionInteger必填

        IP版本。

      • driverTypeString必填

        暂无描述。

      • internalNameString必填

        内部名称。

      • deviceIdInteger必填

        设备ID。

      • typeString必填

        类型。

      • stateString必填

        网卡状态

      • createDateTimestamp必填

        创建时间

      • lastOpDateTimestamp必填

        最后一次修改时间

      • usedIpsList必填

        详情参考usedIps

        • uuidString必填

          资源的UUID,唯一标示该资源

        • ipRangeUuidString必填

          IP段UUID

        • l3NetworkUuidString必填

          分布式端口组UUID

        • ipVersionInteger必填

          IP协议号

        • ipString必填

          IP地址

        • netmaskString必填

          子网掩码

        • gatewayString必填

          网关地址

        • usedForString必填

          分配原因

        • ipInLonglong必填

          Long存储的IP地址,仅ipv4有效

        • vmNicUuidString必填

          虚拟机网卡UUID

        • createDateTimestamp必填

          创建时间

        • lastOpDateTimestamp必填

          最后一次修改时间

    • allVolumesList必填

      详情参考allVolumes

      • uuidString必填

        资源的UUID,唯一标示该资源

      • nameString必填

        资源名称

      • descriptionString必填

        资源的详细描述

      • primaryStorageUuidString必填

        数据存储UUID

      • vmInstanceUuidString必填

        虚拟机UUID

      • diskOfferingUuidString必填

        硬盘规格UUID

      • rootImageUuidString必填

        根镜像UUID。

      • installPathString必填

        安装路径。

      • typeString必填

        类型。

      • formatString必填

        数据格式或导出格式。

      • sizeLong必填

        返回记录数。

      • actualSizeLong必填

        实际大小。

      • deviceIdInteger必填

        设备ID。

      • stateString必填

        当前状态。

      • statusString必填

        状态信息。

      • createDateTimestamp必填

        创建时间

      • lastOpDateTimestamp必填

        最后一次修改时间

      • isShareableBoolean必填

        是否可分享。

      • volumeQosString必填

        暂无描述。

      • lastDetachDateTimestamp必填

        最近一次detach时间。

      • lastVmInstanceUuidString必填

        最近一次云主机实例UUID。

    • vmCdRomsList必填

      详情参考vmCdRoms

      • uuidString必填

        资源的UUID,唯一标示该资源

      • vmInstanceUuidString必填

        虚拟机UUID

      • deviceIdInteger必填

        设备ID。

      • isoUuidString必填

        暂无描述。

      • isoInstallPathString必填

        iso安装路径。

      • nameString必填

        资源名称

      • descriptionString必填

        资源的详细描述

      • createDateTimestamp必填

        创建时间

      • lastOpDateTimestamp必填

        最后一次修改时间

  • secondaryVmInventoryShadowVmInstanceInventory必填

    详情参考secondaryVmInventory

    • primaryVmInstanceUuidString必填

      主云主机实例UUID。

    • secondaryVmInstanceUuidString必填

      暂无描述。

    • statusString必填

      状态信息。

    • uuidString必填

      资源的UUID,唯一标示该资源

    • nameString必填

      资源名称

    • descriptionString必填

      资源的详细描述

    • zoneUuidString必填

      数据中心UUID

    • clusterUuidString必填

      集群UUID

    • imageUuidString必填

      镜像UUID

    • hostUuidString必填

      主机UUID

    • lastHostUuidString必填

      最近一次主机UUID。

    • instanceOfferingUuidString必填

      计算规格UUID

    • rootVolumeUuidString必填

      根硬盘UUID

    • platformString必填

      平台。

    • defaultL3NetworkUuidString必填

      暂无描述。

    • typeString必填

      类型。

    • hypervisorTypeString必填

      暂无描述。

    • memorySizeLong必填

      内存大小。

    • cpuNumInteger必填

      暂无描述。

    • cpuSpeedLong必填

      暂无描述。

    • allocatorStrategyString必填

      暂无描述。

    • createDateTimestamp必填

      创建时间

    • lastOpDateTimestamp必填

      最后一次修改时间

    • stateString必填

      当前状态。

    • vmNicsList必填

      详情参考vmNics

      • uuidString必填

        资源的UUID,唯一标示该资源

      • vmInstanceUuidString必填

        虚拟机UUID

      • l3NetworkUuidString必填

        分布式端口组UUID

      • ipString必填

        来源IP地址。

      • macString必填

        暂无描述。

      • hypervisorTypeString必填

        暂无描述。

      • netmaskString必填

        暂无描述。

      • gatewayString必填

        暂无描述。

      • metaDataString必填

        元数据。

      • ipVersionInteger必填

        IP版本。

      • driverTypeString必填

        暂无描述。

      • internalNameString必填

        内部名称。

      • deviceIdInteger必填

        设备ID。

      • typeString必填

        类型。

      • stateString必填

        网卡状态

      • createDateTimestamp必填

        创建时间

      • lastOpDateTimestamp必填

        最后一次修改时间

      • usedIpsList必填

        详情参考usedIps

        • uuidString必填

          资源的UUID,唯一标示该资源

        • ipRangeUuidString必填

          IP段UUID

        • l3NetworkUuidString必填

          分布式端口组UUID

        • ipVersionInteger必填

          IP协议号

        • ipString必填

          IP地址

        • netmaskString必填

          子网掩码

        • gatewayString必填

          网关地址

        • usedForString必填

          分配原因

        • ipInLonglong必填

          Long存储的IP地址,仅ipv4有效

        • vmNicUuidString必填

          虚拟机网卡UUID

        • createDateTimestamp必填

          创建时间

        • lastOpDateTimestamp必填

          最后一次修改时间

    • allVolumesList必填

      详情参考allVolumes

      • uuidString必填

        资源的UUID,唯一标示该资源

      • nameString必填

        资源名称

      • descriptionString必填

        资源的详细描述

      • primaryStorageUuidString必填

        数据存储UUID

      • vmInstanceUuidString必填

        虚拟机UUID

      • diskOfferingUuidString必填

        硬盘规格UUID

      • rootImageUuidString必填

        根镜像UUID。

      • installPathString必填

        安装路径。

      • typeString必填

        类型。

      • formatString必填

        数据格式或导出格式。

      • sizeLong必填

        返回记录数。

      • actualSizeLong必填

        实际大小。

      • deviceIdInteger必填

        设备ID。

      • stateString必填

        当前状态。

      • statusString必填

        状态信息。

      • createDateTimestamp必填

        创建时间

      • lastOpDateTimestamp必填

        最后一次修改时间

      • isShareableBoolean必填

        是否可分享。

      • volumeQosString必填

        暂无描述。

      • lastDetachDateTimestamp必填

        最近一次detach时间。

      • lastVmInstanceUuidString必填

        最近一次云主机实例UUID。

    • vmCdRomsList必填

      详情参考vmCdRoms

      • uuidString必填

        资源的UUID,唯一标示该资源

      • vmInstanceUuidString必填

        虚拟机UUID

      • deviceIdInteger必填

        设备ID。

      • isoUuidString必填

        暂无描述。

      • isoInstallPathString必填

        iso安装路径。

      • nameString必填

        资源名称

      • descriptionString必填

        资源的详细描述

      • createDateTimestamp必填

        创建时间

      • lastOpDateTimestamp必填

        最后一次修改时间

请求地址

POST/zstack/v1/vm-instances/fault-tolerance

/zstack/v1/vm-instances/fault-tolerance

操作 ID

CreateFaultToleranceVmInstance

永久链接

请求示例

curl -X POST 'http://{host}/zstack/v1/vm-instances/fault-tolerance' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"name":"<name>","instanceOfferingUuid":"<instanceOfferingUuid>","cpuNum":1,"memorySize":1,"imageUuid":"<imageUuid>","l3NetworkUuids":["<l3NetworkUuids>"],"dataDiskOfferingUuids":["<dataDiskOfferingUuids>"],"zoneUuid":"<zoneUuid>","clusterUuid":"<clusterUuid>","hostUuid":"<hostUuid>","primaryStorageUuidForRootVolume":"<primaryStorageUuidForRootVolume>","description":"<description>","defaultL3NetworkUuid":"<defaultL3NetworkUuid>","rootVolumeSystemTags":["<rootVolumeSystemTags>"],"dataVolumeSystemTags":["<dataVolumeSystemTags>"],"resourceUuid":"<resourceUuid>","tagUuids":["<tagUuids>"],"systemTags":["<systemTags>"],"userTags":["<userTags>"],"strategy":"<strategy>","type":"<type>"}'

响应示例

200
{ "primaryVmInventory": { "uuid": "2d62fd64016b3e1297efed88bfee8f3d", "name": "Test-VM", "description": "web server VM", "zoneUuid": "d63f4978a99b3911a79b8298660658da", "clusterUuid": "8c61901b64a2371abe0c9be588343da9", "imageUuid": "86de69d705e538f7b0a94f63f13f5e63", "hostUuid": "b6137d47d5ca34b7b67c2f88b1661bf0", "lastHostUuid": "80265be7bebe336eb87eee4f96fb41fb", "instanceOfferingUuid": "f6a0ef68fe7b332ea2a8b1e08ecc142a", "rootVolumeUuid": "d8be99a7405b38a98c066003daa0e515", "platform": "Linux", "defaultL3NetworkUuid": "53655a79af73382f87c5ff5010a1c4cc", "type": "UserVm", "hypervisorType": "KVM", "memorySize": 8589934592, "cpuNum": 1, "allocatorStrategy": "LastHostPreferredAllocatorStrategy", "createDate": "Nov 14, 2017 2:20:57 PM", "lastOpDate": "Nov 14, 2017 2:20:57 PM", "state": "Running", "allVolumes": [ { "uuid": "d8be99a7405b38a98c066003daa0e515", "name": "Root-Volume-For-VM-2d62fd64016b3e1297efed88bfee8f3d", "primaryStorageUuid": "ab385e443b3e3356b12ea36f81e0ffde", "vmInstanceUuid": "2d62fd64016b3e1297efed88bfee8f3d", "diskOfferingUuid": "8b03e36ce93b37dbb2825df535572700", "rootImageUuid": "86de69d705e538f7b0a94f63f13f5e63", "installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-d8be99a7405b38a98c066003daa0e515/d8be99a7405b38a98c066003daa0e515.qcow2", "type": "Root", "format": "qcow2", "size": 107374182400, "actualSize": 21474836480, "deviceId": 0, "state": "Enabled", "status": "Ready", "createDate": "Nov 14, 2017 2:20:57 PM", "lastOpDate": "Nov 14, 2017 2:20:57 PM" } ] }, "secondaryVmInventory": { "uuid": "5a6d990017e2324397fc89974351dbd5", "name": "Test-svm", "description": "web server svm", "zoneUuid": "cb4ec84375e0396597f86f8472fa0217", "clusterUuid": "19bf28a642733c7f8a09767255eb88ab", "imageUuid": "8f8a5f8e99293536862bf44b0e8e4a06", "hostUuid": "e0d755850cf637df8f7af1004222930d", "lastHostUuid": "190c220ae2323388aa9b6917f6b8608f", "instanceOfferingUuid": "ae9f7726ec1438fcb87574a212bd9f99", "rootVolumeUuid": "d8be99a7405b38a98c066003daa0e515", "platform": "Linux", "defaultL3NetworkUuid": "53655a79af73382f87c5ff5010a1c4cc", "type": "FaultToleranceVmGroup", "hypervisorType": "Ksvm", "memorySize": 8589934592, "cpuNum": 1, "allocatorStrategy": "LastHostPreferredAllocatorStrategy", "createDate": "Nov 14, 2017 2:20:57 PM", "lastOpDate": "Nov 14, 2017 2:20:57 PM", "state": "Running", "allVolumes": [ { "uuid": "d8be99a7405b38a98c066003daa0e515", "name": "Root-Volume-For-VM-2d62fd64016b3e1297efed88bfee8f3d", "primaryStorageUuid": "2f69982e2e91358abd3761dc9f4799a2", "vmInstanceUuid": "2d62fd64016b3e1297efed88bfee8f3d", "diskOfferingUuid": "3a3f0cc999ed3a379b0cd5e5900ac639", "rootImageUuid": "86de69d705e538f7b0a94f63f13f5e63", "installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-d8be99a7405b38a98c066003daa0e515/d8be99a7405b38a98c066003daa0e515.qcow2", "type": "Root", "format": "qcow2", "size": 107374182400, "actualSize": 21474836480, "deviceId": 0, "state": "Enabled", "status": "Ready", "createDate": "Nov 14, 2017 2:20:57 PM", "lastOpDate": "Nov 14, 2017 2:20:57 PM" } ] }, "faultToleranceVmGroupInventory": { "uuid": "b5428087c53939b9a0b85e322f1e7bb6", "name": "Test-ftVm", "description": "web server ftVm", "zoneUuid": "b441a4f72ac23f92be85f951a54b8ea7", "clusterUuid": "618e159139003cf1971132ec1f426456", "imageUuid": "4e57cd7ee15932e68eb87a7d1f9b03e0", "hostUuid": "6a849cdc9f8f359ba9d878e21fc18a15", "lastHostUuid": "24fcefebc2af3f61a8caecd2fd2cef2b", "instanceOfferingUuid": "04d2247fafbd3ba2a64d367f69b2d402", "rootVolumeUuid": "d8be99a7405b38a98c066003daa0e515", "platform": "Linux", "defaultL3NetworkUuid": "53655a79af73382f87c5ff5010a1c4cc", "type": "FaultToleranceVmGroup", "hypervisorType": "KftVm", "memorySize": 8589934592, "cpuNum": 1, "allocatorStrategy": "LastHostPreferredAllocatorStrategy", "createDate": "Nov 14, 2017 2:20:57 PM", "lastOpDate": "Nov 14, 2017 2:20:57 PM", "state": "Running", "vmNics": [ { "uuid": "e7be04a3db4f31ee9fd35feda0b9e3f6", "vmInstanceUuid": "2d62fd64016b3e1297efed88bfee8f3d", "usedIpUuid": "2baea67e32473aff96a40735735587ba", "l3NetworkUuid": "53655a79af73382f87c5ff5010a1c4cc", "ip": "192.168.1.10", "mac": "00:0c:29:bd:99:fc", "hypervisorType": "KVM", "netmask": "255.255.255.0", "gateway": "192.168.1.1", "deviceId": 0, "createDate": "Nov 14, 2017 2:20:57 PM", "lastOpDate": "Nov 14, 2017 2:20:57 PM" } ], "allVolumes": [ { "uuid": "d8be99a7405b38a98c066003daa0e515", "name": "Root-Volume-For-VM-2d62fd64016b3e1297efed88bfee8f3d", "primaryStorageUuid": "8a1c7e7eae623b3c827cee8679c03d85", "vmInstanceUuid": "2d62fd64016b3e1297efed88bfee8f3d", "diskOfferingUuid": "4fe96d078ecf3e94b69c6898e53131e0", "rootImageUuid": "86de69d705e538f7b0a94f63f13f5e63", "installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-d8be99a7405b38a98c066003daa0e515/d8be99a7405b38a98c066003daa0e515.qcow2", "type": "Root", "format": "qcow2", "size": 107374182400, "actualSize": 21474836480, "deviceId": 0, "state": "Enabled", "status": "Ready", "createDate": "Nov 14, 2017 2:20:57 PM", "lastOpDate": "Nov 14, 2017 2:20:57 PM" } ] } }

变更历史

此 API 暂无变更历史记录。

查看全部变更历史