Abstract-Cloud computing is an emerging technology that greatly shapes our lives, where users run their jobs on virtual machines (VMs) on physical machines (PMs) provided by a cloud service provider, saving the investment in upfront infrastructures. Due to the heterogeneity of various jobs, different VMs on the same PMs could have different job completion times. Meanwhile, the PMs are also heterogeneous. Therefore, different VM placements have different job completion times, and our objective is to minimize the total job completion time of the input VM requests through a reasonable VM placement schedule. This problem is NP-hard, since it can be reduced to a knapsack problem. We propose an off-line VM placement method through an emulated VM migration process, while the on-line VM placement is solved by a real VM migration process. The migration algorithm is a heuristic approach, in which we place the VM to its best PM directly, if this PM has enough capacity. Otherwise, we migrate another VM from this PM to accommodate the new VM, if a prespecified migration constraint is satisfied. Furthermore, we study a hybrid scheme where a batch is employed to accept upcoming VMs for the on-line scenario. Evaluation results validate the high efficiency of the proposed algorithms.