318 lines
5.3 KiB
Markdown
318 lines
5.3 KiB
Markdown
# XO
|
|
|
|
This singleton contains the list of pools and various statistics.
|
|
|
|
```coffee
|
|
{
|
|
type: 'xo'
|
|
|
|
UUID: '00000000-0000-0000-0000-000000000000'
|
|
|
|
# UUIDs of all pools.
|
|
pools: [
|
|
...
|
|
]
|
|
|
|
# Number of physical CPUs.
|
|
$CPUs: 3
|
|
|
|
# Number of running VMs.
|
|
$running_VMs: 2
|
|
|
|
# Number of virtual CPUs.
|
|
$vCPUs: 4
|
|
|
|
# Total memory of all hosts.
|
|
$memory: {
|
|
size: 17179869184 # in bytes
|
|
usage: 4294967296 # in bytes
|
|
}
|
|
}
|
|
```
|
|
|
|
# Pool
|
|
|
|
```coffee
|
|
{
|
|
type: 'pool'
|
|
|
|
name_label: 'Main pool'
|
|
name_description: 'Production pool'
|
|
tags: ['tag 1', 'tag 2']
|
|
|
|
# UUIDs of shared SRs.
|
|
SRs: [
|
|
...
|
|
]
|
|
# UUID of the default SR for VDI creation.
|
|
default_SR: '094af72e-697c-45f4-be7e-2ab6e671017c'
|
|
|
|
# High availability.
|
|
HA_enabled: false
|
|
|
|
# UUIDs of all hosts.
|
|
hosts: [
|
|
...
|
|
]
|
|
# Master host: the host to discuss with.
|
|
master:'1a7500de-db29-4ba1-92cc-0339e3765018'
|
|
|
|
# Global VMS: VMs which are currently not running and which are not
|
|
# tied to a local storage.
|
|
VMs: [
|
|
...
|
|
]
|
|
|
|
# UUID of this pool.
|
|
UUID: '67a1e914-8d2e-4216-8b8c-a6d968f87431'
|
|
|
|
# UUIDs of the hosts which are currently running.
|
|
$running_hosts: [
|
|
...
|
|
]
|
|
|
|
# UUIDs of the VMs which are currently running.
|
|
$running_VMs: [
|
|
...
|
|
]
|
|
# UUIDs of all the VMs.
|
|
$VMs: [
|
|
...
|
|
]
|
|
}
|
|
```
|
|
|
|
# Host
|
|
|
|
```coffee
|
|
{
|
|
type: 'host'
|
|
|
|
name_label: 'Atlas'
|
|
name_description: 'Main production host'
|
|
tags: ['tag 1', 'tag 2']
|
|
|
|
# IP address used to control the host.
|
|
address: '192.168.1.56'
|
|
|
|
# UUID of the VM which is the domain controller.
|
|
controller: '58a5b75b-531f-4314-a5d3-acabbd56780a'
|
|
|
|
# Physical CPUs.
|
|
CPUs: [
|
|
{
|
|
usage: 14 # in percentage
|
|
}
|
|
]
|
|
|
|
# Whether or not this host is permitted to run VMs.
|
|
enabled: true
|
|
|
|
# System name of this machine.
|
|
hostname: 'web-1'
|
|
|
|
# iSCSI qualified name.
|
|
iSCSI_name: 'iqn.1992-01.com.example:storage:diskarrays-sn-a8675309'
|
|
|
|
# Information regarding the RAM.
|
|
memory: {
|
|
size: 17179869184 # in bytes
|
|
usage: 4294967296 # in bytes
|
|
}
|
|
|
|
# Power state of the host, either `Running` or `Halted`.
|
|
power_state: 'Running'
|
|
|
|
# UUIDs of SRs local to this host.
|
|
SRs: [
|
|
...
|
|
]
|
|
|
|
# UUIDs of VMs on this host.
|
|
VMs: [
|
|
...
|
|
]
|
|
|
|
# UUID of this host.
|
|
UUID: 'a272be75-cde7-413e-9d80-55e62a0b01f5'
|
|
|
|
# UUIDs of PBDs related to this host.
|
|
$PBDs: [
|
|
...
|
|
]
|
|
|
|
# UUID of the pool this host is in.
|
|
$pool: '67a1e914-8d2e-4216-8b8c-a6d968f87431'
|
|
|
|
# UUIDs of VMs currently running on this host.
|
|
$running_VMs: [
|
|
...
|
|
]
|
|
|
|
# Virtual CPUs of all the VMs on this host.
|
|
$vCPUs: [
|
|
...
|
|
]
|
|
}
|
|
```
|
|
|
|
# Virtual machine
|
|
|
|
TODO: Parent VM vs Parent (pool/host).
|
|
|
|
```coffee
|
|
{
|
|
type: 'VM'
|
|
|
|
name_label: 'Web'
|
|
name_description: 'Web server with Apache 2'
|
|
tags: ['tag 1', 'tag 2']
|
|
|
|
# Address (@todo replace with VIFs).
|
|
address: '192.168.1.24'
|
|
|
|
# Information regarding the RAM.
|
|
memory: {
|
|
size: 4294967296 # in bytes
|
|
usage: 3826815860 # in bytes
|
|
}
|
|
|
|
# Power state of the VM: `Running`, `Paused`, `Suspended` or `Halted`.
|
|
power_state: 'Running'
|
|
|
|
# CPUs of the VM.
|
|
CPUs: [
|
|
{
|
|
usage: 3 # in percentage
|
|
}
|
|
]
|
|
|
|
# UUID of this VM.
|
|
UUID: 'cd64f7d7-17d0-44de-87a9-b698147fb955'
|
|
|
|
# Average usage of this VM's CPUs.
|
|
$CPU_usage: 3 # in percentage.
|
|
|
|
# Pool or host which “contains” this VM.
|
|
$container: 'a272be75-cde7-413e-9d80-55e62a0b01f5'
|
|
|
|
# UUIDs of this VM's VBDs.
|
|
$VBDs: [
|
|
...
|
|
]
|
|
}
|
|
```
|
|
|
|
# Storage repository
|
|
|
|
```coffee
|
|
{
|
|
type: 'SR'
|
|
|
|
name_label: 'ZFS1'
|
|
name_description: 'Nexenta SAN Storage iSCSI'
|
|
tags: ['tag 1', 'tag 2']
|
|
|
|
# @todo Comment.
|
|
SR_type: 'LVM'
|
|
|
|
# Sum of the usage of this VDIs.
|
|
physical_usage: 835628837109 # in bytes
|
|
|
|
# Space allocated for VDIs.
|
|
usage: 923589767331 # in bytes
|
|
|
|
# Total space.
|
|
size: 2199023255552 # in bytes
|
|
|
|
# UUID of this SR.
|
|
UUID: '094af72e-697c-45f4-be7e-2ab6e671017c'
|
|
|
|
# UUIDs of VDIs contained in this SR.
|
|
VDIs: [
|
|
...
|
|
]
|
|
|
|
# Pool or host which “contains” this SR.
|
|
$container: 'a272be75-cde7-413e-9d80-55e62a0b01f5'
|
|
|
|
# UUIDs of PBDs (links to hosts) related to this SR.
|
|
$PBDs: [
|
|
...
|
|
]
|
|
}
|
|
```
|
|
|
|
# Physical block device
|
|
|
|
A PBD is a link between a host and a storage repository.
|
|
|
|
```coffee
|
|
{
|
|
type: 'PBD'
|
|
|
|
# Whether or not this link is up.
|
|
attached: true
|
|
|
|
# UUID of the host.
|
|
host: 'a272be75-cde7-413e-9d80-55e62a0b01f5'
|
|
|
|
# UUID of the SR.
|
|
SR: '094af72e-697c-45f4-be7e-2ab6e671017c'
|
|
|
|
# UUID of this PBD.
|
|
UUID: '094af72e-697c-45f4-be7e-2ab6e671017c'
|
|
}
|
|
```
|
|
|
|
# Virtual disk image
|
|
|
|
A VDI is linked to a SR and con be connected to a VM through
|
|
a VBD.
|
|
|
|
TODO:
|
|
- Determine whether we want to add a `tags` field.
|
|
|
|
```coffee
|
|
{
|
|
type: 'VDI'
|
|
|
|
name_label: 'Main pool'
|
|
name_description: 'Production pool'
|
|
|
|
# Space used (in bytes.)
|
|
usage: 327491256320
|
|
|
|
# Total space (in bytes).
|
|
size: 549755813888
|
|
|
|
# UUID of this VDI.
|
|
UUID: 'b335d99f-aaee-4346-bcd2-258f878e8886'
|
|
|
|
# UUID of the SR which contains this VDI.
|
|
$SR: '094af72e-697c-45f4-be7e-2ab6e671017c'
|
|
|
|
# UUID of the VBD or null if none.
|
|
$VBD: 'b48b506e-9bca-462c-9e53-fa3dcd48ac18'
|
|
}
|
|
```
|
|
|
|
# Virtual block device
|
|
|
|
A VBD is a link between a VM and a VDI.
|
|
|
|
```coffee
|
|
{
|
|
type: 'VBD'
|
|
|
|
# UUID of the VDI.
|
|
VDI: 'b335d99f-aaee-4346-bcd2-258f878e8886'
|
|
|
|
# UUID of the VM.
|
|
VM: '094af72e-697c-45f4-be7e-2ab6e671017c'
|
|
|
|
# UUID of this VBD.
|
|
UUID: '4da6c80b-5c03-4734-9966-a09fc69f64db'
|
|
}
|
|
```
|