cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From syed <...@git.apache.org>
Subject [GitHub] cloudstack pull request #1600: Support Backup of Snapshots for Managed Stora...
Date Thu, 01 Sep 2016 21:40:59 GMT
Github user syed commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1600#discussion_r77259373
  
    --- Diff: engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
---
    @@ -380,6 +513,122 @@ private void handleCreateTemplateFromSnapshot(SnapshotInfo snapshotInfo,
Templat
         }
     
         /**
    +     * Creates a volume on the storage from a snapshot that resides on the secondary
storage (archived snapshot).
    +     * @param snapshotInfo snapshot on secondary
    +     * @param volumeInfo volume to be created on the storage
    +     * @param callback  for async
    +     */
    +    private void handleCreateVolumeFromSnapshotOnSecondaryStorage(SnapshotInfo snapshotInfo,
VolumeInfo volumeInfo, AsyncCompletionCallback<CopyCommandResult> callback) {
    +
    +        // at this point, the snapshotInfo and volumeInfo should have the same disk offering
ID (so either one should be OK to get a DiskOfferingVO instance)
    +        DiskOfferingVO diskOffering = _diskOfferingDao.findByIdIncludingRemoved(volumeInfo.getDiskOfferingId());
    +        SnapshotVO snapshot = _snapshotDao.findById(snapshotInfo.getId());
    +        DataStore destDataStore = volumeInfo.getDataStore();
    +
    +        // update the volume's hv_ss_reserve (hypervisor snapshot reserve) from a disk
offering (used for managed storage)
    +        _volumeService.updateHypervisorSnapshotReserveForVolume(diskOffering, volumeInfo.getId(),
snapshot.getHypervisorType());
    +
    +
    +        CopyCmdAnswer copyCmdAnswer = null;
    +        String errMsg = null;
    +
    +        HostVO hostVO = null;
    +        try {
    +
    +            //create a volume on the storage
    +            AsyncCallFuture<VolumeApiResult> future = _volumeService.createVolumeAsync(volumeInfo,
volumeInfo.getDataStore());
    +            VolumeApiResult result = future.get();
    +
    +            if (result.isFailed()) {
    +                LOGGER.warn("Failed to create a volume: " + result.getResult());
    --- End diff --
    
    changed to ERROR


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message