Abiquo Documentation Cookies Policy

Our Documentation website uses cookies to improve your experience. Please visit our Cookie Policy page for more information about cookies and how we use them.


Documentation

Skip to end of metadata
Go to start of metadata

Abiquo accounting consistency check

Abiquo accounting consistency check is a set of mysql queries performed by a bash script that highlights any possible inconsistency between deployed/used resources and accounted data.
The script just perform SELECT queries, therefore is safe to run this script in production environments.
It might be interesting to run the accounting consistency check script periodically in a cron job and notify to Abiquo support team through a Zendesk ticket any inconsistency reported.
The script returns 0 if there aren't inconsistencies or 1 if inconsistencies are found.

Request a copy of the script through a ticket in Abiquo Zendesk portal.

Versions

Abiquo accounting consistency check has been extensively tested in Abiquo 2.6 and Abiquo 3.x versions, but it should work also for outdated older Abiquo 2.3 version.

Disclaimer

Even if the script has been tested extensively it may show false positives in certain circumstances.
Please, if the script report inconsistencies, let Abiquo support know before perform any change to the database without confirmation.

Requirements

accounting_check.sh requires mysql client tools installed and at least read/select access to Abiquo kinton and kinton_accounting databases.

How to run accounting_check.sh

accounting_check.sh requires Abiquo version parameter to run.
These are all the options you can specify:

Script parameters
  -u : mysql user ( optional | default value: root )
  -p : mysql user password ( optional | default value no password )
  -s : mysql server address ( optional | default value: 127.0.0.1 )
  -d : output log level ( optional | values: 0/1 | default value: 1 )
  -v : Abiquo version ( required | values: 2.3/2.6/3.1 )
  -h : Help . Shows this message

Run execution sample and  output

Execution command
 ./accounting_check.sh -v 3.1 -s 10.60.13.32 -u root -p trivial
Output sample
\e[00;34mDEBUG:\e[00m Checking consistency on table accounting_event_vm...
\e[00;34mDEBUG:\e[00m    -> Check if all accounted virtual machines are deployed
\e[00;34mDEBUG:\e[00m     * All accounted virtual machines are deployed correctly
\e[00;34mDEBUG:\e[00m    -> Check if all deployed virtual machines are accounted
\e[00;34mDEBUG:\e[00m      * All deployed virtual machines are being accounted
\e[00;34mDEBUG:\e[00m    -> Check if any duplicated entry on accounting_event_vm
\e[00;34mDEBUG:\e[00m     * No duplicated entries found
\e[00;34mDEBUG:\e[00m    -> Check accounting units consistency
\e[00;34mDEBUG:\e[00m     * All accounted resource units are consistent
\e[00;34mDEBUG:\e[00m Checking consistency on table accounting_event_storage...
\e[00;34mDEBUG:\e[00m    -> Check if all accounted volumes are deployed
\e[00;34mDEBUG:\e[00m     * All accounted volumes are deployed correctly
\e[00;34mDEBUG:\e[00m    -> Check if all deployed volumes are accounted
\e[00;34mDEBUG:\e[00m      * All volumes are being accounted
\e[00;34mDEBUG:\e[00m    -> Check if any duplicated entry on accounting_event_storage
\e[00;34mDEBUG:\e[00m     * No duplicated entries found
\e[00;34mDEBUG:\e[00m    -> Check accounting units consistency
\e[00;34mDEBUG:\e[00m     * All accounted resource units are consistent
\e[00;34mDEBUG:\e[00m Checking consistency on table accounting_event_vlan...
\e[00;34mDEBUG:\e[00m    -> Check if all accounted vlans exists
\e[00;34mDEBUG:\e[00m     * All accounted vlans exists
\e[00;34mDEBUG:\e[00m    -> Check if all deployed vlans are accounted
\e[00;34mDEBUG:\e[00m      * All deployed vlans are being accounted
\e[00;34mDEBUG:\e[00m Checking consistency on table accounting_event_ips...
\e[00;34mDEBUG:\e[00m    -> Check if all public ips are accounted
\e[00;34mDEBUG:\e[00m     * All used IPs are being accounted
\e[00;34mDEBUG:\e[00m    -> Check if not used public ips are accounted
\e[00;34mDEBUG:\e[00m     * No free IP is being over-accounted
\e[00;34mDEBUG:\e[00m Checking consistency for HA hosted VMs...
\e[00;34mDEBUG:\e[00m    -> Check if all accounted HA hosted VMs are in an HA rack
\e[00;34mDEBUG:\e[00m     * All accounted HA hosted VMs are deployed to HA racks
\e[00;34mDEBUG:\e[00m    -> Check all VMs deployed to an HA rack are accounted as HA hosted
\e[00;34mDEBUG:\e[00m      * All VM deployed in HA racks are accounted as HA VMs
\e[00;34mDEBUG:\e[00m Checking consistency on table accounting_event_pm...
\e[00;34mDEBUG:\e[00m    -> Check if all accounted pm reservation exists
\e[00;34mDEBUG:\e[00m     * All accounted pm reservation exists
\e[00;34mDEBUG:\e[00m    -> Check if all pm reservations are accounted
\e[00;34mDEBUG:\e[00m      * All pm reservations are being accounted
\e[00;34mDEBUG:\e[00m Checking consistency on table accounting_event_repository...
\e[00;34mDEBUG:\e[00m    -> Check if all accounted repository images exists
\e[00;34mDEBUG:\e[00m     * All accounted repository images exists
\e[00;34mDEBUG:\e[00m    -> Check if all existing repository images are accounted
\e[00;34mDEBUG:\e[00m     * All repository images are being accounted