[Haizea] Suspend Resume as Optional parameter

Mehdi Sheikhalishahi mehdi.alishahi at gmail.com
Fri Dec 3 04:16:19 CST 2010


There is a problem in __compute_scheduling_threshold of VM Scheduler, if
there is no override-suspend-time: 0 in config file.

To fix that, I've added a condition on value of suspension parameter, if
suspension is set to none, it returns 0:
In    def __compute_scheduling_threshold(self, lease): of VM Scheduler
        if threshold != None:
            # If there is a hard-coded threshold, use that
            return threshold
        elif  config.get("suspension") != constants.SUSPENSION_NONE:
            factor = config.get("scheduling-threshold-factor")

            # First, figure out the "safe duration" (the minimum duration
            # so that we at least allocate enough time for all the
            # overheads).
            susp_overhead = lease.estimate_suspend_time()
            safe_duration = susp_overhead

            if lease.get_state() == Lease.STATE_SUSPENDED_QUEUED:
                resm_overhead = lease.estimate_resume_time()
                safe_duration += resm_overhead

            # TODO: Incorporate other overheads into the minimum duration
            min_duration = safe_duration

            # At the very least, we want to allocate enough time for the
            # safe duration (otherwise, we'll end up with incorrect
schedules,
            # where a lease is scheduled to suspend, but isn't even
allocated
            # enough time to suspend).
            # The factor is assumed to be non-negative. i.e., a factor of 0
            # means we only allocate enough time for potential
suspend/resume
            # operations, while a factor of 1 means the lease will get as
much
            # running time as spend on the runtime overheads involved in
setting
            # it up
            threshold = safe_duration + (min_duration * factor)
            return threshold
        else:
            return 0

I think it is better than putting that condition in  __schedule_asap of VM
Scheduler, i.e. before self.__compute_scheduling_threshold(lease).

def __schedule_asap of VM Scheduler
   # See __compute_scheduling_threshold for more details.
        min_duration = self.__compute_scheduling_threshold(lease)


On Tue, Nov 30, 2010 at 7:55 PM, Mehdi Sheikhalishahi <
mehdi.alishahi at gmail.com> wrote:

> Thanks for the fix, yes it is working without any problem.
>
> Regards, Mehdi
>
>
> On Mon, Nov 29, 2010 at 5:31 PM, Borja Sotomayor <borja at borjanet.com>wrote:
>
>> Hi,
>>
>> > I guess it is better to relax necessity of suspend-rate and
>> > resume-rate parameters in case of suspension: none. Currently Haizea
>> > raises error if we don't set these two parameters.
>> > suspend-rate: 32
>> > resume-rate: 32
>>
>> I agree. I've committed a fix:
>>
>>
>> https://phoenixforge.cs.uchicago.edu/projects/haizea/repository/revisions/848/diff/branches/1.1/src/haizea/core/configfile.py
>>
>> This doesn't break the unit tests, but let me know if you encounter
>> any problems with this fix.
>>
>> Cheers!
>> --
>> Borja Sotomayor
>> -Scientific Writer at UChicago's Computation Institute
>> http://people.cs.uchicago.edu/~borja/
>> -Community Manager for the OpenNebula project
>> http://www.opennebula.org/
>> _______________________________________________
>> Haizea mailing list
>> Haizea at mailman.cs.uchicago.edu
>> https://mailman.cs.uchicago.edu/mailman/listinfo/haizea
>>
>
>
>


-- 
Regards,
Mehdi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.uchicago.edu/pipermail/haizea/attachments/20101203/a564236a/attachment.htm 


More information about the Haizea mailing list