Recently, cloud computing is growing rapidly and contributing to the realization of other technologies. Cloud data centers use a lot of energy to host applications, which leads to high operating costs and increased carbon dioxide emissions into the environment. Dynamic consolidation of virtual machines (VMs) into the minimum number of physical servers is an efficient approach to managing energy consumption in cloud. Virtual machines placement (VMP) is an important problem in the proper consolidation of VMs and is the most common way to improve resource utilization. In VMP problem, VMs are consolidated to minimize the number of active physical servers. This consolidation is done using migration of VMs. After placement, the VMs execute on selected physical servers and the underloaded physical servers are off to optimize energy consumption. Basically, the purpose of VMP is to allocate a set of VMs to a subset of physical servers, taking into account some objectives such as reducing energy consumption and violating the service level agreement (SLA). In this article, an improved teaching-learning based optimization (TLBO) algorithm is formulated to solve VMP as a multi-objective problem, which we call VMP-TLBO. VMP-TLBO can perform optimal placement of migrated VMs to physical servers with the purpose of reducing energy consumption and SLA violation. VMP-TLBO is implemented in MATLAB and the experimental results show that proposed algorithm does not violate SLA and compared to the best equivalence algorithm (ie, PAPSO), it improves energy consumption and SLA violation by 1.8% and 5.6%, respectively. In addition, VMP-TLBO consolidates migrated VMs into the minimum number of physical servers to minimize the number of overloaded hosts as much as possible.