Inventory
Properties
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 0.6 | ||
| name | The name. For more information, see Resource Property. | 0.6 | ||
| description | The description. For more information, see Resource Property. | Yes | 0.6 | |
| zoneUuid | The zone UUID. For more information, see Zone and Location. | Yes | 0.6 | |
| clusterUuid | The cluster UUID. For more information, see Cluster and Location. | Yes | 0.6 | |
| hostUuid | The UUID of the host on which the VM instance is running. For more information, see Host and Location. | Yes | 0.6 | |
| lastHostUuid | The UUID of the host on which the VM instance was running last time. For more information, see Host and Location. | Yes | 0.6 | |
| imageUuid | The UUID of the image from which the root volume of the VM instance is created. For more information, see Image. | 0.6 | ||
| instanceOfferingUuid | The instance offering UUID. For more information, see Instance Offering. | 0.6 | ||
| rootVolumeUuid | The root volume UUID of a VM instance. For more information, see Volume. | 0.6 | ||
| platform | 4.5.0 | |||
| architecture | The architecture type. | 4.5.0 | ||
| memorySize | 4.5.0 | |||
| defaultL3NetworkUuid | The default L3 network UUID of a VM instance. For more information, see L3 Network and Networks. | 0.6 | ||
| cpuSpeed | The speed of the virtual CPU (vCPU). For more information, see CPU Capacity. | 0.6 | ||
| cpuNum | The CPU count of the VM instance (the vCPU count). For more information, see CPU Capacity. | 0.6 | ||
| allocatorStrategy | The host allocator strategy. For more information, see Allocator Strategy. |
|
0.6 | |
| type | The VM instance type.
|
|
0.6 | |
| hypervisorType | The hypervisor type of the VM instance. For more information, see Host and Hypervisor Type. |
|
0.6 | |
| state | The VM instance state. For more information, see State. |
|
0.6 | |
| guestOsType | The operating system type. | 4.5.0 | ||
| createDate | The creation date. For more information, see Resource Property. | 0.6 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 0.6 |
Sample
{
"inventories": [
{
"allVolumes": [
{
"actualSize": 7995392,
"createDate": "Sep 29, 2022 5:33:11 PM",
"description": "Root volume for VM[uuid:d223cdf002924bd6a8d7eac1542e8387]",
"deviceId": 0,
"format": "qcow2",
"installPath": "/cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-5239c2c6714047d19e6db2d693a54d80/5239c2c6714047d19e6db2d693a54d80.qcow2",
"isShareable": false,
"lastOpDate": "Sep 29, 2022 5:33:11 PM",
"name": "ROOT-for-test",
"primaryStorageUuid": "e6493bf67dbf42e3867912d51252c289",
"rootImageUuid": "7e90e873a776485d8b65a6471e278330",
"size": 12682240,
"state": "Enabled",
"status": "Ready",
"type": "Root",
"uuid": "5239c2c6714047d19e6db2d693a54d80",
"vmInstanceUuid": "d223cdf002924bd6a8d7eac1542e8387"
}
],
"allocatorStrategy": "LeastVmPreferredHostAllocatorStrategy",
"architecture": "x86_64",
"clusterUuid": "26ddf9a8da2e41ee806c135e73979d00",
"cpuNum": 1,
"cpuSpeed": 0,
"createDate": "Sep 29, 2022 5:33:11 PM",
"defaultL3NetworkUuid": "0b0d6fc9a3574d77bdc66c3854b76305",
"description": "",
"guestOsType": "Linux",
"hostUuid": "6010271d3375483dbc922553fd232f86",
"hypervisorType": "KVM",
"imageUuid": "7e90e873a776485d8b65a6471e278330",
"instanceOfferingUuid": "a2013b25ee1b4f4abd2d9ea41162e56f",
"lastHostUuid": "6010271d3375483dbc922553fd232f86",
"lastOpDate": "Sep 29, 2022 5:33:13 PM",
"memorySize": 1073741824,
"name": "test",
"platform": "Linux",
"rootVolumeUuid": "5239c2c6714047d19e6db2d693a54d80",
"state": "Running",
"type": "UserVm",
"uuid": "d223cdf002924bd6a8d7eac1542e8387",
"vmCdRoms": [
{
"createDate": "Sep 29, 2022 5:33:11 PM",
"deviceId": 0,
"lastOpDate": "Sep 29, 2022 5:33:11 PM",
"name": "vm-d223cdf002924bd6a8d7eac1542e8387-cdRom",
"uuid": "cfe7b9a90fae4de688a688d9843a8e3b",
"vmInstanceUuid": "d223cdf002924bd6a8d7eac1542e8387"
}
],
"vmNics": [
{
"createDate": "Sep 29, 2022 5:33:11 PM",
"deviceId": 0,
"driverType": "virtio",
"gateway": "192.168.1.254",
"hypervisorType": "KVM",
"internalName": "vnic3.0",
"ip": "192.168.1.37",
"l3NetworkUuid": "0b0d6fc9a3574d77bdc66c3854b76305",
"lastOpDate": "Sep 29, 2022 5:33:11 PM",
"mac": "fa:1c:43:88:06:00",
"netmask": "255.255.0.0",
"type": "VNIC",
"usedIps": [
{
"createDate": "Sep 29, 2022 5:33:11 PM",
"gateway": "192.168.1.254",
"ip": "192.168.1.37",
"ipInLong": 3232235813,
"ipRangeUuid": "65b4d8c93f7d4f768ceb40e2b7a8a5eb",
"ipVersion": 4,
"l3NetworkUuid": "0b0d6fc9a3574d77bdc66c3854b76305",
"lastOpDate": "Sep 29, 2022 5:33:11 PM",
"netmask": "255.255.0.0",
"uuid": "d870314be51b349882352da7b8c10593",
"vmNicUuid": "08859ad18bf64b7fb1640f84839e7110"
}
],
"uuid": "08859ad18bf64b7fb1640f84839e7110",
"vmInstanceUuid": "d223cdf002924bd6a8d7eac1542e8387"
}
],
"zoneUuid": "398ba10f6bf54a9faf54a5edb6523b4d"
}
],
"success": true
}
Location
ZStack Cloud arranges compute resources through zones, clusters, and hosts. Therefore, the location of a VM instance can be identified according to the zoneUuid, clusterUuid, and hostUuid.
- When a VM instance is running, these UUIDs will be set to values that represent the current location of the VM instance.
- After a VM instance is stopped, hostUuid will be set to NULL, while zoneUuid and clusterUuid will remain unchanged.
- The lastHostUuid parameter is special, as it represents the host on which the VM instance was running last time.
- For newly created VM instances, lastHostUuid is set to NULL.
- Once a VM instance is stopped, lastHostUuid is set to the previous value of lastHostUuid.
Networks
A VM instance can have one or more L3 networks. The VM NIC Inventory section lists the IP address, netmask, MAC address, and other information about each L3 network.
- If a VM instance has more than one L3 network, you must set a default L3 network for this VM instance. The default L3 network provides default route, DNS, and hostname.
- If a VM instance has only one L3 network, this one automatically becomes the default L3 network.
The following example helps you understand what a default L3 network is. Suppose you have a user VM instance, as shown in Figure 3: User VM Instance.
As shown in the figure above, the VM instance has three L3 networks, all of which provide the Source Network Address Translation (SNAT) service. The default L3 network is 10.10.1.0/24.
CIDR: 10.10.1.0/24
Gateway: 10.10.1.1
DNS domain: web.tier.mycompany.com
Then, the routing table of the VM instance would be as follows:
default via 10.10.1.1 dev eth0
10.10.1.0/24 dev eth0 proto kernel scope link src 10.10.1.99
192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.10
172.16.0.0/24 dev eth2 proto kernel scope link src 172.16.0.55
As you can see, the default route points to 10.10.1.1, which is the gateway of the default L3 network. Meanwhile, the /etc/resolv.conf of the VM instance is as follows:
search web.tier.mycompany.com
nameserver 10.10.1.1
That is, the DNS domain is also from the default L3 network. In addition, the DNS name server is also set to the gateway 10.10.1.1 because the default L3 network provides a DNS server. Then, the Full Qualified Domain Name (FQDN) of the VM instance would be as follows:
vm2.web.tier.mycompany.com
FQDN is an extension of the DNS domain.
VM NIC Inventory
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 0.6 | ||
| vmInstanceUuid | The UUID of the parent VM instance. | 0.6 | ||
| l3NetworkUuid | The UUID of the L3 network to which the NIC is attached. | 0.6 | ||
| ip | The IP address. | 0.6 | ||
| mac | The MAC address. | 0.6 | ||
| hypervisorType | The hypervisor type. | 0.6 | ||
| netmask | The netmask. | 0.6 | ||
| gateway | The gateway. | 0.6 | ||
| metaData | The reserved field for internal use. | Yes | 0.6 | |
| deviceId | The device ID, which is an integer that indicates the order of NICs in the Ethernet device of the guest operating system. For example, 0 usually means eth0, and 1 usually means eth1. | 0.6 | ||
| usedIps | 0.6 | |||
| ipVersion | The IP version. | 0.6 |
Sample
{
"inventories": [
{
"createDate": "Sep 1, 2021 1:19:41 PM",
"deviceId": 0,
"driverType": "virtio",
"gateway": "10.34.0.1",
"hypervisorType": "KVM",
"internalName": "vnic7.0",
"ip": "10.34.0.199",
"l3NetworkUuid": "fa7ae74a3bc64532b672bcdac820c3c6",
"lastOpDate": "Sep 1, 2021 1:19:41 PM",
"mac": "fa:4e:29:d7:6e:00",
"netmask": "255.255.255.0",
"type": "VNIC",
"usedIps": [
{
"createDate": "Sep 1, 2021 1:19:41 PM",
"gateway": "10.34.0.1",
"ip": "10.34.0.199",
"ipInLong": 170000583,
"ipRangeUuid": "e04aea52053443de9bb7b82af8233303",
"ipVersion": 4,
"l3NetworkUuid": "fa7ae74a3bc64532b672bcdac820c3c6",
"lastOpDate": "Sep 1, 2021 1:19:41 PM",
"netmask": "255.255.255.0",
"uuid": "0a678264c3d338358a6c1615d808a8e4",
"vmNicUuid": "2e1d6026e32e402ca1d3db5119940f29"
}
],
"uuid": "2e1d6026e32e402ca1d3db5119940f29",
"vmInstanceUuid": "8049b3be8efb46c6aa143236d184c843"
}
],
"success": true
}
Volume
The allVolumes field is a list of volumes, including root volumes and data volumes. To find the root volumes, you can iterate the list by checking the volume type or by using the rootVolumeUuid field to match the volume UUID. A root volume will be always with the VM instance until the VM instance is destroyed.
Hypervisor Type
The hypervisor type of a VM instance might be inherited from the hypervisor type of an image or a host. This depends on how the VM instance is created.
For a VM instance that is created from RootVolumeTemplate:
Images already have operating system installed. Therefore, the VM instance will be created on a host with the same hypervisor type as the VM instance image. In this case, the hypervisor type of the VM instance is inherited from image.
For a VM instance that is created from ISO:
ISO is used to install the operating system on a blank root volume of the VM instance. Therefore, the VM instance might be created on a host of any hypervisor type. In this case, the hypervisor type of the VM instance is inherited from host.
State
A VM instance has the following states during its lifecycle:
Created
Indicates that the VM instance is just created as a record in the database and is not started on any host. This state only exists when you create a new VM instance.
Starting
Indicates that the VM instance is being started on a host.
Running
Indicates that the VM instance is running on a host.
Stopping
Indicates that the VM instance is being stopped on a host.
Stopped
Indicates that the VM instance is stopped and is not running on any host.
Rebooting
Indicates that the VM instance is being rebooted on the host where the VM instance was running last time.
Destroying
Indicates that the VM instance is being deleted.
Destroyed
Indicates that the VM instance is deleted
Migrating
Indicates that the VM instance is being migrated to the other host.
Expunging
Indicates that the database of the VM instance is being deleted.
Pausing
Indicates that the VM instance is being paused on a host.
Paused
Indicates that the VM instance is paused.
Resuming
Indicates that the VM instance is being resumed from the Paused state to the Running state.
VolumeMigrating
Indicates that the root volume of the VM instance is being migrated from local storage to the other host.
Unknown
Indicates that ZStack Cloud fails to detect the state due to reasons such as losing disconnection to the host.
The state transition diagram of a VM instance is shown in Figure 4: VM Instance State Transition Diagram.
ZStack Cloud uses VM Tracer to periodically track the state of VM instances. The default interval is 60 seconds. The state of a VM instance might be affected by factors outside ZStack Cloud.
- For example, the power outage of a host will cause all VM instances running on the host to stop running. Once VM Tracer detects a mismatch between the actual state of a VM instance and the recorded state in the database, VM Tracer will update the database to catch up with the actual state.
- If VM Tracer fails to check the state of a VM instance due to reasons such as disconnection between the management node and the host, VM Tracer will set the state of the VM instance to Unknown. Once VM Tracer successfully detects the VM instance state again, for example, after the management node is reconnected to the host, VM Tracer will update the VM instance to the actual state.
VM CD-ROM Inventory
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 3.3.0 | ||
| name | The name. For more information, see Resource Property. | 3.3.0 | ||
| description | The description. For more information, see Resource Property. | Yes | 3.3.0 | |
| deviceId | The device ID. | Yes | 3.3.0 | |
| isoInstallPath | The installation path on the backup storage. | 3.3.0 | ||
| isoUuid | The ISO UUID. | 3.3.0 | ||
| vmInstanceUuid | The VM instance UUID. | 3.3.0 | ||
| groupBy | Groups rows into subgroups based on values of columns or expressions. This field is equivalent to the Group By clause in MySQL, such as groupBy=type. | Yes | 3.3.0 | |
| createDate | The creation date. For more information, see Resource Property. | 3.3.0 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 3.3.0 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.3.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 3.3.0 |
Sample
{
"inventories": [
{
"createDate": "Jan 15, 2019 4:59:25 PM",
"deviceId": 0,
"lastOpDate": "Jan 15, 2019 4:59:25 PM",
"name": "vm-6e243d2edf8443a4968d3878a4fed2a6-cdRom",
"uuid": "29f6e8c277a94e57bd0b7c627bd65e85",
"vmInstanceUuid": "6e243d2edf8443a4968d3878a4fed2a6"
}
],
"success": true
}
VM Priority Configuration Inventory
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 3.7.0 | ||
| accountUuid | The account UUID. | 3.7.0 | ||
| cpuShares | 3.7.0 | |||
| level | The resource priority. | 3.7.0 | ||
| oomScoreAdj | 3.7.0 | |||
| groupBy | Groups rows into subgroups based on values of columns or expressions. This field is equivalent to the Group By clause in MySQL, such as groupBy=type. | Yes | 3.7.0 | |
| createDate | The creation date. For more information, see Resource Property. | 3.7.0 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 3.7.0 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.7.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 3.7.0 |
Sample
{
"inventories": [
{
"cpuShares": 512,
"createDate": "Oct 16, 2019 9:51:40 AM",
"lastOpDate": "Oct 16, 2019 9:51:40 AM",
"level": "Normal",
"oomScoreAdj": 0,
"uuid": "b29df0c34e874a1c83033a3cfe61f086"
},
{
"cpuShares": 1024,
"createDate": "Oct 16, 2019 9:51:40 AM",
"lastOpDate": "Oct 16, 2019 9:51:40 AM",
"level": "High",
"oomScoreAdj": -900,
"uuid": "c804903064f54e36b3a066be0cd24aef"
}
],
"success": true
}
GuestToolsState Inventory
| Name | Description | Optional | Valid Values | Starting Version |
|---|---|---|---|---|
| vmInstanceUuid | The VM instance UUID. | 4.6.21 | ||
| version | The VM GuestTools version. | 4.6.21 | ||
| platform | The VM OS platform type. | 4.6.21 | ||
| osType | The VM OS type. | 4.6.21 | ||
| qgaState | 4.6.21 | |||
| zwatchState | 4.6.21 | |||
| createDate | The creation date. For more information, see Resource Property. | 4.6.21 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 4.6.21 |
Sample
{
"inventories": [
{
"createDate": "Apr 12, 2023 1:10:34 PM",
"lastOpDate": "Apr 12, 2023 1:10:34 PM",
"osType": "ubuntu 18.04",
"platform": "Linux",
"qgaState": "NotInstalled",
"version": "4.6.21",
"vmInstanceUuid": "93d0afea996d40cc99b49c22960187ba",
"zwatchState": "Running"
}
],
"success": true
}
Directory Inventory
| Name | Description | Optional | Valid Values | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 5.3.20 | ||
| name | The resource name. | 5.3.20 | ||
| groupName | The group name. | 5.3.20 | ||
| parentUuid | The parent directory UUID. | 5.3.20 | ||
| rootDirectoryUuid | The root directory UUID. | 5.3.20 | ||
| zoneUuid | The zone UUID. | 5.3.20 | ||
| type | The directory type. | 5.3.20 | ||
| createDate | The creation time. | 5.3.20 | ||
| lastOpDate | The last operation time. | 5.3.20 |
Sample
{
"inventories": [],
"success": true
}
