-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Comments
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. |
I had used cloudSim in the past. And I would like to work on this feature. |
That is great. I think we could start by modeling the proposed solution. Do you have something in mind already? |
Currently I don't have a clear idea. I will start reading papers and information regarding
|
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. This way, an initial class diagram would be great. |
Currently I am reading papers regarding that. |
Great, if you find some paper that is useful, please provide the DOI link here. |
Unfortunately there are not many papers regarding the issue. I am studying the PowerModelHost |
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 |
That seems to be the way to go. Let me know if you need any help. Thanks. |
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. |
Also please tell me how to introduce a delay in simulation(which function to call)? |
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 |
There are lots of different ways to send a message, depending in which class you are and what you are trying to do. Don't ask me why there is a |
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);
CloudSimTags.HOST_POWER_ON_OFF is added by me. See output of HostActivationExample.java; |
Send a PR and we can start looking at the code and proposing changes. |
Add me to the repository. I need to push my branch in order to create a Pull Request. |
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:
|
I have made a pull request |
- 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>
- 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>
- 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>
- 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>
- 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>
- 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>
- 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>
- 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>
- 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>
- 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>
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
The text was updated successfully, but these errors were encountered: