Skip to content

Commit c5bc600

Browse files
bugfix/CSTACKEX-138: Fix volume attach in iSCSI for ONTAP plugin (#54)
1 parent e9752a8 commit c5bc600

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4847,6 +4847,11 @@ private VolumeVO sendAttachVolumeCommand(UserVmVO vm, VolumeVO volumeToAttach, L
48474847

48484848
throw new CloudRuntimeException(e.getMessage());
48494849
}
4850+
4851+
// Reload volume from DB after grantAccess — managed storage drivers (e.g. ONTAP)
4852+
// may update the volume's path and iScsiName during grantAccess, so the local
4853+
// volumeToAttach object can be stale.
4854+
volumeToAttach = _volsDao.findById(volumeToAttach.getId());
48504855
}
48514856

48524857
if (sendCommand) {

0 commit comments

Comments
 (0)