Cloud computing provides infrastructure, platform and software as services to customers. For the purpose of providing reliable and truthful service, a fair and elastic resource allocation strategy is essential from the standpoint of service customers. In this paper, we propose a game theoretic mechanism for dynamic cloud service management, including task assignment and resource allocation to provide reliable and truthful cloud services. A user utility function is first devised considering the dynamic characteristics of cloud computing. The elementary stepwise system is then applied to efficiently assign tasks to cloud servers. A resource allocation mechanism based on bargaining game solution is also adopted for fair resource allocation in terms of quality of service of requested tasks. Through numerical experiments, it is shown that the proposed mechanism guarantees better system performance than several existing methods. The experimental results show that the mechanism completes the requested tasks earlier with relatively higher utility while providing a significant level of fairness compared with existing ones. The proposed mechanism is expected to support cloud service providers in elastically managing their limited resources in a cloud computing environment in terms of quality of service. Copyright © 2013 John Wiley & Sons, Ltd.