Skip to content

Commit 25cd46c

Browse files
Srivastava, PiyushSrivastava, Piyush
authored andcommitted
feature/CSTACKEX-122: Per host Igroup changes 4
1 parent c1535f3 commit 25cd46c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,16 @@ protected Void managedCopyBaseImageCallback(AsyncCallbackDispatcher<VolumeServic
730730
CopyCmdAnswer answer = (CopyCmdAnswer)result.getAnswer();
731731
TemplateObjectTO templateObjectTo = (TemplateObjectTO)answer.getNewData();
732732

733-
volume.setPath(templateObjectTo.getPath());
733+
// For NFS managed storage, preserve the volume UUID path to avoid file collision
734+
// For iSCSI, update path as before (iSCSI uses _iScsiName field for actual LUN access)
735+
PrimaryDataStore primaryDataStore = (PrimaryDataStore) volumeInfo.getDataStore();
736+
if (primaryDataStore != null && primaryDataStore.getPoolType() == StoragePoolType.NetworkFilesystem) {
737+
if (logger.isDebugEnabled()) {
738+
logger.debug("NFS managed storage - preserving volume path: " + volume.getPath() + " (not overwriting with template path: " + templateObjectTo.getPath() + ")");
739+
}
740+
} else {
741+
volume.setPath(templateObjectTo.getPath());
742+
}
734743

735744
if (templateObjectTo.getFormat() != null) {
736745
volume.setFormat(templateObjectTo.getFormat());

0 commit comments

Comments
 (0)