cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [1/2] git commit: updated refs/heads/4.6 to 65bf2ed
Date Sat, 12 Dec 2015 12:59:25 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.6 61ebb53e1 -> 65bf2edfa


CLOUDSTACK-9113: skip vm with inconsistent state when getVmStats/getVmDiskStats


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/24edf1c1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/24edf1c1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/24edf1c1

Branch: refs/heads/4.6
Commit: 24edf1c1e4892b2f34b334b6e6fa13364bc413e2
Parents: 9ce1334
Author: Wei Zhou <w.zhou@tech.leaseweb.com>
Authored: Mon Dec 7 12:02:43 2015 +0100
Committer: Wei Zhou <w.zhou@tech.leaseweb.com>
Committed: Mon Dec 7 12:15:24 2015 +0100

----------------------------------------------------------------------
 .../LibvirtGetVmDiskStatsCommandWrapper.java        | 16 ++++++++++------
 .../wrapper/LibvirtGetVmStatsCommandWrapper.java    | 14 +++++++++-----
 2 files changed, 19 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/24edf1c1/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmDiskStatsCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmDiskStatsCommandWrapper.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmDiskStatsCommandWrapper.java
index 52449e9..6316be9 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmDiskStatsCommandWrapper.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmDiskStatsCommandWrapper.java
@@ -48,12 +48,16 @@ public final class LibvirtGetVmDiskStatsCommandWrapper extends CommandWrapper<Ge
             final HashMap<String, List<VmDiskStatsEntry>> vmDiskStatsNameMap
= new HashMap<String, List<VmDiskStatsEntry>>();
             final Connect conn = libvirtUtilitiesHelper.getConnection();
             for (final String vmName : vmNames) {
-                final List<VmDiskStatsEntry> statEntry = libvirtComputingResource.getVmDiskStat(conn,
vmName);
-                if (statEntry == null) {
-                    continue;
-                }
+                try {
+                    final List<VmDiskStatsEntry> statEntry = libvirtComputingResource.getVmDiskStat(conn,
vmName);
+                    if (statEntry == null) {
+                        continue;
+                    }
 
-                vmDiskStatsNameMap.put(vmName, statEntry);
+                    vmDiskStatsNameMap.put(vmName, statEntry);
+                } catch (LibvirtException e) {
+                    s_logger.warn("Can't get vm disk stats: " + e.toString() + ", continue");
+                }
             }
             return new GetVmDiskStatsAnswer(command, "", command.getHostName(), vmDiskStatsNameMap);
         } catch (final LibvirtException e) {
@@ -61,4 +65,4 @@ public final class LibvirtGetVmDiskStatsCommandWrapper extends CommandWrapper<Ge
             return new GetVmDiskStatsAnswer(command, null, null, null);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/24edf1c1/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmStatsCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmStatsCommandWrapper.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmStatsCommandWrapper.java
index 6a71d2f..e19d868 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmStatsCommandWrapper.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmStatsCommandWrapper.java
@@ -49,12 +49,16 @@ public final class LibvirtGetVmStatsCommandWrapper extends CommandWrapper<GetVmS
                 final LibvirtUtilitiesHelper libvirtUtilitiesHelper = libvirtComputingResource.getLibvirtUtilitiesHelper();
 
                 final Connect conn = libvirtUtilitiesHelper.getConnectionByVmName(vmName);
-                final VmStatsEntry statEntry = libvirtComputingResource.getVmStat(conn, vmName);
-                if (statEntry == null) {
-                    continue;
-                }
+                try {
+                    final VmStatsEntry statEntry = libvirtComputingResource.getVmStat(conn,
vmName);
+                    if (statEntry == null) {
+                        continue;
+                    }
 
-                vmStatsNameMap.put(vmName, statEntry);
+                    vmStatsNameMap.put(vmName, statEntry);
+                } catch (LibvirtException e) {
+                    s_logger.warn("Can't get vm stats: " + e.toString() + ", continue");
+                }
             }
             return new GetVmStatsAnswer(command, vmStatsNameMap);
         } catch (final LibvirtException e) {


Mime
View raw message