You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2014/02/04 01:48:47 UTC

git commit: updated refs/heads/master to 30695d7

Updated Branches:
  refs/heads/master 657d9e478 -> 30695d7f9


CLOUDSTACK-6019:CreateVolume from snapshot in NFS is throwing Warning
"sync snapshot from cache to region wide store failed for image store
test".


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/30695d7f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/30695d7f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/30695d7f

Branch: refs/heads/master
Commit: 30695d7f93b6cccf8139d5f1e342d0ab8ebb5eec
Parents: 657d9e4
Author: Min Chen <mi...@citrix.com>
Authored: Mon Feb 3 16:26:40 2014 -0800
Committer: Min Chen <mi...@citrix.com>
Committed: Mon Feb 3 16:41:04 2014 -0800

----------------------------------------------------------------------
 .../resource/VmwareStorageSubsystemCommandHandler.java      | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30695d7f/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
index 39c3539..a5ebe2e 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java
@@ -92,6 +92,15 @@ public class VmwareStorageSubsystemCommandHandler extends StorageSubsystemComman
             } else if (srcData.getObjectType() == DataObjectType.TEMPLATE) {
                 // sync template from NFS cache to S3 in NFS migration to S3 case
                 storageManager.createOvaForTemplate((TemplateObjectTO)srcData);
+            } else if (srcData.getObjectType() == DataObjectType.SNAPSHOT && destData.getObjectType() == DataObjectType.SNAPSHOT) {
+                // sync snapshot from NFS cache to S3 in NFS migration to S3 case
+                String parentPath = storageResource.getRootDir(srcDataStore.getUrl());
+                SnapshotObjectTO snap = (SnapshotObjectTO)srcData;
+                String path = snap.getPath();
+                int index = path.lastIndexOf(File.separator);
+                String name = path.substring(index + 1);
+                String snapDir = path.substring(0, index);
+                storageManager.createOva(parentPath + File.separator + snapDir, name);
             } else if (srcData.getObjectType() == DataObjectType.SNAPSHOT && destData.getObjectType() == DataObjectType.TEMPLATE) {
                 //create template from snapshot on src at first, then copy it to s3
                 TemplateObjectTO cacheTemplate = (TemplateObjectTO)destData;