Examples of DiskOfferingVO


Examples of com.cloud.storage.DiskOfferingVO

    public void testClusterAllocatorWithTags() {
        try {
            createDb();
            StoragePoolDetailVO detailVO = new StoragePoolDetailVO(this.storagePoolId, "high", "true");
            poolDetailsDao.persist(detailVO);
            DiskOfferingVO diskOff = this.diskOfferingDao.findById(diskOffering.getId());
            List<String> tags = new ArrayList<String>();
            tags.add("high");
            diskOff.setTagsArray(tags);
            diskOfferingDao.update(diskOff.getId(), diskOff);

            DiskProfile profile = new DiskProfile(volume, diskOff, HypervisorType.XenServer);
            VirtualMachineProfile vmProfile = Mockito.mock(VirtualMachineProfile.class);
            Mockito.when(
                    storageMgr.storagePoolHasEnoughSpace(Matchers.anyListOf(Volume.class),
View Full Code Here

Examples of com.cloud.storage.DiskOfferingVO

    public void testClusterAllocatorWithWrongTag() {
        try {
            createDb();
            StoragePoolDetailVO detailVO = new StoragePoolDetailVO(this.storagePoolId, "high", "true");
            poolDetailsDao.persist(detailVO);
            DiskOfferingVO diskOff = this.diskOfferingDao.findById(diskOffering.getId());
            List<String> tags = new ArrayList<String>();
            tags.add("low");
            diskOff.setTagsArray(tags);
            diskOfferingDao.update(diskOff.getId(), diskOff);

            DiskProfile profile = new DiskProfile(volume, diskOff, HypervisorType.XenServer);
            VirtualMachineProfile vmProfile = Mockito.mock(VirtualMachineProfile.class);
            Mockito.when(
                    storageMgr.storagePoolHasEnoughSpace(Matchers.anyListOf(Volume.class),
View Full Code Here

Examples of com.cloud.storage.DiskOfferingVO

            StoragePoolVO pool = storagePoolDao.findById(storagePoolId);
            pool.setScope(ScopeType.HOST);
            storagePoolDao.update(pool.getId(), pool);

            DiskOfferingVO diskOff = diskOfferingDao.findById(diskOfferingId);
            diskOff.setUseLocalStorage(true);
            diskOfferingDao.update(diskOfferingId, diskOff);

            DiskProfile profile = new DiskProfile(volume, diskOff, HypervisorType.XenServer);
            VirtualMachineProfile vmProfile = Mockito.mock(VirtualMachineProfile.class);
            Mockito.when(
View Full Code Here

Examples of com.cloud.storage.DiskOfferingVO

    private void publishUsageEvent(String type, VMSnapshot vmSnapshot, UserVm userVm, VolumeTO volumeTo){
        VolumeVO volume = _volumeDao.findById(volumeTo.getId());
        Long diskOfferingId = volume.getDiskOfferingId();
        Long offeringId = null;
        if (diskOfferingId != null) {
            DiskOfferingVO offering = _diskOfferingDao.findById(diskOfferingId);
            if (offering != null
                    && (offering.getType() == DiskOfferingVO.Type.Disk)) {
                offeringId = offering.getId();
            }
        }
        UsageEventUtils.publishUsageEvent(
                type,
                vmSnapshot.getAccountId(),
View Full Code Here

Examples of com.cloud.storage.DiskOfferingVO

    }

    @Override
    public DiskOfferingVO persistDeafultDiskOffering(DiskOfferingVO offering) {
        assert offering.getUniqueName() != null : "unique name shouldn't be null for the disk offering";
        DiskOfferingVO vo = findByUniqueName(offering.getUniqueName());
        if (vo != null) {
            return vo;
        }
        try {
            return persist(offering);
View Full Code Here

Examples of com.cloud.storage.DiskOfferingVO

        }
    }

    @Override
    public boolean remove(Long id) {
        DiskOfferingVO diskOffering = createForUpdate();
        diskOffering.setRemoved(new Date());

        return update(id, diskOffering);
    }
View Full Code Here

Examples of com.cloud.storage.DiskOfferingVO

                }
            }

            s_logger.debug("Calling StoragePoolAllocators to find suitable pools");

            DiskOfferingVO diskOffering = _diskOfferingDao.findById(toBeCreated.getDiskOfferingId());
            DiskProfile diskProfile = new DiskProfile(toBeCreated, diskOffering, vmProfile.getHypervisorType());

            boolean useLocalStorage = false;
            if (vmProfile.getType() != VirtualMachine.Type.User) {
                String ssvmUseLocalStorage = _configDao.getValue(Config.SystemVMUseLocalStorage.key());
                if (ssvmUseLocalStorage.equalsIgnoreCase("true")) {
                    useLocalStorage = true;
                }
            } else {
                useLocalStorage = diskOffering.getUseLocalStorage();

                // TODO: this is a hacking fix for the problem of deploy
                // ISO-based VM on local storage
                // when deploying VM based on ISO, we have a service offering
                // and an additional disk offering, use-local storage flag is
View Full Code Here

Examples of com.cloud.storage.DiskOfferingVO

                        // Create an event
                        Long templateId = volume.getTemplateId();
                        Long diskOfferingId = volume.getDiskOfferingId();
                        Long offeringId = null;
                        if (diskOfferingId != null) {
                            DiskOfferingVO offering = _diskOfferingDao
                                    .findById(diskOfferingId);
                            if (offering != null
                                    && (offering.getType() == DiskOfferingVO.Type.Disk)) {
                                offeringId = offering.getId();
                            }
                        }
                        UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, volume.getAccountId(),
                                volume.getDataCenterId(), volume.getId(), volume.getName(), offeringId, templateId,
                                volume.getSize(), Volume.class.getName(), volume.getUuid());
View Full Code Here

Examples of com.cloud.storage.DiskOfferingVO

        long size = 0;
        if (tmp != null) {
            size = tmp;
        }
        if (diskOfferingId != null) {
            DiskOfferingVO diskOffering = _diskOfferingDao.findById(diskOfferingId);
            if (diskOffering != null && diskOffering.isCustomized()) {
                if (diskSize == null) {
                    throw new InvalidParameterValueException("This disk offering requires a custom size specified");
                }
                Long customDiskOfferingMaxSize = volumeMgr.CustomDiskOfferingMaxSize.value();
                Long customDiskOfferingMinSize = volumeMgr.CustomDiskOfferingMinSize.value();
View Full Code Here

Examples of com.cloud.storage.DiskOfferingVO

            usesLocalStorage = true;
        } else {
            List<VolumeVO> volumes = _volsDao.findByInstanceAndType(vm.getId(),
                    Volume.Type.DATADISK);
            for (VolumeVO vol : volumes) {
                DiskOfferingVO diskOffering = _diskOfferingDao.findById(vol
                        .getDiskOfferingId());
                if (diskOffering.getUseLocalStorage()) {
                    usesLocalStorage = true;
                    break;
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.