主权项 |
1. A computing-device implemented method comprising:
receiving a request to provision a virtual machine, wherein the request includes configuration information, wherein the configuration information includes at least a requested amount of random access memory (RAM) and a requested number of central processing unit (CPU) cores; identifying, based on the received configuration information, potential resources for hosting the virtual machine, wherein the potential resources comprise a number of clusters that include one or more host devices, wherein identifying the potential resources for hosting the virtual machine further comprises:
determining, for each of the number of clusters:
whether the amount of RAM in the request is less than or equal to a maximum amount of RAM on each host in the cluster;whether a minimum amount of RAM available on each host in the cluster is greater than zero;whether a remaining amount of RAM on the cluster is greater than or equal to the requested amount of RAM; andwhether a required amount of RAM overhead corresponding to the request is less than or equal to an available amount of RAM overhead on the cluster,wherein the required amount of RAM overhead corresponding to the request is retrieved from a RAM overhead table that includes a plurality of entries of RAM overhead required for allocation corresponding to a plurality of host configurations with different combinations of numbers of CPU cores and amounts of RAM; andadding the cluster to a candidate cluster listing when the amount of RAM in the request is less than or equal to the maximum amount of RAM on each host device in the cluster, the minimum amount of RAM available on each host in the cluster is greater than zero, the remaining amount of RAM on the cluster is greater than or equal to the requested amount of RAM, and the required amount of RAM overhead based on the request is less than or equal to the available amount of RAM overhead on the cluster; scoring the candidate clusters in the candidate cluster listing based on the remaining amount of RAM and the available amount of RAM overhead on the candidate clusters; ranking the candidate clusters based on the scoring; selecting, based on the ranking, an optimal cluster from among the candidate clusters for hosting the requested virtual machine; and provisioning the requested virtual machine on the optimal cluster. |