Package org.apache.cloudstack.storage.datastore.db

Examples of org.apache.cloudstack.storage.datastore.db.ImageStoreVO


            template2.setPrepopulate(true);
            template2.setCrossZones(true);
            template2.setExtractable(true);
            template2 = templateDao.persist(template2);

            ImageStoreVO imageStoreVO = new ImageStoreVO();
            imageStoreVO.setRole(DataStoreRole.ImageCache);
            imageStoreVO.setName(UUID.randomUUID().toString());
            imageStoreVO.setProviderName(DataStoreProvider.NFS_IMAGE);
            imageStoreVO.setProtocol("nfs");
            imageStoreVO.setUrl(UUID.randomUUID().toString());
            imageStoreVO = imageStoreDao.persist(imageStoreVO);

            Date date = DateUtil.now();

            TemplateDataStoreVO templateStoreVO1 = new TemplateDataStoreVO();
            templateStoreVO1.setLastUpdated(date);
            templateStoreVO1.setDataStoreRole(DataStoreRole.ImageCache);
            templateStoreVO1.setDataStoreId(imageStoreVO.getId());
            templateStoreVO1.setState(ObjectInDataStoreStateMachine.State.Ready);
            templateStoreVO1.setCopy(true);
            templateStoreVO1.setTemplateId(template.getId());
            templateDataStoreDao.persist(templateStoreVO1);

            TemplateDataStoreVO templateStoreVO2 = new TemplateDataStoreVO();
            templateStoreVO2.setLastUpdated(date);
            templateStoreVO2.setDataStoreRole(DataStoreRole.ImageCache);
            templateStoreVO2.setDataStoreId(imageStoreVO.getId());
            templateStoreVO2.setState(ObjectInDataStoreStateMachine.State.Ready);
            templateStoreVO2.setCopy(true);
            templateStoreVO2.setTemplateId(template2.getId());
            templateDataStoreDao.persist(templateStoreVO2);

            DataStore store = dataStoreManager.getDataStore(imageStoreVO.getId(), DataStoreRole.ImageCache);
            Assert.assertNull(cacheReplacementAlgorithm.chooseOneToBeReplaced(store));

        } catch (Exception e) {
            Assert.fail();
        }
View Full Code Here


        host.setHypervisorType(HypervisorType.XenServer);
        host.setClusterId(cluster.getId());

        host = hostDao.persist(host);

        imageStore = new ImageStoreVO();
        imageStore.setName("test");
        imageStore.setDataCenterId(dcId);
        imageStore.setProviderName("CloudStack ImageStore Provider");
        imageStore.setRole(DataStoreRole.Image);
        imageStore.setUrl(this.getSecondaryStorage());
View Full Code Here

            host.setHypervisorType(HypervisorType.VMware);
            host.setClusterId(cluster.getId());

            host = hostDao.persist(host);

            imageStore = new ImageStoreVO();
            imageStore.setName(imageStoreName);
            imageStore.setDataCenterId(dcId);
            imageStore.setProviderName("CloudStack ImageStore Provider");
            imageStore.setRole(DataStoreRole.Image);
            imageStore.setUrl(this.getSecondaryStorage());
View Full Code Here

            host.setHypervisorType(this.getHypervisor());
            host.setClusterId(cluster.getId());

            host = hostDao.persist(host);

            imageStore = new ImageStoreVO();
            imageStore.setName(imageStoreName);
            imageStore.setDataCenterId(dcId);
            imageStore.setProviderName(DataStoreProvider.NFS_IMAGE);
            imageStore.setRole(DataStoreRole.Image);
            imageStore.setUrl(this.getSecondaryStorage());
View Full Code Here

        driverMaps = new HashMap<String, ImageStoreDriver>();
    }

    @Override
    public ImageStoreEntity getImageStore(long dataStoreId) {
        ImageStoreVO dataStore = dataStoreDao.findById(dataStoreId);
        String providerName = dataStore.getProviderName();
        ImageStoreProvider provider = (ImageStoreProvider)providerManager.getDataStoreProvider(providerName);
        ImageStoreEntity imgStore = ImageStoreImpl.getDataStore(dataStore, driverMaps.get(provider.getName()), provider);
        return imgStore;
    }
View Full Code Here

        return true;
    }

    @Override
    public ImageStoreEntity getImageStore(String uuid) {
        ImageStoreVO dataStore = dataStoreDao.findByUuid(uuid);
        return getImageStore(dataStore.getId());
    }
View Full Code Here

            host.setHypervisorType(this.getHypervisor());
            host.setClusterId(cluster.getId());

            host = hostDao.persist(host);

            imageStore = new ImageStoreVO();
            imageStore.setName(imageStoreName);
            imageStore.setDataCenterId(dcId);
            imageStore.setProviderName(DataStoreProvider.NFS_IMAGE);
            imageStore.setRole(DataStoreRole.Image);
            imageStore.setUrl(this.getSecondaryStorage());
View Full Code Here

        cluster.setClusterType(Cluster.ClusterType.CloudManaged);
        cluster.setManagedState(Managed.ManagedState.Managed);
        cluster = clusterDao.persist(cluster);
        clusterId = cluster.getId();

        imageStore = new ImageStoreVO();
        imageStore.setName(UUID.randomUUID().toString());
        imageStore.setDataCenterId(dcId);
        imageStore.setProviderName(DataStoreProvider.NFS_IMAGE);
        imageStore.setRole(DataStoreRole.Image);
        imageStore.setUrl(UUID.randomUUID().toString());
View Full Code Here

        imageStoreParameters.put("protocol", uri.getScheme().toLowerCase());
        imageStoreParameters.put("scope", ScopeType.ZONE);
        imageStoreParameters.put("providerName", providerName);
        imageStoreParameters.put("role", role);

        ImageStoreVO ids = imageStoreHelper.createImageStore(imageStoreParameters, details);
        return imageStoreMgr.getImageStore(ids.getId());
    }
View Full Code Here

            imageStoreParameters.put("scope", ScopeType.REGION);
        }
        imageStoreParameters.put("providerName", providerName);
        imageStoreParameters.put("role", role);

        ImageStoreVO ids = imageStoreHelper.createImageStore(imageStoreParameters, details);
        return imageStoreMgr.getImageStore(ids.getId());
    }
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.storage.datastore.db.ImageStoreVO

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.