Skip to content

Commit b21891e

Browse files
Srivastava, PiyushSrivastava, Piyush
authored andcommitted
feature/CSTACKEX-213: Added provider check for attach volume db refresh call
1 parent ab25766 commit b21891e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreCapabilities;
6464
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
6565
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
66+
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider;
6667
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
6768
import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
6869
import org.apache.cloudstack.engine.subsystem.api.storage.HostScope;
@@ -4851,7 +4852,9 @@ private VolumeVO sendAttachVolumeCommand(UserVmVO vm, VolumeVO volumeToAttach, L
48514852
// Reload volume from DB after grantAccess — managed storage drivers (e.g. ONTAP)
48524853
// may update the volume's path and iScsiName during grantAccess, so the local
48534854
// volumeToAttach object can be stale.
4854-
volumeToAttach = _volsDao.findById(volumeToAttach.getId());
4855+
if(DataStoreProvider.ONTAP_PLUGIN_NAME.equals(volumeToAttachStoragePool.getStorageProviderName())){
4856+
volumeToAttach = _volsDao.findById(volumeToAttach.getId());
4857+
}
48554858
}
48564859

48574860
if (sendCommand) {

0 commit comments

Comments
 (0)