Characterizing and exploiting heterogeneity for enhancing energy-efficiency of cloud datacenters