diff --git a/plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/snapshot/LinstorVMSnapshotStrategy.java b/plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/snapshot/LinstorVMSnapshotStrategy.java index af7b6978db56..20a1f90da2f0 100644 --- a/plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/snapshot/LinstorVMSnapshotStrategy.java +++ b/plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/snapshot/LinstorVMSnapshotStrategy.java @@ -239,7 +239,8 @@ public boolean deleteVMSnapshot(VMSnapshot vmSnapshot) { final String snapshotName = vmSnapshotVO.getName(); final List failedToDelete = new ArrayList<>(); for (VolumeObjectTO volumeObjectTO : volumeTOs) { - final String rscName = LinstorUtil.RSC_PREFIX + volumeObjectTO.getUuid(); + final String volPath = volumeObjectTO.getPath(); + final String rscName = LinstorUtil.RSC_PREFIX + (volPath != null ? volPath : volumeObjectTO.getUuid()); String err = linstorDeleteSnapshot(api, rscName, snapshotName); if (err != null) @@ -292,7 +293,8 @@ private boolean revertVMSnapshotOperation(VMSnapshot vmSnapshot, long userVmId) final String snapshotName = vmSnapshotVO.getName(); for (VolumeObjectTO volumeObjectTO : volumeTOs) { - final String rscName = LinstorUtil.RSC_PREFIX + volumeObjectTO.getUuid(); + final String volPath = volumeObjectTO.getPath(); + final String rscName = LinstorUtil.RSC_PREFIX + (volPath != null ? volPath : volumeObjectTO.getUuid()); String err = linstorRevertSnapshot(api, rscName, snapshotName); if (err != null) { throw new CloudRuntimeException(String.format(