主权项 |
1. A method comprising:
identifying one or more physical machines in a network as a candidate source physical machine, wherein each candidate source physical machine stores a set of two or more different virtual machine images; identifying one or more physical machines in the network as a candidate target physical machine, wherein each candidate target physical machine stores a virtual machine image that corresponds to at least one of the different virtual machine images of the candidate source physical machine, and includes available storage capacity for additional virtual machine images; and selecting a virtual machine image from the set of two or more different virtual machine images and selecting a target physical machine from the one or more candidate target physical machines to which the selected virtual machine image is to be migrated from a selected source physical machine; wherein selecting the target physical machine to receive the migrated selected virtual machine image comprises:
calculating, on each candidate target physical machine, an affinity index value for each virtual machine image type t1, . . . tm, wherein m is a natural number greater than zero, and wherein the calculation includes determining the number of instances, nt1, . . .m, for each image type on the candidate target physical machine, wherein n is a natural number greater than zero, resulting in affinity index values per respective image types given by:nt12(m)2,…ntm2(m)2; calculating an affinity index value for the identified one or more candidate target physical machines based on:(nt12+…ntm2)(m)2; andselecting the target physical machine to receive the migrated selected virtual machine image that has an increased affinity index when the selected virtual machine image is migrated thereto, such that migrating the selected virtual machine image from the selected source physical machine to the selected target physical machine results in a maximized image affinity per virtual machine in comparison to each image migration scenario for the selected virtual machine image; and wherein at least one of the steps is carried out by a computer device. |