Fix bandwidth polling exception.

When the bandwidth polling task tries to update bw usage for an
instance that does not have an entry for the last two periods already
in the bw_usage_cache table, it will throw an exception in the
polling task. This was just a misses 'if' statement.
Also:
xenserver: fix swapped bw data in xs plugin.
This fixes bug 1075255
Change-Id: I44bb143039fcdfc8dacb13b67ae8f79dc5f38777
This commit is contained in:
Monsyne Dragon
2012年11月05日 17:46:55 +00:00
parent 10979da33c
commit 65644195fe

View File

@@ -2815,8 +2815,9 @@ class ComputeManager(manager.SchedulerDependentManager):
bw_ctr['uuid'],
prev_time,
bw_ctr['mac_address'])
last_ctr_in = usage['last_ctr_in']
last_ctr_out = usage['last_ctr_out']
if usage:
last_ctr_in = usage['last_ctr_in']
last_ctr_out = usage['last_ctr_out']
if last_ctr_in is not None:
if bw_ctr['bw_in'] < last_ctr_in:

View File

@@ -38,7 +38,7 @@ def _read_proc_net():
dev = devmap.get(dom, {})
# Note, we deliberately swap in and out, as instance traffic
# shows up inverted due to going though the bridge. (mdragon)
dev[vifnum] = dict(bw_in=int(slist[0]), bw_out=int(slist[8]))
dev[vifnum] = dict(bw_in=int(slist[8]), bw_out=int(slist[0]))
devmap[dom] = dev
return devmap
Reference in New Issue
openstack/nova
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.