cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthon...@apache.org
Subject git commit: updated refs/heads/master to 847e1e4
Date Tue, 30 Sep 2014 19:36:14 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 783ed9be9 -> 847e1e47a


when system VM ping times out, stop system VM


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

Branch: refs/heads/master
Commit: 847e1e47aee6b4edeb0265a1a4d3d9a12ffde11d
Parents: 783ed9b
Author: Anthony Xu <anthony.xu@citrix.com>
Authored: Tue Sep 30 12:34:32 2014 -0700
Committer: Anthony Xu <anthony.xu@citrix.com>
Committed: Tue Sep 30 12:35:44 2014 -0700

----------------------------------------------------------------------
 .../com/cloud/agent/manager/AgentManagerImpl.java    |  4 ++--
 .../cloud/consoleproxy/ConsoleProxyManagerImpl.java  |  1 +
 .../storage/secondary/SecondaryStorageListener.java  |  1 +
 .../storage/secondary/SecondaryStorageVmManager.java |  3 +++
 .../SecondaryStorageManagerImpl.java                 | 15 +++++++++++++++
 5 files changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/847e1e47/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 c6664d9..31ef8be 100755
--- a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
@@ -775,7 +775,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager,
Handl
                 }
 
                 if (s_logger.isDebugEnabled()) {
-                    s_logger.debug("The next status of agent " + hostId + "is " + nextStatus
+ ", current status is " + currentStatus);
+                    s_logger.debug("The next status of agent " + hostId + " is " + nextStatus
+ ", current status is " + currentStatus);
                 }
             }
         }
@@ -1513,7 +1513,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager,
Handl
                                     || 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);
+                                disconnectWithoutInvestigation(agentId, Event.PingTimeout);
                             } 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/847e1e47/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
index 14d782a..825af39 100755
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
@@ -324,6 +324,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
                         final ConsoleProxyVO proxy = _consoleProxyDao.findById(proxyVmId);
                         if (proxy != null) {
 
+                            stopProxy(proxyVmId);
                             // Disable this feature for now, as it conflicts
                             // with
                             // the case of allowing user to reboot console proxy

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/847e1e47/server/src/com/cloud/storage/secondary/SecondaryStorageListener.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageListener.java b/server/src/com/cloud/storage/secondary/SecondaryStorageListener.java
index 43613e7..81a4240 100755
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageListener.java
+++ b/server/src/com/cloud/storage/secondary/SecondaryStorageListener.java
@@ -88,6 +88,7 @@ public class SecondaryStorageListener implements Listener {
 
     @Override
     public boolean processDisconnect(long agentId, Status state) {
+        _ssVmMgr.onAgentDisconnect(agentId, state);
         return true;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/847e1e47/server/src/com/cloud/storage/secondary/SecondaryStorageVmManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageVmManager.java b/server/src/com/cloud/storage/secondary/SecondaryStorageVmManager.java
index 3b32c85..f2f5aa0 100755
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageVmManager.java
+++ b/server/src/com/cloud/storage/secondary/SecondaryStorageVmManager.java
@@ -21,6 +21,7 @@ import java.util.List;
 import com.cloud.agent.api.Command;
 import com.cloud.agent.api.StartupCommand;
 import com.cloud.host.HostVO;
+import com.cloud.host.Status;
 import com.cloud.utils.Pair;
 import com.cloud.utils.component.Manager;
 import com.cloud.vm.SecondaryStorageVmVO;
@@ -45,6 +46,8 @@ public interface SecondaryStorageVmManager extends Manager {
 
     public void onAgentConnect(Long dcId, StartupCommand cmd);
 
+    public void onAgentDisconnect(long agentId, Status state);
+
     public boolean generateFirewallConfiguration(Long agentId);
 
     public boolean generateVMSetupCommand(Long hostId);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/847e1e47/services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java
b/services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java
index 1ddc8f5..9288be4 100755
--- a/services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java
+++ b/services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java
@@ -78,6 +78,7 @@ import com.cloud.exception.StorageUnavailableException;
 import com.cloud.host.Host;
 import com.cloud.host.HostVO;
 import com.cloud.host.Status;
+import com.cloud.host.Host.Type;
 import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.info.RunningHostCountInfo;
@@ -998,6 +999,20 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements
Secondar
     public void onAgentConnect(Long dcId, StartupCommand cmd) {
     }
 
+    @Override
+    public void onAgentDisconnect(long agentId, Status state) {
+        HostVO host = _hostDao.findById(agentId);
+        if (host == null || !Type.SecondaryStorageVM.equals(host.getType())) {
+            return;
+        }
+        if (state == Status.Alert || state == Status.Disconnected) {
+            SecondaryStorageVmVO ssvm = getSSVMfromHost(host);
+            if ( ssvm != null ) {
+                stopSecStorageVm(ssvm.getId());
+            }
+        }
+    }
+
     private String getAllocLockName() {
         // to improve security, it may be better to return a unique mashed
         // name(for example MD5 hashed)


Mime
View raw message