An aspect of the disclosure includes a method, a system and a computer program product for determining allocation of virtual machines to computer servers. The method including generating a list of virtual machines (VMs) instances configured to run on a network. A plurality of equivalence sets of VMs is selected. A plurality of starting sets is generated from the equivalence sets of VMs. Combinations are generated of packing solutions of the equivalent sets to a plurality of computer servers. A resource capacity is determined of a first computer server. A first allocation of the starting sets is provided based on the combinations of packing solutions. A second allocation each VM instance is provided based on a colocation parameter and an anti-colocation parameter. Each VM instance is migrated to one of the computer servers based on the second allocation. The state of a computer server is changed after the migration.