Data centers consume large amounts of energy for power distribution and cooling. Existing dynamic capacity provisioning solutions do not fully consider the heterogeneity of workloads and machine hardware in production environments. This paper presents HARMONY, a system for heterogeneity-aware resource management and dynamic capacity provisioning in clouds. It uses k-means clustering to classify workloads and a technique to adjust the number of each type of machine to minimize energy consumption and scheduling delays. Simulations show HARMONY can improve energy efficiency in data centers by up to 28% compared to heterogeneity-oblivious solutions.