The next generation video surveillance systems are expected to face challenges in providing computation support for an unprecedented amount of video streams from multiple video cameras in a timely and scalable fashion. Cloud computing offers huge computation resources for large-scale storage and processing on demand, which are deemed suitable for video surveillance tasks. Cloud also provides quality of service guaranteed hardware and software solutions with the virtual machine (VM) technology using a utility-like service costing model. In cloud-based video surveillance context, the resource requests to handle video surveillance tasks are translated in the form of VM resource requests, which in turn are mapped to VM resource allocation referring to physical server resources hosting the VMs. Due to the nature of video surveillance tasks, these requests are highly time-constrained, heterogeneous and dynamic in nature. Hence, it is very challenging to actually manage the cloud resources from the perspective of VM resource allocation given the stringent requirements of video surveillance tasks. This paper proposes a computation model to efficiently manage cloud resources for surveillance tasks allocation. The proposed model works on optimizing the trade-off between average service waiting time and long-term service cost, and shows that long-term service cost is inversely proportional to high and balanced utilization of cloud resources. Experiments show that our approach provides a near-optimal solution for cloud resource management when handling the heterogeneous and unpredictable video surveillance tasks dynamically over next generation network.