Search in sources :

Example 16 with Volume

use of com.cloud.storage.Volume in project cloudstack by apache.

the class DownloadMonitorImpl method downloadVolumeToStorage.

@Override
public void downloadVolumeToStorage(DataObject volume, AsyncCompletionCallback<DownloadAnswer> callback) {
    boolean downloadJobExists = false;
    VolumeDataStoreVO volumeHost = null;
    DataStore store = volume.getDataStore();
    VolumeInfo volInfo = (VolumeInfo) volume;
    RegisterVolumePayload payload = (RegisterVolumePayload) volInfo.getpayload();
    String url = payload.getUrl();
    String checkSum = payload.getChecksum();
    ImageFormat format = ImageFormat.valueOf(payload.getFormat());
    volumeHost = _volumeStoreDao.findByStoreVolume(store.getId(), volume.getId());
    if (volumeHost == null) {
        volumeHost = new VolumeDataStoreVO(store.getId(), volume.getId(), new Date(), 0, Status.NOT_DOWNLOADED, null, null, "jobid0000", null, url, checkSum);
        _volumeStoreDao.persist(volumeHost);
    } else if ((volumeHost.getJobId() != null) && (volumeHost.getJobId().length() > 2)) {
        downloadJobExists = true;
    } else {
        // persit url and checksum
        volumeHost.setDownloadUrl(url);
        volumeHost.setChecksum(checkSum);
        _volumeStoreDao.update(volumeHost.getId(), volumeHost);
    }
    Long maxVolumeSizeInBytes = getMaxVolumeSizeInBytes();
    if (volumeHost != null) {
        start();
        Volume vol = _volumeDao.findById(volume.getId());
        DownloadCommand dcmd = new DownloadCommand((VolumeObjectTO) (volume.getTO()), maxVolumeSizeInBytes, checkSum, url, format);
        dcmd.setProxy(getHttpProxy());
        if (downloadJobExists) {
            dcmd = new DownloadProgressCommand(dcmd, volumeHost.getJobId(), RequestType.GET_OR_RESTART);
            dcmd.setResourceType(ResourceType.VOLUME);
        }
        EndPoint ep = _epSelector.select(volume);
        if (ep == null) {
            s_logger.warn("There is no secondary storage VM for image store " + store.getName());
            return;
        }
        DownloadListener dl = new DownloadListener(ep, store, volume, _timer, this, dcmd, callback);
        // auto-wired those injected fields in DownloadListener
        ComponentContext.inject(dl);
        if (downloadJobExists) {
            dl.setCurrState(volumeHost.getDownloadState());
        }
        try {
            ep.sendMessageAsync(dcmd, new UploadListener.Callback(ep.getId(), dl));
        } catch (Exception e) {
            s_logger.warn("Unable to start /resume download of volume " + volume.getId() + " to " + store.getName(), e);
            dl.setDisconnected();
            dl.scheduleStatusCheck(RequestType.GET_OR_RESTART);
        }
    }
}
Also used : DownloadCommand(org.apache.cloudstack.storage.command.DownloadCommand) VolumeInfo(org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo) EndPoint(org.apache.cloudstack.engine.subsystem.api.storage.EndPoint) RegisterVolumePayload(com.cloud.storage.RegisterVolumePayload) UploadListener(com.cloud.storage.upload.UploadListener) Date(java.util.Date) URISyntaxException(java.net.URISyntaxException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) ImageFormat(com.cloud.storage.Storage.ImageFormat) DownloadProgressCommand(org.apache.cloudstack.storage.command.DownloadProgressCommand) Volume(com.cloud.storage.Volume) DataStore(org.apache.cloudstack.engine.subsystem.api.storage.DataStore) VolumeDataStoreVO(org.apache.cloudstack.storage.datastore.db.VolumeDataStoreVO)

Example 17 with Volume

use of com.cloud.storage.Volume in project cloudstack by apache.

the class VolumeOrchestrator method migrateVolumes.

@Override
public void migrateVolumes(VirtualMachine vm, VirtualMachineTO vmTo, Host srcHost, Host destHost, Map<Volume, StoragePool> volumeToPool) {
    // Check if all the vms being migrated belong to the vm.
    // Check if the storage pool is of the right type.
    // Create a VolumeInfo to DataStore map too.
    Map<VolumeInfo, DataStore> volumeMap = new HashMap<VolumeInfo, DataStore>();
    for (Map.Entry<Volume, StoragePool> entry : volumeToPool.entrySet()) {
        Volume volume = entry.getKey();
        StoragePool storagePool = entry.getValue();
        StoragePool destPool = (StoragePool) dataStoreMgr.getDataStore(storagePool.getId(), DataStoreRole.Primary);
        if (volume.getInstanceId() != vm.getId()) {
            throw new CloudRuntimeException("Volume " + volume + " that has to be migrated doesn't belong to the" + " instance " + vm);
        }
        if (destPool == null) {
            throw new CloudRuntimeException("Failed to find the destination storage pool " + storagePool.getId());
        }
        volumeMap.put(volFactory.getVolume(volume.getId()), (DataStore) destPool);
    }
    AsyncCallFuture<CommandResult> future = volService.migrateVolumes(volumeMap, vmTo, srcHost, destHost);
    try {
        CommandResult result = future.get();
        if (result.isFailed()) {
            s_logger.debug("Failed to migrated vm " + vm + " along with its volumes. " + result.getResult());
            throw new CloudRuntimeException("Failed to migrated vm " + vm + " along with its volumes. ");
        }
    } catch (InterruptedException e) {
        s_logger.debug("Failed to migrated vm " + vm + " along with its volumes.", e);
    } catch (ExecutionException e) {
        s_logger.debug("Failed to migrated vm " + vm + " along with its volumes.", e);
    }
}
Also used : StoragePool(com.cloud.storage.StoragePool) HashMap(java.util.HashMap) VolumeInfo(org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo) CommandResult(org.apache.cloudstack.storage.command.CommandResult) VmWorkMigrateVolume(com.cloud.vm.VmWorkMigrateVolume) VmWorkAttachVolume(com.cloud.vm.VmWorkAttachVolume) Volume(com.cloud.storage.Volume) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) PrimaryDataStore(org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStore) DataStore(org.apache.cloudstack.engine.subsystem.api.storage.DataStore) ExecutionException(java.util.concurrent.ExecutionException) Map(java.util.Map) HashMap(java.util.HashMap)

Example 18 with Volume

use of com.cloud.storage.Volume in project cloudstack by apache.

the class VolumeOrchestrator method prepare.

@Override
public void prepare(VirtualMachineProfile vm, DeployDestination dest) throws StorageUnavailableException, InsufficientStorageCapacityException, ConcurrentOperationException {
    if (dest == null) {
        if (s_logger.isDebugEnabled()) {
            s_logger.debug("DeployDestination cannot be null, cannot prepare Volumes for the vm: " + vm);
        }
        throw new CloudRuntimeException("Unable to prepare Volume for vm because DeployDestination is null, vm:" + vm);
    }
    // don't allow to start vm that doesn't have a root volume
    if (_volsDao.findByInstanceAndType(vm.getId(), Volume.Type.ROOT).isEmpty()) {
        throw new CloudRuntimeException("Unable to prepare volumes for vm as ROOT volume is missing");
    }
    List<VolumeVO> vols = _volsDao.findUsableVolumesForInstance(vm.getId());
    if (s_logger.isDebugEnabled()) {
        s_logger.debug("Checking if we need to prepare " + vols.size() + " volumes for " + vm);
    }
    List<VolumeTask> tasks = getTasks(vols, dest.getStorageForDisks(), vm);
    Volume vol = null;
    StoragePool pool = null;
    for (VolumeTask task : tasks) {
        if (task.type == VolumeTaskType.NOP) {
            pool = (StoragePool) dataStoreMgr.getDataStore(task.pool.getId(), DataStoreRole.Primary);
            vol = task.volume;
        } else if (task.type == VolumeTaskType.MIGRATE) {
            pool = (StoragePool) dataStoreMgr.getDataStore(task.pool.getId(), DataStoreRole.Primary);
            vol = migrateVolume(task.volume, pool);
        } else if (task.type == VolumeTaskType.RECREATE) {
            Pair<VolumeVO, DataStore> result = recreateVolume(task.volume, vm, dest);
            pool = (StoragePool) dataStoreMgr.getDataStore(result.second().getId(), DataStoreRole.Primary);
            vol = result.first();
        }
        VolumeInfo volumeInfo = volFactory.getVolume(vol.getId());
        DataTO volTO = volumeInfo.getTO();
        DiskTO disk = storageMgr.getDiskWithThrottling(volTO, vol.getVolumeType(), vol.getDeviceId(), vol.getPath(), vm.getServiceOfferingId(), vol.getDiskOfferingId());
        DataStore dataStore = dataStoreMgr.getDataStore(vol.getPoolId(), DataStoreRole.Primary);
        disk.setDetails(getDetails(volumeInfo, dataStore));
        vm.addDisk(disk);
        // If hypervisor is vSphere, check for clone type setting.
        if (vm.getHypervisorType().equals(HypervisorType.VMware)) {
            // retrieve clone flag.
            UserVmCloneType cloneType = UserVmCloneType.linked;
            Boolean value = CapacityManager.VmwareCreateCloneFull.valueIn(vol.getPoolId());
            if (value != null && value) {
                cloneType = UserVmCloneType.full;
            }
            try {
                UserVmCloneSettingVO cloneSettingVO = _vmCloneSettingDao.findByVmId(vm.getId());
                if (cloneSettingVO != null) {
                    if (!cloneSettingVO.getCloneType().equals(cloneType.toString())) {
                        cloneSettingVO.setCloneType(cloneType.toString());
                        _vmCloneSettingDao.update(cloneSettingVO.getVmId(), cloneSettingVO);
                    }
                } else {
                    UserVmCloneSettingVO vmCloneSettingVO = new UserVmCloneSettingVO(vm.getId(), cloneType.toString());
                    _vmCloneSettingDao.persist(vmCloneSettingVO);
                }
            } catch (Throwable e) {
                s_logger.debug("[NSX_PLUGIN_LOG] ERROR: " + e.getMessage());
            }
        }
    }
}
Also used : StoragePool(com.cloud.storage.StoragePool) VolumeInfo(org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo) UserVmCloneSettingVO(com.cloud.vm.UserVmCloneSettingVO) DataTO(com.cloud.agent.api.to.DataTO) VolumeVO(com.cloud.storage.VolumeVO) VmWorkMigrateVolume(com.cloud.vm.VmWorkMigrateVolume) VmWorkAttachVolume(com.cloud.vm.VmWorkAttachVolume) Volume(com.cloud.storage.Volume) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) PrimaryDataStore(org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStore) DataStore(org.apache.cloudstack.engine.subsystem.api.storage.DataStore) DiskTO(com.cloud.agent.api.to.DiskTO)

Example 19 with Volume

use of com.cloud.storage.Volume in project cloudstack by apache.

the class VolumeStateListener method postStateTransitionEvent.

@Override
public boolean postStateTransitionEvent(StateMachine2.Transition<State, Event> transition, Volume vol, boolean status, Object opaque) {
    pubishOnEventBus(transition.getEvent().name(), "postStateTransitionEvent", vol, transition.getCurrentState(), transition.getToState());
    if (transition.isImpacted(StateMachine2.Transition.Impact.USAGE)) {
        Long instanceId = vol.getInstanceId();
        VMInstanceVO vmInstanceVO = null;
        if (instanceId != null) {
            vmInstanceVO = _vmInstanceDao.findById(instanceId);
        }
        if (instanceId == null || vmInstanceVO.getType() == VirtualMachine.Type.User) {
            if (transition.getToState() == State.Ready) {
                if (transition.getCurrentState() == State.Resizing) {
                    // Log usage event for volumes belonging user VM's only
                    UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_RESIZE, vol.getAccountId(), vol.getDataCenterId(), vol.getId(), vol.getName(), vol.getDiskOfferingId(), vol.getTemplateId(), vol.getSize(), Volume.class.getName(), vol.getUuid());
                } else {
                    UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, vol.getAccountId(), vol.getDataCenterId(), vol.getId(), vol.getName(), vol.getDiskOfferingId(), null, vol.getSize(), Volume.class.getName(), vol.getUuid(), vol.isDisplayVolume());
                }
            } else if (transition.getToState() == State.Destroy && vol.getVolumeType() != Volume.Type.ROOT) {
                //Do not Publish Usage Event for ROOT Disk as it would have been published already while destroying a VM
                UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_DELETE, vol.getAccountId(), vol.getDataCenterId(), vol.getId(), vol.getName(), Volume.class.getName(), vol.getUuid(), vol.isDisplayVolume());
            } else if (transition.getToState() == State.Uploaded) {
            //Currently we are not capturing Usage for Secondary Storage so Usage for this operation will be captured when it is moved to primary storage
            }
        }
    }
    return true;
}
Also used : Volume(com.cloud.storage.Volume) VMInstanceVO(com.cloud.vm.VMInstanceVO)

Example 20 with Volume

use of com.cloud.storage.Volume in project cloudstack by apache.

the class UserVmManagerImpl method restoreVMInternal.

public UserVm restoreVMInternal(Account caller, UserVmVO vm, Long newTemplateId) throws InsufficientCapacityException, ResourceUnavailableException {
    Long userId = caller.getId();
    Account owner = _accountDao.findById(vm.getAccountId());
    _userDao.findById(userId);
    long vmId = vm.getId();
    boolean needRestart = false;
    // Input validation
    if (owner == null) {
        throw new InvalidParameterValueException("The owner of " + vm + " does not exist: " + vm.getAccountId());
    }
    if (owner.getState() == Account.State.disabled) {
        throw new PermissionDeniedException("The owner of " + vm + " is disabled: " + vm.getAccountId());
    }
    if (vm.getState() != VirtualMachine.State.Running && vm.getState() != VirtualMachine.State.Stopped) {
        throw new CloudRuntimeException("Vm " + vm.getUuid() + " currently in " + vm.getState() + " state, restore vm can only execute when VM in Running or Stopped");
    }
    if (vm.getState() == VirtualMachine.State.Running) {
        needRestart = true;
    }
    List<VolumeVO> rootVols = _volsDao.findByInstanceAndType(vmId, Volume.Type.ROOT);
    if (rootVols.isEmpty()) {
        InvalidParameterValueException ex = new InvalidParameterValueException("Can not find root volume for VM " + vm.getUuid());
        ex.addProxyObject(vm.getUuid(), "vmId");
        throw ex;
    }
    if (rootVols.size() > 1) {
        InvalidParameterValueException ex = new InvalidParameterValueException("There are " + rootVols.size() + " root volumes for VM " + vm.getUuid());
        ex.addProxyObject(vm.getUuid(), "vmId");
        throw ex;
    }
    VolumeVO root = rootVols.get(0);
    if (!Volume.State.Allocated.equals(root.getState()) || newTemplateId != null) {
        Long templateId = root.getTemplateId();
        boolean isISO = false;
        if (templateId == null) {
            // Assuming that for a vm deployed using ISO, template ID is set to NULL
            isISO = true;
            templateId = vm.getIsoId();
        }
        // If target VM has associated VM snapshots then don't allow restore of VM
        List<VMSnapshotVO> vmSnapshots = _vmSnapshotDao.findByVm(vmId);
        if (vmSnapshots.size() > 0) {
            throw new InvalidParameterValueException("Unable to restore VM, please remove VM snapshots before restoring VM");
        }
        VMTemplateVO template = null;
        //newTemplateId can be either template or ISO id. In the following snippet based on the vm deployment (from template or ISO) it is handled accordingly
        if (newTemplateId != null) {
            template = _templateDao.findById(newTemplateId);
            _accountMgr.checkAccess(caller, null, true, template);
            if (isISO) {
                if (!template.getFormat().equals(ImageFormat.ISO)) {
                    throw new InvalidParameterValueException("Invalid ISO id provided to restore the VM ");
                }
            } else {
                if (template.getFormat().equals(ImageFormat.ISO)) {
                    throw new InvalidParameterValueException("Invalid template id provided to restore the VM ");
                }
            }
        } else {
            if (isISO && templateId == null) {
                throw new CloudRuntimeException("Cannot restore the VM since there is no ISO attached to VM");
            }
            template = _templateDao.findById(templateId);
            if (template == null) {
                InvalidParameterValueException ex = new InvalidParameterValueException("Cannot find template/ISO for specified volumeid and vmId");
                ex.addProxyObject(vm.getUuid(), "vmId");
                ex.addProxyObject(root.getUuid(), "volumeId");
                throw ex;
            }
        }
        TemplateDataStoreVO tmplStore = _templateStoreDao.findByTemplateZoneReady(template.getId(), vm.getDataCenterId());
        if (tmplStore == null) {
            throw new InvalidParameterValueException("Cannot restore the vm as the template " + template.getUuid() + " isn't available in the zone");
        }
        if (needRestart) {
            try {
                _itMgr.stop(vm.getUuid());
            } catch (ResourceUnavailableException e) {
                s_logger.debug("Stop vm " + vm.getUuid() + " failed", e);
                CloudRuntimeException ex = new CloudRuntimeException("Stop vm failed for specified vmId");
                ex.addProxyObject(vm.getUuid(), "vmId");
                throw ex;
            }
        }
        /* If new template/ISO is provided allocate a new volume from new template/ISO otherwise allocate new volume from original template/ISO */
        Volume newVol = null;
        if (newTemplateId != null) {
            if (isISO) {
                newVol = volumeMgr.allocateDuplicateVolume(root, null);
                vm.setIsoId(newTemplateId);
                vm.setGuestOSId(template.getGuestOSId());
                vm.setTemplateId(newTemplateId);
                _vmDao.update(vmId, vm);
            } else {
                newVol = volumeMgr.allocateDuplicateVolume(root, newTemplateId);
                vm.setGuestOSId(template.getGuestOSId());
                vm.setTemplateId(newTemplateId);
                _vmDao.update(vmId, vm);
            }
        } else {
            newVol = volumeMgr.allocateDuplicateVolume(root, null);
        }
        // 1. Save usage event and update resource count for user vm volumes
        _resourceLimitMgr.incrementResourceCount(newVol.getAccountId(), ResourceType.volume, newVol.isDisplay());
        _resourceLimitMgr.incrementResourceCount(newVol.getAccountId(), ResourceType.primary_storage, newVol.isDisplay(), new Long(newVol.getSize()));
        // 2. Create Usage event for the newly created volume
        UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VOLUME_CREATE, newVol.getAccountId(), newVol.getDataCenterId(), newVol.getId(), newVol.getName(), newVol.getDiskOfferingId(), template.getId(), newVol.getSize());
        _usageEventDao.persist(usageEvent);
        handleManagedStorage(vm, root);
        _volsDao.attachVolume(newVol.getId(), vmId, newVol.getDeviceId());
        // Detach, destroy and create the usage event for the old root volume.
        _volsDao.detachVolume(root.getId());
        volumeMgr.destroyVolume(root);
        // For VMware hypervisor since the old root volume is replaced by the new root volume, force expunge old root volume if it has been created in storage
        if (vm.getHypervisorType() == HypervisorType.VMware) {
            VolumeInfo volumeInStorage = volFactory.getVolume(root.getId());
            if (volumeInStorage != null) {
                s_logger.info("Expunging volume " + root.getId() + " from primary data store");
                AsyncCallFuture<VolumeApiResult> future = _volService.expungeVolumeAsync(volFactory.getVolume(root.getId()));
                try {
                    future.get();
                } catch (Exception e) {
                    s_logger.debug("Failed to expunge volume:" + root.getId(), e);
                }
            }
        }
        Map<VirtualMachineProfile.Param, Object> params = null;
        String password = null;
        if (template.getEnablePassword()) {
            password = _mgr.generateRandomPassword();
            boolean result = resetVMPasswordInternal(vmId, password);
            if (result) {
                vm.setPassword(password);
                _vmDao.loadDetails(vm);
                // update the password in vm_details table too
                // Check if an SSH key pair was selected for the instance and if so
                // use it to encrypt & save the vm password
                encryptAndStorePassword(vm, password);
            } else {
                throw new CloudRuntimeException("VM reset is completed but failed to reset password for the virtual machine ");
            }
        }
        if (needRestart) {
            try {
                if (vm.getDetail("password") != null) {
                    params = new HashMap<VirtualMachineProfile.Param, Object>();
                    params.put(VirtualMachineProfile.Param.VmPassword, password);
                }
                _itMgr.start(vm.getUuid(), params);
                vm = _vmDao.findById(vmId);
                if (template.getEnablePassword()) {
                    // this value is not being sent to the backend; need only for api
                    // display purposes
                    vm.setPassword(password);
                    if (vm.isUpdateParameters()) {
                        vm.setUpdateParameters(false);
                        _vmDao.loadDetails(vm);
                        if (vm.getDetail("password") != null) {
                            _vmDetailsDao.remove(_vmDetailsDao.findDetail(vm.getId(), "password").getId());
                        }
                        _vmDao.update(vm.getId(), vm);
                    }
                }
            } catch (Exception e) {
                s_logger.debug("Unable to start VM " + vm.getUuid(), e);
                CloudRuntimeException ex = new CloudRuntimeException("Unable to start VM with specified id" + e.getMessage());
                ex.addProxyObject(vm.getUuid(), "vmId");
                throw ex;
            }
        }
    }
    s_logger.debug("Restore VM " + vmId + " done successfully");
    return vm;
}
Also used : Account(com.cloud.user.Account) VMTemplateVO(com.cloud.storage.VMTemplateVO) UsageEventVO(com.cloud.event.UsageEventVO) VolumeInfo(org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo) VolumeApiResult(org.apache.cloudstack.engine.subsystem.api.storage.VolumeService.VolumeApiResult) VolumeVO(com.cloud.storage.VolumeVO) InvalidParameterValueException(com.cloud.exception.InvalidParameterValueException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) TemplateDataStoreVO(org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO) ExecutionException(com.cloud.utils.exception.ExecutionException) AgentUnavailableException(com.cloud.exception.AgentUnavailableException) TransactionCallbackWithException(com.cloud.utils.db.TransactionCallbackWithException) ResourceUnavailableException(com.cloud.exception.ResourceUnavailableException) VirtualMachineMigrationException(com.cloud.exception.VirtualMachineMigrationException) PermissionDeniedException(com.cloud.exception.PermissionDeniedException) NoTransitionException(com.cloud.utils.fsm.NoTransitionException) CloudException(com.cloud.exception.CloudException) OperationTimedoutException(com.cloud.exception.OperationTimedoutException) InsufficientCapacityException(com.cloud.exception.InsufficientCapacityException) InsufficientAddressCapacityException(com.cloud.exception.InsufficientAddressCapacityException) StorageUnavailableException(com.cloud.exception.StorageUnavailableException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) InvalidParameterValueException(com.cloud.exception.InvalidParameterValueException) ResourceAllocationException(com.cloud.exception.ResourceAllocationException) ConcurrentOperationException(com.cloud.exception.ConcurrentOperationException) ConfigurationException(javax.naming.ConfigurationException) ManagementServerException(com.cloud.exception.ManagementServerException) VMSnapshotVO(com.cloud.vm.snapshot.VMSnapshotVO) Volume(com.cloud.storage.Volume) ResourceUnavailableException(com.cloud.exception.ResourceUnavailableException) PermissionDeniedException(com.cloud.exception.PermissionDeniedException)

Aggregations

Volume (com.cloud.storage.Volume)70 StoragePool (com.cloud.storage.StoragePool)21 ServerApiException (org.apache.cloudstack.api.ServerApiException)16 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)15 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)15 ExcludeList (com.cloud.deploy.DeploymentPlanner.ExcludeList)14 VolumeResponse (org.apache.cloudstack.api.response.VolumeResponse)14 ArrayList (java.util.ArrayList)12 Account (com.cloud.user.Account)11 VolumeVO (com.cloud.storage.VolumeVO)10 DiskProfile (com.cloud.vm.DiskProfile)10 StoragePoolAllocator (org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator)10 Test (org.junit.Test)10 DataCenterDeployment (com.cloud.deploy.DataCenterDeployment)9 HashMap (java.util.HashMap)9 DeploymentPlan (com.cloud.deploy.DeploymentPlan)8 PermissionDeniedException (com.cloud.exception.PermissionDeniedException)8 VirtualMachineProfile (com.cloud.vm.VirtualMachineProfile)8 Project (com.cloud.projects.Project)7 VmWorkAttachVolume (com.cloud.vm.VmWorkAttachVolume)7