Search in sources :

Example 36 with DiskProfile

use of com.cloud.vm.DiskProfile in project cloudstack by apache.

the class VolumeOrchestrator method createVolumeFromSnapshot.

@DB
@Override
public VolumeInfo createVolumeFromSnapshot(Volume volume, Snapshot snapshot, UserVm vm) throws StorageUnavailableException {
    Account account = _entityMgr.findById(Account.class, volume.getAccountId());
    final HashSet<StoragePool> poolsToAvoid = new HashSet<StoragePool>();
    StoragePool pool = null;
    Set<Long> podsToAvoid = new HashSet<Long>();
    Pair<Pod, Long> pod = null;
    DiskOffering diskOffering = _entityMgr.findById(DiskOffering.class, volume.getDiskOfferingId());
    DataCenter dc = _entityMgr.findById(DataCenter.class, volume.getDataCenterId());
    DiskProfile dskCh = new DiskProfile(volume, diskOffering, snapshot.getHypervisorType());
    String msg = "There are no available storage pools to store the volume in";
    if (vm != null) {
        Pod podofVM = _entityMgr.findById(Pod.class, vm.getPodIdToDeployIn());
        if (podofVM != null) {
            pod = new Pair<Pod, Long>(podofVM, podofVM.getId());
        }
    }
    if (vm != null && pod != null) {
        // if VM is running use the hostId to find the clusterID. If it is stopped, refer the cluster where the ROOT volume of the VM exists.
        Long hostId = null;
        Long clusterId = null;
        if (vm.getState() == State.Running) {
            hostId = vm.getHostId();
            if (hostId != null) {
                Host vmHost = _entityMgr.findById(Host.class, hostId);
                clusterId = vmHost.getClusterId();
            }
        } else {
            List<VolumeVO> rootVolumesOfVm = _volsDao.findByInstanceAndType(vm.getId(), Volume.Type.ROOT);
            if (rootVolumesOfVm.size() != 1) {
                throw new CloudRuntimeException("The VM " + vm.getHostName() + " has more than one ROOT volume and is in an invalid state. Please contact Cloud Support.");
            } else {
                VolumeVO rootVolumeOfVm = rootVolumesOfVm.get(0);
                StoragePoolVO rootDiskPool = _storagePoolDao.findById(rootVolumeOfVm.getPoolId());
                clusterId = (rootDiskPool == null ? null : rootDiskPool.getClusterId());
            }
        }
        // Determine what storage pool to store the volume in
        while ((pool = findStoragePool(dskCh, dc, pod.first(), clusterId, hostId, vm, poolsToAvoid)) != null) {
            break;
        }
        if (pool == null) {
            // pool could not be found in the VM's pod/cluster.
            if (s_logger.isDebugEnabled()) {
                s_logger.debug("Could not find any storage pool to create Volume in the pod/cluster of the provided VM " + vm.getUuid());
            }
            StringBuilder addDetails = new StringBuilder(msg);
            addDetails.append(", Could not find any storage pool to create Volume in the pod/cluster of the VM ");
            addDetails.append(vm.getUuid());
            msg = addDetails.toString();
        }
    } else {
        // Determine what pod to store the volume in
        while ((pod = findPod(null, null, dc, account.getId(), podsToAvoid)) != null) {
            podsToAvoid.add(pod.first().getId());
            // Determine what storage pool to store the volume in
            while ((pool = findStoragePool(dskCh, dc, pod.first(), null, null, null, poolsToAvoid)) != null) {
                break;
            }
            if (pool != null) {
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug("Found a suitable pool for create volume: " + pool.getId());
                }
                break;
            }
        }
    }
    if (pool == null) {
        s_logger.info(msg);
        throw new StorageUnavailableException(msg, -1);
    }
    VolumeInfo vol = volFactory.getVolume(volume.getId());
    DataStore store = dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary);
    DataStoreRole dataStoreRole = getDataStoreRole(snapshot);
    SnapshotInfo snapInfo = snapshotFactory.getSnapshot(snapshot.getId(), dataStoreRole);
    if (snapInfo == null && dataStoreRole == DataStoreRole.Image) {
        // snapshot is not backed up to secondary, let's do that now.
        snapInfo = snapshotFactory.getSnapshot(snapshot.getId(), DataStoreRole.Primary);
        if (snapInfo == null) {
            throw new CloudRuntimeException("Cannot find snapshot " + snapshot.getId());
        }
        snapInfo = backupSnapshotIfNeeded(snapshot, dataStoreRole, snapInfo);
    }
    // don't try to perform a sync if the DataStoreRole of the snapshot is equal to DataStoreRole.Primary
    if (!DataStoreRole.Primary.equals(snapInfo.getDataStore().getRole())) {
        try {
            // sync snapshot to region store if necessary
            DataStore snapStore = snapInfo.getDataStore();
            long snapVolId = snapInfo.getVolumeId();
            _snapshotSrv.syncVolumeSnapshotsToRegionStore(snapVolId, snapStore);
        } catch (Exception ex) {
            // log but ignore the sync error to avoid any potential S3 down issue, it should be sync next time
            s_logger.warn(ex.getMessage(), ex);
        }
    }
    // create volume on primary from snapshot
    AsyncCallFuture<VolumeApiResult> future = volService.createVolumeFromSnapshot(vol, store, snapInfo);
    try {
        VolumeApiResult result = future.get();
        if (result.isFailed()) {
            s_logger.debug("Failed to create volume from snapshot:" + result.getResult());
            throw new CloudRuntimeException("Failed to create volume from snapshot:" + result.getResult());
        }
        return result.getVolume();
    } catch (InterruptedException e) {
        s_logger.debug("Failed to create volume from snapshot", e);
        throw new CloudRuntimeException("Failed to create volume from snapshot", e);
    } catch (ExecutionException e) {
        s_logger.debug("Failed to create volume from snapshot", e);
        throw new CloudRuntimeException("Failed to create volume from snapshot", e);
    }
}
Also used : Account(com.cloud.user.Account) StoragePool(com.cloud.storage.StoragePool) DiskOffering(com.cloud.offering.DiskOffering) VolumeInfo(org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo) VolumeApiResult(org.apache.cloudstack.engine.subsystem.api.storage.VolumeService.VolumeApiResult) DataStoreRole(com.cloud.storage.DataStoreRole) VolumeVO(com.cloud.storage.VolumeVO) StorageUnavailableException(com.cloud.exception.StorageUnavailableException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) PrimaryDataStore(org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStore) DataStore(org.apache.cloudstack.engine.subsystem.api.storage.DataStore) StoragePoolVO(org.apache.cloudstack.storage.datastore.db.StoragePoolVO) ExecutionException(java.util.concurrent.ExecutionException) HashSet(java.util.HashSet) Pod(com.cloud.dc.Pod) Host(com.cloud.host.Host) DiskProfile(com.cloud.vm.DiskProfile) NoTransitionException(com.cloud.utils.fsm.NoTransitionException) InsufficientStorageCapacityException(com.cloud.exception.InsufficientStorageCapacityException) StorageUnavailableException(com.cloud.exception.StorageUnavailableException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) StorageAccessException(com.cloud.exception.StorageAccessException) ExecutionException(java.util.concurrent.ExecutionException) InvalidParameterValueException(com.cloud.exception.InvalidParameterValueException) ConcurrentOperationException(com.cloud.exception.ConcurrentOperationException) ConfigurationException(javax.naming.ConfigurationException) SnapshotInfo(org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo) DataCenter(com.cloud.dc.DataCenter) DB(com.cloud.utils.db.DB)

Example 37 with DiskProfile

use of com.cloud.vm.DiskProfile in project cloudstack by apache.

the class VolumeOrchestrator method moveVolume.

@Override
public VolumeInfo moveVolume(VolumeInfo volume, long destPoolDcId, Long destPoolPodId, Long destPoolClusterId, HypervisorType dataDiskHyperType) throws ConcurrentOperationException, StorageUnavailableException {
    // Find a destination storage pool with the specified criteria
    DiskOffering diskOffering = _entityMgr.findById(DiskOffering.class, volume.getDiskOfferingId());
    DiskProfile dskCh = new DiskProfile(volume.getId(), volume.getVolumeType(), volume.getName(), diskOffering.getId(), diskOffering.getDiskSize(), diskOffering.getTagsArray(), diskOffering.isUseLocalStorage(), diskOffering.isRecreatable(), null);
    dskCh.setHyperType(dataDiskHyperType);
    storageMgr.setDiskProfileThrottling(dskCh, null, diskOffering);
    DataCenter destPoolDataCenter = _entityMgr.findById(DataCenter.class, destPoolDcId);
    Pod destPoolPod = _entityMgr.findById(Pod.class, destPoolPodId);
    StoragePool destPool = findStoragePool(dskCh, destPoolDataCenter, destPoolPod, destPoolClusterId, null, null, new HashSet<StoragePool>());
    if (destPool == null) {
        throw new CloudRuntimeException("Failed to find a storage pool with enough capacity to move the volume to.");
    }
    Volume newVol = migrateVolume(volume, destPool);
    return volFactory.getVolume(newVol.getId());
}
Also used : DiskOffering(com.cloud.offering.DiskOffering) DataCenter(com.cloud.dc.DataCenter) StoragePool(com.cloud.storage.StoragePool) Pod(com.cloud.dc.Pod) VmWorkMigrateVolume(com.cloud.vm.VmWorkMigrateVolume) VmWorkAttachVolume(com.cloud.vm.VmWorkAttachVolume) Volume(com.cloud.storage.Volume) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) DiskProfile(com.cloud.vm.DiskProfile)

Example 38 with DiskProfile

use of com.cloud.vm.DiskProfile in project cloudstack by apache.

the class DeploymentPlanningManagerImpl method findSuitablePoolsForVolumes.

protected Pair<Map<Volume, List<StoragePool>>, List<Volume>> findSuitablePoolsForVolumes(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) {
    List<VolumeVO> volumesTobeCreated = _volsDao.findUsableVolumesForInstance(vmProfile.getId());
    Map<Volume, List<StoragePool>> suitableVolumeStoragePools = new HashMap<Volume, List<StoragePool>>();
    List<Volume> readyAndReusedVolumes = new ArrayList<Volume>();
    // There should be atleast the ROOT volume of the VM in usable state
    if (volumesTobeCreated.isEmpty()) {
        // OfflineVmwareMigration: find out what is wrong with the id of the vm we try to start
        throw new CloudRuntimeException("Unable to create deployment, no usable volumes found for the VM: " + vmProfile.getId());
    }
    // don't allow to start vm that doesn't have a root volume
    if (_volsDao.findByInstanceAndType(vmProfile.getId(), Volume.Type.ROOT).isEmpty()) {
        throw new CloudRuntimeException("Unable to prepare volumes for vm as ROOT volume is missing");
    }
    // for each volume find list of suitable storage pools by calling the
    // allocators
    Set<Long> originalAvoidPoolSet = avoid.getPoolsToAvoid();
    if (originalAvoidPoolSet == null) {
        originalAvoidPoolSet = new HashSet<Long>();
    }
    Set<Long> poolsToAvoidOutput = new HashSet<Long>(originalAvoidPoolSet);
    for (VolumeVO toBeCreated : volumesTobeCreated) {
        s_logger.debug("Checking suitable pools for volume (Id, Type): (" + toBeCreated.getId() + "," + toBeCreated.getVolumeType().name() + ")");
        // be reused.
        if (plan.getPoolId() != null || (toBeCreated.getVolumeType() == Volume.Type.DATADISK && toBeCreated.getPoolId() != null && toBeCreated.getState() == Volume.State.Ready)) {
            s_logger.debug("Volume has pool already allocated, checking if pool can be reused, poolId: " + toBeCreated.getPoolId());
            List<StoragePool> suitablePools = new ArrayList<StoragePool>();
            StoragePool pool = null;
            if (toBeCreated.getPoolId() != null) {
                pool = (StoragePool) dataStoreMgr.getPrimaryDataStore(toBeCreated.getPoolId());
            } else {
                pool = (StoragePool) dataStoreMgr.getPrimaryDataStore(plan.getPoolId());
            }
            if (!pool.isInMaintenance()) {
                if (!avoid.shouldAvoid(pool)) {
                    long exstPoolDcId = pool.getDataCenterId();
                    long exstPoolPodId = pool.getPodId() != null ? pool.getPodId() : -1;
                    long exstPoolClusterId = pool.getClusterId() != null ? pool.getClusterId() : -1;
                    boolean canReusePool = false;
                    if (plan.getDataCenterId() == exstPoolDcId && plan.getPodId() == exstPoolPodId && plan.getClusterId() == exstPoolClusterId) {
                        canReusePool = true;
                    } else if (plan.getDataCenterId() == exstPoolDcId) {
                        DataStore dataStore = dataStoreMgr.getPrimaryDataStore(pool.getId());
                        if (dataStore != null && dataStore.getScope() != null && dataStore.getScope().getScopeType() == ScopeType.ZONE) {
                            canReusePool = true;
                        }
                    } else {
                        s_logger.debug("Pool of the volume does not fit the specified plan, need to reallocate a pool for this volume");
                        canReusePool = false;
                    }
                    if (canReusePool) {
                        s_logger.debug("Planner need not allocate a pool for this volume since its READY");
                        suitablePools.add(pool);
                        suitableVolumeStoragePools.put(toBeCreated, suitablePools);
                        if (!(toBeCreated.getState() == Volume.State.Allocated || toBeCreated.getState() == Volume.State.Creating)) {
                            readyAndReusedVolumes.add(toBeCreated);
                        }
                        continue;
                    }
                } else {
                    s_logger.debug("Pool of the volume is in avoid set, need to reallocate a pool for this volume");
                }
            } else {
                s_logger.debug("Pool of the volume is in maintenance, need to reallocate a pool for this volume");
            }
        }
        if (s_logger.isDebugEnabled()) {
            s_logger.debug("We need to allocate new storagepool for this volume");
        }
        if (!isRootAdmin(vmProfile)) {
            if (!isEnabledForAllocation(plan.getDataCenterId(), plan.getPodId(), plan.getClusterId())) {
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug("Cannot allocate new storagepool for this volume in this cluster, allocation state is disabled");
                    s_logger.debug("Cannot deploy to this specified plan, allocation state is disabled, returning.");
                }
                // Cannot find suitable storage pools under this cluster for
                // this volume since allocation_state is disabled.
                // - remove any suitable pools found for other volumes.
                // All volumes should get suitable pools under this cluster;
                // else we cant use this cluster.
                suitableVolumeStoragePools.clear();
                break;
            }
        }
        s_logger.debug("Calling StoragePoolAllocators to find suitable pools");
        DiskOfferingVO diskOffering = _diskOfferingDao.findById(toBeCreated.getDiskOfferingId());
        // FR123 check how is it different for service offering getTagsArray and disk offering's
        // if ((vmProfile.getTemplate().getFormat() == Storage.ImageFormat.ISO || toBeCreated.getVolumeType() == Volume.Type.ROOT)
        // && vmProfile.getServiceOffering().getTagsArray().length != 0) {
        // diskOffering.setTagsArray(Arrays.asList(vmProfile.getServiceOffering().getTagsArray()));
        // }
        DiskProfile diskProfile = new DiskProfile(toBeCreated, diskOffering, vmProfile.getHypervisorType());
        boolean useLocalStorage = false;
        if (vmProfile.getType() != VirtualMachine.Type.User) {
            DataCenterVO zone = _dcDao.findById(plan.getDataCenterId());
            assert (zone != null) : "Invalid zone in deployment plan";
            Boolean useLocalStorageForSystemVM = ConfigurationManagerImpl.SystemVMUseLocalStorage.valueIn(zone.getId());
            if (useLocalStorageForSystemVM != null) {
                useLocalStorage = useLocalStorageForSystemVM.booleanValue();
                s_logger.debug("System VMs will use " + (useLocalStorage ? "local" : "shared") + " storage for zone id=" + plan.getDataCenterId());
            }
        } else {
            useLocalStorage = diskOffering.isUseLocalStorage();
        }
        diskProfile.setUseLocalStorage(useLocalStorage);
        boolean foundPotentialPools = false;
        for (StoragePoolAllocator allocator : _storagePoolAllocators) {
            final List<StoragePool> suitablePools = allocator.allocateToPool(diskProfile, vmProfile, plan, avoid, returnUpTo);
            if (suitablePools != null && !suitablePools.isEmpty()) {
                checkForPreferredStoragePool(suitablePools, vmProfile.getVirtualMachine(), suitableVolumeStoragePools, toBeCreated);
                foundPotentialPools = true;
                break;
            }
        }
        if (avoid.getPoolsToAvoid() != null) {
            poolsToAvoidOutput.addAll(avoid.getPoolsToAvoid());
            avoid.getPoolsToAvoid().retainAll(originalAvoidPoolSet);
        }
        if (!foundPotentialPools) {
            s_logger.debug("No suitable pools found for volume: " + toBeCreated + " under cluster: " + plan.getClusterId());
            // No suitable storage pools found under this cluster for this
            // volume. - remove any suitable pools found for other volumes.
            // All volumes should get suitable pools under this cluster;
            // else we cant use this cluster.
            suitableVolumeStoragePools.clear();
            break;
        }
    }
    HashSet<Long> toRemove = new HashSet<Long>();
    for (List<StoragePool> lsp : suitableVolumeStoragePools.values()) {
        for (StoragePool sp : lsp) {
            toRemove.add(sp.getId());
        }
    }
    poolsToAvoidOutput.removeAll(toRemove);
    if (avoid.getPoolsToAvoid() != null) {
        avoid.getPoolsToAvoid().addAll(poolsToAvoidOutput);
    }
    if (suitableVolumeStoragePools.isEmpty()) {
        s_logger.debug("No suitable pools found");
    }
    return new Pair<Map<Volume, List<StoragePool>>, List<Volume>>(suitableVolumeStoragePools, readyAndReusedVolumes);
}
Also used : DataCenterVO(com.cloud.dc.DataCenterVO) StoragePool(com.cloud.storage.StoragePool) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) DiskProfile(com.cloud.vm.DiskProfile) VolumeVO(com.cloud.storage.VolumeVO) Volume(com.cloud.storage.Volume) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) DiskOfferingVO(com.cloud.storage.DiskOfferingVO) DataStore(org.apache.cloudstack.engine.subsystem.api.storage.DataStore) ArrayList(java.util.ArrayList) ExcludeList(com.cloud.deploy.DeploymentPlanner.ExcludeList) List(java.util.List) StoragePoolAllocator(org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator) HashSet(java.util.HashSet) Pair(com.cloud.utils.Pair)

Example 39 with DiskProfile

use of com.cloud.vm.DiskProfile in project cloudstack by apache.

the class MockStorageManagerImpl method createVolume.

@Override
public CreateAnswer createVolume(CreateCommand cmd) {
    StorageFilerTO sf = cmd.getPool();
    DiskProfile dskch = cmd.getDiskCharacteristics();
    MockStoragePoolVO storagePool = null;
    TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.SIMULATOR_DB);
    try {
        txn.start();
        storagePool = _mockStoragePoolDao.findByUuid(sf.getUuid());
        txn.commit();
        if (storagePool == null) {
            return new CreateAnswer(cmd, "Failed to find storage pool: " + sf.getUuid());
        }
    } catch (Exception ex) {
        txn.rollback();
        throw new CloudRuntimeException("Error when finding storage " + sf.getUuid(), ex);
    } finally {
        txn.close();
        txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
        txn.close();
    }
    String volumeName = UUID.randomUUID().toString();
    MockVolumeVO volume = new MockVolumeVO();
    volume.setPoolId(storagePool.getId());
    volume.setName(volumeName);
    volume.setPath(storagePool.getMountPoint() + volumeName);
    volume.setSize(dskch.getSize());
    volume.setType(MockVolumeType.VOLUME);
    txn = TransactionLegacy.open(TransactionLegacy.SIMULATOR_DB);
    try {
        txn.start();
        volume = _mockVolumeDao.persist(volume);
        txn.commit();
    } catch (Exception ex) {
        txn.rollback();
        throw new CloudRuntimeException("Error when saving volume " + volume, ex);
    } finally {
        txn.close();
        txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
        txn.close();
    }
    VolumeTO volumeTo = new VolumeTO(cmd.getVolumeId(), dskch.getType(), sf.getType(), sf.getUuid(), volume.getName(), storagePool.getMountPoint(), volume.getPath(), volume.getSize(), null);
    return new CreateAnswer(cmd, volumeTo);
}
Also used : CreateAnswer(com.cloud.agent.api.storage.CreateAnswer) TransactionLegacy(com.cloud.utils.db.TransactionLegacy) VolumeTO(com.cloud.agent.api.to.VolumeTO) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) MockStoragePoolVO(com.cloud.simulator.MockStoragePoolVO) MockVolumeVO(com.cloud.simulator.MockVolumeVO) StorageFilerTO(com.cloud.agent.api.to.StorageFilerTO) DiskProfile(com.cloud.vm.DiskProfile) URISyntaxException(java.net.URISyntaxException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) ConfigurationException(javax.naming.ConfigurationException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException)

Example 40 with DiskProfile

use of com.cloud.vm.DiskProfile in project cloudstack by apache.

the class Ovm3StorageProcessor method execute.

public CreateAnswer execute(CreateCommand cmd) {
    LOGGER.debug("execute: " + cmd.getClass());
    StorageFilerTO primaryStorage = cmd.getPool();
    DiskProfile disk = cmd.getDiskCharacteristics();
    /* disk should have a uuid */
    // should also be replaced with getVirtualDiskPath ?
    String fileName = UUID.randomUUID().toString() + ".raw";
    String dst = primaryStorage.getPath() + "/" + primaryStorage.getUuid() + "/" + fileName;
    try {
        StoragePlugin store = new StoragePlugin(c);
        if (cmd.getTemplateUrl() != null) {
            LOGGER.debug("CreateCommand " + cmd.getTemplateUrl() + " " + dst);
            Linux host = new Linux(c);
            host.copyFile(cmd.getTemplateUrl(), dst);
        } else {
            /* this is a dup with the createVolume ? */
            LOGGER.debug("CreateCommand " + dst);
            store.storagePluginCreate(primaryStorage.getUuid(), primaryStorage.getHost(), dst, disk.getSize(), false);
        }
        FileProperties fp = store.storagePluginGetFileInfo(primaryStorage.getUuid(), primaryStorage.getHost(), dst);
        VolumeTO volume = new VolumeTO(cmd.getVolumeId(), disk.getType(), primaryStorage.getType(), primaryStorage.getUuid(), primaryStorage.getPath(), fileName, fp.getName(), fp.getSize(), null);
        return new CreateAnswer(cmd, volume);
    } catch (Exception e) {
        LOGGER.debug("CreateCommand failed", e);
        return new CreateAnswer(cmd, e.getMessage());
    }
}
Also used : CreateAnswer(com.cloud.agent.api.storage.CreateAnswer) FileProperties(com.cloud.hypervisor.ovm3.objects.StoragePlugin.FileProperties) VolumeTO(com.cloud.agent.api.to.VolumeTO) Linux(com.cloud.hypervisor.ovm3.objects.Linux) StorageFilerTO(com.cloud.agent.api.to.StorageFilerTO) DiskProfile(com.cloud.vm.DiskProfile) StoragePlugin(com.cloud.hypervisor.ovm3.objects.StoragePlugin) URISyntaxException(java.net.URISyntaxException) Ovm3ResourceException(com.cloud.hypervisor.ovm3.objects.Ovm3ResourceException)

Aggregations

DiskProfile (com.cloud.vm.DiskProfile)49 StoragePool (com.cloud.storage.StoragePool)26 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)18 StorageFilerTO (com.cloud.agent.api.to.StorageFilerTO)16 DataCenterDeployment (com.cloud.deploy.DataCenterDeployment)16 ExcludeList (com.cloud.deploy.DeploymentPlanner.ExcludeList)16 Test (org.junit.Test)16 Volume (com.cloud.storage.Volume)15 VirtualMachineProfile (com.cloud.vm.VirtualMachineProfile)14 Answer (com.cloud.agent.api.Answer)12 DiskOfferingVO (com.cloud.storage.DiskOfferingVO)12 ArrayList (java.util.ArrayList)12 StoragePoolAllocator (org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator)12 CreateAnswer (com.cloud.agent.api.storage.CreateAnswer)11 StoragePoolVO (org.apache.cloudstack.storage.datastore.db.StoragePoolVO)11 Pair (com.cloud.utils.Pair)10 VolumeTO (com.cloud.agent.api.to.VolumeTO)9 VolumeVO (com.cloud.storage.VolumeVO)9 HashSet (java.util.HashSet)9 CreateCommand (com.cloud.agent.api.storage.CreateCommand)8