incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From muralire...@apache.org
Subject [48/50] [abbrv] git commit: refs/heads/gslb-wip - fix bug vmware create volume from snapshot will missing data
Date Wed, 20 Mar 2013 01:41:17 GMT
fix bug vmware create volume from snapshot will missing data


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

Branch: refs/heads/gslb-wip
Commit: 13691048fb622467271b75fc7b64298e3afe9912
Parents: ba69ce0
Author: hongtu_zang <hongtu_zang@tcloudcomputing.com>
Authored: Sat Mar 16 09:54:09 2013 +0800
Committer: Chip Childers <chip.childers@gmail.com>
Committed: Tue Mar 19 12:53:53 2013 -0400

----------------------------------------------------------------------
 .../vmware/manager/VmwareStorageManagerImpl.java   |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/13691048/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
index e11dd53..1f11645 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
@@ -684,13 +684,16 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager
{
         String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl);
         String srcOVAFileName = secondaryMountPoint + "/" +  secStorageDir + "/"
             + backupName + "." + ImageFormat.OVA.getFileExtension();
-
+        String snapshotDir = "";
+        if (backupName.contains("/")){
+            snapshotDir = backupName.split("/")[0];
+        }
         String srcFileName = getOVFFilePath(srcOVAFileName);
         if(srcFileName == null) {
             Script command = new Script("tar", 0, s_logger);
             command.add("--no-same-owner");
             command.add("-xf", srcOVAFileName);
-            command.setWorkDir(secondaryMountPoint + "/" +  secStorageDir);
+            command.setWorkDir(secondaryMountPoint + "/" +  secStorageDir + "/" + snapshotDir);
             s_logger.info("Executing command: " + command.toString());
             String result = command.execute();
             if(result != null) {
@@ -731,7 +734,7 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager
{
         String backupUuid = UUID.randomUUID().toString();
         exportVolumeToSecondaryStroage(vmMo, volumePath, secStorageUrl,
             getSnapshotRelativeDirInSecStorage(accountId, volumeId), backupUuid, workerVmName);
-        return backupUuid;
+        return backupUuid + "/" + backupUuid;
     }
 
     private void exportVolumeToSecondaryStroage(VirtualMachineMO vmMo, String volumePath,
@@ -739,8 +742,8 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager
{
         String workerVmName) throws Exception {
 
         String secondaryMountPoint = _mountService.getMountPoint(secStorageUrl);
-        String exportPath =  secondaryMountPoint + "/" + secStorageDir;
-
+        String exportPath =  secondaryMountPoint + "/" + secStorageDir + "/" + exportName;
+        
         synchronized(exportPath.intern()) {
             if(!new File(exportPath).exists()) {
                 Script command = new Script(false, "mkdir", _timeout, s_logger);


Mime
View raw message