diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java index b77537ed5be..534f02298be 100755 --- a/server/src/com/cloud/configuration/Config.java +++ b/server/src/com/cloud/configuration/Config.java @@ -140,6 +140,7 @@ public enum Config { SwiftEnable( "Advanced", ManagementServer.class, Boolean.class, "swift.enable", "false", "enable swift ", null), + EventPurgeInterval("Advanced", ManagementServer.class, Integer.class, "event.purge.interval", "86400", "The interval (in seconds) to wait before running the event purge thread", null), AccountCleanupInterval("Advanced", ManagementServer.class, Integer.class, "account.cleanup.interval", "86400", "The interval (in seconds) between cleanup for removed accounts", null), AllowPublicUserTemplates("Advanced", ManagementServer.class, Integer.class, "allow.public.user.templates", "true", "If false, users will not be able to create public templates.", null), InstanceName("Advanced", AgentManager.class, String.class, "instance.name", "VM", "Name of the deployment instance.", "instanceName"), diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index a02c3be9e7f..4373bb3bc55 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -254,6 +254,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura private void populateConfigValuesForValidationSet() { configValuesForValidation = new HashSet(); + configValuesForValidation.add("event.purge.interval"); configValuesForValidation.add("account.cleanup.interval"); configValuesForValidation.add("alert.wait"); configValuesForValidation.add("consoleproxy.capacityscan.interval"); diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index bcdafa98cef..227046b8a2c 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -392,7 +392,7 @@ public class ManagementServerImpl implements ManagementServer { s_logger.error("Unable to find HostAllocators"); } - String value = _configs.get("account.cleanup.interval"); + String value = _configs.get("event.purge.interval"); int cleanup = NumbersUtil.parseInt(value, 60 * 60 * 24); // 1 day. _statsCollector = StatsCollector.getInstance(_configs); diff --git a/server/src/com/cloud/test/DatabaseConfig.java b/server/src/com/cloud/test/DatabaseConfig.java index 6c2f44fdcf5..a6aa094c80d 100755 --- a/server/src/com/cloud/test/DatabaseConfig.java +++ b/server/src/com/cloud/test/DatabaseConfig.java @@ -247,6 +247,7 @@ public class DatabaseConfig { s_configurationComponents.put("capacity.check.period", "management-server"); s_configurationComponents.put("network.throttling.rate", "management-server"); s_configurationComponents.put("multicast.throttling.rate", "management-server"); + s_configurationComponents.put("event.purge.interval", "management-server"); s_configurationComponents.put("account.cleanup.interval", "management-server"); s_configurationComponents.put("expunge.delay", "UserVmManager"); s_configurationComponents.put("expunge.interval", "UserVmManager"); @@ -330,6 +331,7 @@ public class DatabaseConfig { s_defaultConfigurationValues.put("restart.retry.interval", "600"); s_defaultConfigurationValues.put("investigate.retry.interval", "60"); s_defaultConfigurationValues.put("migrate.retry.interval", "120"); + s_defaultConfigurationValues.put("event.purge.interval", "86400"); s_defaultConfigurationValues.put("account.cleanup.interval", "86400"); s_defaultConfigurationValues.put("system.vm.use.local.storage", "false"); s_defaultConfigurationValues.put("use.local.storage", "false"); diff --git a/setup/db/db/schema-303to40.sql b/setup/db/db/schema-303to40.sql index 4ce8e65d1a2..39b52651a64 100644 --- a/setup/db/db/schema-303to40.sql +++ b/setup/db/db/schema-303to40.sql @@ -84,6 +84,5 @@ ALTER TABLE `cloud`.`hypervisor_capabilities` ADD COLUMN `max_data_volumes_limit SET SQL_SAFE_UPDATES=0; UPDATE `cloud`.`hypervisor_capabilities` SET `max_data_volumes_limit`=13 WHERE `hypervisor_type`='XenServer' AND (`hypervisor_version`='6.0' OR `hypervisor_version`='6.0.2'); SET SQL_SAFE_UPDATES=1; - - +INSERT INTO `cloud`.`configuration` (`category`, `instance`, `component`, `name`, `value`, `description`) VALUES ('Advanced', 'DEFAULT', 'management-server', 'event.purge.interval', '86400', 'The interval (in seconds) to wait before running the event purge thread');