Nowadays Internet-scale data centers are facing a severe issue, huge energy consumption, which not only increases operational cost, but also causes environment problem. For data center providers, putting power constraint on a data center may be a feasible way to keep energy consumption within an acceptable range. Hence it is commonly believed that, for a given power budget, maximizing the performance becomes an important goal for a data center, which can be achieved with well-designed resource allocation algorithm. In this paper, we discuss the resource allocation problem in a power-constrained data center, where the power consumption of whole cluster should not exceed a threshold that is set by data center provider. Then, we propose a novel resource allocation heuristic based on preference and fair allocation policy to this problem, and present further discussion and conclusion at the end.