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

Allow placing a group of VMs into the same Host #90

Closed
manoelcampos opened this issue May 24, 2017 · 7 comments
Closed

Allow placing a group of VMs into the same Host #90

manoelcampos opened this issue May 24, 2017 · 7 comments
Assignees
Labels

Comments

@manoelcampos
Copy link
Collaborator

manoelcampos commented May 24, 2017

Current VmAllocationPolicy implementations make VM placement decisions for each VM at a time.
They don't allow placing a group of VMs together to optimize placement and/or avoid VMs in that group to be placed into different Hosts.

If VMs into a group are inter-communicating VMs that are supposed to be placed into the same Host to reduce network traffic and communication delay, this is not ensured.

Even if VMs are not intercommunicating, group placement may be more efficient in some situations.
For instance, consider there are 3 VMs requiring 2 PEs each one and there are the following Hosts where these VMs can be placed, everyone with a specific amount of available Pes.

Host 1 Host 2 Host 3 Host 4
4 PEs 2 PE 10 PEs 12 PEs

Best Fit VM Placement

If it's used a Best Fit allocation policy (which selects the Host with less available PEs which fits the VM, maximizing resource usage), the allocation may be:

Host 1 Host 2
VM 1, VM 2 VM 0

If these 3 VMs are supposed to be a clone of each other, running some service such as a Web Server, and they used to balance workload, the presented allocation is the best, since it has a failure tolerance level of 2 (if 2 Hosts fail, one VM will continue to run in the third Host and the service is not stopped).

However, if these are VMs from different customers, doesn't matter if they are placed into the same of different Hosts. In this case, the presented placement just increases the number of used Hosts, which may lead to increased energy consumption.

Worst Fit VM Placement

If it's used a Worst Fit allocation policy (which selects the Host with more available PEs with fits the VM, maximizing resource idleness), all VMs may be allocated to Host 4.

Host 4
VM 0, VM 1, VM 2

As discussed above, if those VMs belong to the same customer and are used for workload balance, this placement doesn't enable fault tolerance and one VM may interfere with other one's performance. On the other hand, if they belong to different customers, this placement maximizes resource usage and minimize energy consumption.

Problems with presented policies

As can be seen, the kind of policy to be used depends on the desired goal.
Considering the VMs belong to different customers (DatacenterBrokers), the two presented placement aren't the most efficient ones.

The Best Fit placement used 2 Hosts when it could be selected only the Host 3 to place all VMs and reduce the number of active Hosts.
The Worst Fit placement placed all VMs into a single Host, as aimed in this example. However, using Host 3 instead of 4 would be enough for all these 3 VMs, without overloading it.

This way, if a VmAllocationPolicy considered placing a group of VMs together, a Best Fit placement would be able to select Host 3 to place all these VMs.

A brief explanation of why you think this feature is useful

It will give more flexibility for the developer to implement and assess different placement policies, considering distinct scenarios and goals.

Features not Implemented

  • Doesn't allow deciding what to do when there is no Host with enough capacity to place all VMs into a group. In such a case, the allocation of the entire group fails. There would be an option to indicate if the broker should just work that way or, when no Host is found, if it should try to create as many VMs from the group as possible.

Examples Available

@manoelcampos manoelcampos added this to the CloudSim Plus 2.0 milestone May 24, 2017
@manoelcampos manoelcampos modified the milestone: CloudSim Plus 1.2.2 Jun 4, 2017
@manoelcampos manoelcampos added this to the CloudSim Plus 4.0 milestone Jun 28, 2018
@manoelcampos manoelcampos removed this from the CloudSim Plus 4.0 milestone Aug 1, 2018
@mydevgh
Copy link

mydevgh commented Jun 4, 2019

Can the newest version of cloudsim-plus support that allocating a series of VMs to a series of Hosts through some heuristic intelligent algorithms,such as GA? Looking forward to your reply!(。・∀・)ノ゙

@manoelcampos
Copy link
Collaborator Author

Not yet. I'm planning to implement that for some experiments I'm creating for my PhD, but I don't have a deadline set.

@mydevgh
Copy link

mydevgh commented Jun 5, 2019

Ok.Thank you. This feature will be very useful.

@manoelcampos
Copy link
Collaborator Author

I let you know if I come up with some implementation.

@manoelcampos manoelcampos changed the title VmAllocationPolicies don't allow making VM placement decisions based on a group of VMs Allow VmAllocationPolicies to make VM placement decisions based on a group of VMs Jun 10, 2019
@manoelcampos manoelcampos changed the title Allow VmAllocationPolicies to make VM placement decisions based on a group of VMs Allow placing a group of VM into the same Host Jun 10, 2019
@manoelcampos
Copy link
Collaborator Author

Hello @TaoXiaoJie

I started working on this soon than I expected.
I'll be very thankful if you could try the new feature and give me some feedback.
Check the example VmGroupPlacementExample1.

@manoelcampos manoelcampos changed the title Allow placing a group of VM into the same Host Allow placing a group of VMs into the same Host Jun 14, 2019
@manoelcampos manoelcampos self-assigned this Jun 14, 2019
@vaani98
Copy link

vaani98 commented Aug 22, 2019

Is it possible to allocate VMs to hosts based on heuristics like Simuated Annealing?
The examples in the current version of CloudSim-Plus are all for allocating cloudlets to VMs using these heuristics. But to extend this same concept for the allocation of VMs to hosts, it seems like a lot of work would be required because of the lack of existing frameworks.

Would this be easier to implement in the original CloudSim?

@cloudsimplus cloudsimplus deleted a comment from naadi883 Aug 22, 2019
@cloudsimplus cloudsimplus deleted a comment from naadi883 Aug 22, 2019
@manoelcampos
Copy link
Collaborator Author

You can adapt the mentioned example to place VMs into Hosts. The logic is the same, you are just changing the kind of objects to deal with. After implementing your Simulated Annealing algorithm based on the provided example, you can create a subclass of VmAllocationPolicyAbstract and override the defaultFindHostForVm method. You can base your new VmAllocationPolicy on the VmAllocationPolicyBestFit.

For sure, anything that you try to implement in CloudSim will be way more difficult due to the narrow documentation, excessive code duplication and lack of organization.
Furthermore, CloudSim doesn't have anything related to heuristics implementation available.

If you have any further question, please subscribe to the forum.

PS: If you haven't given CloudSim Plus a star, we appreciate if you do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants