mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-7478, CLOUDSTACK-7479: Check for correct storage pool type for ROOT and Data disks in LXC
This commit is contained in:
parent
df198d07e1
commit
e491716aa7
@ -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>();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user