In clouds, placement of on-demand applications on heterogeneous machines, has turned out to be a crucial research problem, particularly, in terms of performance and energy consumption. Techniques like Dynamic Voltage and Frequency Scaling (DVFS), processor speed adjustment and features such as turning off displays, activating sleep modes, etc. are only useful for decreasing the energy consumption of a single machine, at marginal loss in performance. They cannot be used to achieve significant power optimization in High Performance Computing (HPC) systems such as grids, and cloud datacenters; because power saved by scaling down the processor voltage is far less than switching off a machine. Resource management, using dynamic consolidation of VMs, allows cloud service providers to optimize resource usability, performance and decrease power consumption. This paper investigates various resource management techniques, and suggests several heuristic approaches to optimise energy consumption and performance in elastic datacenters. Using real workload datasets, our evaluation suggests that a combination of the proposed VM allocation and consolidation with migration control technique could save approximately 1.96%–9.38% energy, and improve 0.32%–5.96% performance, as compared to its closest rivals.