Cloud computing, with its immense potentials in low cost and on-demand services, is a promising computing platform for both commercial and non-commercial computation applications. It focuses on the sharing of information and computation in a large network that are quite likely to be owned by geographically disbursed different venders. Energy efficiency in data centers has become a hot topic in recent years as more and larger data centers have been established and the electricity cost has become a major expense for operating them. Server consolidation using virtualization technology has become an important technology to improve the energy efficiency of data centers. Virtual machine placement is the key in server consolidation. In the past few years, many approaches to virtual machine placement have been proposed, but existing virtual machine placement approaches to the virtual machine placement problem consider the energy consumption by physical machines. In this paper, we proposed a new approach for placement based on Discrete Chaotic whale optimization Algorithm. First goal of our presented algorithm is reducing the energy consumption in datacenters by decreasing the number of active physical machines. Second goal is decreasing waste of resources and management of them using optimal placement of virtual machines on physical machines in cloud data centers. By using the method, the increase in migration of virtual machines to physical machines is prevented. Finally, our proposed algorithm is compared to some algorithms in this area like FF, ACO, MGGA, GSA, and FCFS.