A hierarchical control framework has been developed for workload consolidation in virtualized environments. The hierarchy uses the concept of receding horizon control and comprises two levels: fully distributed controllers that independently optimize the CPU share provided to virtual machines (VMs) under their control, so that the system-wide CPU capacity is appropriately tuned to the incoming workload intensity; and a supervisory controller that reduces power consumption during periods of light workload by consolidating the workload on to fewer VMs and shutting down extra servers.