Conversation
manoelcampos
left a comment
There was a problem hiding this comment.
You're on the way. Check the comments for details.
cloudsim-plus-examples/src/main/java/org/cloudsimplus/examples/power/HostActivationExample.java
Outdated
Show resolved
Hide resolved
cloudsim-plus/src/main/java/org/cloudbus/cloudsim/hosts/HostSimple.java
Outdated
Show resolved
Hide resolved
cloudsim-plus/src/main/java/org/cloudbus/cloudsim/hosts/HostSimple.java
Outdated
Show resolved
Hide resolved
cloudsim-plus/src/main/java/org/cloudbus/cloudsim/hosts/HostSimple.java
Outdated
Show resolved
Hide resolved
manoelcampos
left a comment
There was a problem hiding this comment.
Good progress. Since this is a framework that other projects depend on,I we need to make a thorough review to ensure the design is adequate, to avoid future needs to change and break backward compatibility.
This way, there will be some more review rounds. I hope you understand.
cloudsim-plus/src/main/java/org/cloudbus/cloudsim/power/models/PowerModelHost.java
Outdated
Show resolved
Hide resolved
cloudsim-plus-examples/src/main/java/org/cloudsimplus/examples/power/HostActivationExample.java
Outdated
Show resolved
Hide resolved
cloudsim-plus-examples/src/main/java/org/cloudsimplus/examples/power/HostActivationExample.java
Outdated
Show resolved
Hide resolved
| final double hostStartUpDelay = 5; //Indicates Host Power On Delay | ||
| final double hostShutDownDelay = 5; //Indicates Host Power off Delay | ||
| final double hostStartUpPower = 5; //Indicates Host Power On Power | ||
| final double hostShutDownPower = 5; //Indicates Host Power off Power |
There was a problem hiding this comment.
We need to think about this startup and shutdown power consumption.
Those operations impact the host CPU load. Currently, PowerModelHost class considers that load to calculate power consumption. For better accuracy, power consumption is computed considering a static power amount of watts and a dynamic one according to the CPU load.
This way, we could use the already existing methods in that class to compute the power consumption.
But instead of statically defining the exact power consumption during startup and shutdown, we could define a UtilizationModel for startup and other for shutdown.
Maybe this will complicate the implementation too much. Anyway, I need to take a time to think about it.
We could even address this as a different issue and PR. Let it be the way it is by now. We decide about it before finishing this PR.
cloudsim-plus/src/main/java/org/cloudbus/cloudsim/datacenters/DatacenterSimple.java
Outdated
Show resolved
Hide resolved
cloudsim-plus/src/main/java/org/cloudbus/cloudsim/hosts/HostSimple.java
Outdated
Show resolved
Hide resolved
cloudsim-plus/src/main/java/org/cloudbus/cloudsim/hosts/HostSimple.java
Outdated
Show resolved
Hide resolved
|
I have exams for next two months. I will work on the issue after some time. |
|
No problem. I'll make some changes. |
007a8c1 to
3a34d2d
Compare
ac36bc0 to
217191e
Compare
ed6c771 to
66855c1
Compare
f2e8847 to
ff93c4b
Compare
|
The implementation is almost done. But it requests a bunch of tests. |
d9a35f7 to
bd4391a
Compare
98f450a to
4ea24e2
Compare
- Adds power on/off delay and power consumption attributes in PowerModelHost - Moves some local Host variables to constants. This centralizes the example configuration in the same place. - Uses a smaller shut down delay since that operation is usually quicker than start up. - Adds missing import for Host JavaDoc - Removes redundant public modifier in Host interface methods. - Makes Host setStartUpShutDownDelay and setStartUpShutDownPower to return this instance, enabling chained calls as other existing setters. - Final parameters in interfaces are useless, since implementing classes can change it. - Removes redundancy in startUp and shutDown parameters for Host and HostSimple. - Remove if conditions when setting startup/shutdown delay and power. - Introduces validations on PowerModelHost setters. - There is no need for those if conditions here. If the given value is zero and the current attribute is also zero, that doesn't change anything. And there is no worries about performance here. This way, as less code we have as better. Furthermore, the if may cause unexpected behavior. If I set the attributes with some value and later on I dedice to disable them (setting 0), the condition won't allow me to change them to zero again. - Removes host methods from PowerModel interface. Since this is a generic interface that is used to implement different power models for Datacenters or even VMs, those Hosts methods don't belong there. They are moved to the PowerModelHost class. The host prefix in those method names were removed because it's redundant. - Removes redundant methods from Host. - Methods setStartUpShutDownDelay and setStartUpShutDownPower are already in PowerModelHost. Since the dev is not required to provide a power model for Hosts, these methods just clutter the Host code, which is already large. Despite they work as shortcuts, they just adds to much coupling. Changing the methods on the PowerModelHost may required changing them in Host. The documentation of the methods on the different places tend to mismatch and it's hard to keep them in sync. - Only adds the startup power consumed if the Host has started. - Only adds up shutdown power consumed if the Host has started and is not active anymore. Otherwise, it has never started yet or it's currently active. - Refactors PowerModelHost startup and shutdown methods to return this, enabling chained calls. - Creates PowerModelHostSimple for HostActivationExample - Updates code after removing startup and shutdown methods from Host (which are in PowerModelHost). - Update PowerExample after changes in PowerModelHost. - Update docs in PowerModelHost and PowerModelHostSimple - Refactors PowerModelHost and PowerModelHostSimple to remove code duplication - Moves some host variables to constants, to centralize configuration. == Rework for HOST_POWER_ON_OFF tag - Renames HOST_POWER_ON_OFF to HOST_POWER_ON, including a new HOST_POWER_OFF - Renames Host.processHostPowerOnOff to processHostActivation for simplification. Adds an activate parameter instead of just negating the Host.active attribute which would cause issues when one try to start an already started Host up (that would make the Host to be shutdown instead of started up). - Refactors HostSimple.processHostActivation for simplification. - Refactors HostSimple.setActive to reduce duplication and the number of if's. == Adds CloudSimTags.VM_CREATE_RETRY Enables retrying VM creation if no suitable active Host is found. The previuos DatacenterBroker failedVmsRetry attributed enabled that but it just worked when to try the next datacenter. Now the attribute is called failedVmsRetryDelay, indicating the time to wait to retry creating VMs. The VM allocation policy just allocates the selected Host for the requesting VM if it's active. But if a suitable Host is selected, it's activation is requested, which may not be instantaneous if a Host startup delay is set. == Update HostActivationExample to reflect the new changes after the broker failedVmsRetry (boolean) to failedVmsRetryDelay (double). == Shows only active hosts in HostActivationExample. - Displays VM submission delay in results table. == Enables waiting VMs and Cloudlets to be created when new Vms are submitted. - When new VMs are submitted, if there is a VM creation retry in course, doesn't send another one. This was making some VM creation requests to fail in being processed. - Request creation of waiting Cloudlets after each VM creation. If we wait to create cloudlets just after all waiting VMs are created, that was making VMs to become idle and even be destroyed. This way, those waiting Cloudlets targeting that VM won't be executed. == Update HostActivationExample - Reflect the new Host power on/off delay feature. Co-authored-by: Manoel Campos <[email protected]> Signed-off-by: Manoel Campos <[email protected]>
Signed-off-by: Manoel Campos <[email protected]>
|
Hello @wadewaleganesh |
Close #238