cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jburwell <...@git.apache.org>
Subject [GitHub] cloudstack pull request: Taking fast and efficient volume snapshot...
Date Thu, 12 May 2016 23:01:51 GMT
Github user jburwell commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1403#discussion_r63111572
  
    --- Diff: engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
---
    @@ -172,78 +258,207 @@ private void validate(SnapshotInfo snapshotInfo) {
             }
         }
     
    -    private Void handleCreateTemplateFromSnapshot(SnapshotInfo snapshotInfo, TemplateInfo
templateInfo, AsyncCompletionCallback<CopyCommandResult> callback) {
    +    private boolean usingBackendSnapshotFor(SnapshotInfo snapshotInfo) {
    +        String property = getProperty(snapshotInfo.getId(), "takeSnapshot");
    +
    +        return Boolean.parseBoolean(property);
    +    }
    +
    +    private void handleCreateTemplateFromSnapshot(SnapshotInfo snapshotInfo, TemplateInfo
templateInfo, AsyncCompletionCallback<CopyCommandResult> callback) {
             try {
                 snapshotInfo.processEvent(Event.CopyingRequested);
             }
             catch (Exception ex) {
                 throw new CloudRuntimeException("This snapshot is not currently in a state
where it can be used to create a template.");
             }
     
    -        HostVO hostVO = getHost(snapshotInfo.getDataStore().getId());
    -        DataStore srcDataStore = snapshotInfo.getDataStore();
    +        HostVO hostVO = getHost(snapshotInfo);
     
    -        String value = _configDao.getValue(Config.PrimaryStorageDownloadWait.toString());
    -        int primaryStorageDownloadWait = NumbersUtil.parseInt(value, Integer.parseInt(Config.PrimaryStorageDownloadWait.getDefaultValue()));
    -        CopyCommand copyCommand = new CopyCommand(snapshotInfo.getTO(), templateInfo.getTO(),
primaryStorageDownloadWait, VirtualMachineManager.ExecuteInSequence.value());
    +        boolean usingBackendSnapshot = usingBackendSnapshotFor(snapshotInfo);
    +        boolean computeClusterSupportsResign = clusterDao.computeWhetherClusterSupportsResigning(hostVO.getClusterId());
     
    -        String errMsg = null;
    -
    -        CopyCmdAnswer copyCmdAnswer = null;
    +        if (usingBackendSnapshot && !computeClusterSupportsResign) {
    +            throw new CloudRuntimeException("Unable to locate an applicable host with
which to perform a resignature operation");
    --- End diff --
    
    Please include the cluster id in the error message to assist operational debugging.


---
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