VM Related Interfaces

Create FT Virtual Machine

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "name": "vm1",
    "instanceOfferingUuid": "e7f7da783e573c7ebc3859e2d16552f3",
    "imageUuid": "de06f83941db39ad805e51631319934a",
    "l3NetworkUuids": [
      "54f599b8cc84319e926c2a87a9aa69f3"
    ],
    "dataDiskOfferingUuids": [
      "515287814adc30b0ac62ca9404850d3a",
      "eb016f64ac4234fbbeaea24cd35ac3c4"
    ],
    "clusterUuid": "ee25403505453f4b91fc090dd7ca0a98",
    "description": "this is a vm",
    "strategy": "InstantStart",
    "type": "FaultToleranceVmGroup"
  },
  "systemTags": [],
  "userTags": []
}

In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"vm1","instanceOfferingUuid":"e7f7da783e573c7ebc3859e2d16552f3","imageUuid":"de06f83941db39ad805e51631319934a","l3NetworkUuids":["54f599b8cc84319e926c2a87a9aa69f3"],"dataDiskOfferingUuids":["515287814adc30b0ac62ca9404850d3a","eb016f64ac4234fbbeaea24cd35ac3c4"],"clusterUuid":"ee25403505453f4b91fc090dd7ca0a98","description":"this is a vm","strategy":"InstantStart","type":"FaultToleranceVmGroup"}}' \
http://localhost:8080/zstack/v1/vm-instances/fault-tolerance

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
nameStringbody(included in the params structure)Resource name 3.9.0
instanceOfferingUuid (Optional)Stringbody(included in the params structure)Instance Offering UUID 3.9.0
cpuNum (Optional)Integerbody(included in the params structure)  3.9.0
memorySize (Optional)Longbody(included in the params structure)  3.9.0
imageUuidStringbody(included in the params structure)Image UUID 3.9.0
l3NetworkUuidsListbody(included in the params structure)  3.9.0
dataDiskOfferingUuids (Optional)Listbody(included in the params structure)  3.9.0
zoneUuid (Optional)Stringbody(included in the params structure)Data Center UUID 3.9.0
clusterUuid (Optional)Stringbody(included in the params structure)Cluster UUID 3.9.0
hostUuid (Optional)Stringbody(included in the params structure)Host UUID 3.9.0
primaryStorageUuidForRootVolume (Optional)Stringbody(included in the params structure)  3.9.0
description (Optional)Stringbody(included in the params structure)Detailed description of the resource 3.9.0
defaultL3NetworkUuid (Optional)Stringbody(included in the params structure)  3.9.0
rootVolumeSystemTags (Optional)Listbody(included in the params structure)  3.9.0
dataVolumeSystemTags (Optional)Listbody(included in the params structure)  3.9.0
resourceUuid (Optional)Stringbody(included in the params structure)  3.9.0
tagUuids (Optional)Listbody(included in the params structure)Tag UUID List 3.9.0
systemTags (Optional)Listbody  3.9.0
userTags (Optional)Listbody  3.9.0
strategy (Optional)Stringbody(included in the params structure)  0.6
type (Optional)Stringbody(included in the params structure)  0.6

API Response

Response Example

{
  "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"
      }
    ]
  }
}
NameTypeDescriptionStarting Version
successbooleanWhether the request is successful4.10.16
errorErrorCodeFor details, see error4.10.16
primaryVmInventoryVmInstanceInventoryFor details, see primaryVmInventory3.9.0
secondaryVmInventoryShadowVmInstanceInventoryFor details, see secondaryVmInventory3.9.0

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, default is null0.6
opaqueLinkedHashMapReserved field, default is null0.6
causeErrorCodeRoot cause: the source error that triggered the current error. If there is no original error, this field is null0.6

primaryVmInventory

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource0.6
nameStringResource name0.6
descriptionStringDetailed description of the resource0.6
zoneUuidStringData Center UUID0.6
clusterUuidStringCluster UUID0.6
imageUuidStringImage UUID0.6
hostUuidStringHost UUID0.6
lastHostUuidStringLast Host UUID0.6
instanceOfferingUuidStringInstance Offering UUID, deprecated0.6
rootVolumeUuidStringRoot Disk UUID0.6
platformStringVirtual Machine platform type, Windows / Linux / Other0.6
architectureStringVirtual Machine architecture, x86_64 / aarch64 / Other0.6
defaultL3NetworkUuidStringDefault Distributed Port Group UUID0.6
typeStringVirtual Machine type, User VM or platform special purpose VM0.6
hypervisorTypeStringVirtual Machine hypervisor type, typically KVM0.6
memorySizeLongMemory size0.6
cpuNumIntegerCPU number0.6
cpuSpeedLongCPU speed0.6
allocatorStrategyStringVirtual Machine allocation strategy0.6
createDateTimestampCreate time0.6
lastOpDateTimestampLast modification time0.6
stateStringVirtual Machine enabled state0.6
guestOsTypeStringVirtual Machine host operating system type3.11.2
vmNicsListFor details, see vmNics0.6
allVolumesListFor details, see allVolumes0.6
vmCdRomsListFor details, see vmCdRoms0.6

vmNics

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource3.17.13
vmInstanceUuidStringVirtual Machine UUID3.17.13
l3NetworkUuidStringDistributed Port Group UUID3.17.13
ipString 3.17.13
macString 3.17.13
hypervisorTypeString 3.17.13
netmaskString 3.17.13
gatewayString 3.17.13
metaDataString 3.17.13
ipVersionInteger 3.17.13
driverTypeString 3.17.13
internalNameString 3.17.13
deviceIdInteger 3.17.13
typeString 3.17.13
stateStringNIC state3.17.13
createDateTimestampCreate time3.17.13
lastOpDateTimestampLast modification time3.17.13
usedIpsListFor details, see usedIps3.17.13

usedIps

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource4.10.0
ipRangeUuidStringIP Range UUID4.10.0
l3NetworkUuidStringDistributed Port Group UUID4.10.0
ipVersionIntegerIP protocol number4.10.0
ipStringIP address4.10.0
netmaskStringSubnet mask4.10.0
gatewayStringGateway address4.10.0
usedForStringAllocation reason4.10.0
ipInLonglongLong stored IP address, only valid for ipv44.10.0
vmNicUuidStringVirtual Machine NIC UUID4.10.0
createDateTimestampCreate time4.10.0
lastOpDateTimestampLast modification time4.10.0

allVolumes

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource3.17.13
nameStringResource name3.17.13
descriptionStringDetailed description of the resource3.17.13
primaryStorageUuidStringData Storage UUID3.17.13
vmInstanceUuidStringVirtual Machine UUID3.17.13
diskOfferingUuidStringDisk Offering UUID3.17.13
rootImageUuidString 3.17.13
installPathString 3.17.13
typeString 3.17.13
formatString 3.17.13
sizeLong 3.17.13
actualSizeLong 3.17.13
deviceIdInteger 3.17.13
stateString 3.17.13
statusString 3.17.13
createDateTimestampCreate time3.17.13
lastOpDateTimestampLast modification time3.17.13
isShareableBoolean 3.17.13
volumeQosString 3.17.13
lastDetachDateTimestamp 3.17.13
lastVmInstanceUuidString 3.17.13

vmCdRoms

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource3.17.13
vmInstanceUuidStringVirtual Machine UUID3.17.13
deviceIdInteger 3.17.13
isoUuidString 3.17.13
isoInstallPathString 3.17.13
nameStringResource name3.17.13
descriptionStringDetailed description of the resource3.17.13
createDateTimestampCreate time3.17.13
lastOpDateTimestampLast modification time3.17.13

secondaryVmInventory

NameTypeDescriptionStarting Version
primaryVmInstanceUuidString 0.6
secondaryVmInstanceUuidString 0.6
statusString 0.6
uuidStringUUID of the resource, uniquely identifying the resource0.6
nameStringResource name0.6
descriptionStringDetailed description of the resource0.6
zoneUuidStringData Center UUID0.6
clusterUuidStringCluster UUID0.6
imageUuidStringImage UUID0.6
hostUuidStringHost UUID0.6
lastHostUuidString 0.6
instanceOfferingUuidStringInstance Offering UUID0.6
rootVolumeUuidStringRoot Disk UUID0.6
platformString 0.6
defaultL3NetworkUuidString 0.6
typeString 0.6
hypervisorTypeString 0.6
memorySizeLong 0.6
cpuNumInteger 0.6
cpuSpeedLong 0.6
allocatorStrategyString 0.6
createDateTimestampCreate time0.6
lastOpDateTimestampLast modification time0.6
stateString 0.6
vmNicsListFor details, see vmNics0.6
allVolumesListFor details, see allVolumes0.6
vmCdRomsListFor details, see vmCdRoms0.6

vmNics

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource3.17.13
vmInstanceUuidStringVirtual Machine UUID3.17.13
l3NetworkUuidStringDistributed Port Group UUID3.17.13
ipString 3.17.13
macString 3.17.13
hypervisorTypeString 3.17.13
netmaskString 3.17.13
gatewayString 3.17.13
metaDataString 3.17.13
ipVersionInteger 3.17.13
driverTypeString 3.17.13
internalNameString 3.17.13
deviceIdInteger 3.17.13
typeString 3.17.13
stateStringNIC state3.17.13
createDateTimestampCreate time3.17.13
lastOpDateTimestampLast modification time3.17.13
usedIpsListFor details, see usedIps3.17.13

usedIps

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource4.10.0
ipRangeUuidStringIP Range UUID4.10.0
l3NetworkUuidStringDistributed Port Group UUID4.10.0
ipVersionIntegerIP protocol number4.10.0
ipStringIP address4.10.0
netmaskStringSubnet mask4.10.0
gatewayStringGateway address4.10.0
usedForStringAllocation reason4.10.0
ipInLonglongLong stored IP address, only valid for ipv44.10.0
vmNicUuidStringVirtual Machine NIC UUID4.10.0
createDateTimestampCreate time4.10.0
lastOpDateTimestampLast modification time4.10.0

allVolumes

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource3.17.13
nameStringResource name3.17.13
descriptionStringDetailed description of the resource3.17.13
primaryStorageUuidStringData Storage UUID3.17.13
vmInstanceUuidStringVirtual Machine UUID3.17.13
diskOfferingUuidStringDisk Offering UUID3.17.13
rootImageUuidString 3.17.13
installPathString 3.17.13
typeString 3.17.13
formatString 3.17.13
sizeLong 3.17.13
actualSizeLong 3.17.13
deviceIdInteger 3.17.13
stateString 3.17.13
statusString 3.17.13
createDateTimestampCreate time3.17.13
lastOpDateTimestampLast modification time3.17.13
isShareableBoolean 3.17.13
volumeQosString 3.17.13
lastDetachDateTimestamp 3.17.13
lastVmInstanceUuidString 3.17.13

vmCdRoms

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource3.17.13
vmInstanceUuidStringVirtual Machine UUID3.17.13
deviceIdInteger 3.17.13
isoUuidString 3.17.13
isoInstallPathString 3.17.13
nameStringResource name3.17.13
descriptionStringDetailed description of the resource3.17.13
createDateTimestampCreate time3.17.13
lastOpDateTimestampLast modification time3.17.13

SDK Examples

Java SDK

CreateFaultToleranceVmInstanceAction action = new CreateFaultToleranceVmInstanceAction();
action.name = "vm1";
action.instanceOfferingUuid = "e7f7da783e573c7ebc3859e2d16552f3";
action.imageUuid = "de06f83941db39ad805e51631319934a";
action.l3NetworkUuids = asList("54f599b8cc84319e926c2a87a9aa69f3");
action.dataDiskOfferingUuids = asList("515287814adc30b0ac62ca9404850d3a","eb016f64ac4234fbbeaea24cd35ac3c4");
action.clusterUuid = "ee25403505453f4b91fc090dd7ca0a98";
action.description = "this is a vm";
action.strategy = "InstantStart";
action.type = "FaultToleranceVmGroup";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateFaultToleranceVmInstanceAction.Result res = action.call();

Python SDK

action = CreateFaultToleranceVmInstanceAction()
action.name = "vm1"
action.instanceOfferingUuid = "e7f7da783e573c7ebc3859e2d16552f3"
action.imageUuid = "de06f83941db39ad805e51631319934a"
action.l3NetworkUuids = [54f599b8cc84319e926c2a87a9aa69f3]
action.dataDiskOfferingUuids = [515287814adc30b0ac62ca9404850d3a, eb016f64ac4234fbbeaea24cd35ac3c4]
action.clusterUuid = "ee25403505453f4b91fc090dd7ca0a98"
action.description = "this is a vm"
action.strategy = "InstantStart"
action.type = "FaultToleranceVmGroup"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()