Database maintenance
PowerVC performs
soft deletion while deleting a record from its database. You might occasionally want to remove such
soft deleted table rows. This operation is called purging the database. You can use the
powervc-manage
tool to accomplish purging activities. PowerVC supports purging Nova, Cinder, and Glance
databases.
About this task
PowerVC has a cron job (daily) that purges database records that are older than 90 days.
User can perform the following steps to modify the cron job, which deletes the data older than 90
days by default.
- Open /etc/cron.daily/powervc_purge_deleted_records file.
- Change
/opt/ibm/powervc/bin/powervc-manage -o dbpurge -y
to/opt/ibm/powervc/bin/powervc-manage -o dbpurge -d <days> -y
- Restart cron service.
For example, to delete records older than 60 days instead of 90 days, edit the file as the
following example.
/opt/ibm/powervc/bin/powervc-manage -o dbpurge -d 60 -y
- Purging the database
- Follow these steps to purge the soft deleted rows from the tables:
Procedure
Run the /opt/ibm/powervc/bin/powervc-manage -o dbpurge command.
You can use the following optional parameters:
- --older-than-days DAYS: Purge the rows that have been deleted for longer
than
DAYS
days. The default is 90 days. - --noprompt: Specifies whether to suppress the warning message when purging deleted records.
What to do next
- Example
-
/opt/ibm/powervc/bin/powervc-manage -o dbpurge --older-than-days 7 -y
Running this command purges the rows, which are older than 7 days, from the Nova, Cinder, and Glance databases.
- Considerations
-
- When an instance is deleted from PowerVC, records present in the instance_health_status table are not soft deleted. The records are hard deleted directly by the periodic job that runs every 30 minutes. By running the PowerVC dbpurge command with any number of days (-d value), you can delete the old entries that remain in the instance_health_status table.
- When an instance is deleted from PowerVC, records present in the instance_actions and instance_actions_events table are not soft deleted. By running the dbpurge command, you can hard delete the records directly based on the day that is specified in the command.
- As there is no soft deletion for the instance_health_status, instance_actions, and instance_actions_events tables, the Total Rows to be deleted column in the dbpurge output is 0.