From 57b1783764fa74c7e6ae08033a2d297d1428f0f7 Mon Sep 17 00:00:00 2001 From: Vijay Date: Fri, 27 Jul 2012 20:58:56 +0530 Subject: [PATCH] CS-15729. AutoScale. Default counter names are corrected to valid values without special characters --- server/src/com/cloud/network/as/AutoScaleManagerImpl.java | 8 ++++---- setup/db/create-schema.sql | 6 +++--- setup/db/db/schema-304to305.sql | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java index 89d51de4f32..39ee647940f 100644 --- a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java +++ b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java @@ -173,7 +173,7 @@ public class AutoScaleManagerImpl implements AutoScaleService, Manager { for (Counter counter : counters) { if (!supportedCounters.contains(counter.getSource().name().toString())) { throw new InvalidParameterException("AutoScale counter with source='" + counter.getSource() + "' is not supported " + - "in the network where lb is configured"); + "in the network where lb is configured"); } } } @@ -566,7 +566,7 @@ public class AutoScaleManagerImpl implements AutoScaleService, Manager { Account caller = UserContext.current().getCaller(); Ternary domainIdRecursiveListProject = new Ternary(domainId, isRecursive, null); + ListProjectResourcesCriteria>(domainId, isRecursive, null); _accountMgr.buildACLSearchParameters(caller, id, accountName, null, permittedAccounts, domainIdRecursiveListProject, listAll, false); domainId = domainIdRecursiveListProject.first(); @@ -666,10 +666,10 @@ public class AutoScaleManagerImpl implements AutoScaleService, Manager { if (!vmGroupVO.getState().equals(AutoScaleVmGroup.State_Disabled)) { throw new InvalidParameterValueException("The AutoScale Policy can be updated only if the Vm Group it is associated with is disabled in state", null); } - if (vmGroupVO.getInterval() < policy.getDuration()) { + if (policy.getDuration() < vmGroupVO.getInterval()) { throw new InvalidParameterValueException("duration is less than the associated AutoScaleVmGroup's interval", null); } - if (vmGroupVO.getInterval() < policy.getQuietTime()) { + if (policy.getQuietTime() < vmGroupVO.getInterval()) { throw new InvalidParameterValueException("quietTime is less than the associated AutoScaleVmGroup's interval", null); } } diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql index b74a0bffd4f..9c6cea96387 100755 --- a/setup/db/create-schema.sql +++ b/setup/db/create-schema.sql @@ -2443,9 +2443,9 @@ CREATE TABLE `cloud`.`autoscale_vmgroup_policy_map` ( CONSTRAINT `fk_autoscale_vmgroup_policy_map__policy_id` FOREIGN KEY `fk_autoscale_vmgroup_policy_map__policy_id` (`policy_id`) REFERENCES `autoscale_policies` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (1,'snmp','Linux User CPU Time(%)', '.1.3.6.1.4.1.2021.11.9.0', now()); -INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (2,'snmp','Linux System CPU Time(%)', '.1.3.6.1.4.1.2021.11.10.0', now()); -INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (3,'snmp','Linux CPU Idle Time(%)', '.1.3.6.1.4.1.2021.11.11.0', now()); +INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (1,'snmp','Linux User CPU - Percentage', '1.3.6.1.4.1.2021.11.9.0', now()); +INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (2,'snmp','Linux System CPU - Percentage', '1.3.6.1.4.1.2021.11.10.0', now()); +INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (3,'snmp','Linux CPU Idle - Percentage', '1.3.6.1.4.1.2021.11.11.0', now()); INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (100,'netscaler','ResponseTime(in ms)', 'RESPTIME', now()); SET foreign_key_checks = 1; diff --git a/setup/db/db/schema-304to305.sql b/setup/db/db/schema-304to305.sql index fb79f0fae57..b1cc3c85bf8 100755 --- a/setup/db/db/schema-304to305.sql +++ b/setup/db/db/schema-304to305.sql @@ -282,9 +282,9 @@ CREATE TABLE `cloud`.`autoscale_vmgroup_policy_map` ( CONSTRAINT `fk_autoscale_vmgroup_policy_map__policy_id` FOREIGN KEY `fk_autoscale_vmgroup_policy_map__policy_id` (`policy_id`) REFERENCES `autoscale_policies` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (1,'snmp','Linux User CPU Time(%)', '.1.3.6.1.4.1.2021.11.9.0', now()); -INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (2,'snmp','Linux System CPU Time(%)', '.1.3.6.1.4.1.2021.11.10.0', now()); -INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (3,'snmp','Linux CPU Idle Time(%)', '.1.3.6.1.4.1.2021.11.11.0', now()); +INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (1,'snmp','Linux User CPU - Percentage', '1.3.6.1.4.1.2021.11.9.0', now()); +INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (2,'snmp','Linux System CPU - Percentage', '1.3.6.1.4.1.2021.11.10.0', now()); +INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (3,'snmp','Linux CPU Idle - Percentage', '1.3.6.1.4.1.2021.11.11.0', now()); INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (100,'netscaler','ResponseTime(in ms)', 'RESPTIME', now()); CREATE TABLE `cloud`.`s2s_vpn_gateway` (