cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject git commit: updated refs/heads/master-6-17-stable to 166622f
Date Fri, 28 Jun 2013 00:36:20 GMT
Updated Branches:
  refs/heads/master-6-17-stable 3357ee61c -> 166622f35


CLOUDSTACK-2384: Template created from snapshot error.

In DB, the backedUpSnapshotUuid format got changed.
This messed up the vmdk file path in template creation from snapshot


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

Branch: refs/heads/master-6-17-stable
Commit: 166622f356fa27b89a5d2f04b4dfdaa73c6d84f2
Parents: 3357ee6
Author: Fang Wang <fang.wang@citrix.com>
Authored: Thu Jun 27 15:31:28 2013 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Thu Jun 27 17:36:04 2013 -0700

----------------------------------------------------------------------
 .../vmware/manager/VmwareStorageManagerImpl.java        | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/166622f3/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 4ae0f30..7b01d06 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
@@ -687,7 +687,10 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager
{
         String result;
         Script command;
         String templateVMDKName = "";
-        String snapshotFullVMDKName = snapshotRoot + "/";
+        //String snapshotFullVMDKName = snapshotRoot + "/";
+        // the backedUpSnapshotUuid field currently has the format: uuid/uuid. so we need
to extract the uuid out
+        String backupSSUuid = backedUpSnapshotUuid.substring(0, backedUpSnapshotUuid.indexOf('/'));
+        String snapshotFullVMDKName = snapshotRoot + "/" + backupSSUuid + "/";
 
         synchronized(installPath.intern()) {
             command = new Script(false, "mkdir", _timeout, s_logger);
@@ -742,12 +745,15 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager
{
                         throw new Exception(msg);
                      }
 
-                     File snapshotdir = new File(snapshotRoot);
+                     s_logger.info("vmdkfile parent dir: " + snapshotFullVMDKName);
+                     File snapshotdir = new File(snapshotFullVMDKName);
+                     // File snapshotdir = new File(snapshotRoot);
                      File[] ssfiles = snapshotdir.listFiles();
                      // List<String> filenames = new ArrayList<String>();
                      for (int i = 0; i < ssfiles.length; i++) {
                          String vmdkfile = ssfiles[i].getName();
-                         if(vmdkfile.toLowerCase().startsWith(backedUpSnapshotUuid) &&
vmdkfile.toLowerCase().endsWith(".vmdk")) {
+                         s_logger.info("vmdk file name: " + vmdkfile);
+                         if(vmdkfile.toLowerCase().startsWith(backupSSUuid) && vmdkfile.toLowerCase().endsWith(".vmdk"))
{
                               snapshotFullVMDKName += vmdkfile;
                               templateVMDKName += vmdkfile;
                               break;


Mime
View raw message