Project

General

Profile

Revision 676

Fixed: Haizea would crash when fetching nodes for which OpenNebula had not yet collected monitoring information. This fix also has the pleasant side effect of allowing Haizea to detect new hosts added in OpenNebula without having to restart Haizea.

View differences:

vm_scheduler.py
330 330
                    use = r.vmrr.resources_in_pnode[node].get_by_type(constants.RES_CPU)
331 331
                    util[type(r)] = use + util.setdefault(type(r),0.0)
332 332
        util[None] = total - sum(util.values())
333
        for k in util:
334
            util[k] /= total
333
        
334
        if total != 0:
335
            for k in util:
336
                util[k] /= total
335 337
            
336 338
        return util              
337 339
        

Also available in: Unified diff