Skip to content

Commit eb1a0ef

Browse files
authored
linstor: deleteAsync fallback to volume UUID if path not set yet (#9325)
1 parent 121a35d commit eb1a0ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/driver/LinstorPrimaryDataStoreDriverImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ public void deleteAsync(DataStore dataStore, DataObject dataObject, AsyncComplet
242242
case VOLUME:
243243
{
244244
final VolumeInfo volumeInfo = (VolumeInfo) dataObject;
245-
final String rscName = LinstorUtil.RSC_PREFIX + volumeInfo.getPath();
245+
// if volume creation wasn't completely done .setPath wasn't called, so we fallback to vol.getUuid()
246+
final String volUuid = volumeInfo.getPath() != null ? volumeInfo.getPath() : volumeInfo.getUuid();
247+
final String rscName = LinstorUtil.RSC_PREFIX + volUuid;
246248
deleteResourceDefinition(storagePool, rscName);
247249

248250
long usedBytes = storagePool.getUsedBytes();

0 commit comments

Comments
 (0)