Despite the salient feature of cloud computing, the cloud provider still suffers from electricity bill, which in part comes from 1) the power consumption of running physical machines (PMs) to guarantee the resource/time requirements of virtual machines (VMs), and 2) the dynamically varying electricity price offered by smart grids. In the literature, there exist viable solutions adaptive to electricity price variation to reduce the electricity bill. However, they are not applicable to serving time-sensitive VM requests. In serving time-sensitive VM requests, it is potential for the cloud provider to apply proper consolidation strategies to further reduce the electricity bill. Few prior works have provided theoretical solutions of VM consolidation strategies that are adaptive to electricity price variations in serving time-sensitive VM requests. In this work, to address this challenge, we develop electricity-priceaware consolidation algorithms for both the offline and online scenarios. For the offline scenario, we first develop a consolidation algorithm with constant approximation, which always approaches the optimal solution within a constant factor of 5. For the online scenario, we propose an O(log( Lmax L min ))-competitive algorithm that is able to approach the optimal offline solution within a logarithmic factor, where Lmax L min is the ratio of the longest length of the processing time requirement of VMs to the shortest one. Our trace-driven simulation results further demonstrate that the average performance of the proposed algorithms produce nearoptimal electricity bill.