mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-17 19:14:40 +01:00
CLOUDSTACK-4362: always honor vCenter on-disk meta data to work with live migration better
This commit is contained in:
parent
281b94d587
commit
e81e75c6b0
@ -2969,13 +2969,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
||||
throw new Exception("Primary datastore " + primaryStore.getUuid() + " is not mounted on host.");
|
||||
DatastoreMO dsMo = volumeDsDetails.second();
|
||||
|
||||
String datastoreDiskPath = VmwareStorageLayoutHelper.syncVolumeToVmDefaultFolder(
|
||||
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);
|
||||
|
||||
// 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);
|
||||
@ -2990,6 +2984,12 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
||||
}
|
||||
}
|
||||
|
||||
String datastoreDiskPath = VmwareStorageLayoutHelper.syncVolumeToVmDefaultFolder(
|
||||
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);
|
||||
|
||||
// last resort, try chain info stored in DB
|
||||
if(volumeTO.getChainInfo() != null) {
|
||||
VirtualMachineDiskInfo diskInfo = _gson.fromJson(volumeTO.getChainInfo(), VirtualMachineDiskInfo.class);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user