Database archiving utility

Note

All commands of section are executed only on controller.

Utility description

openstack aos db purge is console utility for archiving databases modules deleted records. The utility searches the tables for records marked as deleted and transfers them to the corresponding shadow tables (tables with the shadow prefix in the name) when launched without additional parameters.

Utility arguments
Parameter Description
-h, --help Help output. Optional parameter.
--incorrect Archiving records in tables corresponding to instances deleted or missing in Nova database. Optional parameter.
--age AGE Removal of TRS instances the last session of which was opened several days ago or more and subsequent archiving of the corresponding records in the tables. The number of days is set by the AGE parameter. Optional parameter.
--journal --age AGE Archiving the log table of actions taken several days ago or more. The number of days is set by the AGE parameter. Optional parameter.
-v, --verbose Flag for displaying a detailed message about database archiving error. Optional parameter.

Examples of using

Archiving records marked as deleted in all tables

Archiving records marked as deleted in all tables:

openstack aos db purge

Example of response:

Processing modules: monitor, scheduler, rs_server

==============
DB purge table
==============
+---+---------------------+--------+-----------------------+
| N | Module name         | Status | Result                |
+---+---------------------+--------+-----------------------+
| 1 | Monitor             | OK     | 0 rows are archived.  |
+---+---------------------+--------+-----------------------+
| 2 | Scheduler           | OK     | 13 rows are archived. |
+---+---------------------+--------+-----------------------+
| 3 | RSserver            | OK     | 4 rows are archived.  |
+---+---------------------+--------+-----------------------+

Removing TRS instances with subsequent archiving

Removing TRS instances the last session of which was <AGE> days or more ago is started by the command:

openstack aos db purge --age 14

where 14 is the number of days. Databases modules records marked as deleted will be archived after executing the command .

Example of response:

1 instances will be removed. Are you sure? (y/n)y
Processing modules: monitor, scheduler, rs_server

==============
DB purge table
==============
+---+---------------------+--------+----------------------+
| N | Module name         | Status | Result               |
+---+---------------------+--------+----------------------+
| 1 | Monitor             | OK     | 0 rows are archived. |
+---+---------------------+--------+----------------------+
| 2 | Scheduler           | OK     | 0 rows are archived. |
+---+---------------------+--------+----------------------+
| 3 | RSserver            | OK     | 4 rows are archived. |
+---+---------------------+--------+----------------------+

Archiving invalid records in all tables

Starting to archive records in modules databases corresponding to remote or missing instances in Nova database followed by starting archiving records marked as deleted is performed by the command:

openstack aos db purge --incorrect

Example of response:

Processing modules: monitor, scheduler, rs_server

==============
DB purge table
==============
+---+---------------------+--------+-----------------------+
| N | Module name         | Status | Result                |
+---+---------------------+--------+-----------------------+
| 1 | Monitor             | OK     | 0 rows are archived.  |
+---+---------------------+--------+-----------------------+
| 2 | Scheduler           | OK     | 13 rows are archived. |
+---+---------------------+--------+-----------------------+
| 3 | RSserver            | OK     | 4 rows are archived.  |
+---+---------------------+--------+-----------------------+

Removing TRS instances and archiving invalid records

Simultaneous use of parameters --age and --incorrect starts to archive TRS instances and corresponding records, then archives invalid records databases modules:

openstack aos db purge --age 14 --incorrect

Example of response:

1 instances will be removed. Are you sure? (y/n)y
Processing modules: monitor, scheduler, rs_server

==============
DB purge table
==============
+---+---------------------+--------+-----------------------+
| N | Module name         | Status | Result                |
+---+---------------------+--------+-----------------------+
| 1 | Monitor             | OK     | 0 rows are archived.  |
+---+---------------------+--------+-----------------------+
| 2 | Scheduler           | OK     | 13 rows are archived. |
+---+---------------------+--------+-----------------------+
| 3 | RSserver            | OK     | 4 rows are archived.  |
+---+---------------------+--------+-----------------------+

Action logs records archiving

Simultaneous use of parameters --age and --journal starts archiving action log records. It is performed by the command:

openstack aos db purge --age 10 --journal

Example of response:

45 journal rows have been archived.

Results table description

Field name Description
N Module serial number.
Module name Module name.
Status

Archiving progress status. Possible values:

  • OK - archiving was successful;
  • FAIL - archiving failed.
Result

Results of archiving. Possible values:

  • n rows are archived. - message about successfully archiving of records in the corresponding module where n is the number of records;
  • Error - message indicating the problem.