Virtual machine migration is an effective method to improve the resource utilization of cloud data center. The common migration methods use heuristic algorithms to allocation virtual machines, the solution results is easy to fall into local optimal solution. Therefore, an algorithm called Migrating algorithm based on Genetic Algorithm (MGA) is introduced in this paper, which roots from genetic evolution theory to achieve global optimal search in the map of virtual machines to target nodes, and improves the objective function of Genetic Algorithm by setting the resource utilization of virtual machine and target node as an input factor into the calculation process. There is a contrast between MGA, Single Threshold (ST) and Double Threshold (DT) through simulation experiments, the results show that the MGA can effectively reduce migrations times and the number of host machine used.