diff --git a/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java b/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java index 87746447188d..ca49f5f4da16 100644 --- a/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java +++ b/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java @@ -285,15 +285,17 @@ public boolean connectPhysicalDisk(String volumePath, KVMStoragePool pool, Map rscs = api.resourceList(rscName, null, null); + return rscs.stream().anyMatch(rsc -> rsc.getState() != null ? rsc.getState().isInUse() : false); + } }