cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [05/50] [abbrv] git commit: updated refs/heads/rbac to 48e08fe
Date Thu, 06 Mar 2014 22:06:48 GMT
Do not do investigation for SSVM/CPVM agent host upon disconnect.


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

Branch: refs/heads/rbac
Commit: 90262a81ec5fdbe56b997a4064db0fdace550180
Parents: 0c48f70
Author: Kelven Yang <kelveny@gmail.com>
Authored: Wed Feb 26 17:33:09 2014 -0800
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Fri Feb 28 15:36:00 2014 -0800

----------------------------------------------------------------------
 .../src/com/cloud/agent/manager/AgentManagerImpl.java   | 12 ++++++++++--
 .../src/com/cloud/agent/manager/DirectAgentAttache.java |  2 +-
 .../src/com/cloud/ha/HighAvailabilityManagerImpl.java   | 10 ++--------
 3 files changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/90262a81/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
index 251f338..0d41bc1 100755
--- a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
@@ -1469,8 +1469,16 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager,
Handl
                             status_logger.debug("Ping timeout but host " + agentId + " is
in resource state of " + resourceState + ", so no investigation");
                             disconnectWithoutInvestigation(agentId, Event.ShutdownRequested);
                         } else {
-                            status_logger.debug("Ping timeout for host " + agentId + ", do
invstigation");
-                            disconnectWithInvestigation(agentId, Event.PingTimeout);
+                            HostVO host = _hostDao.findById(agentId);
+                            if (host != null && (host.getType() == Host.Type.ConsoleProxy
|| host.getType() == Host.Type.SecondaryStorageVM
+                                    || host.getType() == Host.Type.SecondaryStorageCmdExecutor))
{
+
+                                s_logger.warn("Disconnect agent for CPVM/SSVM due to physical
connection close. host: " + host.getId());
+                                disconnectWithoutInvestigation(agentId, Event.ShutdownRequested);
+                            } else {
+                                status_logger.debug("Ping timeout for host " + agentId +
", do invstigation");
+                                disconnectWithInvestigation(agentId, Event.PingTimeout);
+                            }
                         }
                     }
                 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/90262a81/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java b/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java
index ef002d0..354da4b 100755
--- a/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java
@@ -182,7 +182,7 @@ public class DirectAgentAttache extends AgentAttache {
                 Command[] cmds = _req.getCommands();
                 ArrayList<Answer> answers = new ArrayList<Answer>(cmds.length);
                 for (Command cmd : cmds) {
-                    Answer answer = new Answer(cmd, false, "Bailed out as maximum oustanding
task limit reached");
+                    Answer answer = new Answer(cmd, false, "Bailed out as maximum outstanding
task limit reached");
                     answers.add(answer);
                 }
                 Response resp = new Response(_req, answers.toArray(new Answer[answers.size()]));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/90262a81/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
index 4a24d63..b7d5be8 100755
--- a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
+++ b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
@@ -63,7 +63,6 @@ import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.resource.ResourceManager;
 import com.cloud.server.ManagementServer;
-import com.cloud.service.ServiceOfferingVO;
 import com.cloud.service.dao.ServiceOfferingDao;
 import com.cloud.storage.StorageManager;
 import com.cloud.storage.dao.GuestOSCategoryDao;
@@ -952,13 +951,8 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements
HighAvai
     @Override
     public boolean postStateTransitionEvent(State oldState, VirtualMachine.Event event, State
newState, VirtualMachine vo, boolean status, Object opaque) {
         if (oldState == State.Running && event == VirtualMachine.Event.FollowAgentPowerOffReport
&& newState == State.Stopped) {
-            long serviceOfferingId = vo.getServiceOfferingId();
-
-            ServiceOfferingVO serviceOffering = _serviceOfferingDao.findById(serviceOfferingId);
-            if (serviceOffering != null && serviceOffering.getOfferHA()) {
-
-                VMInstanceVO vm = _instanceDao.findById(vo.getId());
-
+            VMInstanceVO vm = _instanceDao.findById(vo.getId());
+            if (vm.isHaEnabled()) {
                 s_logger.info("Detected out-of-band stop of a HA enabled VM " + vm.getInstanceName()
+ ", will schedule restart");
                 scheduleRestart(vm, true);
             }


Mime
View raw message