Public clouds provide Infrastructure as a Service (IaaS) to users who do not own sufficient compute resources. IaaS achieves the economy of scale by multiplexing, and therefore faces the challenge of scheduling tasks to meet the peak demand while preserving Quality-of-Service (QoS). Previous studies proposed proactive machine purchasing or cloud federation to resolve this problem. However, the former is not economic and the latter for now is hardly feasible in practice. In this paper, we propose a resource allocation framework in which an IaaS provider can outsource its tasks to External Clouds (ECs) when its own resources are not sufficient to meet the demand. This architecture does not require any formal inter-cloud agreement that is necessary for the cloud federation. The key issue is how to allocate users' tasks to maximize the profit of IaaS provider while guaranteeing QoS. This problem is formulated as an integer programming (IP) model, and solved by a self-adaptive learning particle swarm optimization (SLPSO)-based scheduling approach. In SLPSO, four updating strategies are used to adaptively update the velocity of each particle to ensure its diversity and robustness. Experiments show that, SLPSO can improve a cloud provider's profit by 0.25%-11.56% compared with standard PSO; and by 2.37%-16.71% for problems of nontrivial size compared with CPLEX under reasonable computation time. © 2004-2012 IEEE.