mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	Handle volume copy from secondary to primary in case of vSAN
This commit is contained in:
		
							parent
							
								
									d48cab75ab
								
							
						
					
					
						commit
						0a412ac6da
					
				| @ -3483,7 +3483,7 @@ public class VmwareStorageProcessor implements StorageProcessor { | |||||||
|                 throw new Exception("Unable to create container VM for volume creation"); |                 throw new Exception("Unable to create container VM for volume creation"); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             clonedVm.moveAllVmDiskFiles(primaryDsMo, "", false); |             clonedVm.moveAllVmDiskFiles(primaryDsMo, HypervisorHostHelper.VSPHERE_DATASTORE_BASE_FOLDER, false); | ||||||
|             clonedVm.detachAllDisks(); |             clonedVm.detachAllDisks(); | ||||||
|             return _storage.getSize(srcOVFFileName); |             return _storage.getSize(srcOVFFileName); | ||||||
|         } finally { |         } finally { | ||||||
|  | |||||||
| @ -260,10 +260,15 @@ public class DatastoreMO extends BaseMO { | |||||||
|             destFullPath = String.format("[%s] %s", destDsName, destFilePath); |             destFullPath = String.format("[%s] %s", destDsName, destFilePath); | ||||||
| 
 | 
 | ||||||
|         DatastoreMO srcDsMo = new DatastoreMO(_context, morDestDs); |         DatastoreMO srcDsMo = new DatastoreMO(_context, morDestDs); | ||||||
|  |         try { | ||||||
|             if (!srcDsMo.fileExists(srcFullPath)) { |             if (!srcDsMo.fileExists(srcFullPath)) { | ||||||
|                 s_logger.error(String.format("Cannot move file to destination datastore due to file %s does not exists", srcFullPath)); |                 s_logger.error(String.format("Cannot move file to destination datastore due to file %s does not exists", srcFullPath)); | ||||||
|                 return false; |                 return false; | ||||||
|             } |             } | ||||||
|  |         } catch (Exception e) { | ||||||
|  |             s_logger.error(String.format("Cannot move file to destination datastore due to file %s due to exeception %s", srcFullPath, e.getMessage())); | ||||||
|  |             return false; | ||||||
|  |         } | ||||||
| 
 | 
 | ||||||
|         ManagedObjectReference morTask = _context.getService().moveDatastoreFileTask(morFileManager, srcFullPath, morSrcDc, destFullPath, morDestDc, forceOverwrite); |         ManagedObjectReference morTask = _context.getService().moveDatastoreFileTask(morFileManager, srcFullPath, morSrcDc, destFullPath, morDestDc, forceOverwrite); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user