Information processing methods, apparatus, equipment, storage media and computer program products
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-29
- Publication Date
- 2026-08-14
AI Technical Summary
计算节点上可以部署多台不同类型的虚拟机,多台虚拟机在运行时会发生资源竞争,就会导致某些虚拟机由于受到资源竞争的影响而导致性能下降
[0015]本申请实施例提供的信息处理方法、装置、设备、存储介质及计算机程序产品,所述方法包括:调度器获取第一请求,所述第一请求携带请求创建的虚拟机的目标类型;确定各个计算节点的类型;其中,所述计算节点的类型包括第一类型或者第二类型,所述第一类型表征所述计算节点支持创建配置有不同优先级属性的虚拟机,所述第二类型表征所述计算节点支持创建未配置有优先级属性的虚拟机;根据所述各个计算节点的类型,确定与所述目标类型匹配的目标计算节点,通过所述目标计算节点创建与所述目标类型匹配的虚拟机。
Smart Images

Figure CN122570077A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of wireless communication technology, and in particular to an information processing method, apparatus, device, storage medium, and computer program product. Background Technology
[0002] In related technologies, virtual machines are created and deployed on compute nodes based on user requests, and these virtual machines rely on the resources of the compute nodes to run. Multiple virtual machines of different types can be deployed on a compute node. When these virtual machines are running, resource contention occurs, which can lead to performance degradation in some virtual machines due to the impact of resource contention. Therefore, ensuring that the performance of these virtual machines is not affected by resource contention has become a pressing technical problem to be solved. Summary of the Invention
[0003] In view of this, embodiments of this application aim to provide an information processing method, apparatus, device, storage medium, and computer program product.
[0004] The technical solution of this application embodiment is implemented as follows: This application provides an information processing method applied to a scheduler, the method comprising: Obtain the first request, which carries the target type of the virtual machine to be created; Determine the type of each compute node; wherein, the type of the compute node includes a first type or a second type, the first type indicating that the compute node supports the creation of virtual machines configured with different priority attributes, and the second type indicating that the compute node supports the creation of virtual machines without priority attributes configured. Based on the type of each computing node, a target computing node matching the target type is determined, and a virtual machine matching the target type is created using the target computing node.
[0005] Furthermore, according to at least one embodiment of this application, determining the type of each computing node includes: For each of the aforementioned computing nodes, perform the following operations: Obtain first information from the database; the first information is used to indicate whether the computing node is configured with a processor (CPU, Central Processing Unit) super-resolution ratio; If the first information indicates that the computing node is configured with a CPU super-resolution ratio, then the type of the computing node is determined to be the first type; or... If the first information indicates that the computing node is not configured with a CPU super-resolution ratio, the type of the computing node is determined to be the second type.
[0006] Furthermore, according to at least one embodiment of this application, the first request also carries the specifications of the virtual machine to be created; the step of determining the target computing node matching the target type based on the types of the respective computing nodes includes: For each of the aforementioned computing nodes, perform the following operations: If the compute node is of the second type, and the target type indicates a request to create a virtual machine without a configured priority attribute, then the compute node is selected as the target compute node matching the target type; or, If the type of the compute node is the first type, and the target type represents the request to create a first virtual machine configured with a first priority attribute and / or a second virtual machine configured with a second priority attribute, then determine the remaining virtual central processing unit (vCPU) number of the compute node for the first virtual machine and / or the second virtual machine; based on the remaining vCPU number and the specifications of the virtual machine to be created, determine whether to use the compute node as the target compute node; The priority indicated by the first priority attribute is lower than the priority indicated by the second priority attribute.
[0007] Furthermore, according to at least one embodiment of this application, determining the remaining number of vCPUs of the computing node for the first virtual machine includes: The database is used to obtain a first quantity, a second quantity, a first value, and a first CPU super-resolution ratio of the compute node; wherein, the first quantity represents the maximum total number of physical CPU cores that the compute node can allocate to all unbound virtual machines, the second quantity represents the maximum total memory capacity that the compute node can allocate to all unbound virtual machines, the first value represents the first proportion of the number of unbound virtual machines of different specifications that have been created on the compute node, the different specifications include different combinations of vCPU specifications and memory specifications, and the first CPU super-resolution ratio is the ratio of the maximum total number of vCPUs that the compute node can allocate to all unbound virtual machines to the maximum total number of physical CPU cores; The first quantity is multiplied by the first CPU super-resolution ratio to obtain the third quantity; the third quantity represents the maximum total number of vCPUs that can be allocated to all non-core-bound virtual machines on the computing node. Based on the second quantity, the third quantity, and the first value, a first set of constraints is generated; based on the first set of constraints, a fourth quantity is determined; the fourth quantity represents the total number of vCPUs occupied by non-core-bound virtual machines of different specifications that have been created on the computing node. The difference between the third quantity and the fourth quantity is obtained; the difference represents the number of remaining vCPUs of the computing node for the first virtual machine.
[0008] Furthermore, according to at least one embodiment of this application, generating a first set of constraints based on the second quantity, the third quantity, and the first value includes: A base specification is determined from the different specifications, the base specification including a first base specification for vCPU and a second base specification for memory; For each of the different specifications, the product of the corresponding specification relative to the first basic specification, the number of vCPUs corresponding to the first basic specification, and the first unknown parameter is taken to obtain the first coefficient corresponding to the corresponding specification. The product of the corresponding specification relative to the second basic specification, the memory capacity corresponding to the second basic specification, and the second unknown parameter is taken to obtain the second coefficient corresponding to the corresponding specification. The first unknown parameter represents the number of unbound virtual machines corresponding to the first basic specification, and the second unknown parameter represents the number of unbound virtual machines corresponding to the second basic specification. Multiply the first coefficient corresponding to each specification by each value in the first quantity ratio represented by the first value to obtain the second quantity ratio, and add the values in the second quantity ratio to obtain the second value; multiply the second coefficient corresponding to each specification by each value in the first quantity ratio represented by the first value to obtain the third quantity ratio, and add the values in the third quantity ratio to obtain the third value. The first set of constraints is generated based on the second value, the third value, the second quantity, and the third quantity. The first set of constraints includes: The second value is less than or equal to the third quantity; The third value is less than or equal to the second quantity.
[0009] Furthermore, according to at least one embodiment of this application, determining the fourth quantity based on the first set of constraints includes: Based on the first set of constraints, determine the maximum value of the first unknown parameter and the maximum value of the second unknown parameter, and determine the minimum value from the maximum value of the first unknown parameter and the maximum value of the second unknown parameter. For each of the different specifications, the product of the multiple of the corresponding specification relative to the first basic specification, the number of vCPUs corresponding to the first basic specification, and the minimum value is obtained to obtain the third coefficient corresponding to the corresponding specification; the third coefficient corresponding to each specification is multiplied by each value in the first quantity ratio represented by the first value to obtain the fourth quantity ratio; the values in the fourth quantity ratio are added together to obtain the fourth quantity.
[0010] Furthermore, according to at least one embodiment of this application, determining the remaining number of vCPUs of the computing node for the second virtual machine includes: The fifth quantity, sixth quantity, and fourth value are obtained from the database; the fifth quantity represents the maximum total number of physical CPU cores that the computing node can allocate to all core-bound virtual machines; the sixth quantity represents the maximum total memory capacity that the computing node can allocate to all core-bound virtual machines; and the fourth value represents the proportion of the fifth quantity of core-bound virtual machines of different specifications that have been created on the computing node. Based on the fifth quantity, the sixth quantity, and the fourth value, a second set of constraints is generated; based on the second set of constraints, a seventh quantity is determined; the seventh quantity represents the total number of vCPUs occupied by different specifications of core-bound virtual machines that have been created on the computing node. The difference between the fifth quantity and the seventh quantity is obtained; the difference represents the number of remaining vCPUs of the compute node for the second virtual machine; the fifth quantity is equal to the maximum total number of vCPUs that the compute node can allocate for all core-bound virtual machines.
[0011] Furthermore, according to at least one embodiment of this application, determining the remaining number of vCPUs of the computing node for the first virtual machine and the second virtual machine includes: The eighth quantity and the second CPU super-resolution ratio of the compute node are obtained from the database; the eighth quantity represents the maximum total number of physical CPU cores that the compute node can allocate to all unbound virtual machines and all bound virtual machines; the second CPU super-resolution ratio is the ratio of the maximum total number of vCPUs that the compute node can allocate to all unbound virtual machines and all bound virtual machines to the maximum total number of physical CPU cores. The product of the eighth quantity and the second CPU super-resolution ratio is used to obtain the ninth quantity; the ninth quantity represents the maximum total number of vCPUs that can be allocated to the computing node for all unbound virtual machines and all bound virtual machines. Determine the tenth quantity; the tenth quantity represents the total number of vCPUs occupied by non-core-bound virtual machines and core-bound virtual machines of different specifications that have been created on the computing node; The difference between the ninth quantity and the tenth quantity is obtained; the difference represents the number of remaining vCPUs of the computing node for the first virtual machine and the second virtual machine.
[0012] This application provides an information processing apparatus, including: The acquisition module is used to acquire a first request, wherein the first request carries the target type of the virtual machine to be created; A processing module is used to determine the type of each computing node; wherein, the type of the computing node includes a first type or a second type, the first type indicating that the computing node supports creating virtual machines configured with different priority attributes, and the second type indicating that the computing node supports creating virtual machines without configured priority attributes; based on the type of each computing node, a target computing node matching the target type is determined, and a virtual machine matching the target type is created through the target computing node. This application provides a network device, including a processor and a memory for storing computer programs that can run on the processor. When the processor runs the computer program, it executes the steps of any of the methods described above for the network device side.
[0013] At least one embodiment of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.
[0014] At least one embodiment of this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the methods described above.
[0015] The information processing method, apparatus, device, storage medium, and computer program product provided in this application embodiment include: a scheduler acquiring a first request, the first request carrying a target type of a virtual machine to be created; determining the type of each computing node; wherein the type of the computing node includes a first type or a second type, the first type indicating that the computing node supports creating virtual machines configured with different priority attributes, and the second type indicating that the computing node supports creating virtual machines without priority attributes; determining a target computing node matching the target type according to the type of each computing node, and creating a virtual machine matching the target type through the target computing node.
[0016] By adopting the technical solution provided in the embodiments of this application, the scheduler determines the target computing node that matches the target type based on the target type of the virtual machine to be created and the type of computing node, and deploys the virtual machine to be created on the target computing node. In this way, virtual machines with priority attributes and virtual machines without priority attributes will not be deployed on the same computing node, so virtual machines without priority attributes and virtual machines with priority attributes will not compete for resources, thereby ensuring the performance of virtual machines with priority attributes. Attached Figure Description
[0017] Figure 1This is a schematic diagram of the system architecture for the information processing method described in the embodiments of this application; Figure 2 This is a schematic diagram illustrating the implementation flow of the information processing method in an embodiment of this application; Figure 3 This is a schematic diagram of the scheduler obtaining the first CPU super-resolution ratio of the computing node from the database in an embodiment of this application; Figure 4 This is a schematic diagram of the composition structure of the information processing device according to an embodiment of this application; Figure 5 This is a schematic diagram of the composition structure of the network device in an embodiment of this application. Detailed Implementation
[0018] Before introducing the technical solutions of the embodiments of this application, the relevant technologies will be introduced first.
[0019] In related technologies, hybrid virtual machine deployment refers to deploying and migrating virtual machines with different requirements for resources such as processor (CPU, Central Processing Unit), input / output resources (I / O), and memory to the same computing node through scheduling, thereby making full use of the node's resources. In single-machine resource scheduling and allocation, different virtual machines are distinguished by high and low priority, and resources are allocated according to priority. That is, when high-priority virtual machines and low-priority virtual machines compete for resources, resources are preferentially allocated to the former, strictly guaranteeing its Quality of Service (QoS).
[0020] One scenario for hybrid virtual machine deployment is the co-deployment of core-bound and non-core-bound virtual machines on the same compute node. To address this, the operating system (such as OpenEuler) in OpenStack Nova introduces high and low priority features for virtual machines based on the SkylarkQoS service. This concept of high and low priority is incorporated into the virtual machine creation and migration processes, with high and low priority attributes added to virtual machine objects. Core-bound virtual machines correspond to high-priority virtual machines, and non-core-bound virtual machines correspond to low-priority virtual machines.
[0021] The key changes to the high and low priority features are as follows: First, it supports specifying priority attributes for the virtual machine's flavor and instances within the nova component when creating a virtual machine. High-priority attributes can only be set for core-bound virtual machines, while low-priority attributes can only be set for unbound virtual machines. Second, for virtual machines with priority attributes, the virtualization configuration file (libvirt XML) needs to be modified to allow the standalone QoS management component (named Skylark) to be aware of this and automatically perform resource allocation and QoS management. Third, the core-bound range for low-priority virtual machines has been changed to fully utilize the idle resources of high-priority virtual machines.
[0022] Here, a one-to-one CPU range for high-priority virtual machines (represented by `cpu_dedicated_set`) is specified, while a CPU range for low-priority virtual machines to prevent starvation (represented by `cpu_shared_set`) is also specified. Additionally, compute node configuration fields such as `cpu_priority_mix_enable` are set, with a default value of `False`. When this configuration is set to `True`, low-priority virtual machines can use the CPU range bound to high-priority virtual machines; that is, low-priority virtual machines can use the CPUs specified by `cpu_shared_set` and `cpu_dedicated_set`.
[0023] In related technologies, high and low priority characteristics do not affect the existing resource model and node scheduling strategy of the compute service (Nova). Regular virtual machines (VMs) can coexist with VMs that have priority attributes. When a regular VM and a high-priority VM compete for resources, the QoS management component (named Skylark) will not intervene. Therefore, situations may arise where regular VMs and high-priority VMs are scheduled to the same compute node and compete for resources. In this case, the performance of the high-priority VM may degrade due to resource contention.
[0024] In mixed deployment scenarios, there are two definitions of CPU super-resolution ratio: global super-resolution ratio and local super-resolution ratio. The global super-resolution ratio is the ratio of the total number of all available vCPUs to the total number of available physical CPU cores. Here, the total number of all available vCPUs refers to the maximum total number of vCPUs that can be allocated to all high-priority virtual machines and all low-priority virtual machines, and the total number of available physical CPUs can refer to the maximum total number of physical CPU cores that can be allocated to all high-priority virtual machines and all low-priority virtual machines. The local super-resolution ratio refers to the super-resolution capability of low-priority virtual machines, that is, the ratio of the maximum total number of vCPUs that can be allocated to all low-priority virtual machines to the maximum total number of physical CPU cores that can be allocated to all low-priority virtual machines. The relationship between the global and local super-resolution ratios is: Global Super-Resolution Ratio = (Maximum total number of vCPUs that can be allocated to all high-priority virtual machines on the compute node + Maximum total number of vCPUs that can be allocated to all low-priority virtual machines on the compute node) / Total number of available physical CPU cores on the compute node. The total number of available physical CPUs can refer to the maximum total number of physical CPU cores that can be allocated to all high-priority virtual machines and all low-priority virtual machines. The maximum total number of vCPUs that can be allocated to all low-priority virtual machines on a compute node = local super-resolution ratio × maximum total number of physical CPU cores that can be allocated to all low-priority virtual machines on the compute node. Currently, the local super-resolution ratio depends on the configuration of the host group (aggregate) and the configuration of the configuration file (such as nova.conf) on the compute node. However, the configuration of the host group (aggregate) specifies the super-resolution ratio of the same batch of homogeneous hosts, and its configuration granularity is at the host group level, not the node level, which is less flexible. The configuration granularity of nova.conf on the compute node reaches the node level, but this method requires restarting the service after each configuration change for the configuration to take effect, which will have a certain impact on data consistency, service availability, and user experience. The high and low priority feature only restricts the priority attributes of core-bound virtual machines and unbound virtual machines, but does not propose a specific solution for how to combine the local super-resolution ratio, global super-resolution ratio, CPU constraints, memory constraints, etc., of the remaining vCPUs of the compute node for the scheduler to schedule tasks in mixed deployment scenarios.
[0025] Based on this, in this embodiment of the application, the scheduler obtains a first request, the first request carrying the target type of the virtual machine to be created; determines the type of each computing node; wherein, the type of the computing node includes a first type or a second type, the first type indicating that the computing node supports the creation of virtual machines configured with different priority attributes, and the second type indicating that the computing node supports the creation of virtual machines without priority attributes; according to the type of each computing node, determines a target computing node that matches the target type, and creates a virtual machine that matches the target type through the target computing node.
[0026] See Figure 1 , Figure 1 This is a schematic diagram of the system architecture for the information processing method applied in the embodiments of this application, such as... Figure 1 As shown, the system includes: A scheduler is configured to: acquire a first request carrying the target type of the virtual machine to be created; determine the type of each compute node; wherein the type of the compute node includes a first type or a second type, the first type indicating that the compute node supports creating virtual machines configured with different priority attributes, and the second type indicating that the compute node supports creating virtual machines without priority attributes; determine a target compute node matching the target type based on the type of each compute node, and create a virtual machine matching the target type through the target compute node; Compute nodes are used to create virtual machines that are requested to be created.
[0027] Here, a scheduling service runs on the scheduler.
[0028] Here, the scheduler can also be called nova-scheduler.
[0029] Here, the scheduler may include a message receiving module, a scheduling execution module, a scheduling algorithm module, a cached data module, a dynamic resource configuration module, etc.
[0030] Here, the scheduler can obtain the first request sent by the user through the Nova API interface.
[0031] Here, the dynamic resource configuration module will obtain the resource status on the compute nodes from the database, such as the total number of available CPUs, the total number of available memory pages, the total number of CPUs that can be allocated to high-priority virtual machines, and the total number of CPUs that can be allocated to low-priority virtual machines to prevent starvation; it will also obtain the number and proportion of virtual machine specifications of various types and specifications in the current resource pool from external sources (API interface or monitoring module).
[0032] Here, the compute service cancels the reporting of the total amount of CPU available to high-priority virtual machines on the host machine (i.e., compute nodes) and the total amount of CPU reserved for low-priority virtual machines to prevent starvation.
[0033] Here, the computing service obtains and counts the maximum number of physical CPU cores that high- and low-priority virtual machines can use or be allocated on each host machine, i.e., the computing node, and updates this information to the database through resource reporting.
[0034] See Figure 2 , Figure 2 This is a schematic diagram illustrating the implementation flow of the information processing method provided in this application embodiment, applied to a scheduler, such as... Figure 2 As shown, the method includes steps 201 to 203: Step 201: Obtain the first request, which carries the target type of the virtual machine to be created.
[0035] Here, the target type may include one of the following: Request the creation of a virtual machine configured with the first priority attribute; Request the creation of a virtual machine configured with the second priority attribute; Request the creation of a virtual machine configured with a first priority attribute and a second priority attribute; Request to create a virtual machine that is not configured with a priority attribute.
[0036] The priority indicated by the first priority attribute is lower than the priority indicated by the second priority attribute.
[0037] Here, a virtual machine configured with the first priority attribute can also be described as an unbound core virtual machine, which can also be called a low-priority virtual machine.
[0038] Here, a virtual machine configured with a second priority attribute can also be described as a core-bound virtual machine. A core-bound virtual machine can also be called a high-priority virtual machine. The resource scheduling priority of a core-bound virtual machine is higher than that of an unbound virtual machine.
[0039] Here, a virtual machine without a priority attribute can also be described as a regular virtual machine, and resource scheduling of a regular virtual machine does not consider priority.
[0040] Here, the first request sent by the user can be obtained through the API interface.
[0041] Step 202: Determine the type of each compute node; wherein the type of the compute node includes a first type or a second type, the first type indicating that the compute node supports the creation of virtual machines configured with different priority attributes, and the second type indicating that the compute node supports the creation of virtual machines without priority attributes.
[0042] Here, the computing node can also be referred to as the host machine, etc.
[0043] Here, the first type indicates that the compute node supports the creation of virtual machines configured with different priority attributes, which can be understood as the compute node supporting the mixed deployment of core-bound virtual machines and unbound virtual machines. The priority attribute configured for core-bound virtual machines is high priority, and the priority attribute configured for unbound virtual machines is low priority. That is, resources are scheduled for high-priority virtual machines first.
[0044] Here, the second type indicates that the computing node supports the creation of virtual machines without priority attributes. This can be understood as the computing node supporting the deployment of virtual machines without priority attributes, i.e., it does not support hybrid deployment and does not consider priority when scheduling resources for virtual machines.
[0045] In practical applications, for compute nodes that support mixed deployment of core-bound and non-core-bound virtual machines, the CPU super-resolution ratio can be set. For compute nodes that do not support mixed deployment, the CPU super-resolution ratio is not set. In this way, the type of compute node can be distinguished based on whether the CPU super-resolution ratio is set.
[0046] Based on this, in some embodiments, determining the type of each computing node includes: For each of the aforementioned computing nodes, perform the following operations: Retrieve first information from the database; the first information is used to indicate whether the computing node is configured with a CPU super-resolution ratio. If the first information indicates that the computing node is configured with a CPU super-resolution ratio, then the type of the computing node is determined to be the first type; or... If the first information indicates that the computing node is not configured with a CPU super-resolution ratio, the type of the computing node is determined to be the second type.
[0047] Here, the database can store the first piece of information, which can be a field, such as the cpu_local_ratio field. If the value of this field is a preset value, such as 1, it means that the compute node is a compute node that supports the mixed deployment of core-bound virtual machines and unbound virtual machines, and the CPU super-ratio of this compute node is set. If the value of this field is a preset value, such as 0, it means that the compute node does not support mixed deployment, that is, it supports the deployment of ordinary virtual machines without priority attributes, and the CPU super-ratio of this compute node is not set.
[0048] Here, CPU super-resolution ratio can refer to the global super-resolution ratio and / or the local super-resolution ratio. The global super-resolution ratio can be the ratio of the maximum total number of vCPUs that a compute node can allocate to all unbound virtual machines and all bound virtual machines to the maximum total number of physical CPU cores. The local super-resolution ratio can be the ratio of the maximum total number of vCPUs that a compute node can allocate to all unbound virtual machines to the maximum total number of physical CPU cores.
[0049] Here, virtual machines without priority attributes and virtual machines with priority attributes are assigned to different types of compute nodes. Thus, when a request is made to create a regular virtual machine, i.e. a virtual machine without priority attributes, the host machine that supports the mixed deployment of core-bound and non-core-bound virtual machines will be filtered out during compute node filtering, thereby preventing the regular virtual machine from being scheduled to that host machine.
[0050] Here, for host machines (compute nodes) that do not support hybrid deployment, if the first piece of information stored in the database, namely the cpu_local_ratio field, has a preset value such as zero, it indicates that the compute node does not support hybrid deployment and no CPU super-ratio is set for the compute node. In this case, when faced with requests to create virtual machines with high and low priority attributes, the scheduling service (scheduler) will filter out these host machines (compute nodes). Therefore, only ordinary virtual machines (VMs) without priority attributes can be created on these host machines, and virtual machines with priority attributes cannot be created.
[0051] In this application, to ensure that high-priority virtual machines are not interfered with by ordinary virtual machines, ordinary virtual machines and virtual machines with priority attributes are isolated at the scheduling level. By adding type filtering for the host machine, i.e., the compute node, isolation is achieved between ordinary virtual machines without priority attributes and virtual machines with priority attributes. This ensures that high-priority virtual machines are not interfered with by ordinary virtual machines, thereby avoiding the performance degradation of high-priority virtual machines due to resource contention by ordinary virtual machines, as seen in related technologies.
[0052] Step 203: Based on the type of each computing node, determine the target computing node that matches the target type, and create a virtual machine that matches the target type through the target computing node.
[0053] In practical applications, ordinary virtual machines (VMs) and VMs with priority attributes are isolated at the scheduling level. This ensures that VMs with priority attributes, especially those with high priority attributes, are not affected by resource contention from other VMs, thus guaranteeing the performance of high-priority VMs. When a request is made to create a VM with priority attributes, the remaining number of vCPUs can be determined. Based on the specifications of the requested VM and the remaining number of vCPUs, the compute nodes used to deploy the VM with priority attributes are determined.
[0054] Based on this, in some embodiments, the first request also carries the specifications of the virtual machine to be created; determining the target computing node matching the target type according to the types of each computing node includes: For each of the aforementioned computing nodes, perform the following operations: If the compute node is of the second type, and the target type indicates a request to create a virtual machine without a configured priority attribute, then the compute node is selected as the target compute node matching the target type; or, If the compute node is of the first type, and the target type represents a request to create a first virtual machine configured with a first priority attribute and / or a second virtual machine configured with a second priority attribute, then the remaining vCPUs of the compute node for the first virtual machine and / or the second virtual machine are determined; based on the remaining vCPUs and the specifications of the virtual machine to be created, it is determined whether to use the compute node as the target compute node; The priority indicated by the first priority attribute is lower than the priority indicated by the second priority attribute.
[0055] Here, if the compute node is of the second type, and the target type indicates a request to create a virtual machine without a priority attribute, then the compute node is selected as the target compute node matching the target type. If the compute node is of the first type, and the target type indicates a request to create a virtual machine without a priority attribute, then the compute node is not selected as the target compute node matching the target type. In this way, virtual machines without priority attributes and virtual machines with priority attributes can be created on different compute nodes. That is, virtual machines without priority attributes (ordinary virtual machines) and virtual machines with priority attributes (high-priority virtual machines and / or low-priority virtual machines) will not be deployed simultaneously on the same compute node, thus avoiding the performance degradation of high-priority virtual machines due to resource contention among ordinary virtual machines, as is common in related technologies.
[0056] Here, if the compute node is of the first type, and the target type represents a request to create a first virtual machine configured with a first priority attribute and / or a second virtual machine configured with a second priority attribute, then determining the remaining vCPUs of the compute node for the first virtual machine and / or the second virtual machine can include the following three cases: In the first scenario, if the compute node is of the first type and the target type represents a request to create a first virtual machine configured with a first priority attribute, then the remaining vCPUs of the compute node for the first virtual machine are determined.
[0057] In the second scenario, if the compute node is of the first type and the target type represents a request to create a second virtual machine configured with a second priority attribute, then the remaining vCPUs of the compute node for the second virtual machine are determined.
[0058] In the third scenario, if the compute node is of the first type and the target type represents a request to create a first virtual machine configured with a first priority attribute and a second virtual machine configured with a second priority attribute, then the remaining vCPUs of the compute node for the first virtual machine and the second virtual machine are determined.
[0059] Here, the first virtual machine can also be called an unbound virtual machine, and the second virtual machine can also be called a bound virtual machine.
[0060] Here, the specifications of the virtual machine to be created may include vCPU specifications and memory specifications. For example, 2C4G means 2 vCPUs and 4G of memory capacity, where 2 vCPUs is the vCPU specification and 4G of memory capacity is the memory specification.
[0061] Here, determining whether to use the compute node as the target compute node based on the remaining number of vCPUs and the specifications of the virtual machine to be created may include: comparing the number of vCPUs included in the specifications of the virtual machine to be created with the remaining number of vCPUs; if the number of vCPUs included in the specifications of the virtual machine to be created is less than or equal to the remaining number of vCPUs, then the compute node is used as the target compute node; otherwise, the compute node is not used as the target compute node.
[0062] Here, after determining the target compute node, the scheduler can instruct the target compute node to create a virtual machine that matches the target type.
[0063] In practical applications, the first CPU super-resolution ratio can be obtained from the database, and the remaining number of vCPUs for the first virtual machine can be determined by combining the generated first set of constraints.
[0064] Based on this, in some embodiments, determining the remaining number of vCPUs of the computing node for the first virtual machine includes: The database is used to obtain a first quantity, a second quantity, a first value, and a first CPU super-resolution ratio of the compute node; wherein, the first quantity represents the maximum total number of physical CPU cores that the compute node can allocate to all unbound virtual machines, the second quantity represents the maximum total memory capacity that the compute node can allocate to all unbound virtual machines, the first value represents the first proportion of the number of unbound virtual machines of different specifications that have been created on the compute node, the different specifications include different combinations of vCPU specifications and memory specifications, and the first CPU super-resolution ratio is the ratio of the maximum total number of vCPUs that the compute node can allocate to all unbound virtual machines to the maximum total number of physical CPU cores; The first quantity is multiplied by the first CPU super-resolution ratio to obtain the third quantity; the third quantity represents the maximum total number of vCPUs that can be allocated to all non-core-bound virtual machines on the computing node. Based on the second quantity, the third quantity, and the first value, a first set of constraints is generated; based on the first set of constraints, a fourth quantity is determined; the fourth quantity represents the total number of vCPUs occupied by non-core-bound virtual machines of different specifications that have been created on the computing node. The difference between the third quantity and the fourth quantity is obtained; the difference represents the number of remaining vCPUs of the computing node for the first virtual machine.
[0065] Here, the first CPU super-resolution ratio can be obtained from the database based on the identification information of the computing node; the database stores the correspondence between the identification information of the computing node and the first CPU super-resolution ratio of the computing node.
[0066] Here, the first CPU super-resolution ratio can also be called the local super-resolution ratio.
[0067] Here, the first virtual machine can also be called an unbound core virtual machine.
[0068] See Figure 3 , Figure 3 This is a schematic diagram of the scheduler obtaining the first CPU super-ratio of a compute node from the database in an embodiment of this application. The labels of the compute nodes, such as identification information, can be stored in the compute_node_tags data table in the nova database. The first CPU super-ratio of the compute node is obtained by using key-value pairs, where the key represents the label of the compute node, such as identification information, and the value is cpu_local_ratio=<the value of the first CPU super-ratio>.
[0069] Here, at the priority level, the CPU super-resolution ratio set through the label association of compute nodes has the highest priority, that is, higher than the super-resolution ratio set through host groups (aggregate) and the super-resolution ratio set in the configuration file (nova.conf) on the compute node in related technologies. This enables dynamic updates of the super-resolution ratio configuration without restarting the service, thereby ensuring data consistency, improving service availability, and reducing user perception.
[0070] Here, the value of the first CPU super-resolution ratio set by the label association of the compute node is stored in the database and can be updated to the cache periodically. The scheduling service, i.e., the scheduler, obtains the value of the first CPU super-resolution ratio to calculate the remaining number of vCPUs for unbound virtual machines in order to schedule tasks.
[0071] In practical applications, for scenarios where high- and low-priority virtual machines are deployed together, the first set of constraints can be generated based on CPU constraints and memory constraints.
[0072] Based on this, in some embodiments, generating the first set of constraints according to the second quantity, the third quantity, and the first value includes: A base specification is determined from the different specifications, the base specification including a first base specification for vCPU and a second base specification for memory; For each of the different specifications, the product of the corresponding specification relative to the first basic specification, the number of vCPUs corresponding to the first basic specification, and the first unknown parameter is taken to obtain the first coefficient corresponding to the corresponding specification. The product of the corresponding specification relative to the second basic specification, the memory capacity corresponding to the second basic specification, and the second unknown parameter is taken to obtain the second coefficient corresponding to the corresponding specification. The first unknown parameter represents the number of unbound virtual machines corresponding to the first basic specification, and the second unknown parameter represents the number of unbound virtual machines corresponding to the second basic specification. Multiply the first coefficient corresponding to each specification by each value in the first quantity ratio represented by the first value to obtain the second quantity ratio, and add the values in the second quantity ratio to obtain the second value; multiply the second coefficient corresponding to each specification by each value in the first quantity ratio represented by the first value to obtain the third quantity ratio, and add the values in the third quantity ratio to obtain the third value. The first set of constraints is generated based on the second value, the third value, the second quantity, and the third quantity. The first set of constraints includes: The second value is less than or equal to the third quantity; The third value is less than or equal to the second quantity.
[0073] Here, the different specifications may include different combinations of vCPU specifications and memory specifications. For example, 2C4G represents a combination of 2 vCPUs and 4G of memory capacity; 2C8G represents a combination of 2 vCPUs and 8G of memory capacity.
[0074] Here, the basic specification can be a preset minimum specification, such as 2C4G or 2C8G.
[0075] Here, the basic specifications include a first basic specification for vCPUs and a second basic specification for memory. This can mean that the basic specifications include the first basic specification for vCPUs and the second basic specification for memory.
[0076] For example, suppose different specifications include 2C4G and 2C8G, where 2C4G represents a combination of 2 vCPUs and 4G of memory capacity, and 2C8G represents a combination of 2 vCPUs and 8G of memory capacity. 2C4G can be used as the basic specification, the 2 vCPUs included in 2C4G are the first basic specification, and the 4G included in 2C4G are the second basic specification.
[0077] Here, the number of unbound virtual machines corresponding to the first basic specification can be understood as the number of unbound virtual machines of the basic specification that the compute node has created, in terms of vCPUs. The number of unbound virtual machines corresponding to the second basic specification can be understood as the number of unbound virtual machines of the basic specification that the compute node has created, in terms of memory.
[0078] Here, the multiple of the corresponding specification relative to the first basic specification may refer to the multiple of the vCPU specification within the corresponding specification relative to the first basic specification. Similarly, the multiple of the corresponding specification relative to the second basic specification may refer to the multiple of the memory specification within the corresponding specification relative to the second basic specification.
[0079] For example, suppose different specifications include 2C4G and 2C8G. 2C4G is the base specification, representing a combination of 2 vCPUs and 4G of memory. Using 2 vCPUs as the first base specification, the multiple of 2C4G relative to the first base specification is 2 vCPUs / 2 vCPUs = 1. The multiple of 2C8G relative to the first base specification is also 2 vCPUs / 2 vCPUs = 1. Using 4G as the second base specification, the multiple of 2C4G relative to the second base specification is 4G / 4G = 1. The multiple of 2C8G relative to the second base specification is 8G / 4G = 2.
[0080] Here, the memory capacity can be understood as including several GB (abbreviated as G).
[0081] In some embodiments, determining the fourth quantity based on the first set of constraints includes: Based on the first set of constraints, determine the maximum value of the first unknown parameter and the maximum value of the second unknown parameter, and determine the minimum value from the maximum value of the first unknown parameter and the maximum value of the second unknown parameter. For each of the different specifications, the product of the multiple of the corresponding specification relative to the first basic specification, the number of vCPUs corresponding to the first basic specification, and the minimum value is obtained to obtain the third coefficient corresponding to the corresponding specification; the third coefficient corresponding to each specification is multiplied by each value in the first quantity ratio represented by the first value to obtain the fourth quantity ratio; the values in the fourth quantity ratio are added together to obtain the fourth quantity.
[0082] Here, determining the maximum value of the first unknown parameter and the maximum value of the second unknown parameter based on the first set of constraints can be understood as solving the inequality included in the first constraint in the first set of constraints to obtain the maximum value of the first unknown parameter, and solving the inequality included in the second constraint in the first set of constraints to obtain the maximum value of the second unknown parameter; wherein, the inequality included in the first constraint is that the second value is less than or equal to the third quantity, and the inequality included in the second constraint is that the third value is less than or equal to the second quantity.
[0083] Here, when the memory allocation for high-priority virtual machines (core-bound virtual machines) and low-priority virtual machines (unbound virtual machines) is fixed, the second constraint can be that the third value is less than or equal to the second quantity. When the memory allocation for high-priority virtual machines (core-bound virtual machines) and low-priority virtual machines (unbound virtual machines) is not fixed, the second constraint can be that the third value is less than or equal to the maximum total memory capacity that the compute node can allocate to all unbound virtual machines and all core-bound virtual machines.
[0084] Here, determining whether to use the compute node as the target compute node based on the remaining number of vCPUs and the specifications of the virtual machine to be created may include: comparing the number of vCPUs included in the specifications of the virtual machine to be created with the remaining number of vCPUs; if the number of vCPUs included in the specifications of the virtual machine to be created is less than or equal to the remaining number of vCPUs, then the compute node is used as the target compute node; otherwise, the compute node is not used as the target compute node.
[0085] Here, after calculating the number of remaining vCPUs of the computing node for the first virtual machine, the remaining memory capacity of the computing node for the first virtual machine can also be calculated.
[0086] Specifically, calculating the remaining memory capacity of the computing node for the first virtual machine may include: for each of the different specifications, multiplying the multiple of the corresponding specification relative to the second basic specification, the memory capacity corresponding to the second basic specification, and the minimum value to obtain a coefficient corresponding to the corresponding specification; multiplying the coefficient corresponding to each specification by each value in the first quantity ratio represented by the first value and then adding them together to obtain the total memory capacity occupied by the non-core-bound virtual machines of different specifications created by the computing node; and subtracting the second quantity from the total memory capacity occupied by the non-core-bound virtual machines of different specifications created by the computing node to obtain a difference value; the difference value represents the remaining memory capacity of the computing node for the first virtual machine.
[0087] Accordingly, determining whether to use the compute node as the target compute node based on the remaining number of vCPUs and the specifications of the requested virtual machine can further include: determining whether to use the compute node as the target compute node based on the remaining number of vCPUs, the specifications of the requested virtual machine, and the remaining memory capacity. Specifically, the number of vCPUs included in the specifications of the requested virtual machine is compared with the remaining number of vCPUs, and the memory capacity included in the specifications of the requested virtual machine is compared with the remaining memory capacity; if the number of vCPUs included in the specifications of the requested virtual machine is less than or equal to the remaining number of vCPUs, and the memory capacity included in the specifications of the requested virtual machine is less than or equal to the remaining memory capacity, then the compute node is used as the target compute node; otherwise, the compute node is not used as the target compute node.
[0088] The following example illustrates the process of determining the fourth quantity.
[0089] Currently, the various virtual machine specifications in the resource pool differ in the number of CPUs and memory, but the CPU-to-memory ratio is generally 1:2, 1:4, and 1:8. Therefore, we can use 2C4G, 2C8G, or 2C16G as the base specifications for each type, and abstract the resource usage of any specification as a multiple of the base specification's resource usage. Thus, calculating the remaining resource amount for virtual machines of various specifications in different scenarios can be based on the resources corresponding to the base specification, the multiples of different specifications relative to the base specification, and the number of virtual machines of the base specification.
[0090] For example, suppose the first unknown parameter is represented by S1, the second unknown parameter by S2, and the ratio of the number of the two types of unbound virtual machines already created on the compute node is 1:S 14 There are two specifications: 2C4G and 2C8G. The basic specification is 2C4G, with 2 vCPUs being the first basic specification for vCPUs and 4G being the second basic specification for memory.
[0091] First, for the first specification, 2C4G, multiply the multiple of 2C4G relative to the first base specification of vCPU (1), the number of vCPUs corresponding to the first base specification (2), and the first unknown parameter (S1) to obtain the first coefficient corresponding to the specification, denoted as 1×2×S1=2S1. For the second specification, 2C8G, multiply the multiple of 2C8G relative to the first base specification of vCPU (1), the number of virtual CPUs corresponding to the first base specification (2), and the first unknown parameter (S1) to obtain the first coefficient corresponding to the specification, denoted as 1×2×S1=2S1. Multiply the two obtained first coefficients by each value in the first quantity ratio represented by the first value to obtain the second quantity ratio, which can be expressed as 2S1: 2S1×S 14 Adding the values in the second quantity ratio gives the second value, which can be expressed as 2S1 + 2S1 × S 14 For the first specification, 2C4G, the product of 1 (the multiple of 2C4G relative to the second basic memory specification), 4 (the memory capacity corresponding to the second basic specification), and S2 (the unknown parameter) is taken to obtain the second coefficient corresponding to the specification, denoted as 1×4×S2=4S2. For the second specification, 2C8G, the product of 2C8G relative to the second basic memory specification, 2 (the multiple of 2C8G relative to the second basic memory specification), 4 (the memory capacity corresponding to the second basic specification), and S2 (the unknown parameter) is taken to obtain the second coefficient corresponding to the specification, denoted as 2×4×S2=8S2. Multiplying the two obtained second coefficients by each value in the first quantity ratio represented by the first value yields the third quantity ratio, which can be expressed as 4S2:8S2×S2. 14 Adding the values in the third quantity ratio gives the third value, which can be expressed as 4S² + 8S² × S. 14 .
[0092] Next, based on the second value, the third value, the second quantity, and the third quantity, the first set of constraints is generated; wherein, the first set of constraints includes: a first constraint and a second constraint, the first constraint including that the second value is less than or equal to the third quantity, and the second constraint including that the third value is less than or equal to the second quantity. The generated first set of constraints is represented by formulas (1) and (2), as follows: (1) (2) Wherein 2S1+2S1×S 14 S1 represents the second value, S1 represents the first unknown parameter, and the first quantity ratio is 1:S 14The value is obtained from the database, 4S² + 8S² × S 14 S1 represents the third value, and S2 represents the second unknown parameter. Indicates the third quantity, The value of the first quantity and the first CPU super-resolution ratio are determined based on the first quantity and the first CPU super-resolution ratio, which are obtained from the database. This indicates the second quantity. The value is obtained from the database.
[0093] Then, by solving the inequality in formula (1), the maximum value of the first unknown parameter S1 is obtained, and by solving the inequality in formula (2), the maximum value of the second unknown parameter S2 is obtained. The maximum value can refer to the largest integer value. The minimum value is determined from the maximum value of the first unknown parameter S1 and the maximum value of the second unknown parameter S2, expressed by formula (3), as follows: (3) Where S represents the minimum value, This represents the maximum value of the first unknown parameter. This represents the maximum value of the second unknown parameter.
[0094] Finally, for the first specification, 2C4G, the product of 1 (the multiple of 2C4G relative to the first base specification of vCPUs), 2 (the number of vCPUs corresponding to the first base specification), and the minimum value S is taken to obtain the third coefficient corresponding to the specification, denoted as 1×2×S=2S. For the second specification, 2C8G, the product of 1 (the multiple of 2C8G relative to the first base specification of vCPUs), 2 (the number of virtual CPUs corresponding to the first base specification), and the minimum value S is taken to obtain the third coefficient corresponding to the specification, denoted as 1×2×S=2S. Multiplying the two obtained third coefficients by the values in the first quantity ratio represented by the first value, respectively, yields the fourth quantity ratio, which can be expressed as 2S: 2S×S 14 Adding the values in the fourth quantity ratio gives the fourth quantity, which can be expressed as 2S + 2S×S. 14 =(1+ S 14 )×2S. The difference between the third quantity and the fourth quantity is obtained; the difference represents the number of remaining vCPUs of the computing node for the first virtual machine, and is expressed by formula (4), as follows: (4) in, This represents the number of remaining vCPUs on the compute node for the first virtual machine; C represents the maximum total number of physical CPU cores that the compute node can allocate to all unbound virtual machines and all bound virtual machines; D represents the maximum total number of physical CPU cores that the compute node can allocate to all bound virtual machines; and CD represents the first number, i.e., the maximum total number of physical CPU cores that the compute node can allocate to all unbound virtual machines. This represents the super-resolution ratio of the first CPU, and the value of the first CPU super-resolution ratio is obtained from the database, (2S + 2S×S) 14 The fourth quantity represents the total number of vCPUs occupied by the two different types of unbound virtual machines created on the compute node, and S represents the minimum value. The ratio of the first quantity is 1:S. 14 The value is obtained from the database.
[0095] Here, referring to the calculation process of the remaining vCPUs, the remaining memory capacity of the computing node for the first virtual machine can be calculated, which can be expressed by formula (5), as follows: (5) in, This represents the maximum total memory capacity that can be allocated to all unbound virtual machines on the computing node, (4S + 2 × 4S × S). 14 ) represents the total memory capacity occupied by the two types of unbound virtual machines created on the computing node, S represents the minimum value, and the first quantity ratio is 1:S 14 The value is obtained from the database.
[0096] In some embodiments, determining the number of remaining vCPUs for the compute node relative to the second virtual machine includes: The fifth quantity, sixth quantity, and fourth value are obtained from the database; the fifth quantity represents the maximum total number of physical CPU cores that the compute node can allocate to all core-bound virtual machines; the sixth quantity represents the maximum total memory capacity that the compute node can allocate to all core-bound virtual machines; and the fourth value represents the proportion of the fifth quantity of core-bound virtual machines of different specifications that have been created on the compute node, wherein the different specifications include different combinations of vCPU specifications and memory specifications. Based on the fifth quantity, the sixth quantity, and the fourth value, a second set of constraints is generated; based on the second set of constraints, a seventh quantity is determined; the seventh quantity represents the total number of vCPUs occupied by different specifications of core-bound virtual machines that have been created on the computing node. The difference between the fifth quantity and the seventh quantity is obtained; the difference represents the number of remaining vCPUs of the compute node for the second virtual machine; the fifth quantity is equal to the maximum total number of vCPUs that the compute node can allocate for all core-bound virtual machines.
[0097] Here, the second virtual machine can also be called a core-bound virtual machine.
[0098] Here, generating a second set of constraints based on the fifth quantity, the sixth quantity, and the fourth value may include: determining a basic specification from the different specifications, wherein the basic specification includes a third basic specification of vCPU and a fourth basic specification of memory; For each of the different specifications, the product of the corresponding specification relative to the third basic specification, the number of vCPUs corresponding to the third basic specification, and the third unknown parameter is taken to obtain the fourth coefficient corresponding to the corresponding specification. The product of the corresponding specification relative to the fourth basic specification, the memory capacity corresponding to the fourth basic specification, and the fourth unknown parameter is taken to obtain the fifth coefficient corresponding to the corresponding specification. The third unknown parameter represents the number of core-bound virtual machines corresponding to the third basic specification, and the fourth unknown parameter represents the number of core-bound virtual machines corresponding to the fourth basic specification. Multiply the fourth coefficient corresponding to each specification by each value in the fifth quantity ratio represented by the fourth value to obtain the sixth quantity ratio. Add the values in the sixth quantity ratio to obtain the fifth value. Multiply the fifth coefficient corresponding to each specification by each value in the fifth quantity ratio represented by the fourth value to obtain the seventh quantity ratio. Add the values in the seventh quantity ratio to obtain the sixth value. The second set of constraints is generated based on the fifth value, the sixth value, the fifth quantity, and the sixth quantity; the fifth quantity is equal to the maximum total number of vCPUs that the computing node can allocate to all core-bound virtual machines. The second set of constraints includes: The fifth value is less than or equal to the fifth quantity; The sixth value is less than or equal to the sixth quantity.
[0099] Here, for core-bound virtual machines, the compute node is defined as the maximum total number of vCPUs that can be allocated to all core-bound virtual machines being equal to the maximum total number of physical CPU cores, i.e., the two are in a 1:1 ratio.
[0100] Here, the different specifications can include different combinations of vCPU specifications and memory specifications. For example, 2C4G represents a combination of 2 vCPUs and 4G of memory capacity; 2C8G represents a combination of 2 vCPUs and 8G of memory capacity.
[0101] Here, the basic specification can be a preset minimum specification, such as 2C4G or 2C8G.
[0102] Here, the basic specifications include the third basic specifications of vCPU and the fourth basic specifications of memory. It can mean that the vCPU specifications included in the basic specifications are the third basic specifications, and the memory specifications included in the basic specifications are the fourth basic specifications.
[0103] For example, suppose different specifications include 2C4G and 2C8G, where 2C4G represents a combination of 2 vCPUs and 4G of memory capacity; 2C8G represents a combination of 2 vCPUs and 8G of memory capacity. Two vCPUs can be used as the basic specification, the two vCPUs included in 2C4G are the third basic specification, and the 4G included in 2C4G are the fourth basic specification.
[0104] Here, the number of unbound virtual machines corresponding to the third basic specification can be understood as the number of bound virtual machines of the basic specification that the compute node has created, in terms of vCPUs. The number of unbound virtual machines corresponding to the fourth basic specification can be understood as the number of bound virtual machines of the basic specification that the compute node has created, in terms of memory.
[0105] Here, the multiple of the corresponding specification relative to the third basic specification may refer to the multiple of the vCPU specification within the corresponding specification relative to the third basic specification. Similarly, the multiple of the corresponding specification relative to the fourth basic specification may refer to the multiple of the memory specification within the corresponding specification relative to the fourth basic specification.
[0106] For example, suppose different specifications include 2C4G and 2C8G, where 2C4G represents a combination of 2 vCPUs and 4G of memory; 2C8G represents a combination of 2 vCPUs and 8G of memory. Taking 2 vCPUs as the third basic specification, the multiple of 2C4G relative to the third basic specification is 2 vCPUs / 2 vCPUs = 1, and the multiple of 2C8G relative to the third basic specification is 2 vCPUs / 2 vCPUs = 1. Taking 4G as the fourth basic specification, the multiple of 2C4G relative to the fourth basic specification is 4G / 4G = 1, and the multiple of 2C8G relative to the fourth basic specification is 8G / 4G = 2.
[0107] Here, the memory capacity can be understood as including several GB (abbreviated as G).
[0108] In some embodiments, determining the seventh quantity based on the second set of constraints includes: Based on the second set of constraints, determine the maximum value of the third unknown parameter and the maximum value of the fourth unknown parameter, and determine the minimum value from the maximum value of the third unknown parameter and the maximum value of the fourth unknown parameter; For each of the different specifications, the product of the multiple of the corresponding specification relative to the third basic specification, the number of vCPUs corresponding to the third basic specification, and the minimum value is obtained to obtain the sixth coefficient corresponding to the corresponding specification; the sixth coefficient corresponding to each specification is multiplied by each value in the fifth quantity ratio represented by the fourth value to obtain the eighth quantity ratio; the values in the eighth quantity ratio are added together to obtain the seventh quantity.
[0109] Here, determining the maximum value of the third unknown parameter and the maximum value of the fourth unknown parameter based on the second set of constraints can be understood as solving the inequality included in the first constraint in the second set of constraints to obtain the maximum value of the third unknown parameter, and solving the inequality included in the second constraint in the second set of constraints to obtain the maximum value of the fourth unknown parameter; wherein, the inequality included in the first constraint is that the fifth value is less than or equal to the fifth quantity, and the inequality included in the second constraint is that the sixth value is less than or equal to the sixth quantity.
[0110] Here, when the memory allocation for high-priority virtual machines (core-bound virtual machines) and low-priority virtual machines (unbound virtual machines) is fixed, the second constraint can be that the sixth value is less than or equal to the sixth quantity. When the memory allocation for high-priority virtual machines (core-bound virtual machines) and low-priority virtual machines (unbound virtual machines) is not fixed, the second constraint can be that the sixth value is less than or equal to the maximum total memory capacity that the compute node can allocate to all unbound virtual machines and all core-bound virtual machines.
[0111] Here, determining whether to use the compute node as the target compute node based on the remaining number of vCPUs and the specifications of the virtual machine to be created may include: comparing the number of vCPUs included in the specifications of the virtual machine to be created with the remaining number of vCPUs; if the number of vCPUs included in the specifications of the virtual machine to be created is less than or equal to the remaining number of vCPUs, the compute node is used as the target compute node; otherwise, the compute node is not used as the target compute node.
[0112] Here, after calculating the number of remaining vCPUs of the computing node for the second virtual machine, the remaining memory capacity of the computing node for the second virtual machine can also be calculated.
[0113] Specifically, calculating the remaining memory capacity of the computing node for the second virtual machine may include: for each of the different specifications, multiplying the multiple of the corresponding specification relative to the fourth basic specification, the memory capacity corresponding to the fourth basic specification, and the minimum value to obtain a coefficient corresponding to the corresponding specification; multiplying the coefficient corresponding to each specification by each value in the fifth quantity ratio represented by the fourth value and then adding them together to obtain the total memory capacity occupied by the core-bound virtual machines of different specifications created by the computing node; and subtracting the sixth quantity from the total memory capacity occupied by the core-bound virtual machines of different specifications created by the computing node to obtain a difference value; the difference value represents the remaining memory capacity of the computing node for the second virtual machine.
[0114] Accordingly, determining whether to use the compute node as the target compute node based on the remaining number of vCPUs and the specifications of the requested virtual machine can further include: determining whether to use the compute node as the target compute node based on the remaining number of vCPUs, the specifications of the requested virtual machine, and the remaining memory capacity. Specifically, the number of vCPUs included in the specifications of the requested virtual machine is compared with the remaining number of vCPUs, and the memory capacity included in the specifications of the requested virtual machine is compared with the remaining memory capacity; if the number of vCPUs included in the specifications of the requested virtual machine is less than or equal to the remaining number of vCPUs, and the memory capacity included in the specifications of the requested virtual machine is less than or equal to the remaining memory capacity, then the compute node is used as the target compute node; otherwise, the compute node is not used as the target compute node.
[0115] The following example illustrates the process of determining the seventh quantity.
[0116] For example, suppose the third unknown parameter is represented by N1, the fourth unknown parameter by N2, and the fifth unknown parameter is calculated to have a ratio of 1:D between the two types of bound-core virtual machines that have already been created. 14 It is divided into 2C4G and 2C8G, with the basic specification being 2C4G. Two vCPUs are used as the third basic specification for vCPUs, and 4G is used as the fourth basic specification for memory.
[0117] First, for the first specification, 2C4G, multiply the product of 1 (the multiple of 2C4G relative to the third base specification of vCPUs), 2 (the number of vCPUs corresponding to the third base specification), and N1 (the third unknown parameter) to obtain the fourth coefficient corresponding to the specification, denoted as 1×2×N1=2N1. For the second specification, 2C8G, multiply the product of 1 (the multiple of 2C8G relative to the third base specification of vCPUs), 2 (the number of virtual CPUs corresponding to the third base specification), and N1 (the third unknown parameter) to obtain the fourth coefficient corresponding to the specification, denoted as 1×2×N1=2N1. Multiply the two obtained fourth coefficients by each value in the fifth quantity ratio represented by the fourth value to obtain the sixth quantity ratio, which can be expressed as 2N1: 2N1×D 14 Adding the values in the sixth quantity ratio yields the fifth value, which can be expressed as 2N1 + 2N1 × D. 14 For the first specification, 2C4G, the product of 1 (the multiple of the fourth basic memory specification), 4 (the memory capacity corresponding to the fourth basic specification), and N2 (the fourth unknown parameter) is taken to obtain the fifth coefficient corresponding to the specification, denoted as 1×4×N2=4N2. For the second specification, 2C8G, the product of 22 (the multiple of the fourth basic memory specification), 4 (the memory capacity corresponding to the fourth basic specification), and N2 (the fourth unknown parameter) is taken to obtain the fifth coefficient corresponding to the specification, denoted as 2×4×N2=8N2. Multiplying the two obtained fifth coefficients by each value in the fifth quantity ratio represented by the fourth value, the seventh quantity ratio is obtained, which can be expressed as 4N2:8N2×D. 14 Adding the values in the seventh quantity ratio yields the sixth value, which can be expressed as 4N² + 8N² × D. 14 .
[0118] Next, based on the fifth value, the sixth value, the fifth quantity, and the sixth quantity, a second set of constraints is generated; wherein the second set of constraints includes: a first constraint and a second constraint, the first constraint including that the fifth value is less than or equal to the fifth quantity, and the second constraint including that the sixth value is less than or equal to the sixth quantity. The generated second set of constraints is expressed by formulas (6) and (7), as follows: (6) (7) Wherein 2N1+2N1×D 14 N1 represents the fifth value, N1 represents the third unknown parameter, and the fifth quantity ratio is 1:D 14The value is obtained from the database, 4N² + 8N² × D 14 N1 represents the sixth value, and N2 represents the fourth unknown parameter. This indicates the fifth quantity. This indicates the sixth quantity. and The value is obtained from the database.
[0119] Then, by solving the inequality in formula (5), the maximum value of the third unknown parameter is obtained, and by solving the inequality in formula (6), the maximum value of the fourth unknown parameter is obtained. Here, the maximum value refers to the largest integer value. The minimum value is determined from the maximum values of the third and fourth unknown parameters, expressed by formula (8), as follows: (8) Where N represents the minimum value, This represents the maximum value of the third unknown parameter. This represents the maximum value of the fourth unknown parameter.
[0120] Finally, for the first specification, 2C4G, the product of 1 (the multiple of 2C4G relative to the third base specification of vCPUs), 2 (the number of vCPUs corresponding to the third base specification), and the minimum value N, yields the sixth coefficient corresponding to that specification, denoted as 1×2×N=2N. For the second specification, 2C8G, the product of 1 (the multiple of 2C8G relative to the third base specification of vCPUs), 2 (the number of virtual CPUs corresponding to the third base specification), and the minimum value N, yields the seventh coefficient corresponding to that specification, denoted as 1×2×N=2N. Multiplying the two sixth coefficients by the values in the fifth quantity ratio represented by the fourth value yields the eighth quantity ratio, which can be expressed as 2N: 2N×D. 14 Adding the values in the eighth quantity ratio yields the seventh quantity, expressed as 2N + 2N×D. 14 The difference between the fifth quantity and the seventh quantity is obtained; the difference represents the number of remaining vCPUs of the computing node for the second virtual machine. The fifth quantity is equal to the maximum total number of vCPUs that the computing node can allocate for all core-bound virtual machines, as expressed by formula (9), as follows: (9) in, This represents the number of remaining vCPUs for the second virtual machine on the compute node, where D represents the fifth quantity, (2N + 2N × D). 14 ) represents the seventh quantity, N represents the minimum value, and the fifth quantity ratio is 1:D 14The value is obtained from the database.
[0121] Here, referring to the calculation process of the remaining vCPUs, the remaining memory capacity of the computing node for the second virtual machine can be calculated, which can be expressed by formula (10), as follows: (10) in, This represents the maximum total memory capacity that can be allocated to all core-bound virtual machines on the compute node, (4N + 2 × 4N × D). 14 The expression represents the total amount of memory occupied by the two types of core-bound virtual machines created on the compute node, where N represents the minimum value, and the fifth quantity ratio is 1:D. 14 The value is obtained from the database.
[0122] In practical applications, for scenarios involving the co-location of high- and low-priority virtual machines, the second CPU super-resolution ratio can be obtained from the database, and the remaining number of vCPUs for the first virtual machine and the second virtual machine can be determined based on the second CPU super-resolution ratio.
[0123] Based on this, in some embodiments, determining the remaining vCPUs of the computing node for the first virtual machine and the second virtual machine includes: The eighth quantity and the second CPU super-resolution ratio of the compute node are obtained from the database; the eighth quantity represents the maximum total number of physical CPU cores that the compute node can allocate to all unbound virtual machines and all bound virtual machines; the second CPU super-resolution ratio is the ratio of the maximum total number of vCPUs that the compute node can allocate to all unbound virtual machines and all bound virtual machines to the maximum total number of physical CPU cores. The product of the eighth quantity and the second CPU super-resolution ratio is used to obtain the ninth quantity; the ninth quantity represents the maximum total number of vCPUs that can be allocated to the computing node for all unbound virtual machines and all bound virtual machines. Determine the tenth quantity; the tenth quantity represents the total number of vCPUs occupied by non-core-bound virtual machines and core-bound virtual machines of different specifications that have been created on the computing node; the different specifications include different combinations of vCPU specifications and memory specifications; The difference between the ninth quantity and the tenth quantity is obtained; the difference represents the number of remaining vCPUs of the computing node for the first virtual machine and the second virtual machine.
[0124] Here, determining whether to use the compute node as the target compute node based on the remaining number of vCPUs and the specifications of the virtual machine to be created may include: comparing the total number of vCPUs included in the specifications of the first and second virtual machines to be created with the remaining number of vCPUs; if the total number of vCPUs is less than or equal to the remaining number of vCPUs, then the compute node is used as the target compute node; otherwise, the compute node is not used as the target compute node.
[0125] Here, determining the tenth quantity may include determining the total number of vCPUs occupied by different types of unbound virtual machines created on the compute node, and determining the total number of vCPUs occupied by different types of bound virtual machines created on the compute node, and adding the two total vCPU counts together to obtain the tenth quantity. It should be noted that the process of determining these two total vCPU counts has been described above and will not be repeated here.
[0126] Here, the second CPU super-resolution ratio can also be called the global super-resolution ratio.
[0127] Here, the ninth quantity can be expressed by formula (11), as follows: (11) Where C represents the eighth quantity, and cpu_allocation_ratio represents the second CPU super-resolution ratio.
[0128] Here, the maximum total number of physical CPU cores that the entire host machine (compute node) can allocate to all core-bound virtual machines (high-priority virtual machines) is D, and the maximum total number of vCPUs that can be allocated to all non-core-bound virtual machines (low-priority virtual machines) is (C × cpu_allocation_ratio) - D. The maximum total number of vCPUs that can be allocated to the entire host machine (compute node) for both high and low priority virtual machines is the eighth number mentioned above. Specifically, the maximum total number of physical CPU cores that the compute node can allocate to all core-bound virtual machines (high-priority virtual machines) is equal to the maximum total number of vCPUs that the compute node can allocate to all core-bound virtual machines (high-priority virtual machines).
[0129] Here, determining whether to use the compute node as the target compute node based on the remaining number of vCPUs and the specifications of the virtual machine to be created may include: comparing the total number of vCPUs included in the specifications of the first and second virtual machines to be created with the remaining number of vCPUs; if the total number of vCPUs is less than or equal to the remaining number of vCPUs, the compute node is used as the target compute node; otherwise, the compute node is not used as the target compute node.
[0130] Here, after calculating the remaining vCPUs of the compute node for the first virtual machine and the second virtual machine, the remaining memory capacity of the compute node for the first virtual machine and the second virtual machine can also be calculated. The difference between the maximum total memory capacity that the compute node can allocate for all unbound virtual machines and all bound virtual machines and the remaining memory capacity of the compute node for the first virtual machine and the remaining memory capacity of the compute node for the second virtual machine is obtained; this difference represents the remaining memory capacity of the compute node for the first virtual machine and the second virtual machine. It should be noted that the process of determining the remaining memory capacity of the compute node for the first virtual machine has been described above, and the process of determining the remaining memory capacity of the compute node for the second virtual machine has been described above, and will not be repeated here.
[0131] Accordingly, determining whether to use the compute node as the target compute node based on the remaining number of vCPUs and the specifications of the requested virtual machine can further include: determining whether to use the compute node as the target compute node based on the remaining number of vCPUs for the first virtual machine and the second virtual machine, the specifications of the requested virtual machine, and the remaining memory capacity for the first virtual machine and the second virtual machine. Specifically, the total number of vCPUs included in the specifications of the requested first virtual machine and the second virtual machine is compared with the remaining number of vCPUs, and the total memory capacity included in the specifications of the requested first virtual machine and the second virtual machine is compared with the remaining memory capacity. If the total number of vCPUs is less than or equal to the remaining number of vCPUs, and the total memory capacity is less than or equal to the remaining memory capacity, then the compute node is used as the target compute node; otherwise, the compute node is not used as the target compute node.
[0132] It should be noted that in this application, the computing node can also calculate the remaining amount of vCPU based on different request scenarios and provide it to the scheduling service, i.e., the scheduler.
[0133] It should be noted that in this application, for mixed deployment scenarios, the maximum total number of usable physical CPUs allocated to high-priority virtual machines and / or low-priority virtual machines is dynamically configured, that is, the maximum total number of physical CPUs obtained from the database can be adjusted according to the actual situation.
[0134] It should be noted that in this application, at the scheduling service level, the dynamic resource configuration module included in the scheduler obtains the resource usage on the host machine from the database and calculates the number of remaining vCPUs, thereby determining the target host machine, i.e., the target computing node.
[0135] The embodiments of this application have the following advantages: (1) The scheduler determines the target computing node that matches the target type based on the target type of the virtual machine to be created and the type of the computing node. The virtual machine to be created is deployed on the target computing node. In this way, virtual machines with priority attributes and virtual machines without priority attributes will not be deployed on the same computing node. Thus, virtual machines without priority attributes and virtual machines with priority attributes will not compete for resources, thereby ensuring the performance of virtual machines with priority attributes.
[0136] This paper presents a resource isolation method for scenarios involving the co-location of high- and low-priority virtual machines. This method isolates ordinary virtual machines from virtual machines with priority attributes at the scheduling level, ensuring that high-priority virtual machines are not interfered with by other virtual machines and that they receive the highest QoS guarantee. In other words, it avoids resource competition between ordinary and high-priority virtual machines and guarantees the performance of high-priority virtual machines.
[0137] (2) For scenarios involving the co-location of high-priority and low-priority virtual machines, calculate the available remaining vCPU resources for different types of virtual machines to be created, and determine the target computing node based on the remaining vCPU resources. Here, based on CPU and memory constraint logic, the optimal resource configuration can be selected for different request scenarios, and the available remaining vCPU resources for different types of virtual machines created in the request can be calculated accordingly.
[0138] This allows resource quotas to be updated dynamically without restarting the service, while refining the configuration granularity to the node level, thus improving the flexibility of resource configuration. Here, CPU and memory constraints are given for virtual machines with different priority attributes in mixed deployment scenarios.
[0139] This allows for dynamic updates to the node super-resolution ratio configuration without requiring service restarts, thereby ensuring data consistency, improving service availability, and reducing user perception.
[0140] Based on this, a dynamic resource configuration module is added to the scheduling service to enable dynamic resource configuration.
[0141] Here, the local super-resolution ratio is dynamically set for compute nodes by labeling them. In terms of priority, the CPU super-resolution ratio set by associating the compute node with its label has the highest priority, that is, it has a higher priority than the super-resolution ratio set by the host group (aggregate) and the super-resolution ratio set by the configuration file (nova.conf) on the compute node in related technologies.
[0142] Here, for virtual machines with different priority attributes in mixed deployment scenarios, CPU and memory constraints are given, and the available remaining vCPU resources for virtual machines with different priority attributes that are requested to be created are calculated, which can better adjust the allocation of host resources in mixed virtual machine deployment scenarios.
[0143] This approach can be widely applied to both public and private cloud platforms. By isolating resources between mixed and non-mixed computing nodes, the performance of high-priority virtual machines is guaranteed. At the same time, the dynamic and flexible configuration of resource quotas can make resource allocation more reasonable, thereby improving the resource utilization of the host machine.
[0144] To implement the information processing method of this application embodiment, this application embodiment also provides an information processing device, which is installed in a network device. Figure 4 This is a schematic diagram of the composition structure of the information processing device according to an embodiment of this application, as shown below. Figure 4 As shown, the device includes: The acquisition module 41 is used to acquire a first request, wherein the first request carries the target type of the virtual machine to be created; Processing module 42 is used to determine the type of each computing node; wherein the type of the computing node includes a first type or a second type, the first type indicates that the computing node supports the creation of virtual machines configured with different priority attributes, and the second type indicates that the computing node supports the creation of virtual machines without priority attributes; based on the type of each computing node, a target computing node matching the target type is determined, and a virtual machine matching the target type is created through the target computing node.
[0145] In some embodiments, the processing module 42 is specifically used for: For each of the aforementioned computing nodes, perform the following operations: Retrieve first information from the database; the first information is used to indicate whether the computing node is configured with a CPU super-resolution ratio. If the first information indicates that the computing node is configured with a CPU super-resolution ratio, then the type of the computing node is determined to be the first type; or... If the first information indicates that the computing node is not configured with a CPU super-resolution ratio, the type of the computing node is determined to be the second type.
[0146] In some embodiments, the first request further carries the specifications of the virtual machine to be created; the processing module 42 is specifically used for: For each of the aforementioned computing nodes, perform the following operations: If the compute node is of the second type, and the target type indicates a request to create a virtual machine without a configured priority attribute, then the compute node is selected as the target compute node matching the target type; or, If the type of the compute node is the first type, and the target type represents the request to create a first virtual machine configured with a first priority attribute and / or a second virtual machine configured with a second priority attribute, then determine the remaining virtual central processing unit (vCPU) number of the compute node for the first virtual machine and / or the second virtual machine; based on the remaining vCPU number and the specifications of the virtual machine to be created, determine whether to use the compute node as the target compute node; The priority indicated by the first priority attribute is lower than the priority indicated by the second priority attribute.
[0147] In some embodiments, the processing module 42 is specifically used for: The database is used to obtain a first quantity, a second quantity, a first value, and a first CPU super-resolution ratio of the compute node; wherein, the first quantity represents the maximum total number of physical CPU cores that the compute node can allocate to all unbound virtual machines, the second quantity represents the maximum total memory capacity that the compute node can allocate to all unbound virtual machines, the first value represents the first proportion of the number of unbound virtual machines of different specifications that have been created on the compute node, the different specifications include different combinations of vCPU specifications and memory specifications, and the first CPU super-resolution ratio is the ratio of the maximum total number of vCPUs that the compute node can allocate to all unbound virtual machines to the maximum total number of physical CPU cores; The first quantity is multiplied by the first CPU super-resolution ratio to obtain the third quantity; the third quantity represents the maximum total number of vCPUs that can be allocated to all non-core-bound virtual machines on the computing node. Based on the second quantity, the third quantity, and the first value, a first set of constraints is generated; based on the first set of constraints, a fourth quantity is determined; the fourth quantity represents the total number of vCPUs occupied by non-core-bound virtual machines of different specifications that have been created on the computing node. The difference between the third quantity and the fourth quantity is obtained; the difference represents the number of remaining vCPUs of the computing node for the first virtual machine.
[0148] In some embodiments, the processing module 42 is specifically used for: A base specification is determined from the different specifications, the base specification including a first base specification for vCPU and a second base specification for memory; For each of the different specifications, the product of the corresponding specification relative to the first basic specification, the number of vCPUs corresponding to the first basic specification, and the first unknown parameter is taken to obtain the first coefficient corresponding to the corresponding specification. The product of the corresponding specification relative to the second basic specification, the memory capacity corresponding to the second basic specification, and the second unknown parameter is taken to obtain the second coefficient corresponding to the corresponding specification. The first unknown parameter represents the number of unbound virtual machines corresponding to the first basic specification, and the second unknown parameter represents the number of unbound virtual machines corresponding to the second basic specification. Multiply the first coefficient corresponding to each specification by each value in the first quantity ratio represented by the first value to obtain the second quantity ratio, and add the values in the second quantity ratio to obtain the second value; multiply the second coefficient corresponding to each specification by each value in the first quantity ratio represented by the first value to obtain the third quantity ratio, and add the values in the third quantity ratio to obtain the third value. The first set of constraints is generated based on the second value, the third value, the second quantity, and the third quantity. The first set of constraints includes: The second value is less than or equal to the third quantity; The third value is less than or equal to the second quantity.
[0149] In some embodiments, the processing module 42 is specifically used to: determine the maximum value of the first unknown parameter and the maximum value of the second unknown parameter according to the first set of constraints, and determine the minimum value from the maximum value of the first unknown parameter and the maximum value of the second unknown parameter; For each of the different specifications, the product of the multiple of the corresponding specification relative to the first basic specification, the number of vCPUs corresponding to the first basic specification, and the minimum value is obtained to obtain the third coefficient corresponding to the corresponding specification; the third coefficient corresponding to each specification is multiplied by each value in the first quantity ratio represented by the first value to obtain the fourth quantity ratio; the values in the fourth quantity ratio are added together to obtain the fourth quantity.
[0150] In some embodiments, the processing module 42 is specifically used to: obtain a fifth quantity, a sixth quantity, and a fourth value from the database; the fifth quantity represents the maximum total number of physical CPU cores that the computing node can allocate to all core-bound virtual machines, the sixth quantity represents the maximum total memory capacity that the computing node can allocate to all core-bound virtual machines, and the fourth value represents the proportion of the fifth quantity of core-bound virtual machines of different specifications that have been created on the computing node; Based on the fifth quantity, the sixth quantity, and the fourth value, a second set of constraints is generated; based on the second set of constraints, a seventh quantity is determined; the seventh quantity represents the total number of vCPUs occupied by different specifications of core-bound virtual machines that have been created on the computing node. The difference between the fifth quantity and the seventh quantity is obtained; the difference represents the number of remaining vCPUs of the compute node for the second virtual machine; the fifth quantity is equal to the maximum total number of vCPUs that the compute node can allocate for all core-bound virtual machines.
[0151] In some embodiments, the processing module 42 is specifically used for: The eighth quantity and the second CPU super-resolution ratio of the compute node are obtained from the database; the eighth quantity represents the maximum total number of physical CPU cores that the compute node can allocate to all unbound virtual machines and all bound virtual machines; the second CPU super-resolution ratio is the ratio of the maximum total number of vCPUs that the compute node can allocate to all unbound virtual machines and all bound virtual machines to the maximum total number of physical CPU cores. The product of the eighth quantity and the second CPU super-resolution ratio is used to obtain the ninth quantity; the ninth quantity represents the maximum total number of vCPUs that can be allocated to the computing node for all unbound virtual machines and all bound virtual machines. Determine the tenth quantity; the tenth quantity represents the total number of vCPUs occupied by non-core-bound virtual machines and core-bound virtual machines of different specifications that have been created on the computing node; The difference between the ninth quantity and the tenth quantity is obtained; the difference represents the number of remaining vCPUs of the computing node for the first virtual machine and the second virtual machine.
[0152] In practical applications, the acquisition module 41 can be implemented by the communication interface in the information processing device; the processing module 42 can be implemented by the processor in the information processing device.
[0153] It should be noted that the information processing device provided in the above embodiments is only illustrated by the division of the above program modules. In practical applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the information processing device and the information processing method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0154] This application also provides a network device, such as... Figure 5 As shown, it includes: The communication interface 51 enables information exchange with other devices; The processor 52, connected to the communication interface 51, is used to execute the methods provided by one or more technical solutions on the network device side when running a computer program. The computer program is stored in the memory 53.
[0155] It should be noted that the specific processing procedures of the processor 52 and the communication interface 51 are detailed in the method embodiment and will not be repeated here.
[0156] Of course, in practical applications, the various components in network device 50 are coupled together through bus system 55. It can be understood that bus system 55 is used to implement communication between these components. In addition to a data bus, bus system 55 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 5 The general labeled all buses as Bus System 55.
[0157] The memory 53 in this embodiment is used to store various types of data to support the operation of the network device 50. Examples of such data include any computer program used to operate on the network device 50.
[0158] The methods disclosed in the embodiments of this application can be applied to the processor 52, or implemented by the processor 52. The processor 52 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware or by instructions in the form of software in the processor 52. The processor 52 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 52 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in the memory 53. The processor 52 reads the information in the memory 53 and completes the steps of the aforementioned method in combination with its hardware.
[0159] In an exemplary embodiment, the network device 50 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned method.
[0160] It is understood that the memory (memory 53) in the embodiments of this application can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memories.
[0161] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory storing a computer program, which can be executed by the processor 52 of the network device 50 to complete the steps described in the aforementioned network device-side method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.
[0162] For example, embodiments of this application also provide a computer program product, including a computer program that can be executed by the processor 52 of the network device 50 to perform the steps described in any of the foregoing methods.
[0163] It should be noted that terms such as "first" and "second" are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0164] Furthermore, the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.
[0165] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application.
Claims
1. An information processing method, characterized in that, Applied to a scheduler, the method includes: Obtain the first request, which carries the target type of the virtual machine to be created; The type of each compute node is determined; wherein the type of the compute node includes a first type or a second type, the first type indicating that the compute node supports the creation of virtual machines configured with different priority attributes, and the second type indicating that the compute node supports the creation of virtual machines without priority attributes; Based on the type of each computing node, a target computing node matching the target type is determined, and a virtual machine matching the target type is created using the target computing node.
2. The method according to claim 1, characterized in that, Determining the type of each computing node includes: For each of the aforementioned computing nodes, perform the following operations: Retrieve first information from the database; the first information is used to indicate whether the computing node is configured with a CPU super-resolution ratio. If the first information indicates that the computing node is configured with a CPU super-resolution ratio, then the type of the computing node is determined to be the first type; or... If the first information indicates that the computing node is not configured with a CPU super-resolution ratio, the type of the computing node is determined to be the second type.
3. The method according to claim 1, characterized in that, The first request also carries the specifications of the virtual machine to be created; determining the target computing node matching the target type based on the types of each computing node includes: For each of the aforementioned computing nodes, perform the following operations: If the type of the compute node is the second type, and the target type represents a request to create a virtual machine without a priority attribute, then the compute node is taken as the target compute node that matches the target type. or, If the type of the compute node is the first type, and the target type represents the request to create a first virtual machine configured with a first priority attribute and / or a second virtual machine configured with a second priority attribute, then determine the number of remaining virtual processors (vCPUs) of the compute node for the first virtual machine and / or the second virtual machine; based on the number of remaining vCPUs and the specifications of the virtual machine to be created, determine whether to use the compute node as the target compute node; The priority indicated by the first priority attribute is lower than the priority indicated by the second priority attribute.
4. The method according to claim 3, characterized in that, Determining the number of remaining vCPUs for the first virtual machine on the compute node includes: The database is used to obtain a first quantity, a second quantity, a first value, and a first CPU super-resolution ratio of the compute node; wherein, the first quantity represents the maximum total number of physical CPU cores that the compute node can allocate to all unbound virtual machines, the second quantity represents the maximum total memory capacity that the compute node can allocate to all unbound virtual machines, the first value represents the first proportion of the number of unbound virtual machines of different specifications that have been created on the compute node, the different specifications include different combinations of vCPU specifications and memory specifications, and the first CPU super-resolution ratio is the ratio of the maximum total number of vCPUs that the compute node can allocate to all unbound virtual machines to the maximum total number of physical CPU cores; The first quantity is multiplied by the first CPU super-resolution ratio to obtain the third quantity; the third quantity represents the maximum total number of vCPUs that can be allocated to all non-core-bound virtual machines on the computing node. Based on the second quantity, the third quantity, and the first value, a first set of constraints is generated; based on the first set of constraints, a fourth quantity is determined; the fourth quantity represents the total number of vCPUs occupied by non-core-bound virtual machines of different specifications that have been created on the computing node. The difference between the third quantity and the fourth quantity is obtained; the difference represents the number of remaining vCPUs of the computing node for the first virtual machine.
5. The method according to claim 4, characterized in that, The step of generating a first set of constraints based on the second quantity, the third quantity, and the first value includes: A base specification is determined from the different specifications, the base specification including a first base specification for vCPU and a second base specification for memory; For each of the different specifications, the product of the corresponding specification relative to the first basic specification, the number of vCPUs corresponding to the first basic specification, and the first unknown parameter is taken to obtain the first coefficient corresponding to the corresponding specification. The product of the corresponding specification relative to the second basic specification, the memory capacity corresponding to the second basic specification, and the second unknown parameter is taken to obtain the second coefficient corresponding to the corresponding specification. The first unknown parameter represents the number of unbound virtual machines corresponding to the first basic specification, and the second unknown parameter represents the number of unbound virtual machines corresponding to the second basic specification. Multiply the first coefficient corresponding to each specification by each value in the first quantity ratio represented by the first value to obtain the second quantity ratio, and add the values in the second quantity ratio to obtain the second value; multiply the second coefficient corresponding to each specification by each value in the first quantity ratio represented by the first value to obtain the third quantity ratio, and add the values in the third quantity ratio to obtain the third value. The first set of constraints is generated based on the second value, the third value, the second quantity, and the third quantity. The first set of constraints includes: The second value is less than or equal to the third quantity; The third value is less than or equal to the second quantity.
6. The method according to claim 5, characterized in that, The step of determining the fourth quantity based on the first set of constraints includes: Based on the first set of constraints, determine the maximum value of the first unknown parameter and the maximum value of the second unknown parameter, and determine the minimum value from the maximum value of the first unknown parameter and the maximum value of the second unknown parameter. For each of the different specifications, the product of the multiple of the corresponding specification relative to the first basic specification, the number of vCPUs corresponding to the first basic specification, and the minimum value is obtained to obtain the third coefficient corresponding to the corresponding specification; the third coefficient corresponding to each specification is multiplied by each value in the first quantity ratio represented by the first value to obtain the fourth quantity ratio; the values in the fourth quantity ratio are added together to obtain the fourth quantity.
7. The method according to claim 3, characterized in that, Determining the number of remaining vCPUs on the compute node for the second virtual machine includes: The fifth quantity, sixth quantity, and fourth value are obtained from the database; the fifth quantity represents the maximum total number of physical CPU cores that the compute node can allocate to all core-bound virtual machines; the sixth quantity represents the maximum total memory capacity that the compute node can allocate to all core-bound virtual machines; and the fourth value represents the proportion of the fifth quantity of core-bound virtual machines of different specifications that have been created on the compute node, wherein the different specifications include different combinations of vCPU specifications and memory specifications. Based on the fifth quantity, the sixth quantity, and the fourth value, a second set of constraints is generated; based on the second set of constraints, a seventh quantity is determined; the seventh quantity represents the total number of vCPUs occupied by different specifications of core-bound virtual machines that have been created on the computing node. The difference between the fifth quantity and the seventh quantity is obtained; the difference represents the number of remaining vCPUs of the compute node for the second virtual machine; the fifth quantity is equal to the maximum total number of vCPUs that the compute node can allocate for all core-bound virtual machines.
8. The method according to claim 3, characterized in that, Determining the remaining vCPUs of the compute node for the first virtual machine and the second virtual machine includes: The eighth quantity and the second CPU super-resolution ratio of the compute node are obtained from the database; the eighth quantity represents the maximum total number of physical CPU cores that the compute node can allocate to all unbound virtual machines and all bound virtual machines; the second CPU super-resolution ratio is the ratio of the maximum total number of vCPUs that the compute node can allocate to all unbound virtual machines and all bound virtual machines to the maximum total number of physical CPU cores. The product of the eighth quantity and the second CPU super-resolution ratio is used to obtain the ninth quantity; the ninth quantity represents the maximum total number of vCPUs that can be allocated to the computing node for all unbound virtual machines and all bound virtual machines. Determine the tenth quantity; the tenth quantity represents the total number of vCPUs occupied by non-core-bound virtual machines and core-bound virtual machines of different specifications that have been created on the computing node; the different specifications include different combinations of vCPU specifications and memory specifications; The difference between the ninth quantity and the tenth quantity is obtained; the difference represents the number of remaining vCPUs of the computing node for the first virtual machine and the second virtual machine.
9. An information processing device, characterized in that, include: The acquisition module is used to acquire a first request, wherein the first request carries the target type of the virtual machine to be created; A processing module is used to determine the type of each computing node; wherein the type of the computing node includes a first type or a second type, the first type indicating that the computing node supports the creation of virtual machines configured with different priority attributes, and the second type indicating that the computing node supports the creation of virtual machines without priority attributes; based on the type of each computing node, a target computing node matching the target type is determined, and a virtual machine matching the target type is created through the target computing node.
10. A network device, characterized in that, This includes a processor and memory for storing computer programs that can run on the processor. When the processor is used to run the computer program, it performs the steps of the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.