Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jmsw4bn opened this issue Apr 26, 2020 · 19 comments · Fixed by #311
Closed

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

jmsw4bn opened this issue Apr 26, 2020 · 19 comments · Fixed by #311
Assignees
Labels
accuracy feature power Issues related to the Power Module

Comments

@jmsw4bn
Copy link

jmsw4bn commented Apr 26, 2020

ISSUE

When I change the active state of a host.

Actual behavior

No extra power and time cost is spent.

Expected behavior

Actually, extra power and time cost is needed to power on/off a host, and a host cannot directly change from an active state to off state (and vice versa).
I scrutinize the source code, and find that, when setting a host active, the host is active immediately.
Accordingly to the actual situations, it will take tens of seconds to power a host on/off, and during such time extra power is consumed.

Therefore, I suggest to fix this problem to support accurate power-aware simulations.

Available Examples

Related Issues

@manoelcampos manoelcampos added feature good-first-issue A good issue to start contributing to the project help wanted labels Apr 28, 2020
@manoelcampos
Copy link
Collaborator

Hello @jmsw4bn

Thanks for reporting this issue. You're right. This is a feature inherited from CloudSim. Despite lots of bugs were fixed and new features included, Host's boot and shutdown processes are simplistic and don't consider the time and power consumption.
But unfortunately, I won't be able to implement this feature in the short term.
I hope to get some help from the community to implement that.
If you're willing to do that and need some support, just let me know.

@manoelcampos manoelcampos added the power Issues related to the Power Module label May 13, 2020
@manoelcampos manoelcampos changed the title The power and time cost is not considered, when powering on/off a host. The power and time cost is not considered, when powering a host on/off Aug 28, 2020
@wadewaleganesh
Copy link
Contributor

wadewaleganesh commented Apr 2, 2021

I had used cloudSim in the past. And I would like to work on this feature.

@manoelcampos
Copy link
Collaborator

That is great. I think we could start by modeling the proposed solution. Do you have something in mind already?

@wadewaleganesh
Copy link
Contributor

Currently I don't have a clear idea. I will start reading papers and information regarding

  • what all actions get run while starting and stopping the host
  • time required for all of these actions
  • if required we can simulate these actions too

@manoelcampos
Copy link
Collaborator

manoelcampos commented Apr 3, 2021

The operations performed during startup and shutdown will vary depending on the host OS. Since we don't simulate OS specific features, we should follow a simpler approach.

The startup up and shutdown time will vary according to the host capacity (CPU cores and MIPS). Host load will impact that too.
If there are some papers related to that, it would be great.
Anyway, we should create some interface and classes to model these behaviors, such as the ones that model power consumption (see PowerModelHost).

This way, an initial class diagram would be great.

@wadewaleganesh
Copy link
Contributor

Currently I am reading papers regarding that.

@manoelcampos
Copy link
Collaborator

Great, if you find some paper that is useful, please provide the DOI link here.

@manoelcampos manoelcampos added the in-progress Someone has started to work on the issue. The progress may be available at the dev branch. label Apr 14, 2021
@wadewaleganesh
Copy link
Contributor

Unfortunately there are not many papers regarding the issue. I am studying the PowerModelHost

@wadewaleganesh
Copy link
Contributor

wadewaleganesh commented May 9, 2021

Instead of adding new interface and classes, I am thinking of adding simple methods to simulate power consumption during power on/off in PowerModelHost.java. Because power consumption during power on/off should come under PowerModel. Also, introduce delay during power on/off in setActive in Host.java

@manoelcampos
Copy link
Collaborator

That seems to be the way to go. Let me know if you need any help. Thanks.

@wadewaleganesh
Copy link
Contributor

wadewaleganesh commented Jun 7, 2021

What should be the number of instructions required for booting up/down the host? Depending upon that we can calculate the time required to finish boot up/down.
Time = (No. of Instructions for boot up/down in Million) ÷ (MIPS of Host)

@wadewaleganesh
Copy link
Contributor

wadewaleganesh commented Jun 7, 2021

Also please tell me how to introduce a delay in simulation(which function to call)?

@manoelcampos
Copy link
Collaborator

What should be the number of instructions required for booting up/down the host? Depending upon that we can calculate the time required to finish boot up/down.
Time = (No. of Instructions for boot up/down in Million) ÷ (MIPS of Host)

I'm not an OS expert, but this is totally dependent on the OS and version being used and the underlying hardware. Regarding that, I'm afraid there is no way we could accurately compute the number of instructions required to determine boot time. If we consider different hardware architectures, multiple linux distributions and the countless number of kernel versions, it's unfeasible to determine an equation to compute MI number.

A simple solution to simulate boot/shutdown time may be just PowerModelHost attributes to determine the delay (in seconds) for those tasks. One would argue that boot/shutdown time is not always the same. But for simulation purposes, a static value may be good enough. If you have heterogenous hosts, you can use PowerModelHosts with different configurations.

@manoelcampos
Copy link
Collaborator

manoelcampos commented Jun 7, 2021

Also please tell me how to introduce a delay in simulation(which function to call)?

There are lots of different ways to send a message, depending in which class you are and what you are trying to do.
Check the CloudSim.send(), CloudSimEntity.send() and CloudSimEntity.schedule() methods. There are lots of overloaded versions of them. Just use the one that fits you and has the least number of parameters. Usually, there is a delay parameter (that is what you're looking for).

Don't ask me why there is a send and a schedule methods that do the same thing 🤣. This is just inherited from CloudSim. Those methods are used everywhere and I didn't want to touch them.

@wadewaleganesh
Copy link
Contributor

wadewaleganesh commented Jun 8, 2021

I have added a delay call (using simulation.send()) for 10 seconds(for testing), but the 10 seconds are considered after all the simulation is done, not when host powers on/off. I am confused what to do.

See this call before return statement in HostSimple.java > setActive(bool activate);

public final Host setActive(final boolean activate) {
        if(isFailed() && activate){
            throw new IllegalStateException("The Host is failed and cannot be activated.");
        }

        final boolean wasActive = this.active;
        

        if(activate && !this.active) {
            setStartTime(getSimulation().clock());
        } else if(!activate && this.active){
            setShutdownTime(getSimulation().clock());
        }

        this.active = activate;
        notifyStartupOrShutdown(activate, wasActive);
        this.getSimulation().send(datacenter, datacenter, 10, CloudSimTags.HOST_POWER_ON_OFF, datacenter);
        return this;
    }

CloudSimTags.HOST_POWER_ON_OFF is added by me.

See output of HostActivationExample.java;
1.txt : (without delay)
2.txt : (with delay)

@manoelcampos
Copy link
Collaborator

Send a PR and we can start looking at the code and proposing changes.

@wadewaleganesh
Copy link
Contributor

Add me to the repository. I need to push my branch in order to create a Pull Request.

@manoelcampos
Copy link
Collaborator

manoelcampos commented Jun 8, 2021

There is no need for that. If you have a fork of the repository, you can freely send a Pull Request. If you haven't created the fork yet, follow these steps:

  • fork CloudSim Plus repository
  • clone it into a directory different than the one you already made the changes
  • copy changed files to the new directory
  • push the changes in this new directory and open a PR

@wadewaleganesh
Copy link
Contributor

I have made a pull request

manoelcampos added a commit to wadewaleganesh/cloudsim-plus that referenced this issue Aug 4, 2021
- Made changes for Power on/off delay and power consumption
- Update docs in CloudSimTags.java
- Uses the CloudSimEntity.schedule method
  that simplifies the call for current parameters.

Co-authored-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
manoelcampos added a commit to wadewaleganesh/cloudsim-plus that referenced this issue Aug 4, 2021
- Made changes for Power on/off delay and power consumption
- Update docs in CloudSimTags.java
- Uses the CloudSimEntity.schedule method
  that simplifies the call for current parameters.

Co-authored-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
manoelcampos added a commit to wadewaleganesh/cloudsim-plus that referenced this issue Aug 6, 2021
- Made changes for Power on/off delay and power consumption
- Update docs in CloudSimTags.java
- Uses the CloudSimEntity.schedule method
  that simplifies the call for current parameters.

Co-authored-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
manoelcampos added a commit to wadewaleganesh/cloudsim-plus that referenced this issue Aug 6, 2021
- Made changes for Power on/off delay and power consumption
- Update docs in CloudSimTags.java
- Uses the CloudSimEntity.schedule method
  that simplifies the call for current parameters.

Co-authored-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
manoelcampos added a commit that referenced this issue Aug 11, 2021
- Made changes for Power on/off delay and power consumption
- Update docs in CloudSimTags.java
- Uses the CloudSimEntity.schedule method
  that simplifies the call for current parameters.

Co-authored-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
manoelcampos added a commit to wadewaleganesh/cloudsim-plus that referenced this issue Aug 12, 2021
- Made changes for Power on/off delay and power consumption
- Update docs in CloudSimTags.java
- Uses the CloudSimEntity.schedule method
  that simplifies the call for current parameters.

Co-authored-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
manoelcampos added a commit to wadewaleganesh/cloudsim-plus that referenced this issue Aug 12, 2021
- Made changes for Power on/off delay and power consumption
- 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 <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
manoelcampos added a commit to wadewaleganesh/cloudsim-plus that referenced this issue Aug 12, 2021
- Adds power on/off delay and power consumption attributes
- 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 <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
manoelcampos added a commit to wadewaleganesh/cloudsim-plus that referenced this issue Aug 12, 2021
- 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 <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
manoelcampos added a commit that referenced this issue Aug 12, 2021
- 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 <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
@manoelcampos manoelcampos added accuracy and removed help wanted in-progress Someone has started to work on the issue. The progress may be available at the dev branch. good-first-issue A good issue to start contributing to the project labels Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accuracy feature power Issues related to the Power Module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants