In data centers, the energy-efficient scheduling of virtual machines (VMs) is critical to the full utilization of physical machines (PMs). Considering the sheer amount of data in cloud environment, this paper puts forward a novel energy-efficient scheduling method for VM consolidation and migration in cloud data centers. The proposed method optimizes the energy consumption at cloud data centers through three algorithms: the first algorithm describes the general migration of VMs among PMs; the second algorithm defines the migration of VMs among PMs; the third algorithm explains how the migration takes place. The effectiveness of our method was demonstrated on CloudSim with 5 PMs and 30 VMs, under the constraints of arrival time and deadline. The results show that our method can balance the load of input jobs and schedule the VMs properly, thus reducing the carbon emissions at the cloud data center.