From d948eec0040eb568e8869e594889358b5bf8fa1b Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Tue, 6 Jan 2015 11:09:45 -0500 Subject: [PATCH] compute/api: crontab to move deleted instance rows to another database table Create a crontab which moves deleted instances rows to another database table that you don't have to backup. This is done to optimize database management at scale. Depending on the amount of deleted instances that you get on a daily basis you want to modify the $max_rows parameter. This feature is implemented as in nova CLI and addressed by this blueprint: https://blueprints.launchpad.net/nova/+spec/db-archiving Change-Id: Id9c50e82347562255e5b31cd1442ec0de46c48eb --- manifests/compute/api.pp | 2 ++ spec/classes/cloud_compute_api_spec.rb | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/manifests/compute/api.pp b/manifests/compute/api.pp index 75abc2a3..36710126 100644 --- a/manifests/compute/api.pp +++ b/manifests/compute/api.pp @@ -97,6 +97,8 @@ class cloud::compute::api( } } + include 'nova::cron::archive_deleted_rows' + @@haproxy::balancermember{"${::fqdn}-compute_api_ec2": listening_service => 'ec2_api_cluster', server_names => $::hostname, diff --git a/spec/classes/cloud_compute_api_spec.rb b/spec/classes/cloud_compute_api_spec.rb index 8c2aede1..292fbbdf 100644 --- a/spec/classes/cloud_compute_api_spec.rb +++ b/spec/classes/cloud_compute_api_spec.rb @@ -125,6 +125,10 @@ describe 'cloud::compute::api' do ) end + it 'configure a crontab that move deleted instance rows to another database table' do + is_expected.to contain_class('nova::cron::archive_deleted_rows') + end + context 'with default firewall enabled' do let :pre_condition do "class { 'cloud': manage_firewall => true }"