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:
parent
10979da33c
commit
65644195fe
@ -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:
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user