Abstract By sharing resources with each other, different cloud providers in a cloud federation can exploit their diversity in resource configuration and operational cost so as to improve service performance. They should consider the strategy of resource pricing, job scheduling and server provisioning altogether to maximize their own interests. On the other hand, they need to efficiently trade the resources with a suitable mechanism, typically auction, so as to guarantee the participants’ profits. Nevertheless, in consideration of the heterogeneous execution times of jobs, both the pricing strategy and trading mechanism should be delicately designed, which is obviously a challenging task. In this paper, we firstly propose a truthful, individual-rational and ex-post budget-balanced auction mechanism for selecting pairs of buyer and seller winners to trade virtual machines for different durations. Then, to maximize the individual profits, we propose a dynamic resource bidding scheme and a job scheduling strategy based on our importance model of jobs with heterogeneous execution times and resource requirements. The simulation results show that, compared with existing ones, our design can better handle varieties of both execution time and resource requirement and make the participants obtain more individual profits.