  Cloud providers handle substantial number of requests to create and delete
virtual machines (VMs) on a daily basis, where the unknown sequence of requests
eventually leads to resource fragmentation. To mitigate this issue, periodic
consolidation of VMs into fewer number of physical hosts is an important
cost-saving procedure, closely related to the vector bin-packing problem. In
this paper, we propose the BalCon algorithm for consolidation that steadily
reduces the number of active hosts and keeps migration costs low. BalCon
classifies the cluster's state and selects one of three heuristics to balance
resources for superior consolidation. To evaluate BalCon's performance with
respect to optimality, we introduce integer programming models. BalCon finds
99.7% of the optimal solutions for over 750 problem instances. This outstanding
result was achieved due to the Force Step of our algorithm, which is the key
improvement detail for common heuristics. We compare BalCon with a modified
Sercon heuristic using Huawei and synthetic datasets with two resources for
allocation.
