Examples of SnapshotInfo


Examples of com.semagia.atomico.server.dm.impl.SnapshotInfo

        final URI link = URI.create(linkAdr);
        final String id = "http://www.semagia.com/test";
        final String title = "title";
        final long updated = now();
        final MediaType mt = MediaType.ATOM_XML;
        final ISnapshotInfo snapInfo = new SnapshotInfo(id, title, updated, mt, "snapId");
        feed.addEntry(snapInfo, link);
        assertEquals(1, feed.getEntries().size());
        final ISnapshotEntry entry = feed.getEntries().iterator().next();
        assertNotNull(entry);
        assertEquals(id, entry.getId());
View Full Code Here

Examples of com.semagia.atomico.server.dm.impl.SnapshotInfo

        }
        final String id = "http://www.semagia.com/test";
        final String title = "title";
        final long updated = now();
        final MediaType mt = MediaType.ATOM_XML;
        final ISnapshotInfo snapInfo = new SnapshotInfo(id, title, updated, mt, "snapId");
        try {
            feed.addEntry(snapInfo, null);
            fail("feed.addEntry(info, null) is illegal");
        }
        catch (IllegalArgumentException ex) {
View Full Code Here

Examples of com.vmware.vim.binding.vim.vm.SnapshotInfo

   /*
    * Updates all snapshots of this VM.
    */
   private synchronized void updateSnapshots(VirtualMachine vm) throws Exception {
      SnapshotInfo snapInfo = vm.getSnapshot();
      if (snapInfo != null) {
         Map<ManagedObjectReference, VcSnapshotImpl> newMap =
            new HashMap<ManagedObjectReference, VcSnapshotImpl>();
         updateSnapshotTree(newMap, snapshots, snapInfo.getRootSnapshotList());
         snapshots = newMap;
         currentSnapshot = snapInfo.getCurrentSnapshot();
      } else {
         snapshots.clear();
         currentSnapshot = null;
      }
   }
View Full Code Here

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

        if (vol != null) {
            this.volume = (VolumeObjectTO)vol.getTO();
            this.setVmName(vol.getAttachedVmName());
        }

        SnapshotInfo parentSnapshot = snapshot.getParent();
        if (parentSnapshot != null) {
            this.parentSnapshotPath = parentSnapshot.getPath();
        }
        this.dataStore = snapshot.getDataStore().getTO();
        this.setName(snapshot.getName());
        this.hypervisorType = snapshot.getHypervisorType();
    }
View Full Code Here

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

                    List<SnapshotDataStoreVO> destroyedSnapshotStoreVOs = _snapshotStoreDao.listDestroyed(store.getId());
                    s_logger.debug("Secondary storage garbage collector found " + destroyedSnapshotStoreVOs.size()
                            + " snapshots to cleanup on snapshot_store_ref for store: " + store.getName());
                    for (SnapshotDataStoreVO destroyedSnapshotStoreVO : destroyedSnapshotStoreVOs) {
                        // check if this snapshot has child
                        SnapshotInfo snap = snapshotFactory.getSnapshot(destroyedSnapshotStoreVO.getSnapshotId(), store);
                        if ( snap.getChild() != null ){
                            s_logger.debug("Skip snapshot on store: " + destroyedSnapshotStoreVO + " , because it has child");
                            continue;
                        }

                        if (s_logger.isDebugEnabled()) {
View Full Code Here

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

            if (store == null) {
                throw new CloudRuntimeException("cannot find an image store for zone " + zoneId);
            }
            AsyncCallFuture<TemplateApiResult> future = null;
            if (snapshotId != null) {
                SnapshotInfo snapInfo = this._snapshotFactory.getSnapshot(snapshotId, DataStoreRole.Image);
                DataStore snapStore = snapInfo.getDataStore();
                if ( snapStore != null ){
                    store = snapStore; // pick snapshot image store to create template
                }
                future = this._tmpltSvr.createTemplateFromSnapshotAsync(snapInfo, tmplInfo, store);
            } else if (volumeId != null) {
View Full Code Here

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

    protected Void createVolumeFromSnapshotCallback(
            AsyncCallbackDispatcher<VolumeServiceImpl, CopyCommandResult> callback,
            CreateVolumeFromBaseImageContext<VolumeApiResult> context) {
        CopyCommandResult result = callback.getResult();
        VolumeInfo volume = (VolumeInfo) context.templateOnStore;
        SnapshotInfo snapshot = context.snapshot;
        VolumeApiResult apiResult = new VolumeApiResult(volume);
        Event event = null;
        if (result.isFailed()) {
            apiResult.setResult(result.getResult());
            event = Event.OperationFailed;
        } else {
            event = Event.OperationSuccessed;
        }

        try {
            if (result.isSuccess()) {
                volume.processEvent(event, result.getAnswer());
            } else {
                volume.processEvent(event);
            }
            snapshot.processEvent(event);
        } catch (Exception e) {
            s_logger.debug("create volume from snapshot failed", e);
            apiResult.setResult(e.toString());
        }
View Full Code Here

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

        VolumeObject vol = (VolumeObject) volume;
        boolean result = vol.stateTransit(Volume.Event.SnapshotRequested);
        if (!result) {
            s_logger.debug("Failed to transit state");
        }
        SnapshotInfo snapshot = null;
        try {
            snapshot = snapshotMgr.takeSnapshot(volume);
        } catch (Exception e) {
            s_logger.debug("Take snapshot: " + volume.getId() + " failed", e);
        } finally {
View Full Code Here

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

        boolean backedUp = false;
        // does the caller have the authority to act on this volume
        _accountMgr.checkAccess(UserContext.current().getCaller(), null, true, volume);

        SnapshotInfo snapshot = this.snapshotFactory.getSnapshot(snapshotId, DataStoreRole.Primary);

        try {
          postCreateSnapshot(volumeId, snapshot.getId(), policyId);
          //Check if the snapshot was removed while backingUp. If yes, do not log snapshot create usage event
          SnapshotVO freshSnapshot = _snapshotDao.findById(snapshot.getId());
          if ((freshSnapshot != null) && backedUp) {
            UsageEventUtils.publishUsageEvent(EventTypes.EVENT_SNAPSHOT_CREATE, snapshot.getAccountId(),
                snapshot.getDataCenterId(), snapshotId, snapshot.getName(), null, null,
                volume.getSize(), snapshot.getClass().getName(), snapshot.getUuid());
          }

          _resourceLimitMgr.incrementResourceCount(snapshotOwner.getId(), ResourceType.snapshot);

        } catch(Exception e) {
View Full Code Here

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



    @Override
    public Snapshot backupSnapshot(Long snapshotId) {
       SnapshotInfo snapshot = this.snapshotFactory.getSnapshot(snapshotId, DataStoreRole.Image);
       if (snapshot != null) {
         throw new CloudRuntimeException("Already in the backup snapshot:" + snapshotId);
       }

         return this.snapshotSrv.backupSnapshot(snapshot);
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.