Cloud datacenters form the underlying infrastructure of cloud computing, containing a large number of physical machines (servers).The servers are virtualized to host many virtual machines (VMs) that support a wide range of services for cloud users.Efficient management of VMs is crucial to achieve optimum resource utilization, better energy efficiency, and a high degree of quality of service (QoS).Virtual machines consolidation is one of the main mechanisms to achieve such objectives.Consolidation techniques involve dynamically re-allocation of VMs across physical machines to balance workloads, reduce energy consumption, and maintain system reliability.However, VM consolidation is a complex process that can introduce significant overhead in terms of power consumption, network bandwidth, and service disruption.This makes its optimization a critical challenge for cloud service providers.This paper proposes DHLT-ACO (Dynamic Host Load Thresholding with Ant Colony Optimization) to enhance VM consolidation through two key mechanisms.At first, an adaptive host load detection method based on exponentially weighted moving average (EWMA) and a confidence interval-based dynamic thresholds to enhance the accuracy of detecting underloaded and overloaded hosts.Second, an improved Ant Colony Optimization (ACO) algorithm to optimize VMs placement by dynamically adjusting exploration and exploitation parameters, ensuring faster convergence and better resource allocation.Experimental results demonstrate that DHLT-ACO outperforms existing methods in terms of power consumption, number of VMs migration, and minimizing service level agreement (SLA) violations.DHLT-ACO achieved energy savings of 21.3%, reduced the number of migrations by 47%, and minimized SLA violations by 45.1% over the utilization-aware VM placement (UAVMP), hybrid VM allocation and placement (HVMAP), normalization-based VM consolidation (NVMC), and modified genetic-based VM consolidation (MGVMC) on average.These improvements verify the efficiency of DHLT-ACO in achieving energy efficiency, reducing the number of migrations and ensuring compliance with SLA in cloud computing environments.