Search code examples
cloudcloud-hostingpaas

Cloud Placement Logic


I am PaaS/IaaS developer.I am trying to bring in new algorithm to design placement login or resource management logic.Eg:I am creating instance of linux for the user I want to consider memory cpu usage heapsize all this factors and design my placement mechanism.Also i want to retry if instance fails.Any help to design this?


Solution

  • As nmahee suggested, you should use a BinPacking solver with the following constrains: 1. Support more than one dimension (CPU, Memory, Disk Space, etc...) 2. Support an incremental algorithm that starts with the current distribution and results with a new distribution. Unlike the classic binpacking that assumes you are starting with a clean slate. 3. Trade-off between an optimal solution and a minimum change to the existing distribution. For example if a new resource is added, should you move an existing resource to have an optimum solution ? (In PaaS the answer is usually no).

    For a general purpose BinPacking solver look into Drools.

    For a (very ad-hoc) solver you can take a look at the engine that is used by Cloudify. When we have the time we would probably re-write it with drools. https://github.com/OpenSpaces/OpenSpaces/blob/master/src/main/java/org/openspaces/grid/gsm/machines/BinPackingSolver.java

    This solver basically looks at each machine's free capacity, used capacity and change in capacity needed (capacity is abstraction for cpu/memory/disk - see 1 above). Where used capacity is the existing solution (see 2 above). Another trait of this algorithm is that it completely ignores other resources on this machine. If there are other resources on this machine it is reflected by a smaller free capacity value. Basically we are calling the solver separately for each resource, each time masking the rest of the resources on the machine by decreasing the free capacity (see 3 above)