File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff 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 ());
You can’t perform that action at this time.
0 commit comments