Examples of VolumeInfo


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

        }
    }
   
    @Test
    public void createSnapshot() throws InterruptedException, ExecutionException {
        VolumeInfo vol = createCopyBaseImage();
        SnapshotVO snapshotVO = createSnapshotInDb(vol);
        SnapshotInfo snapshot = this.snapshotFactory.getSnapshot(snapshotVO.getId(), vol.getDataStore());
        SnapshotInfo newSnapshot = null;
        for (SnapshotStrategy strategy : this.snapshotStrategies) {
            if (strategy.canHandle(snapshot)) {
                newSnapshot = strategy.takeSnapshot(snapshot);
            }
View Full Code Here

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

        }

    }

    protected Answer migrateVolumeToPool(DataObject srcData, DataObject destData) {
        VolumeInfo volume = (VolumeInfo)srcData;
        StoragePool destPool = (StoragePool)this.dataStoreMgr.getDataStore(destData.getDataStore().getId(), DataStoreRole.Primary);
        MigrateVolumeCommand command = new MigrateVolumeCommand(volume.getId(), volume.getPath(), destPool);
        EndPoint ep = selector.select(volume.getDataStore());
        MigrateVolumeAnswer answer = (MigrateVolumeAnswer) ep.sendMessage(command);

        if (answer == null || !answer.getResult()) {
            throw new CloudRuntimeException("Failed to migrate volume " + volume + " to storage pool " + destPool);
        } else {
            // Update the volume details after migration.
            VolumeVO volumeVo = this.volDao.findById(volume.getId());
            Long oldPoolId = volume.getPoolId();
            volumeVo.setPath(answer.getVolumePath());
            volumeVo.setFolder(destPool.getPath());
            volumeVo.setPodId(destPool.getPodId());
            volumeVo.setPoolId(destPool.getId());
            volumeVo.setLastPoolId(oldPoolId);
            this.volDao.update(volume.getId(), volumeVo);
        }

        return answer;
    }
View Full Code Here

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

    @Test(priority = 2)
    public void createVolumeFromTemplate() {
        DataStore primaryStore = this.primaryStore;
        TemplateInfo te = createTemplate();
        VolumeVO volume = createVolume(te.getId(), primaryStore.getId());
        VolumeInfo vol = volumeFactory.getVolume(volume.getId(), primaryStore);
        // ve.createVolumeFromTemplate(primaryStore.getId(), new VHD(), te);
        AsyncCallFuture<VolumeApiResult> future = volumeService.createVolumeFromTemplateAsync(vol,
                primaryStore.getId(), te);
        try {
            future.get();
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.