Skip to content
Pavel Zinin edited this page Oct 15, 2018 · 4 revisions

VMList

Here, time data type corresponds to ISO 8601 string time format

Opens a websocket and puts virtual machine list and updates in it

Format

Property Value
path /vmlist
arguments None
authentication user, admin

This methods puts initial JSON entries for every VM (initial format) and a JSON entry for every change (change format)

Initial entry format

{
  "uuid": "1547839e-3f52-48d0-ae71-a5110bbfd64a",
  "power_state": "Running",
  "type": "initial",
  "ref": "OpaqueRef:e2311915-7c8f-8bde-ea44-915933329768",
  "access": [
    {
      "userid": "users/3",
      "access": [
        "all"
      ]
    }
  ],
  "networks": {
  "0": {
    "MAC": "92:4c:8c:8c:bf:46",
    "VIF": "OpaqueRef:a6ba59e5-0320-b12c-4df7-bcc39e1c3854",
    "attached": false,
    "ip": "10.10.10.20",
    "ipv6": "fe80::904c:8cff:fe8c:bf46",
    "network": "920b8d47-9945-63d8-4b04-ad06c65d950a",
    "status": ""
  }
},
  "name_label": "Create from Utility",
  "start_time": "2018-09-24T14:58:13+00:00",
   "domain_type": "hvm",
    "guest_metrics": "OpaqueRef:f5836387-423f-d25e-2680-a98b4c728726",
    "install_time": "2018-09-18T13:49:13+00:00",
    "memory_actual": "536862720",
    "metrics": "OpaqueRef:53dd2c16-b19c-42e6-a6c9-25d1c5775574",
    "PV_drivers_up_to_date": true,
    "PV_drivers_version": {
      "build": "0",
      "major": "6",
      "micro": "80",
      "minor": "6"
    },
    "os_version": {
      "distro": "ubuntu",
      "major": "18",
      "minor": "04",
      "name": "Ubuntu 18.04.1 LTS",
      "uname": "4.15.0-34-generic"
    },
       "disks": {
      "OpaqueRef:87c4035d-bc22-9205-edb4-bd1472fd6dad": {
        "VDI": "0830f5de-d36e-4184-acea-4c40cb14498f",
        "attached": true,
        "bootable": true,
        "device": "xvda",
        "mode": "RW",
        "type": "Disk"
      },
    }
}

Initial fields description

type is either initial or add

uuid : string

UNIQUE virtual machine ID. Does not change from session to session

ref : string

UNIQUE virtual machine ID. Contrary to uuid, it may change from session to session. Currently not used by API methods

name_label : string

Human-readable virtual machine name

network : dictionary of <string, NetworkObject>

Dictionary of Network objects, connected to this machine. Counter numbers (starting with 0, as string) serve as keys

NetworkObject

Field Type Description Required
MAC string Interface's MAC Address Yes
VIF string Interface's unique ID Yes
attached bool Interface's attach status Yes
network string Network's unique ID Yes
ip string Reported IP address No, only with guest tools
ipv6 string Reported IPv6 address No, only with guest tools
status string Error status No

disks : dictionary of <string, DiskObject>

Dictionary of Network objects, connected to this machine. Device IDs serve as keys

DiskObject

Field Type Description
attached bool Attach status
bootable bool Is device bootable
mode string RO or RW Read/write mode
type string CD or Disk Device type: Compact disc or hard disk
device string Device name: For unix OSes it's how the device is named in /dev

access : array of AccessObjects

Array of objects with the following fields:

AccessObject

Field Type Description
userid string unique user id. Begins with user or group depending on account type
access array Array of access rights

domain_type: string

Virtualization type: pv (Paravirtualized) or hvm (Hardware-assisted virtualization)

guest_metrics: starting

Guest agent metrics' unique ID

install_tine: time

Installation time

memory_actual: int

Actual RAM memory usage, in bytes

memory_static_min, memory_static_max, memory_dynamic_min, memory_dynamic_max : int

Minimum/maximum memory usage allowed, in bytes. static fields are hard restrictions whereas dynamic are soft restrictions

VCPUs_at_startup: int

Number of virtual CPUs available at VM start

VCPUs_max: int

Hard limit of maximum number of VCPUs for this machine

metrics: string

Performance metrics' unique ID

start_time: time

Time when the machine was turned on

power_state : string

The machine's power state: Halted, Running or Suspended

os_version: OSVersion

This field is not present when no OS information is available Contains an object representing the machine's OS version, as follows:

Field Description
distro Linux distribution short name, for example ubuntu
major Major version number, for example 18
minor Minor version name, for example 04
name Full OS name, for example Ubuntu 18.04.1 LTS
uname Kernel version, for example 4.15.0-34-generic

PV_drivers_up_to_date: bool

This entry is present if a VM has guest tools installed. If the tools are up to date, this is True

PV_drivers_version: object

Guest tools version: contains an object with major, minor, micro and build version numbers. Only present if Guest tools are installed.

Change entry format

This example represents a moment after a machine is turned off

{
  "new_val": {
    "PV_drivers_up_to_date": true,
    "PV_drivers_version": {
      "build": "0",
      "major": "6",
      "micro": "80",
      "minor": "6"
    },
    "access": [
      {
        "access": [
          "all"
        ],
        "userid": "users/root"
      }
    ],
    "disks": {
      "OpaqueRef:87c4035d-bc22-9205-edb4-bd1472fd6dad": {
        "VDI": "0830f5de-d36e-4184-acea-4c40cb14498f",
        "attached": true,
        "bootable": true,
        "device": "xvda",
        "mode": "RW",
        "type": "Disk"
      },
  "new_val": {
    "PV_drivers_up_to_date": true,
    "PV_drivers_version": {
      "build": "0",
      "major": "6",
      "micro": "80",
      "minor": "6"
    },
    "access": [
      {
        "access": [
          "all"
        ],
        "userid": "users/root"
      }
    ],
    "disks": {
      "OpaqueRef:87c4035d-bc22-9205-edb4-bd1472fd6dad": {
        "VDI": "0830f5de-d36e-4184-acea-4c40cb14498f",
        "attached": true,
        "bootable": true,
        "device": "xvda",
        "mode": "RW",
        "type": "Disk"
      },
      "OpaqueRef:a86df685-f357-6dc6-aa36-07798b166421": {
        "VDI": "db199908-f133-4c7f-b06c-10ac2784ad5d",
        "attached": true,
        "bootable": true,
        "device": "xvdb",
        "mode": "RO",
        "type": "CD"
      }
    },
    "domain_type": "hvm",
    "guest_metrics": "OpaqueRef:f5836387-423f-d25e-2680-a98b4c728726",
    "install_time": "2018-09-18T13:49:13+00:00",
    "memory_actual": "536862720",
    "metrics": "OpaqueRef:53dd2c16-b19c-42e6-a6c9-25d1c5775574",
    "name_label": "Test VM",
    "networks": {
      "0": {
        "MAC": "92:4c:8c:8c:bf:46",
        "VIF": "OpaqueRef:a6ba59e5-0320-b12c-4df7-bcc39e1c3854",
        "attached": true,
        "network": "920b8d47-9945-63d8-4b04-ad06c65d950a",
        "status": ""
      }
    },
    "os_version": {
      "distro": "ubuntu",
      "major": "18",
      "minor": "04",
      "name": "Ubuntu 18.04.1 LTS",
      "uname": "4.15.0-34-generic"
    },
    "power_state": "Halted",
    "ref": "OpaqueRef:b68d9b9c-9932-dd93-6c76-ae2026d686bb",
    "start_time": "2018-09-24T14:58:13+00:00",
    "uuid": "2e2f14ce-77bb-2a25-00a2-d66816321561"
  },
  "old_val": {
    "PV_drivers_up_to_date": true,
    "PV_drivers_version": {
      "build": "0",
      "major": "6",
      "micro": "80",
      "minor": "6"
    },
    "access": [
      {
        "access": [
          "all"
        ],
        "userid": "users/root"
      }
    ],
    "disks": {
      "OpaqueRef:87c4035d-bc22-9205-edb4-bd1472fd6dad": {
        "VDI": "0830f5de-d36e-4184-acea-4c40cb14498f",
        "attached": true,
        "bootable": true,
        "device": "xvda",
        "mode": "RW",
        "type": "Disk"
      },
      "OpaqueRef:a86df685-f357-6dc6-aa36-07798b166421": {
        "VDI": "db199908-f133-4c7f-b06c-10ac2784ad5d",
        "attached": true,
        "bootable": true,
        "device": "xvdb",
        "mode": "RO",
        "type": "CD"
      }
    },
    "domain_type": "hvm",
    "guest_metrics": "OpaqueRef:f5836387-423f-d25e-2680-a98b4c728726",
    "install_time": "2018-09-18T13:49:13+00:00",
    "memory_actual": "536862720",
    "metrics": "OpaqueRef:53dd2c16-b19c-42e6-a6c9-25d1c5775574",
    "name_label": "Test VM",
    "networks": {
      "0": {
        "MAC": "92:4c:8c:8c:bf:46",
        "VIF": "OpaqueRef:a6ba59e5-0320-b12c-4df7-bcc39e1c3854",
        "attached": true,
        "network": "920b8d47-9945-63d8-4b04-ad06c65d950a",
        "status": ""
      }
    },
    "os_version": {
      "distro": "ubuntu",
      "major": "18",
      "minor": "04",
      "name": "Ubuntu 18.04.1 LTS",
      "uname": "4.15.0-34-generic"
    },
    "power_state": "Running",
    "ref": "OpaqueRef:b68d9b9c-9932-dd93-6c76-ae2026d686bb",
    "start_time": "2018-09-24T14:58:13+00:00",
    "uuid": "2e2f14ce-77bb-2a25-00a2-d66816321561"
  },
  "type": "change"
}
      "OpaqueRef:a86df685-f357-6dc6-aa36-07798b166421": {
        "VDI": "db199908-f133-4c7f-b06c-10ac2784ad5d",
        "attached": true,
        "bootable": true,
        "device": "xvdb",
        "mode": "RO",
        "type": "CD"
      }
    },
    "domain_type": "hvm",
    "guest_metrics": "OpaqueRef:f5836387-423f-d25e-2680-a98b4c728726",
    "install_time": "2018-09-18T13:49:13+00:00",
    "memory_actual": "536862720",
    "metrics": "OpaqueRef:53dd2c16-b19c-42e6-a6c9-25d1c5775574",
    "name_label": "Test VM",
    "networks": {
      "0": {
        "MAC": "92:4c:8c:8c:bf:46",
        "VIF": "OpaqueRef:a6ba59e5-0320-b12c-4df7-bcc39e1c3854",
        "attached": true,
        "network": "920b8d47-9945-63d8-4b04-ad06c65d950a",
        "status": ""
      }
    },
    "os_version": {
      "distro": "ubuntu",
      "major": "18",
      "minor": "04",
      "name": "Ubuntu 18.04.1 LTS",
      "uname": "4.15.0-34-generic"
    },
    "power_state": "Halted",
    "ref": "OpaqueRef:b68d9b9c-9932-dd93-6c76-ae2026d686bb",
    "start_time": "2018-09-24T14:58:13+00:00",
    "uuid": "2e2f14ce-77bb-2a25-00a2-d66816321561"
  },
  "old_val": {
    "PV_drivers_up_to_date": true,
    "PV_drivers_version": {
      "build": "0",
      "major": "6",
      "micro": "80",
      "minor": "6"
    },
    "access": [
      {
        "access": [
          "all"
        ],
        "userid": "users/root"
      }
    ],
    "disks": {
      "OpaqueRef:87c4035d-bc22-9205-edb4-bd1472fd6dad": {
        "VDI": "0830f5de-d36e-4184-acea-4c40cb14498f",
        "attached": true,
        "bootable": true,
        "device": "xvda",
        "mode": "RW",
        "type": "Disk"
      },
      "OpaqueRef:a86df685-f357-6dc6-aa36-07798b166421": {
        "VDI": "db199908-f133-4c7f-b06c-10ac2784ad5d",
        "attached": true,
        "bootable": true,
        "device": "xvdb",
        "mode": "RO",
        "type": "CD"
      }
    },
    "domain_type": "hvm",
    "guest_metrics": "OpaqueRef:f5836387-423f-d25e-2680-a98b4c728726",
    "install_time": "2018-09-18T13:49:13+00:00",
    "memory_actual": "536862720",
    "metrics": "OpaqueRef:53dd2c16-b19c-42e6-a6c9-25d1c5775574",
    "name_label": "Test VM",
    "networks": {
      "0": {
        "MAC": "92:4c:8c:8c:bf:46",
        "VIF": "OpaqueRef:a6ba59e5-0320-b12c-4df7-bcc39e1c3854",
        "attached": true,
        "network": "920b8d47-9945-63d8-4b04-ad06c65d950a",
        "status": ""
      }
    },
    "os_version": {
      "distro": "ubuntu",
      "major": "18",
      "minor": "04",
      "name": "Ubuntu 18.04.1 LTS",
      "uname": "4.15.0-34-generic"
    },
    "power_state": "Running",
    "ref": "OpaqueRef:b68d9b9c-9932-dd93-6c76-ae2026d686bb",
    "start_time": "2018-09-24T14:58:13+00:00",
    "uuid": "2e2f14ce-77bb-2a25-00a2-d66816321561"
  },
  "type": "change"
}

Change fields description

type is either change or remove

Field Type Description
old_val initial-like entry Old value
new_val initial-like entry New value. Not present if type is remove

Type field

Type field is present in every entry and named type. Values:

  • change - this entry has change format and the object has been changed
  • remove - this entry has change format and the object has been removed. Only old_val is present
  • initial - this entry has initial format and the object has been there before the socket opened
  • add - this entry has initial format and the object has just been added
Clone this wiki locally