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/06/23 09:32:13 UTC
[1/2] git commit: updated refs/heads/master to bbcffbb
Repository: cloudstack
Updated Branches:
refs/heads/master 1c8018517 -> bbcffbbab
CLOUDSTACK-6968: allowing cluster scope volumes to attach to any VM. If migration is
needed then first they will be migrated to appropriate cluster before attaching.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6416de57
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6416de57
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6416de57
Branch: refs/heads/master
Commit: 6416de5770ad5579f78dc06ebc58bb0e4262c2c2
Parents: 1c80185
Author: Anshul Gangwar <an...@citrix.com>
Authored: Mon Jun 23 11:30:50 2014 +0530
Committer: Devdeep Singh <de...@gmail.com>
Committed: Mon Jun 23 12:15:10 2014 +0530
----------------------------------------------------------------------
server/src/com/cloud/storage/VolumeApiServiceImpl.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6416de57/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index 8a7b220..fff6b11 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -26,7 +26,6 @@ import java.util.concurrent.ExecutionException;
import javax.inject.Inject;
-import com.cloud.utils.DateUtil;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd;
@@ -116,6 +115,7 @@ import com.cloud.user.User;
import com.cloud.user.VmDiskStatisticsVO;
import com.cloud.user.dao.AccountDao;
import com.cloud.user.dao.VmDiskStatisticsDao;
+import com.cloud.utils.DateUtil;
import com.cloud.utils.EnumUtils;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.Pair;
@@ -2010,7 +2010,9 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
}
if (storeForNewStoreScope.getScopeId().equals(vmClusterId)) {
return false;
- }
+ } else {
+ return true;
+ }
} else if (storeForNewStoreScope.getScopeType() == ScopeType.HOST
&& (storeForExistingStoreScope.getScopeType() == ScopeType.CLUSTER || storeForExistingStoreScope.getScopeType() == ScopeType.ZONE)) {
Long hostId = _vmInstanceDao.findById(existingVolume.getInstanceId()).getHostId();
[2/2] git commit: updated refs/heads/master to bbcffbb
Posted by de...@apache.org.
CLOUDSTACK-6965: fixed the NullPointerException introduced by fix for cloudstack
6935 in AbstractStoragePoolAllocator#filter method for Zone Wide storage
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/bbcffbba
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/bbcffbba
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/bbcffbba
Branch: refs/heads/master
Commit: bbcffbbab09905872a1b9c405a67734e457182fd
Parents: 6416de5
Author: Anshul Gangwar <an...@citrix.com>
Authored: Mon Jun 23 10:58:44 2014 +0530
Committer: Devdeep Singh <de...@gmail.com>
Committed: Mon Jun 23 12:17:08 2014 +0530
----------------------------------------------------------------------
.../allocator/AbstractStoragePoolAllocator.java | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bbcffbba/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
index 2d958a6..847bad3 100755
--- a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
@@ -27,11 +27,12 @@ import java.util.Random;
import javax.inject.Inject;
import javax.naming.ConfigurationException;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator;
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
-import org.apache.log4j.Logger;
import com.cloud.dc.ClusterVO;
import com.cloud.dc.dao.ClusterDao;
@@ -171,10 +172,17 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase implement
}
Long clusterId = pool.getClusterId();
- ClusterVO cluster = _clusterDao.findById(clusterId);
- if (!(cluster.getHypervisorType() == dskCh.getHypervisorType())) {
+ if (clusterId != null) {
+ ClusterVO cluster = _clusterDao.findById(clusterId);
+ if (!(cluster.getHypervisorType() == dskCh.getHypervisorType())) {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("StoragePool's Cluster does not have required hypervisorType, skipping this pool");
+ }
+ return false;
+ }
+ } else if (pool.getHypervisor() != null && !(pool.getHypervisor() == dskCh.getHypervisorType())) {
if (s_logger.isDebugEnabled()) {
- s_logger.debug("StoragePool's Cluster does not have required hypervisorType, skipping this pool");
+ s_logger.debug("StoragePool does not have required hypervisorType, skipping this pool");
}
return false;
}