In order to perform optimal Virtual Machine (VM) consolidation under QoS constraints based on energy consumption in Cloud Data Centres (CDCs) containing heterogeneous physical resources, one must build a framework that combines many subsystem algorithms, including prediction, selection, placement, etc. Several energy minimization strategies can be used in CDCs, but the most importantly is one in which minimization is done through switching off selected host underload servers after reallocating all VMs on the selected server. Predicting the resources needed in a given time period is the first and the most important step in dynamic provisioning to meet QoS expectations in the presence of variable workloads. In other words, we use previous usage patterns to estimate future VM request workloads in a data centre. The first step in the prediction process of the energy-consumption framework is to cluster the historical data. In this paper, we proposed a clustering for both user and VM requests. Real Google traces that feature over 25 million tasks collected over a 29-day period are used as an example in this paper.