1. A method implemented to provide a virtual network to tenants requiring bandwidth in a cloud computing environment, wherein the virtual network includes virtual switches that manage servers that host virtual machines (VMs), the method comprising: receiving a request for a task, the request including a first parameter indicating VMs required, a second parameter indicating bandwidths the required VMs need, a third parameter indicating a duration of the task, and a fourth parameter indicating a deadline of the task; selecting a starting time of the task and a bandwidth allocation of the task, wherein the bandwidth allocation of the task is shrank to be smaller than the second parameter indicating, and wherein the selection aims at minimizing a measurement of cloud resource utilization considering consumptions of both VMs and bandwidth; and allocating VMs for the request at the starting time with the bandwidth allocated at a particular location in the cloud computing environment such that the task is completed prior to the deadline.