Skip to content

SelectionPolicyLeastFull accidentally tries to select Most Full Host for PowerVMs #212

@lFirsl

Description

@lFirsl

Hello.

While experimenting around with the Power Classes (PowerDatacenter, PowerHosts, PowerVM, etc), I've come across what looks like a bug to me.

Bug Description

When, within a simulation, we are using:

No PowerVM is ever allocated to any PowerHost, throwing a "No Suitable Host Found!" error for each PowerVM, despite the PowerHosts being allocated more than enough PEs and RAM.

When trying to debug the issue, I came upon this code within the SelectionPolicyLeastFull policy:

if (hostCandidate instanceof PowerHost powerHost) {
hostAvailable = powerHost.getUtilizationOfCpu();
} else {
hostAvailable = hostCandidate.getGuestScheduler().getAvailableMips();
}
if (hostAvailable > maxAvailable) {
maxAvailable = hostAvailable;
selectedHost = hostCandidate;
}

To my understanding, this line:


Gets an utilization of the CPU ranging from 0 to 1 - where 0 is no utilization and 1 is maximum utilization.

But this line:

hostAvailable = hostCandidate.getGuestScheduler().getAvailableMips();

Gets the currently available MIPS for the host - where 0 is maximum utilization (there are no more available MIPS) and any higher number represents how many available MIPS are available.

However, with PowerHosts that are yet to receive any PowerVMs or cloudlets, the utilization is always 0, and as such, when we get to this section:

if (hostAvailable > maxAvailable) {
maxAvailable = hostAvailable;
selectedHost = hostCandidate;
}

We never enter this if statement block, because we are comparing against a higher than 0 number.

As such, no host canditate is ever chosen, and thus no PowerVM is ever allocated. Furthermore, even if we did enter this statement, we'd always be holding the Most Full PowerHost as our host candidate.

Potential Fix

For my use case, I'm simply taking available MIPS for the PowerVMs too (as they also have access to this function) and leave the rest as is:

hostAvailable = hostCandidate.getGuestScheduler().getAvailableMips();

This returns us back to what looks like intended behaviour of LeastFull allocation.

Note

I am quite new at using CloudSim and still getting familiar with the system as a whole. If it is the case that I'm misunderstanding the intended use/functionality here, my sincerest apologies for the inconvenience!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions