1. A method of resource allocation within a datacenter comprising: receiving a request for resources from a user, the request comprising a number of virtual machines and a user-specified performance characteristic; mapping the request to physical resources within the datacenter to allocate the requested number of virtual machines on physical machines within the datacenter, mapping the request to physical resources within the datacenter to allocate the requested number of virtual machines including: starting at a first level in a topology tree within the datacenter, determining how many virtual machines can be allocated in each sub-tree in the level; if a sub-tree in the level can accommodate all the requested virtual machines, allocating the requested number of virtual machines in the sub-tree to the user; and if none of the sub-trees in the level can accommodate all the requested virtual machines, moving to a next level in the topology tree and repeating the determining step; if the allocation is successful, updating stored data identifying residual capacity on a set of elements within the datacenter as a result of the allocation of virtual machines to the user; and sending a message to the user accepting the request, the user-specified performance characteristic comprising a bandwidth characteristic on links between virtual machines, and the set of virtual machines that can be allocated in each sub-tree in a level being determined based on a minimizing calculation involving the requested number of virtual machines, the number of empty slots in the sub-tree, and the residual bandwidth for a link.