Updated Branches: refs/heads/4.3 48a439156 -> d3bff27ef
CLOUDSTACK-5112 [Baremetal]Make IPMI retry times configurable Conflicts: server/src/com/cloud/configuration/Config.java setup/db/db/schema-420to421.sql Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d3bff27e Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d3bff27e Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d3bff27e Branch: refs/heads/4.3 Commit: d3bff27ef9c7053babb9db76b03c1506e922dfae Parents: 48a4391 Author: Frank.Zhang <frank.zh...@citrix.com> Authored: Fri Nov 8 13:44:07 2013 -0800 Committer: Frank.Zhang <frank.zh...@citrix.com> Committed: Thu Dec 5 17:30:54 2013 -0800 ---------------------------------------------------------------------- .../baremetal/networkservice/BareMetalResourceBase.java | 12 ++++++++++-- server/src/com/cloud/configuration/Config.java | 9 +++++++++ setup/db/db/schema-420to421.sql | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d3bff27e/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java index 0daafd0..86129c5 100755 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java @@ -116,6 +116,8 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource protected Script2 _bootOrRebootCommand; protected String _vmName; protected VMInstanceDao vmDao; + protected int ipmiRetryTimes = 5; + private void changeVmState(String vmName, VirtualMachine.State state) { synchronized (_vms) { @@ -183,14 +185,20 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource _isEchoScAgent = Boolean.valueOf(echoScAgent); } + ConfigurationDao configDao = ComponentContext.getComponent(ConfigurationDao.class); String ipmiIface = "default"; try { - ConfigurationDao configDao = ComponentContext.getComponent(ConfigurationDao.class); ipmiIface = configDao.getValue(Config.BaremetalIpmiLanInterface.key()); } catch (Exception e) { s_logger.debug(e.getMessage(), e); } + try { + ipmiRetryTimes = Integer.valueOf(configDao.getValue(Config.BaremetalIpmiRetryTimes.key())); + } catch (Exception e) { + s_logger.debug(e.getMessage(), e); + } + String injectScript = "scripts/util/ipmi.py"; String scriptPath = Script.findScript("", injectScript); if (scriptPath == null) { @@ -286,7 +294,7 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource } protected boolean doScript(Script cmd, OutputInterpreter interpreter) { - return doScript(cmd, interpreter, 5); + return doScript(cmd, interpreter, ipmiRetryTimes); } protected boolean doScript(Script cmd, OutputInterpreter interpreter, int retry) { http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d3bff27e/server/src/com/cloud/configuration/Config.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java index e767b88..6f94a15 100755 --- a/server/src/com/cloud/configuration/Config.java +++ b/server/src/com/cloud/configuration/Config.java @@ -192,6 +192,14 @@ public enum Config { AlertPurgeInterval("Advanced", ManagementServer.class, Integer.class, "alert.purge.interval", "86400", "The interval (in seconds) to wait before running the alert purge thread", null), AlertPurgeDelay("Advanced", ManagementServer.class, Integer.class, "alert.purge.delay", "0", "Alerts older than specified number days will be purged. Set this value to 0 to never delete alerts", null), HostReservationReleasePeriod("Advanced", ManagementServer.class, Integer.class, "host.reservation.release.period", "300000", "The interval in milliseconds between host reservation release checks", null), + UseSystemPublicIps("Advanced", ManagementServer.class, Boolean.class, "use.system.public.ips", "true", + "If true, when account has dedicated public ip range(s), once the ips dedicated to the account have been" + + " consumed ips will be acquired from the system pool", + null, ConfigurationParameterScope.account.toString()), + UseSystemGuestVlans("Advanced", ManagementServer.class, Boolean.class, "use.system.guest.vlans", "true", + "If true, when account has dedicated guest vlan range(s), once the vlans dedicated to the account have been" + + " consumed vlans will be allocated from the system pool", + null, ConfigurationParameterScope.account.toString()), // LB HealthCheck Interval. LBHealthCheck("Advanced", ManagementServer.class, String.class, "healthcheck.update.interval", "600", "Time Interval to fetch the LB health check states (in sec)", null), @@ -379,6 +387,7 @@ public enum Config { IntervalToEchoBaremetalSecurityGroupAgent("Advanced", ManagementServer.class, Integer.class, "interval.baremetal.securitygroup.agent.echo", "10", "Interval to echo baremetal security group agent, in seconds", null), TimeoutToEchoBaremetalSecurityGroupAgent("Advanced", ManagementServer.class, Integer.class, "timeout.baremetal.securitygroup.agent.echo", "3600", "Timeout to echo baremetal security group agent, in seconds, the provisioning process will be treated as a failure", null), BaremetalIpmiLanInterface("Advanced", ManagementServer.class, String.class, "baremetal.ipmi.lan.interface", "default", "option specified in -I option of impitool. candidates are: open/bmc/lipmi/lan/lanplus/free/imb, see ipmitool man page for details. default valule 'default' means using default option of ipmitool", null), + BaremetalIpmiRetryTimes("Advanced", ManagementServer.class, String.class, "baremetal.ipmi.fail.retry", "5", "ipmi interface will be temporary out of order after power opertions(e.g. cycle, on), it leads following commands fail immediately. The value specifies retry times before accounting it as real failure", null), ApiLimitEnabled("Advanced", ManagementServer.class, Boolean.class, "api.throttling.enabled", "false", "Enable/disable Api rate limit", null), ApiLimitInterval("Advanced", ManagementServer.class, Integer.class, "api.throttling.interval", "1", "Time interval (in seconds) to reset API count", null), http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d3bff27e/setup/db/db/schema-420to421.sql ---------------------------------------------------------------------- diff --git a/setup/db/db/schema-420to421.sql b/setup/db/db/schema-420to421.sql index fe1e0d4..302d44a 100644 --- a/setup/db/db/schema-420to421.sql +++ b/setup/db/db/schema-420to421.sql @@ -225,4 +225,4 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'manag INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'baremetal.ipmi.fail.retry', 'default', "ipmi interface will be temporary out of order after power opertions(e.g. cycle, on), it leads following commands fail immediately. The value specifies retry times before accounting it as real failure"); INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.hung.wokervm.timeout', '7200', 'Worker VM timeout in seconds'); INSERT IGNORE INTO `cloud`.`configuration` VALUES ("Alert", 'DEFAULT', 'management-server', "alert.smtp.connectiontimeout", "30000", "Socket connection timeout value in milliseconds. -1 for infinite timeout."); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ("Alert", 'DEFAULT', 'management-server', "alert.smtp.timeout", "30000", "Socket I/O timeout value in milliseconds. -1 for infinite timeout."); \ No newline at end of file +INSERT IGNORE INTO `cloud`.`configuration` VALUES ("Alert", 'DEFAULT', 'management-server', "alert.smtp.timeout", "30000", "Socket I/O timeout value in milliseconds. -1 for infinite timeout.");