From fb29f77987d9bb1009f99edf55758309e8c710dc Mon Sep 17 00:00:00 2001 From: Carlos Camacho Date: Mon, 12 Mar 2018 12:09:00 +0100 Subject: [PATCH] Add purge to Nova cleanup cron. This patch enable the option --purge in the Cron cleaning the Nova deleted instances. Also, enables the --all-cells option to cause the purge to be applied against all cell databases Also adds new cron options to purge the shadow tables daily with a 14 days retention period. Depends-On: I2dcf37417c36fb8b1bde207c60d22d580005715c Depends-On: I4ac0c9bd30463c546b141326b1293c78f845cf81 Depends-On: I9ffebfad1d31182f43ed688a7c1ff3047655cbae Depends-On: Ia99cd83dae1ed35b4cb6f035c445617f1e40f490 Change-Id: I5033f9a4e2f540b9f0154e287560bd6cce412663 --- puppet/services/nova-api.yaml | 6 ++ puppet/services/nova-base.yaml | 70 +++++++++++++++++++ ...dd-purge-nova-tables-e0706cdcffa0f42e.yaml | 6 ++ 3 files changed, 82 insertions(+) create mode 100644 releasenotes/notes/add-purge-nova-tables-e0706cdcffa0f42e.yaml diff --git a/puppet/services/nova-api.yaml b/puppet/services/nova-api.yaml index f7a861ab2c..65ed64360c 100644 --- a/puppet/services/nova-api.yaml +++ b/puppet/services/nova-api.yaml @@ -55,6 +55,11 @@ parameters: description: | Whether to create cron job for purging soft deleted rows in Nova database. type: boolean + NovaEnableDBArchive: + default: true + description: | + Whether to create cron job for archiving soft deleted rows in Nova database. + type: boolean MonitoringSubscriptionNovaApi: default: 'overcloud-nova-api' type: string @@ -162,6 +167,7 @@ outputs: nova::api::neutron_metadata_proxy_shared_secret: {get_param: NeutronMetadataProxySharedSecret} nova::api::instance_name_template: {get_param: InstanceNameTemplate} nova_enable_db_purge: {get_param: NovaEnableDBPurge} + nova_enable_db_archive: {get_param: NovaEnableDBArchive} nova::policy::policies: {get_param: NovaApiPolicies} - if: diff --git a/puppet/services/nova-base.yaml b/puppet/services/nova-base.yaml index b569431e1a..7e743797c4 100644 --- a/puppet/services/nova-base.yaml +++ b/puppet/services/nova-base.yaml @@ -142,6 +142,65 @@ parameters: type: boolean description: > Cron to move deleted instances to another table - Until complete + default: true + NovaCronArchiveDeleteRowsPurge: + type: boolean + description: > + Purge shadow tables immediately after scheduled archiving + default: false + NovaCronPurgeShadowTablesMinute: + type: string + description: > + Cron to purge shadow tables - Minute + default: '0' + NovaCronPurgeShadowTablesHour: + type: string + description: > + Cron to purge shadow tables - Hour + default: '5' + NovaCronPurgeShadowTablesMonthday: + type: string + description: > + Cron to purge shadow tables - Month Day + default: '*' + NovaCronPurgeShadowTablesMonth: + type: string + description: > + Cron to purge shadow tables - Month + default: '*' + NovaCronPurgeShadowTablesWeekday: + type: string + description: > + Cron to purge shadow tables - Week Day + default: '*' + NovaCronPurgeShadowTablesUser: + type: string + description: > + Cron to purge shadow tables - User + default: 'nova' + NovaCronPurgeShadowTablesDestination: + type: string + description: > + Cron to purge shadow tables - Log destination + default: '/var/log/nova/nova-rowspurge.log' + NovaCronPurgeShadowTablesAge: + type: number + description: > + Cron to purge shadow tables - Age + This will define the retention policy when + purging the shadow tables in days. + 0 means, purge data older than today in + shadow tables. + default: 14 + NovaCronPurgeShadowTablesVerbose: + type: boolean + description: > + Cron to purge shadow tables - Verbose + default: false + NovaCronPurgeShadowTablesAllCells: + type: boolean + description: > + Cron to purge shadow tables - All cells default: false NovaPlacementAPIInterface: type: string @@ -252,6 +311,17 @@ outputs: nova::cron::archive_deleted_rows::user: {get_param: NovaCronArchiveDeleteRowsUser} nova::cron::archive_deleted_rows::destination: {get_param: NovaCronArchiveDeleteRowsDestination} nova::cron::archive_deleted_rows::until_complete: {get_param: NovaCronArchiveDeleteRowsUntilComplete} + nova::cron::archive_deleted_rows::purge: {get_param: NovaCronArchiveDeleteRowsPurge} + nova::cron::purge_shadow_tables::minute: {get_param: NovaCronPurgeShadowTablesMinute} + nova::cron::purge_shadow_tables::hour: {get_param: NovaCronPurgeShadowTablesHour} + nova::cron::purge_shadow_tables::monthday: {get_param: NovaCronPurgeShadowTablesMonthday} + nova::cron::purge_shadow_tables::month: {get_param: NovaCronPurgeShadowTablesMonth} + nova::cron::purge_shadow_tables::weekday: {get_param: NovaCronPurgeShadowTablesWeekday} + nova::cron::purge_shadow_tables::user: {get_param: NovaCronPurgeShadowTablesUser} + nova::cron::purge_shadow_tables::destination: {get_param: NovaCronPurgeShadowTablesDestination} + nova::cron::purge_shadow_tables::age: {get_param: NovaCronPurgeShadowTablesAge} + nova::cron::purge_shadow_tables::verbose: {get_param: NovaCronPurgeShadowTablesVerbose} + nova::cron::purge_shadow_tables::all_cells: {get_param: NovaCronPurgeShadowTablesAllCells} - if: - compute_upgrade_level_empty diff --git a/releasenotes/notes/add-purge-nova-tables-e0706cdcffa0f42e.yaml b/releasenotes/notes/add-purge-nova-tables-e0706cdcffa0f42e.yaml new file mode 100644 index 0000000000..a0a4c3a7e7 --- /dev/null +++ b/releasenotes/notes/add-purge-nova-tables-e0706cdcffa0f42e.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Add the ability of fully purging the shadow + tables whether in the archive or the purge + cron.