...
The Abiquo kinton schema contains triggers for accounting integration. The triggers run stored procedures in the kinton_accounting schema to automatically capture data in if/then/when scenarios.
Accounting of VMs:
...
...
Resource | Triggers |
---|
VMs | update_virtualmachine_update_stats AFTER UPDATE ON virtualmachine |
...
...
...
create_rasd_management_update_stats AFTER INSERT ON rasd_management
delete_rasd_management_update_stats AFTER DELETE ON rasd_management |
...
...
...
...
update_ip_pool_management_update_stats AFTER UPDATE ON ip_pool_management
update_rasd_management_update_stats AFTER UPDATE ON rasd_management |
...
...
...
...
create_vlan_network_update_stats AFTER INSERT ON vlan_network
delete_vlan_network_update_stats AFTER DELETE ON vlan_network |
...
...
...
...
rack_update AFTER UPDATE ON rack |
Accounting of Physical Machine:
...
...
Physical Machines | physicalmachine_create AFTER INSERT ON physicalmachine
physicalmachine_delete AFTER DELETE ON physicalmachine
physicalmachine_update AFTER UPDATE ON physicalmachine |
Accounting of Virtual Machine Templates:
...
...
VM templates | virtualimage_create AFTER INSERT ON virtualimage |
...
virtualimage_delete AFTER DELETE ON virtualimage |
...
virtualimage_update AFTER UPDATE ON virtualimage |
...
virtualimageconversion_update AFTER UPDATE ON virtualimage_conversion |
Stored procedures for event accounting
...
Div |
---|
|
Table accounting_event_vm Field Name | Field Type | Description |
---|
idVMAccountingEvent | BIGINT | ID event unique | idVM | INTEGER | ID of virtual machine owning the resource | idEnterprise | INTEGER | ID of Enterprise resource owner | idVirtualDataCenter | INTEGER | ID of Virtual Datacenter facility owner | idVirtualApp | INTEGER | ID Virtual App resource owner | cpu | INTEGER | 'cores' units | ram | INTEGER | Memory, in megabytes (MB) | hd | BIGINT | Local storage, in bytes (B) | startTime | TIMESTAMP | When a resource was created | stopTime | TIMESTAMP | When a resources was destroyed | consolidated | TINYINT | Flag for processed or not | costCode | TINYINT | Cost code assigned for pricing purposes | hypervisorType | VARCHAR | The type of hypervisor hosting the virtual machine | idDataCenter | INTEGER | ID of Datacenter | VirtualMachine-haHosted | INTEGER | Flag for hosted on HA-enabled PM or not |
Table accounting_event_pmThis table stores details of reserved physical servers - one row for each reserved server. Field Name | Field Type | Description | idPMAccountingEvent | BIGINT | Unique column identifier for the accounting event | idPhysicalMachine | INT | ID of the physical machine, as defined in the kinton.physicalmachine table. NOTE: Use the kinton_accounting ABQ_PM_ID_TO_NAME(id) function to obtain the machine name associated with the ID | idEnterprise | INT | ID of the ENTERPRISE, as defined in the kinton.enterprise table. NOTE: Use the kinton_accounting ABQ_ENT_ID_TO_NAME(id) function to obtain the machine name associated with the ID | cpu | INT | The number of physical CPUs in the machine | ram | INT | The physical machine’s RAM (in MB) | startTime | TIMESTAMP | The time at which the machine reservation started | stopTime | TIMESTAMP | The time at which the reservation finished. This value is NULL if the reservation is still active | idDataCenter | INT | ID of the physical datacenter, as defined in the kinton.datacenter table. NOTE: Use the kinton_accounting ABQ_DC_ID_TO_NAME(id) function to obtain the datacenter name associated with the ID | consolidated | TINYINT | Indicates whether this row has been consoliated with other rows. Currently this value is always 0 | version_c | INT | Software controlled data version | Table accounting_event_repositoryThis table contains details of the repository usage. There is one row for each VM Template and Instance stored in the repository. Persistent VM templates are not included in this table, because they are stored as external volumes and charged separately. Warning |
---|
title | Accounting of Conversions was deprecated in v3.4 |
---|
| As of v3.4, Abiquo does not account disk conversions of VM templates or persistent VM templates. |
Field Name | Field Type | Description | idRepoAccountingEvent | BIGINT | Unique column identifier for the accounting event | idImage | INT | ID of the repository image, as defined in the kinton.virtualimage table. NOTE: Use the kinton_accounting ABQ_IMG_ID_TO_NAME(id) function to obtain the image name associated with the ID | idEnterprise | INT | ID of the ENTERPRISE, as defined in the kinton.enterprise table. NOTE: Use the kinton_accounting ABQ_ENT_ID_TO_NAME(id) function to obtain the machine name associated with the ID | idImageTypeName | INT | The ID of the image type name in the generic accounting name table, use the kinton_accounting ABQ_OBJECT_ID_TO_NAME (id) function to retrieve the actual type name. Names are one of: INSTANCE, TEMPLATE, INSTANCE-CONVERSION, TEMPLATE-CONVERSION | idImageFormatName | INT | The ID of the image format name in the generic accounting name table, use the kinton_accounting ABQ_OBJECT_ID_TO_NAME (id) function to retrieve the actual format name. Names are: VMDK_FLAT, RAW, etc. see the wiki API reference for further details | imageSize | BIGINT | Physical Size of the repository image, in bytes | idRepository | INT | The ID of the image repository as defined in the kinton.repository table | idRepositoryName | | INT | The ID of the repository name in the generic accounting name table, use the kinton_accounting ABQ_OBJECT_ID_TO_NAME (id) function to retrieve the actual repository name. THIS FIELD WAS DEPRECATED IN ABIQUO 3.4 | startTime | TIMESTAMP | The time at which the image was created in the repository | stopTime | TIMESTAMP | The time at which the image was deleted from the repository. This value is NULL if the image still exists. | idDataCenter | INT | ID of the physical datacenter, as defined in the kinton.datacenter table. NOTE: Use the kinton_accounting ABQ_DC_ID_TO_NAME(id) function to obtain the datacenter name associated with the ID. | consolidated | TINYINT | Indicates whether this row has been consoliated with other rows. Currently this value is always 0. | version_c | INT | Software controlled data version. |
|
accounting_event_detail table
...
Div |
---|
class | verysmallcode widecode |
---|
|
Field Name | Field Type | Description |
---|
idVM | INTEGER | ID virtual machine owning the resource | idEnterprise | INTEGER | ID Enterprise resource owner | idVirtualDataCenter | INTEGER | ID Virtual Datacenter owner | idVirtualApp | INTEGER | ID Virtual App resource owner | enterpriseName | VARCHAR | Company Name resource owner | virtualDataCenter | VARCHAR | Virtual Datacenter name resource owner | virtualApp | VARCHAR | Virtual App Name resource owner | virtualmachine | VARCHAR | Virtual Machine Name resource owner | starttime | TIMESTAMP | Start of the time slice | endTime | TIMESTAMP | End of the time slice | idAccountingResourceType | TINYINT | Resource type posted: virtualmachine-vcpu, virtualmachine-vram, virtualmachine-vhd, ExternalStorage, IPAddress, VLAN, VirtualMachine-hypervisorType | resourceType | VARCHAR | Resource type (text) | resourceUnits | BIGINT | Resource units to account for | resourceName | VARCHAR | Resource Name to account for. A new resource type 'VirtualMachine-hypervisorType' is now recorded for each VM. The Hypervisor Type is recorded in this 'resourceName' column. | costCode | VARCHAR | Cost code of Virtual Image. Only valid when the idAccountingResourceType is 1 (virtualmachine-vcpu) | idStorageTier | INTEGER | Code associated with this storage resource's QoS/Tier level. Only valid for the 'External Storage' resource type |
|
Every hour, the status of each resource implemented in the system is recorded, which can generate a large number of rows. Abiquo recommends that the table is periodically purged of resource information which is no longer required.
...
The resources in the accounting_event_detail table are represented with a numerical value, as defined in the table below in the idAccountingResourceType column.
Parameter Name | idAccountingResourceType
| |
VirtualMachine-vcpu | 1 | |
VirtualMachine-vram | 2 | |
VirtualMachine-vhd | 3 | |
ExternalStorage | 4 | |
IPAddress | 5 | |
VLAN | 6 | |
VirtualMachine-hypervisorType | 7 | |
VirtualMachine-haHosted | 8 | |
ReservedPhysicalMachine-cpu | 9 | |
ReservedPhysicalMachine-ram | 10 | |
RepositoryStorage | 11 | |
VirtualMachine-antiAffinity | 12 | |
VirtualMachine-tierhd | 13 |
v3.8 |
Resource owners
Abiquo records resource ownership at the following levels:
...