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:

manager.py
742 742
        
743 743
        # Main loop
744 744
        while not self.done:
745
            # Check if there are any changes in the resource pool
746
            new_nodes = self.manager.scheduler.vm_scheduler.resourcepool.refresh_nodes()      
747
            for n in new_nodes:
748
                rt = slottable.create_resource_tuple_from_capacity(n.capacity)
749
                slottable.add_node(n.id, rt)   
750
            
745 751
            # Check to see if there are any leases which are ending prematurely.
746 752
            # Note that this is unique to simulation.
747 753
            prematureends = self.manager.scheduler.slottable.get_prematurely_ending_res(self.time)
......
923 929
        # Main loop
924 930
        while not self.done:
925 931
            self.logger.status("Waking up to manage resources")
926
            
932
                        
927 933
            # Save the waking time. We want to use a consistent time in the 
928 934
            # resource manager operations (if we use now(), we'll get a different
929 935
            # time every time)
......
934 940
            # Next schedulable time
935 941
            self.nextschedulable = round_datetime(self.lastwakeup + self.non_sched)
936 942
            
943
            # Check if there are any changes in the resource pool
944
            new_nodes = self.manager.scheduler.vm_scheduler.resourcepool.refresh_nodes()      
945
            for n in new_nodes:
946
                rt = self.manager.scheduler.slottable.create_resource_tuple_from_capacity(n.capacity)
947
                self.manager.scheduler.slottable.add_node(n.id, rt)                  
948
            
937 949
            # Wake up the resource manager
938 950
            self.manager.process_ending_reservations(self.lastwakeup)
939 951
            self.manager.process_starting_reservations(self.lastwakeup)

Also available in: Unified diff