The massive deployment of data center services and cloud computing comes with exorbitant energy costs and excessive carbon footprint. This demands green initiatives and energy-efficient strategies for greener data centers. Assignment of an application to different virtual machines has a significant impact on both energy consumption and resource utilization in virtual resource management of a data centre. However, energy efficiency and resource utilization are conflicting in general. Thus, it is imperative to develop a scalable application assignment strategy that maintains a trade-off between energy efficiency and resource utilization. To address this problem, this paper formulates application assignment to virtual machines as a profile-driven optimization problem under constraints. Then, a Repairing Genetic Algorithm (RGA) is presented to solve the large-scale optimization problem. It enhances penalty-based genetic algorithm by incorporating the Longest Cloudlet Fastest Processor (LCFP), from which an initial population is generated, and an infeasible-solution repairing procedure (ISRP). The application assignment with RGA is integrated into a three-layer energy management framework for data centres. Experiments are conducted to demonstrate the effectiveness of the presented approach, e.g., 23% less energy consumption and 43% more resource utilization in comparison with the steady-state Genetic Algorithm (GA) under investigated scenarios