This paper concerns the management of energy in data centers using a cyber-physical model that supports the coordinated control of both computational and thermal (cooling) resources. On the basis of the structure of the proposed model and practical issues related to the data center layout and distribution of information, we propose a hierarchical optimization scheme in which the higher level chooses goals for regulation at the lower level. Linear programming is applied to solve sequences of one-step look-ahead problems at both the top level and in the lower-level controllers to solve. The approach is illustrated with simulation results.