Remove deleted Cinder rows

Creates cron job running every 24 hours
for "cinder-manage db purge"

Partial-bug: rhbz#1249106
Depends-On: I677f2ef3d9ca81fff0f672c8e34b6e4278674a96
Change-Id: I9ec5b570feb0e9a415c432aea12e6d63f6fbf833
This commit is contained in:
Martin Mágr 2015-08-04 15:07:37 +02:00
parent 1165218e8c
commit d7782f41c3
3 changed files with 28 additions and 0 deletions

View File

@ -465,6 +465,9 @@ Cinder Config parameters
**CONFIG_CINDER_DB_PW**
Password to use for the Block Storage service (cinder) to access the database.
**CONFIG_CINDER_DB_PURGE_ENABLE**
Enter y if cron job for removing soft deleted DB rows should be created.
**CONFIG_CINDER_KS_PW**
Password to use for the Block Storage service to authenticate with the Identity service.

View File

@ -58,6 +58,22 @@ def initConfig(controller):
"NEED_CONFIRM": True,
"CONDITION": False},
{"CMD_OPTION": 'cinder-db-purge-enable',
"PROMPT": (
"Enter y if cron job for removing soft deleted DB rows "
"should be created"
),
"OPTION_LIST": ['y', 'n'],
"VALIDATORS": [validators.validate_not_empty],
"PROCESSORS": [processors.process_bool],
"DEFAULT_VALUE": 'y',
"MASK_INPUT": False,
"LOOSE_VALIDATION": False,
"CONF_NAME": 'CONFIG_CINDER_DB_PURGE_ENABLE',
"USE_DEFAULT": False,
"NEED_CONFIRM": True,
"CONDITION": False},
{"CMD_OPTION": "cinder-ks-passwd",
"PROMPT": "Enter the password for the Cinder Keystone access",
"OPTION_LIST": [],

View File

@ -37,3 +37,12 @@ Cinder::Type {
class { '::cinder::backends':
enabled_backends => hiera_array('CONFIG_CINDER_BACKEND'),
}
$db_purge = hiera('CONFIG_CINDER_DB_PURGE_ENABLE')
if $db_purge {
class { '::cinder::cron::db_purge':
hour => '*/24',
destination => '/dev/null',
age => 1
}
}