This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch 4.13
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.13 by this push:
     new 8b234bd  kvm: fix CloudRuntimeException in volume stats for migrated 
volume (#3949)
8b234bd is described below

commit 8b234bd14feeaf47b665be825dd0ecfa8f65c401
Author: slavkap <51903378+slav...@users.noreply.github.com>
AuthorDate: Fri Jun 12 08:02:01 2020 +0300

    kvm: fix CloudRuntimeException in volume stats for migrated volume (#3949)
    
    When you migrate volume between data stores CS keeps the original UUID and 
changes the path of the volume.
    When volume is not found by the given path the agent throws 
CloudRuntimeException but it's not catched in 
LibvirtGetVolumeStatsCommandWrapper.java
---
 .../kvm/resource/wrapper/LibvirtGetVolumeStatsCommandWrapper.java      | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVolumeStatsCommandWrapper.java
 
b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVolumeStatsCommandWrapper.java
index 6d945b1..00bdfcd 100644
--- 
a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVolumeStatsCommandWrapper.java
+++ 
b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVolumeStatsCommandWrapper.java
@@ -33,6 +33,7 @@ import com.cloud.hypervisor.kvm.storage.KVMStoragePool;
 import com.cloud.resource.CommandWrapper;
 import com.cloud.resource.ResourceWrapper;
 import com.cloud.storage.Storage.StoragePoolType;
+import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.agent.api.GetVolumeStatsAnswer;
 import com.cloud.agent.api.GetVolumeStatsCommand;
 import com.cloud.agent.api.VolumeStatsEntry;
@@ -52,7 +53,7 @@ public final class LibvirtGetVolumeStatsCommandWrapper 
extends CommandWrapper<Ge
                 statEntry.put(volumeUuid, 
getVolumeStat(libvirtComputingResource, conn, volumeUuid, storeUuid, poolType));
             }
             return new GetVolumeStatsAnswer(cmd, "", statEntry);
-        } catch (LibvirtException e) {
+        } catch (LibvirtException | CloudRuntimeException e) {
             return new GetVolumeStatsAnswer(cmd, "Can't get vm disk stats: " + 
e.getMessage(), null);
         }
     }

Reply via email to