Offloading tasks from mobile devices to available cloud servers were improved since the introduction of the cloudlet. With the implementation of dynamic offloading algorithms, mobile devices can choose the appropriate server for the set of tasks. However, current task distribution approaches do not consider the number of VM, which can be a critical factor in the decision making. This paper proposes a dynamic task distribution on clustered data centers. A proportional VM migration approach is also proposed, where it migrates virtual machines to the cloud servers proportionally according to their allocated CPU, in order to prevent overloading of resources in servers. Moreover, we included the resource capacity of each data center in terms of the maximum CPU in order to improve the migration approach in cloud servers. Simulation results show that the proposed mechanism for task distribution greatly improves the overall performance of the system.