Skip to content

Close #238#311

Merged
manoelcampos merged 2 commits intocloudsimplus:masterfrom
wadewaleganesh:master
Aug 12, 2021
Merged

Close #238#311
manoelcampos merged 2 commits intocloudsimplus:masterfrom
wadewaleganesh:master

Conversation

@wadewaleganesh
Copy link
Copy Markdown
Contributor

@wadewaleganesh wadewaleganesh commented Jun 9, 2021

Close #238

@wadewaleganesh wadewaleganesh changed the title Initiaal change towards Issue#238 Initial change towards Issue #238 Jun 9, 2021
@manoelcampos manoelcampos self-requested a review June 10, 2021 19:00
@manoelcampos manoelcampos changed the title Initial change towards Issue #238 Close #238 Jun 10, 2021
@manoelcampos manoelcampos marked this pull request as draft June 10, 2021 19:02
Copy link
Copy Markdown
Collaborator

@manoelcampos manoelcampos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're on the way. Check the comments for details.

@manoelcampos manoelcampos changed the title Close #238 Close #238 (WIP) Jun 11, 2021
Copy link
Copy Markdown
Collaborator

@manoelcampos manoelcampos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@wadewaleganesh
Copy link
Copy Markdown
Contributor Author

I have exams for next two months. I will work on the issue after some time.

@manoelcampos
Copy link
Copy Markdown
Collaborator

No problem. I'll make some changes.

@manoelcampos manoelcampos force-pushed the master branch 11 times, most recently from 007a8c1 to 3a34d2d Compare June 20, 2021 01:08
@manoelcampos manoelcampos force-pushed the master branch 5 times, most recently from ac36bc0 to 217191e Compare August 4, 2021 19:15
@manoelcampos manoelcampos force-pushed the master branch 2 times, most recently from ed6c771 to 66855c1 Compare August 4, 2021 20:27
@manoelcampos manoelcampos changed the title Close #238 (WIP) Close #238 Aug 4, 2021
@manoelcampos manoelcampos force-pushed the master branch 2 times, most recently from f2e8847 to ff93c4b Compare August 6, 2021 12:59
@manoelcampos
Copy link
Copy Markdown
Collaborator

manoelcampos commented Aug 6, 2021

The implementation is almost done. But it requests a bunch of tests.

wadewaleganesh and others added 2 commits August 12, 2021 16:32
- 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]>
@manoelcampos manoelcampos marked this pull request as ready for review August 12, 2021 19:44
@manoelcampos manoelcampos merged commit a411cb3 into cloudsimplus:master Aug 12, 2021
@manoelcampos
Copy link
Copy Markdown
Collaborator

Hello @wadewaleganesh
Thanks for all the work you did.
I've just finished the implementation and merged the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The power and time cost is not considered, when powering a host on/off

2 participants