You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ki...@apache.org on 2013/06/28 07:47:24 UTC

[1/2] git commit: updated refs/heads/master to 87a5dc5

Updated Branches:
  refs/heads/master b09f69d91 -> 87a5dc582


CLOUDSTACK-3239: Delete Traffic Monitor directly without going through maintenance state


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

Branch: refs/heads/master
Commit: 7713c5cdbc07580583f57434306614eedcc4c5ef
Parents: b09f69d
Author: Kishan Kavala <ki...@cloud.com>
Authored: Thu Jun 27 17:34:10 2013 +0530
Committer: Kishan Kavala <ki...@cloud.com>
Committed: Fri Jun 28 11:12:55 2013 +0530

----------------------------------------------------------------------
 .../cloud/network/NetworkUsageManagerImpl.java  | 29 ++++++++++----------
 1 file changed, 15 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7713c5cd/server/src/com/cloud/network/NetworkUsageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkUsageManagerImpl.java b/server/src/com/cloud/network/NetworkUsageManagerImpl.java
index 3ac77f9..972d3ff 100755
--- a/server/src/com/cloud/network/NetworkUsageManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkUsageManagerImpl.java
@@ -188,20 +188,14 @@ public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsage
     @Override
     public boolean deleteTrafficMonitor(DeleteTrafficMonitorCmd cmd) {
         long hostId = cmd.getId();
-        User caller = _accountMgr.getActiveUser(UserContext.current().getCallerUserId());
         HostVO trafficMonitor = _hostDao.findById(hostId);
         if (trafficMonitor == null) {
             throw new InvalidParameterValueException("Could not find an traffic monitor with ID: " + hostId);
         }
 
-		try {
-			if (_resourceMgr.maintain(hostId) && _resourceMgr.deleteHost(hostId, false, false)) {
-				return true;
-            } else {
-                return false;
-            }
-        } catch (AgentUnavailableException e) {
-            s_logger.debug(e);
+        if (_resourceMgr.deleteHost(hostId, false, false)) {
+            return true;
+        } else {
             return false;
         }
     }
@@ -528,13 +522,20 @@ public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsage
         return host;
     }
 
-	@Override
+    @Override
     public DeleteHostAnswer deleteHost(HostVO host, boolean isForced, boolean isForceDeleteStorage) throws UnableDeleteHostException {
-		if(host.getType() != Host.Type.TrafficMonitor){
-	    return null;
-    }
+        if(host.getType() != Host.Type.TrafficMonitor){
+            return null;
+        }
+
+        long hostId = host.getId();
+        _agentMgr.disconnectWithoutInvestigation(hostId, Status.Event.Remove);
+        _detailsDao.deleteDetails(hostId);
+        host.setGuid(null);
+        _hostDao.update(hostId, host);
+        _hostDao.remove(hostId);
+        return new DeleteHostAnswer(false);
 
-		return new DeleteHostAnswer(true);
     }
 
 }


[2/2] git commit: updated refs/heads/master to 87a5dc5

Posted by ki...@apache.org.
encrypt vnc_password for removed Vms also. Snapshots of removed Vms still refer Vm VOs


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

Branch: refs/heads/master
Commit: 87a5dc582e3400d2b825522e9bb2ca949363458f
Parents: 7713c5c
Author: Kishan Kavala <ki...@cloud.com>
Authored: Thu Jun 27 17:39:05 2013 +0530
Committer: Kishan Kavala <ki...@cloud.com>
Committed: Fri Jun 28 11:13:02 2013 +0530

----------------------------------------------------------------------
 engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/87a5dc58/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java
index 2d77429..e1b56df 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade2214to30.java
@@ -462,7 +462,7 @@ public class Upgrade2214to30 extends Upgrade30xBase implements DbUpgrade {
         ResultSet rs = null;
         try {
         	int numRows = 0;
-        	pstmt = conn.prepareStatement("select count(id) from `cloud`.`vm_instance` where removed is null");
+        	pstmt = conn.prepareStatement("select count(id) from `cloud`.`vm_instance`");
             rs = pstmt.executeQuery();
             if(rs.next()){
             	numRows = rs.getInt(1);
@@ -471,7 +471,7 @@ public class Upgrade2214to30 extends Upgrade30xBase implements DbUpgrade {
             pstmt.close();
             int offset = 0;
             while(offset < numRows){
-            	pstmt = conn.prepareStatement("select id, vnc_password from `cloud`.`vm_instance` where removed is null limit "+offset+", 500");
+            	pstmt = conn.prepareStatement("select id, vnc_password from `cloud`.`vm_instance` limit "+offset+", 500");
             	rs = pstmt.executeQuery();
             	while (rs.next()) {
             		long id = rs.getLong(1);