mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
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
This commit is contained in:
parent
f433db9881
commit
8b234bd14f
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user