You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by fr...@apache.org on 2013/11/08 22:45:44 UTC

git commit: updated refs/heads/4.2 to 88047a4

Updated Branches:
  refs/heads/4.2 2526383b9 -> 88047a458


CLOUDSTACK-5112
[Baremetal]Make IPMI retry times configurable


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/88047a45
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/88047a45
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/88047a45

Branch: refs/heads/4.2
Commit: 88047a458b94ab2db3af360b6615f5812f22819a
Parents: 2526383
Author: Frank.Zhang <fr...@citrix.com>
Authored: Fri Nov 8 13:44:07 2013 -0800
Committer: Frank.Zhang <fr...@citrix.com>
Committed: Fri Nov 8 13:45:28 2013 -0800

----------------------------------------------------------------------
 .../baremetal/networkservice/BareMetalResourceBase.java | 12 ++++++++++--
 server/src/com/cloud/configuration/Config.java          |  2 +-
 setup/db/db/schema-420to421.sql                         |  2 ++
 3 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/88047a45/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 2ce6670..2d12dcd 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BareMetalResourceBase.java
@@ -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) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/88047a45/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 f3cb919..f06b463 100755
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -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),

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/88047a45/setup/db/db/schema-420to421.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-420to421.sql b/setup/db/db/schema-420to421.sql
index d429b30..baadbda 100644
--- a/setup/db/db/schema-420to421.sql
+++ b/setup/db/db/schema-420to421.sql
@@ -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");