Virtual machine placement (VMP) optimization is a crucial task in the field of cloud computing. VMP optimization has a substantial impact on the energy efficiency of data centers, as it reduces the number of active physical servers, thereby reducing the power consumption. In this paper, a computational intelligence technique is applied to address the problem of VMP optimization. The problem is formulated as a minimization problem in which the objective is to reduce the number of active hosts and the power consumption. Based on the promising performance of the grey wolf optimization (GWO) technique for combinatorial problems, GWO-VMP is proposed. We propose transforming the VMP optimization problem into binary and discrete problems via two algorithms. The proposed method effectively minimizes the number of active servers that are used to host the virtual machines (VMs). We evaluated the proposed method on various VM sizes in the CloudSIM environment of homogeneous and heterogeneous servers. The experimental results demonstrate the efficiency of the proposed method in reducing energy consumption and the more efficient use of CPU and memory resources.