VM Related Interfaces

Query Fault Tolerance Virtual Machine

GET/zstack/v1/vm-instances/fault-tolerance
GET/zstack/v1/vm-instances/fault-tolerance/{uuid}

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/fault-tolerance?q=uuid=c5ee0e70278431ea8395393399cb9b8e
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/fault-tolerance/e03a1bf3dd7c3626beb5885aa11fad96

Queryable Fields

Run the CLI command tool, enter QueryFaultToleranceVm and press Tab to view all queryable fields and resource names that can be queried across tables.

API Response

Response Example

{
  "inventories": [
    {
      "primaryVmInstanceUuid": "ff01ec80fd11327cba7519b66119d900",
      "status": "Protected",
      "uuid": "29143af975e13ecca23fe27cf41e17f2",
      "name": "Test-VM",
      "description": "Appliance VM",
      "zoneUuid": "f0e256b44d7f3d43ae1425447293fe56",
      "clusterUuid": "8e6eaa82530635ad9989a418291c1ab1",
      "imageUuid": "2f68491966cf31849a18bb05e3ca003a",
      "hostUuid": "9c41e82a18bb3c0a975e830f89991775",
      "lastHostUuid": "f26bf2d572d039c4b700e5eaa6096666",
      "instanceOfferingUuid": "be00bf01f4c93f23a412e199c6e834b3",
      "rootVolumeUuid": "a849787166773022ad1adfbbc9dec525",
      "platform": "Linux",
      "defaultL3NetworkUuid": "438062279ec7390ea33bd67bac0911f7",
      "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",
      "vmNics": [
        {
          "uuid": "be5f5b6c35bf3cadbfe054eb359b6ba3",
          "vmInstanceUuid": "29143af975e13ecca23fe27cf41e17f2",
          "usedIpUuid": "7244210bce0c3e5b991a69e105457ab9",
          "l3NetworkUuid": "438062279ec7390ea33bd67bac0911f7",
          "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,
          "state": "enable",
          "createDate": "Nov 14, 2017 2:20:57 PM",
          "lastOpDate": "Nov 14, 2017 2:20:57 PM"
        }
      ],
      "allVolumes": [
        {
          "uuid": "a849787166773022ad1adfbbc9dec525",
          "name": "Root-Volume-For-VM-29143af975e13ecca23fe27cf41e17f2",
          "primaryStorageUuid": "c6d8def978b03513b15411ac1e923606",
          "vmInstanceUuid": "29143af975e13ecca23fe27cf41e17f2",
          "diskOfferingUuid": "de1d61e08234314abe1f5e09c202fcb9",
          "rootImageUuid": "2f68491966cf31849a18bb05e3ca003a",
          "installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-a849787166773022ad1adfbbc9dec525/a849787166773022ad1adfbbc9dec525.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
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error3.9.0
inventoriesListFor details, see inventories3.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

inventories

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
rootVolumeUuidStringDisk 1 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 resource4.7.13
vmInstanceUuidStringVirtual Machine UUID4.7.13
l3NetworkUuidStringDistributed Port Group UUID4.7.13
ipString 4.7.13
macString 4.7.13
hypervisorTypeString 4.7.13
netmaskString 4.7.13
gatewayString 4.7.13
metaDataString 4.7.13
ipVersionInteger 4.7.13
driverTypeString 4.7.13
internalNameString 4.7.13
deviceIdInteger 4.7.13
typeString 4.7.13
stateStringNIC Status4.7.13
createDateTimestampCreate time4.7.13
lastOpDateTimestampLast modification time4.7.13
usedIpsListFor details, see usedIps4.7.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
ipVersionInteger 4.10.0
ipString 4.10.0
netmaskString 4.10.0
gatewayString 4.10.0
usedForString 4.10.0
ipInLonglong 4.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 resource4.7.13
nameStringResource name4.7.13
descriptionStringDetailed description of the resource4.7.13
primaryStorageUuidStringData Storage UUID4.7.13
vmInstanceUuidStringVirtual Machine UUID4.7.13
diskOfferingUuidStringDisk Offering UUID4.7.13
rootImageUuidString 4.7.13
installPathString 4.7.13
typeString 4.7.13
formatString 4.7.13
sizeLong 4.7.13
actualSizeLong 4.7.13
deviceIdInteger 4.7.13
stateString 4.7.13
statusString 4.7.13
createDateTimestampCreate time4.7.13
lastOpDateTimestampLast modification time4.7.13
isShareableBoolean 4.7.13
volumeQosString 4.7.13
lastDetachDateTimestamp 4.7.13
lastVmInstanceUuidString 4.7.13

vmCdRoms

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource4.7.13
vmInstanceUuidStringVirtual Machine UUID4.7.13
deviceIdInteger 4.7.13
isoUuidString 4.7.13
isoInstallPathString 4.7.13
nameStringResource name4.7.13
descriptionStringDetailed description of the resource4.7.13
createDateTimestampCreate time4.7.13
lastOpDateTimestampLast modification time4.7.13

SDK Examples

Java SDK

QueryFaultToleranceVmAction action = new QueryFaultToleranceVmAction();
action.conditions = asList("uuid=b6e4e92b187b3e1a979d1eeb04100c09");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryFaultToleranceVmAction.Result res = action.call();

Python SDK

QueryFaultToleranceVmAction action = QueryFaultToleranceVmAction()
action.conditions = ["uuid=b4d511cd48ae33ffb4964ffee8c721be"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryFaultToleranceVmAction.Result res = action.call()