cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anim...@apache.org
Subject [12/21] git commit: updated refs/heads/4.2 to 51707d8
Date Tue, 03 Sep 2013 23:41:41 GMT
CLOUDSTACK-4362: always honor vCenter on-disk meta data to work with live migration better
(cherry picked from commit e362f51f37b718466f2d80d9193e58e1fafcb8fb)

Signed-off-by: animesh <animesh@apache.org>


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

Branch: refs/heads/4.2
Commit: 92f2360f6109492cdebb247cf6da35dc513e0fbd
Parents: ae00118
Author: Kelven Yang <kelveny@gmail.com>
Authored: Fri Aug 30 11:10:56 2013 -0700
Committer: animesh <animesh@apache.org>
Committed: Tue Sep 3 16:25:02 2013 -0700

----------------------------------------------------------------------
 .../vmware/resource/VmwareResource.java         | 34 ++++++++++----------
 1 file changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/92f2360f/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 96ee201..de6885c 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -3031,27 +3031,27 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
         	throw new Exception("Primary datastore " + primaryStore.getUuid() + " is not mounted
on host.");
         DatastoreMO dsMo = volumeDsDetails.second();
 
+        // we will honor vCenter's meta if it exists
+        if(diskInfoBuilder != null && diskInfoBuilder.getDiskCount() > 0) {
+        	// we will always on-disk info from vCenter in this case
+        	VirtualMachineDiskInfo diskInfo = diskInfoBuilder.getDiskInfoByDeviceBusName(deviceBusName);
+        	if(diskInfo != null) {
+        		if(s_logger.isInfoEnabled())
+        			s_logger.info("Volume " + volumeTO.getId() + " does not seem to exist on datastore.
use on-disk chain: " + 
+        				_gson.toJson(diskInfo));
+        		
+        		return diskInfo.getDiskChain();
+        	} else {
+        		s_logger.warn("Volume " + volumeTO.getId() + " does not seem to exist on datastore.
on-disk may be out of sync as well. disk device info: " + deviceBusName);
+        	}
+        }
+        
         String datastoreDiskPath = VmwareStorageLayoutHelper.syncVolumeToVmDefaultFolder(
-        	dcMo, vmMo.getName(), dsMo, volumeTO.getPath());
-
+            	dcMo, vmMo.getName(), dsMo, volumeTO.getPath());
         if(!dsMo.fileExists(datastoreDiskPath)) {
     		if(s_logger.isInfoEnabled())
     			s_logger.info("Volume " + volumeTO.getId() + " does not seem to exist on datastore,
out of sync? path: " + datastoreDiskPath);
     		
-            if(diskInfoBuilder != null && diskInfoBuilder.getDiskCount() > 0)
{
-            	// we will always on-disk info from vCenter in this case
-            	VirtualMachineDiskInfo diskInfo = diskInfoBuilder.getDiskInfoByDeviceBusName(deviceBusName);
-            	if(diskInfo != null) {
-            		if(s_logger.isInfoEnabled())
-            			s_logger.info("Volume " + volumeTO.getId() + " does not seem to exist on datastore.
use on-disk chain: " + 
-            				_gson.toJson(diskInfo));
-            		
-            		return diskInfo.getDiskChain();
-            	} else {
-            		s_logger.warn("Volume " + volumeTO.getId() + " does not seem to exist on datastore.
on-disk may be out of sync as well. disk device info: " + deviceBusName);
-            	}
-            }
-            
             // last resort, try chain info stored in DB
             if(volumeTO.getChainInfo() != null) {
             	VirtualMachineDiskInfo diskInfo = _gson.fromJson(volumeTO.getChainInfo(), VirtualMachineDiskInfo.class);
@@ -3061,7 +3061,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
             	}
             	
             	throw new Exception("Volume " + volumeTO.getId() + " does not seem to exist
on datastore. Broken disk chain");
-            }
+            	}
     	}
         
     	return new String[] { datastoreDiskPath }; 


Mime
View raw message