- # Incase we rebooted and need to bring up the htbs that are in the db but
- # not known to tc.
- #nohtbxids = Set(slices.keys()) - Set(livehtbs.keys())
- #logger.log("bwmon: Found %s slices that should have htbs but dont." % nohtbxids.__len__())
- #newslicesxids.update(nohtbxids)
+ # Incase we rebooted and need to keep track of already running htbs
+ norecxids = Set(livehtbs.keys()) - Set(slices.keys())
+ logger.log("bwmon: Found %s slices that have htbs but not in dat." % norecxids.__len__())
+ # Reset tc counts.
+ for norecxid in norecxids:
+ slices[norecxid] = Slice(norecxid, live[norecxid]['name'], live[norecxid]['_rspec'])
+ slices[norecxid].reset(livehtbs[norecxid]['maxrate'],
+ livehtbs[norecxid]['maxexemptrate'],
+ livehtbs[norecxid]['usedbytes'],
+ livehtbs[norecxid]['usedi2bytes'],
+ live[norecxid]['_rspec'])