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 2014/09/04 19:33:47 UTC
git commit: updated refs/heads/master to e491716
Repository: cloudstack
Updated Branches:
refs/heads/master df198d07e -> e491716aa
CLOUDSTACK-7478, CLOUDSTACK-7479: Check for correct storage pool type for ROOT and Data disks in LXC
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e491716a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e491716a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e491716a
Branch: refs/heads/master
Commit: e491716aa7524e620e740fb687cdbde49b9e94b2
Parents: df198d0
Author: Kishan Kavala <ki...@apache.org>
Authored: Thu Sep 4 22:55:20 2014 +0530
Committer: Kishan Kavala <ki...@apache.org>
Committed: Thu Sep 4 22:55:30 2014 +0530
----------------------------------------------------------------------
.../allocator/AbstractStoragePoolAllocator.java | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e491716a/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 d3df356..d717f72 100755
--- a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
@@ -27,6 +27,7 @@ import java.util.Random;
import javax.inject.Inject;
import javax.naming.ConfigurationException;
+import com.cloud.storage.Storage;
import org.apache.log4j.Logger;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
@@ -179,6 +180,23 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase implement
return false;
}
+ if(HypervisorType.LXC.equals(dskCh.getHypervisorType())){
+ if(Volume.Type.ROOT.equals(dskCh.getType())){
+ //LXC ROOT disks supports NFS and local storage pools only
+ if(!(Storage.StoragePoolType.NetworkFilesystem.equals(pool.getPoolType()) ||
+ Storage.StoragePoolType.Filesystem.equals(pool.getPoolType())) ){
+ s_logger.debug("StoragePool does not support LXC ROOT disk, skipping this pool");
+ return false;
+ }
+ } else if (Volume.Type.DATADISK.equals(dskCh.getType())){
+ //LXC DATA disks supports NFS and local storage pools only
+ if(!Storage.StoragePoolType.RBD.equals(pool.getPoolType())){
+ s_logger.debug("StoragePool does not support LXC DATA disk, skipping this pool");
+ return false;
+ }
+ }
+ }
+
// check capacity
Volume volume = _volumeDao.findById(dskCh.getVolumeId());
List<Volume> requestVolumes = new ArrayList<Volume>();