CLOUDSTACK-5112

[Baremetal]Make IPMI retry times configurable
This commit is contained in:
Frank.Zhang 2013-11-08 13:44:07 -08:00
parent 2526383b9e
commit 88047a458b
3 changed files with 13 additions and 3 deletions

View File

@ -90,6 +90,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) {
@ -157,14 +159,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) {
@ -260,7 +268,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) {

View File

@ -230,7 +230,6 @@ public enum Config {
"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),
@ -424,6 +423,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),

View File

@ -221,3 +221,5 @@ CREATE VIEW `cloud`.`user_vm_view` AS
update `cloud`.`volumes` v, `cloud`.`volume_host_ref` vhr set v.format=vhr.format where v.id=vhr.volume_id and v.format is null;
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', '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');
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");