Package org.apache.cloudstack.engine.subsystem.api.storage

Examples of org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope


                    s_logger.debug("System vm template is not ready at data center " + dataCenterId + ", wait until it is ready to launch secondary storage vm");
                }
                return false;
            }

            List<DataStore> stores = this._dataStoreMgr.getImageStoresByScope(new ZoneScope(dataCenterId));
            if (stores.size() < 1) {
                s_logger.debug("No image store added  in zone " + dataCenterId + ", wait until it is ready to launch secondary storage vm");
                return false;
            }
View Full Code Here


        long dataCenterId = pool.longValue();

        List<SecondaryStorageVmVO> ssVms = _secStorageVmDao.getSecStorageVmListInStates(SecondaryStorageVm.Role.templateProcessor, dataCenterId, State.Running, State.Migrating,
                State.Starting,  State.Stopped, State.Stopping );
        int vmSize = (ssVms == null)? 0 : ssVms.size();
        List<DataStore> ssStores = this._dataStoreMgr.getImageStoresByScope(new ZoneScope(dataCenterId));
        int storeSize = (ssStores == null)? 0 : ssStores.size();
        if ( storeSize > vmSize ) {
            s_logger.info("No secondary storage vms found in datacenter id=" + dataCenterId + ", starting a new one");
            return new Pair<AfterScanAction, Object>(AfterScanAction.expand, SecondaryStorageVm.Role.templateProcessor);
        }
View Full Code Here

            Long dcId = volume.getDataCenterId();
            if (_snapshotDao.listByVolumeIdIncludingRemoved(volumeId).isEmpty()) {
                // This volume doesn't have any snapshots. Nothing do delete.
                continue;
            }
            List<DataStore> ssHosts = this.dataStoreMgr.getImageStoresByScope(new ZoneScope(dcId));
            for (DataStore ssHost : ssHosts) {
                String snapshotDir = TemplateConstants.DEFAULT_SNAPSHOT_ROOT_DIR + "/" + accountId + "/" + volumeId;
                DeleteSnapshotsDirCommand cmd = new DeleteSnapshotsDirCommand(ssHost.getTO(), snapshotDir);
                EndPoint ep = _epSelector.select(ssHost);
                Answer answer = ep.sendMessage(cmd);
View Full Code Here

    }

    @Override
    public List<TemplateDataStoreVO> listByTemplateZoneDownloadStatus(long templateId, Long zoneId, Status... status) {
        // get all elgible image stores
        List<DataStore> imgStores = this._storeMgr.getImageStoresByScope(new ZoneScope(zoneId));
        if (imgStores != null) {
            List<TemplateDataStoreVO> result = new ArrayList<TemplateDataStoreVO>();
            for (DataStore store : imgStores) {
                List<TemplateDataStoreVO> sRes = this.listByTemplateStoreDownloadStatus(templateId, store.getId(),
                        status);
View Full Code Here

    }

    @Override
    public TemplateDataStoreVO findByTemplateZoneDownloadStatus(long templateId, Long zoneId, Status... status) {
        // get all elgible image stores
        List<DataStore> imgStores = this._storeMgr.getImageStoresByScope(new ZoneScope(zoneId));
        if (imgStores != null) {
            for (DataStore store : imgStores) {
                List<TemplateDataStoreVO> sRes = this.listByTemplateStoreDownloadStatus(templateId, store.getId(),
                        status);
                if (sRes != null && sRes.size() > 0) {
View Full Code Here

    @Override
    public TemplateDataStoreVO findByTemplateZone(long templateId, Long zoneId, DataStoreRole role) {
        // get all elgible image stores
        List<DataStore> imgStores = null;
        if (role == DataStoreRole.Image) {
            imgStores = this._storeMgr.getImageStoresByScope(new ZoneScope(zoneId));
        } else if (role == DataStoreRole.ImageCache) {
            imgStores = this._storeMgr.getImageCacheStores(new ZoneScope(zoneId));
        }
        if (imgStores != null) {
            for (DataStore store : imgStores) {
                List<TemplateDataStoreVO> sRes = this.listByTemplateStore(templateId, store.getId());
                if (sRes != null && sRes.size() > 0) {
View Full Code Here

        return imageDataStoreMgr.listImageStoresByScope(scope);
    }

    @Override
    public DataStore getImageStore(long zoneId) {
        List<DataStore> stores = getImageStoresByScope(new ZoneScope(zoneId));
        if (stores == null || stores.size() == 0) {
            return null;
        }
        Collections.shuffle(stores);
        return stores.get(0);
View Full Code Here

        return imageDataStoreMgr.listImageCacheStores(scope);
    }

    @Override
    public DataStore getImageCacheStore(long zoneId) {
        List<DataStore> stores = getImageCacheStores(new ZoneScope(zoneId));
        if (stores == null || stores.size() == 0) {
            return null;
        }
        Collections.shuffle(stores);
        return stores.get(0);
View Full Code Here

        return this.imageDataStoreVO.getUrl();
    }

    @Override
    public Scope getScope() {
        return new ZoneScope(imageDataStoreVO.getDataCenterId());
    }
View Full Code Here

        store = createPrimaryDataStore(ScopeType.CLUSTER);
        host = createHost(Hypervisor.HypervisorType.XenServer);
        addStorageToHost(store, host);

        ZoneScope srcScope = new ZoneScope(dcId);

        DataStore srcStore = mock(DataStore.class);
        DataStore destStore = mock(DataStore.class);

        when(srcStore.getScope()).thenReturn(srcScope);
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope

Copyright © 2018 www.massapicom. 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.