File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
server/src/main/java/com/cloud/storage Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2881,8 +2881,12 @@ private Optional<String> setExtractVolumeSearchCriteria(SearchCriteria<VolumeDat
28812881 } else if (volumeStoreRef != null ) {
28822882 s_logger .debug ("volume " + volumeId + " is already installed on secondary storage, install path is " +
28832883 volumeStoreRef .getInstallPath ());
2884+ VolumeInfo destVol = volFactory .getVolume (volumeId , DataStoreRole .Image );
2885+ if (destVol == null ) {
2886+ throw new CloudRuntimeException ("Failed to find the volume on a secondary store" );
2887+ }
28842888 ImageStoreEntity secStore = (ImageStoreEntity ) dataStoreMgr .getDataStore (volumeStoreRef .getDataStoreId (), DataStoreRole .Image );
2885- String extractUrl = secStore .createEntityExtractUrl (volumeStoreRef .getInstallPath (), volume .getFormat (), null );
2889+ String extractUrl = secStore .createEntityExtractUrl (volumeStoreRef .getInstallPath (), volume .getFormat (), destVol );
28862890 volumeStoreRef = _volumeStoreDao .findByVolume (volumeId );
28872891 volumeStoreRef .setExtractUrl (extractUrl );
28882892 volumeStoreRef .setExtractUrlCreated (DateUtil .now ());
You can’t perform that action at this time.
0 commit comments