The consolidation of the virtual machines (VMs) helps to optimise the usage of resources and hence reduces the energy consumption in a cloud data centre. VM placement plays an important part in the consolidation of the VMs. The researchers have developed various algorithms for VM placement considering the optimised energy consumption. However, these algorithms lack the use of exploitation mechanism efficiently. This paper addresses VM placement issues by proposing two meta-heuristic algorithms namely, the enhanced modified firefly algorithm (MFF) and the hierarchical cluster based modified firefly algorithm (HCMFF), presenting the comparative analysis relating to energy optimisation. The comparisons are made against the existing honeybee (HB) algorithm, honeybee cluster based technique (HCT) and the energy consumption results of all the participating algorithms confirm that the proposed HCMFF is more efficient than the other algorithms. The simulation study shows that HCMFF consumes 12% less energy than honeybee algorithm, 6% less than HCT algorithm and 2% less than original firefly. The usage of the appropriate algorithm can help in efficient usage of energy in cloud computing.