The document proposes an algorithm for automated live migration of virtual machines to improve efficiency. It aims to address the bin packing problem where virtual machines are packed into physical machines. The proposed first-fit algorithm is implemented in OpenStack and aims to minimize the number of physical machines used and reduce migration time compared to best-fit. The algorithm detects underload and overload of virtual machines to trigger migrations between physical machines for dynamic consolidation. Evaluation shows the first-fit algorithm reduces migration time but further optimization is needed.