Database Schema for Accounting 3.0

This page presents a simplified view of the database schema used by the acct daemon. It includes the tables relevant for third party accounting or statistics software developers.

Virtual Machines

  • TABLE: vms
  • PRIMARY KEY: id
Name SQL Type Description
id int(11) Unique DB identifier for this VM
uid int(11)
gid int(11) The id of the group
name text Name of the Virtual Machine
stime int(11) Start time, time the VM was created
etime int(11) End time, time the VM entered DONE state
mem int(11) Used by the VM as reported by the monitor system
cpu Float Used by the VM as reported by the monitor system
vcpu int(11) Virtual CPUs

Hosts

  • TABLE: hosts
  • PRIMARY KEY: id
Name SQL Type Description
id int(11) Unique Host Identifier
name varchar(256) Hostname of this host
im_mad varchar(128) Name of the information driver used to monitor this host
vm_mad varchar(128) Name of the driver needed for communication with the hypervisor present in this host
tm_mad varchar(128) Name of the driver needed for staging files to and from this host

Registers

It contains information of VM execution on a given host. During its life-cycle a VM can be executed on multiple hosts (e.g. because of a migration or a stop/resume operation).

  • TABLE: registers
  • PRIMARY KEY: (vm_id,seq)
  • FOREIGN KEY: vm_id ⇒ vms(id)
Name SQL Type Description
vm_id int(11) Corresponds with id identifier of vms
seq int(11) Sequence number, one VM can have more than one history. Sequence number 0 means first host
hostname text Hostname where the VM is running on
hid int(11) Host Id where the VM is running on
pstime int(11) Prolog start time. Time at which files were started being staged into the host prior the running of the VM
petime int(11) Prolog end time. Time at which files were finished being staged into the host prior the running of the VM
rstime int(11) Running start time. Time at which the VM actually was handed to the hypervisor of this host for execution
retime int(11) Running end time. Time at which the VM stop running at this host
estime int(11) Epilog start time. Time at which files were started being staged out of the host after the VM finished running
eetime int(11) Epilog end time. Time at which files were ended being staged out of the host after the VM finished running
reason int(11) Reason of the migration from this host. See table below

Specific reasons:

Value Name Description
0 NONE Normal termination in host
1 ERROR The VM was migrated because of an error
2 STOP_RESUME The VM was migrated because of a stop/resume request
3 USER The VM was migrated because of an explicit request
4 CANCEL The VM was migrated because of an explicit cancel

VM Deltas

Consumption for an interval (ptimestamp-timestamp)

  • TABLE: vm_deltas
  • PRIMARY KEY: (vm_id,timestamp)
  • FOREIGN KEY: vm_id ⇒ vms(id)
Name SQL Type Description
vm_id int(11) Corresponds with id identifier of vms
timestamp int(11) Timestamp for this interval
ptimestamp int(11) Previous timestamp
net_tx int(11) Consumption transmitted by the VM as reported by the monitor system from ptimestamp to timestamp
net_rx int(11) Received by the VM as reported by the monitor system ffrom ptimestamp to timestamp

VM Samples

The Virtual Machine statistics for a set of given timestamps. The number of rows of this table is limited by the configuration variable WINDOW_SIZE

  • TABLE: vm_samples
  • PRIMARY KEY: (vm_id,timestamp)
  • FOREIGN KEY: vm_id ⇒ vms(id)
Name SQL Type Description
vm_id int(11) Unique DB identifier for this VM
state int(11) Dispatch Manager (main) VM state, check table below
lcm_state int(11) Life Cycle Manager (ACTIVE sub-states) VM state, check table below
timestamp int(11) Timestamp for this sample
last_poll int(11) Last time the VM was polled
memory int(11) Used by the VM as reported by the monitor system
cpu int(11) Used by the VM as reported by the monitor system
net_tx int(11) Transmitted by the VM as reported by the monitor system
net_rx int(11) Received by the VM as reported by the monitor system

Possible values for state column:

Value Name
0 INIT
1 PENDING
2 HOLD
3 ACTIVE
4 STOPPED
5 SUSPENDED
6 DONE
7 FAILED

The lcm_state is a sub-state of the ACTIVE “main” state. Possible values for lcm_state column:

Value Name
0 LCM_INIT
1 PROLOG
2 BOOT
3 RUNNING
4 MIGRATE
5 SAVE_STOP
6 SAVE_SUSPEND
7 SAVE_MIGRATE
8 PROLOG_MIGRATE
9 PROLOG_RESUME
10 EPILOG_STOP
11 EPILOG
12 SHUTDOWN
13 CANCEL
14 FAILURE
15 DELETE
16 UNKNOWN

Host Samples

The Hosts statistics for a set of given timestamps. The number of rows of this table is limited by the configuration variable WINDOW_SIZE

  • TABLE: host_samples
  • PRIMARY KEY: (host_id,timestamp)
  • FOREIGN KEY: host_id ⇒ hosts(id)
Name SQL Type Description
host_id int(11) Unique Host Identifier
state int(11) Host state. See table below for details
timestamp int(11) Timestamp for this sample
last_poll int(11) Last time the Host was polled
disk_usage int(11) Allocated capacity as requested in VM templates
mem_usage int(11)
cpu_usage int(11)
max_disk int(11) Max capacity as returned by IM probes
max_mem int(11)
max_cpu int(11)
free_disk int(11) Free capacity as returned by IM probes
free_mem int(11)
free_cpu int(11)
used_disk int(11) Used capacity as returned by IM probes
used_mem int(11)
used_cpu int(11)
rvms int(11) Number of VMs running in the host

Possible values for state column:

Value Name Description
0 INIT Initial state for enabled hosts
1 MONITORING The host is being monitored
2 MONITORED The host has been successfully monitored
3 ERROR An error ocurrer while monitoring the host
4 DISABLED The host is disabled won't be monitored