You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by de...@apache.org on 2014/05/09 12:48:57 UTC

[1/3] git commit: updated refs/heads/4.4-forward to 98df3e5

Repository: cloudstack
Updated Branches:
  refs/heads/4.4-forward e8e0449ed -> 98df3e55b


CLOUDSTACK-6399: When there are no vms running on hyperv host, then agent was returning null. In
that case cloudstack was not doing anything and not updating the state of the vms to stopped.
Now the agent returns empty list of hostvmstatereport. Management server will then update the
vm state to stopped (instead of not acting upon the return state).


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

Branch: refs/heads/4.4-forward
Commit: 704f6d8279c314a165199804ee43eaac4b0d482a
Parents: e8e0449
Author: Anshul Gangwar <an...@citrix.com>
Authored: Fri May 9 14:32:36 2014 +0530
Committer: Devdeep Singh <de...@gmail.com>
Committed: Fri May 9 15:30:05 2014 +0530

----------------------------------------------------------------------
 .../hyperv/resource/HypervDirectConnectResource.java  | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/704f6d82/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java
index 7888e43..1816baf 100644
--- a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java
+++ b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java
@@ -90,10 +90,10 @@ import com.cloud.agent.api.SetupGuestNetworkCommand;
 import com.cloud.agent.api.StartCommand;
 import com.cloud.agent.api.StartupCommand;
 import com.cloud.agent.api.StartupRoutingCommand;
-import com.cloud.agent.api.UnPlugNicAnswer;
-import com.cloud.agent.api.UnPlugNicCommand;
 import com.cloud.agent.api.StartupRoutingCommand.VmState;
 import com.cloud.agent.api.StartupStorageCommand;
+import com.cloud.agent.api.UnPlugNicAnswer;
+import com.cloud.agent.api.UnPlugNicCommand;
 import com.cloud.agent.api.UnsupportedAnswer;
 import com.cloud.agent.api.check.CheckSshAnswer;
 import com.cloud.agent.api.check.CheckSshCommand;
@@ -355,8 +355,12 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S
         }
         s_logger.debug("HostVmStateReportCommand received response "
                 + s_gson.toJson(result));
-        if (!result.isEmpty()) {
-            return result;
+        if (result != null) {
+            if (!result.isEmpty()) {
+                return result;
+            } else {
+                return new ArrayList<Map<String, String>>();
+            }
         }
         return null;
     }
@@ -364,7 +368,7 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S
     protected HashMap<String, HostVmStateReportEntry> getHostVmStateReport() {
         final HashMap<String, HostVmStateReportEntry> vmStates = new HashMap<String, HostVmStateReportEntry>();
         ArrayList<Map<String, String>> vmList = requestHostVmStateReport();
-        if (vmList == null || vmList.isEmpty()) {
+        if (vmList == null) {
             return null;
         }
 


[2/3] git commit: updated refs/heads/4.4-forward to 98df3e5

Posted by de...@apache.org.
CLOUDSTACK-6620: Fixed null pointer exception in hyperv agent in getting vmstats, when all vms are deleted from outside


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

Branch: refs/heads/4.4-forward
Commit: 4106aa07214209631ab9e6223c7efe4580ac30bf
Parents: 704f6d8
Author: Anshul Gangwar <an...@citrix.com>
Authored: Fri May 9 14:49:32 2014 +0530
Committer: Devdeep Singh <de...@gmail.com>
Committed: Fri May 9 15:32:49 2014 +0530

----------------------------------------------------------------------
 .../hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs    | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4106aa07/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs
index 7dbb8c1..372f848 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs
@@ -2685,6 +2685,10 @@ namespace HypervResource
 
         public void GetSummaryInfo(Dictionary<string, VmStatsEntry> vmProcessorInfo, List<System.Management.ManagementPath> vmsToInspect)
         {
+            if (vmsToInspect == null || vmsToInspect.Count == 0)
+            {
+                return;
+            }
             // Process info available from WMI, 
             // See http://msdn.microsoft.com/en-us/library/hh850062(v=vs.85).aspx
             uint[] requestedInfo = new uint[] {  // TODO: correct?


[3/3] git commit: updated refs/heads/4.4-forward to 98df3e5

Posted by de...@apache.org.
CLOUDSTACK-6622: After a volume was live migrated, the destination smb storage path was added to
the folder column. For an smb share the smb credentials are in the query string of the path.
Before adding the path, smb shares query string should be cleaned up.


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

Branch: refs/heads/4.4-forward
Commit: 98df3e55b93df9f30b5767b20c0a4a6f1336406a
Parents: 4106aa0
Author: Devdeep Singh <de...@gmail.com>
Authored: Fri May 9 15:54:56 2014 +0530
Committer: Devdeep Singh <de...@gmail.com>
Committed: Fri May 9 15:54:56 2014 +0530

----------------------------------------------------------------------
 .../storage/motion/AncientDataMotionStrategy.java         |  9 ++++++++-
 .../storage/motion/HypervStorageMotionStrategy.java       | 10 +++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/98df3e55/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
----------------------------------------------------------------------
diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
index fbdacfa..415a077 100644
--- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
+++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
@@ -63,6 +63,7 @@ import com.cloud.host.Host;
 import com.cloud.storage.DataStoreRole;
 import com.cloud.storage.StoragePool;
 import com.cloud.storage.VolumeVO;
+import com.cloud.storage.Storage.StoragePoolType;
 import com.cloud.storage.dao.VolumeDao;
 import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.db.DB;
@@ -389,10 +390,16 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
             VolumeVO volumeVo = volDao.findById(volume.getId());
             Long oldPoolId = volume.getPoolId();
             volumeVo.setPath(((MigrateVolumeAnswer)answer).getVolumePath());
-            volumeVo.setFolder(destPool.getPath());
             volumeVo.setPodId(destPool.getPodId());
             volumeVo.setPoolId(destPool.getId());
             volumeVo.setLastPoolId(oldPoolId);
+            // For SMB, pool credentials are also stored in the uri query string.  We trim the query string
+            // part  here to make sure the credentials do not get stored in the db unencrypted.
+            String folder = destPool.getPath();
+            if (destPool.getPoolType() == StoragePoolType.SMB && folder != null && folder.contains("?")) {
+                folder = folder.substring(0, folder.indexOf("?"));
+            }
+            volumeVo.setFolder(folder);
             volDao.update(volume.getId(), volumeVo);
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/98df3e55/plugins/hypervisors/hyperv/src/org/apache/cloudstack/storage/motion/HypervStorageMotionStrategy.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/src/org/apache/cloudstack/storage/motion/HypervStorageMotionStrategy.java b/plugins/hypervisors/hyperv/src/org/apache/cloudstack/storage/motion/HypervStorageMotionStrategy.java
index 011bd12..8a1c414 100644
--- a/plugins/hypervisors/hyperv/src/org/apache/cloudstack/storage/motion/HypervStorageMotionStrategy.java
+++ b/plugins/hypervisors/hyperv/src/org/apache/cloudstack/storage/motion/HypervStorageMotionStrategy.java
@@ -50,6 +50,7 @@ import com.cloud.host.Host;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.storage.StoragePool;
 import com.cloud.storage.VolumeVO;
+import com.cloud.storage.Storage.StoragePoolType;
 import com.cloud.storage.dao.VolumeDao;
 import com.cloud.utils.Pair;
 import com.cloud.utils.exception.CloudRuntimeException;
@@ -161,10 +162,17 @@ public class HypervStorageMotionStrategy implements DataMotionStrategy {
                     VolumeVO volumeVO = volDao.findById(volume.getId());
                     Long oldPoolId = volumeVO.getPoolId();
                     volumeVO.setPath(volumeTo.getPath());
-                    volumeVO.setFolder(pool.getPath());
                     volumeVO.setPodId(pool.getPodId());
                     volumeVO.setPoolId(pool.getId());
                     volumeVO.setLastPoolId(oldPoolId);
+                    // For SMB, pool credentials are also stored in the uri query string.  We trim the query string
+                    // part  here to make sure the credentials do not get stored in the db unencrypted.
+                    String folder = pool.getPath();
+                    if (pool.getPoolType() == StoragePoolType.SMB && folder != null && folder.contains("?")) {
+                        folder = folder.substring(0, folder.indexOf("?"));
+                    }
+                    volumeVO.setFolder(folder);
+
                     volDao.update(volume.getId(), volumeVO);
                     updated = true;
                     break;