A minimum cost maximum flow algorithm is proposed for resources (e.g. virtual machines) placement in clouds confronted to dynamic workloads and flows variations. The algorithm is compared to an exact method generalizing the classical bin-packing formulation using a linear integer program. A directed graph is used to model the allocation problem for virtual cloud resources organized in a finite number of resource types; a common practice in cloud services. Providers can use the minimum cost maximum flow algorithm to opportunistically select the most appropriate physical resources to host virtual machines or applications or to ensure elastic platform provisioning according to dynamic applications, jobs and flows variations.