Virtual machine scheduling method and device, electronic equipment and storage medium
通过获取虚机的目标调度标签和集群标签,确定目标集群和计算节点,解决了现有技术中计算节点资源不均衡和迁移困难的问题,实现了资源平衡和迁移的可行性。
Patent Information
- Application Number
- CN202311227776.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-21
- Publication Date
- 2025-03-21
AI Technical Summary
The prior art has problems of resource imbalance and migration difficulties in the confirmation process of computing nodes, especially when most customers tend to a certain type of target model, resulting in resource tightness and the inability to migrate between different models.
By obtaining the target virtual machine scheduling tag of the virtual machine to be scheduled, matching the tags and cluster tags of the candidate cluster, determining the target cluster and target computing nodes, realizing the scheduling of the virtual machine.
This method can effectively balance the utilization rate of computing node resources, realize virtual machine migration between different models, and solve the problems of resource imbalance and migration difficulties.
Smart Images

Figure CN119668770A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of cluster scheduling, and in particular to a virtual machine scheduling method and device, an electronic device, and a storage medium. Background Art
[0002] At present, the scheduling process of an instance is to select a computing node that meets the startup requirements from a batch of computing nodes as the running node of the instance. Therefore, the so-called scheduling process is the process of selecting computing nodes.
[0003] So how to determine whether a computing node meets the requirements of this startup requires a certain screening strategy; and through the screening strategy, multiple computing nodes that can create instances may be found, so how to determine the computing node that will eventually deploy the instance among the multiple computing nodes that can create instances? Here, a weighting strategy is needed, that is, according to a strategy, the weights of the computing nodes that can meet the startup requirements are calculated, sorted according to the weights, and computing nodes with higher priorities are selected from them.
[0004] In the related art, the matching is based on the expected AZ (i.e., available zone) and the model cluster. However, the following technical problems exist when using this method to confirm the computing nodes: 1. When most customers prefer a certain target model for the computing node model, the computing node resources in other clusters except the cluster supporting the target model will be idle, while the target model's resources will be in short supply; 2. The current model must be kept the same during the scheduling process, so migration between different models cannot be completed.
[0005] Therefore, the related art has the problems as described above. Summary of the invention
[0006] The present application provides a virtual machine scheduling method and device, an electronic device and a storage medium to solve at least one technical problem existing in the related art.
[0007] According to one aspect of an embodiment of the present application, a virtual machine scheduling method is provided, including:
[0008] Obtain a target virtual machine scheduling tag of the virtual machine to be scheduled, wherein the target virtual machine scheduling tag is used to indicate the computing node type of the computing node to which the virtual machine to be scheduled needs to be scheduled;
[0009] Determine a target cluster corresponding to the virtual machine to be scheduled according to the target virtual machine scheduling label and the cluster label of each candidate cluster, wherein the cluster label is used to correspond to one or more computing node types;
[0010] In the target cluster, determining the target computing node to which the virtual machine to be scheduled needs to be scheduled;
[0011] Schedule the virtual machine to be scheduled to the target computing node.
[0012] Optionally, as in the aforementioned method, determining the target cluster corresponding to the to-be-scheduled virtual machine according to the target virtual machine scheduling tag and the cluster tag of each candidate cluster includes:
[0013] Matching the candidate cluster label of each candidate cluster with the target virtual machine scheduling label to obtain a matching result corresponding to each candidate cluster;
[0014] According to all the matching results, the target cluster is determined from all the candidate clusters, wherein the target matching results corresponding to the target cluster meet the matching success requirements corresponding to the target cluster.
[0015] Optionally, as in the aforementioned method, before determining the target cluster corresponding to the virtual machine to be scheduled according to the target virtual machine scheduling tag and the cluster tag of each candidate cluster, the method further includes:
[0016] When the candidate cluster is a first cluster, obtaining a first cluster label of the candidate cluster, wherein the first cluster supports multiple computing node types;
[0017] When the candidate cluster is a second cluster, obtaining a second cluster label of the candidate cluster, wherein the second cluster supports only one corresponding computing node type;
[0018] In the case that the candidate cluster is the third cluster, a third cluster label of the candidate cluster is acquired, wherein the third cluster label includes a correspondence between users and computing nodes.
[0019] Optionally, as in the aforementioned method, matching the candidate cluster label of each candidate cluster with the target virtual machine scheduling label to obtain a matching result corresponding to each candidate cluster includes:
[0020] When the type of the target virtual machine scheduling tag is a first scheduling tag, matching the target virtual machine scheduling tag with a first designated cluster tag of a first designated cluster to obtain a first matching result corresponding to the first designated cluster, wherein the first designated cluster is any first cluster among all first clusters;
[0021] Determining the target cluster from all candidate clusters according to all matching results includes:
[0022] When the first matching result indicates that the first designated cluster tag includes the target virtual machine scheduling tag, determining that the first matching result satisfies a first matching success requirement corresponding to the first designated cluster;
[0023] The first designated cluster is determined as the target cluster.
[0024] Optionally, as in the aforementioned method, matching the candidate cluster label of each candidate cluster with the target virtual machine scheduling label to obtain a matching result corresponding to each candidate cluster includes:
[0025] When the type of the target virtual machine scheduling tag is a second scheduling tag, matching the target virtual machine scheduling tag with a second designated cluster tag of a second designated cluster to obtain a second matching result corresponding to the second designated cluster, wherein the second designated cluster is any second cluster among all second clusters;
[0026] Determining the target cluster from all candidate clusters according to all matching results includes:
[0027] When the second matching result indicates that the second designated cluster tag is completely consistent with the target virtual machine scheduling tag, determining that the second matching result meets a second matching success requirement corresponding to the second designated cluster;
[0028] The second designated cluster is determined as the target cluster.
[0029] Optionally, as in the aforementioned method, matching the candidate cluster label of each candidate cluster with the target virtual machine scheduling label to obtain a matching result corresponding to each candidate cluster includes:
[0030] When the type of the target virtual machine scheduling tag is a third scheduling tag, matching the target virtual machine scheduling tag with a third designated cluster tag of a third designated cluster to obtain a third matching result corresponding to the third designated cluster, wherein the third designated cluster is any one of all third clusters;
[0031] Determining the target cluster from all candidate clusters according to all matching results includes:
[0032] When the third matching result indicates that the designated usage subtag in the third designated cluster tag is consistent with the target usage subtag in the target virtual machine scheduling tag, and the designated user subtag in the third designated cluster tag is consistent with the target user subtag in the target virtual machine scheduling tag, it is determined that the third matching result meets the third matching success requirement corresponding to the third designated cluster;
[0033] The third designated cluster is determined as the target cluster.
[0034] Optionally, as in the aforementioned method, determining, in the target cluster, a target computing node to which the to-be-scheduled virtual machine needs to be scheduled includes:
[0035] In the third designated cluster label, determine the computing node label that uniquely corresponds to the designated purpose sub-label and the designated user sub-label;
[0036] The computing node indicated by the computing node label is determined as the target computing node.
[0037] According to another aspect of the embodiment of the present application, a virtual machine scheduling device is also provided, including:
[0038] An acquisition module, used to acquire a target virtual machine scheduling tag of a virtual machine to be scheduled, wherein the target virtual machine scheduling tag is used to indicate a computing node type of a computing node to which the virtual machine to be scheduled needs to be scheduled;
[0039] A cluster determination module, configured to determine a target cluster corresponding to the virtual machine to be scheduled according to the target virtual machine scheduling label and the cluster label of each candidate cluster, wherein the cluster label is used to correspond to one or more computing node types;
[0040] A node determination module, used to determine, in the target cluster, the target computing node to which the virtual machine to be scheduled needs to be scheduled;
[0041] The scheduling module is used to schedule the virtual machine to be scheduled to the target computing node.
[0042] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein the memory is used to store a computer program; and the processor is used to execute the method steps in any of the above embodiments by running the computer program stored in the memory.
[0043] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the method steps in any of the above embodiments when executed.
[0044] In an embodiment of the present application, a method is adopted to obtain a target virtual machine scheduling tag of a virtual machine to be scheduled; and according to the target virtual machine scheduling tag and the cluster tag of each candidate cluster, a target cluster corresponding to the virtual machine to be scheduled is determined, and then a method of scheduling the virtual machine to be scheduled to a target computing node is determined in the target cluster; and the target virtual machine scheduling tag is used to indicate the computing node type of the computing node to which the virtual machine to be scheduled needs to be scheduled, and the cluster tag is used to correspond to one or more computing node types; thereby, the target computing node in a cluster can be used to schedule virtual machines that meet the requirements of one or more computing node types, thereby balancing the utilization rate of computing node resources in the virtual machine, and realizing virtual machine migration between different models; thereby overcoming the technical problems existing in the related art that when most customers prefer a certain type of target model for the model of computing nodes, the computing node resources in other clusters except the cluster supporting the target model will be idle, while the resources of the target model will be in short supply; and the current model needs to be kept the same during the scheduling process, so the migration between different models cannot be completed. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0047] Figure 1 is a schematic diagram of a hardware environment of an optional virtual machine scheduling method according to an embodiment of the present application;
[0048] Figure 2 It is a flowchart of an optional virtual machine scheduling method according to an embodiment of the present application;
[0049] Figure 3 is a flow chart of an optional virtual machine scheduling method according to another embodiment of the present application;
[0050] Figure 4 is a logical schematic diagram of an optional virtual machine scheduling method according to an embodiment of the present application;
[0051] Figure 5 is a logical schematic diagram of another optional virtual machine scheduling method according to an embodiment of the present application;
[0052] Figure 6is a logical schematic diagram of another optional virtual machine scheduling method according to an embodiment of the present application;
[0053] Figure 7 is a structural block diagram of an optional virtual machine scheduling device according to an embodiment of the present application;
[0054] Figure 8 It is a structural block diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0056] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0057] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretation:
[0058] 1. Openstack: an open source cloud operating system.
[0059] 2. Nova: The component responsible for the computing part of Openstack.
[0060] 3. Az: available zone, available zone.
[0061] 4. Aggregate: host cluster.
[0062] According to one aspect of an embodiment of the present application, a virtual machine scheduling method is provided. Optionally, in this embodiment, the virtual machine scheduling method can be applied to Figure 1In the hardware environment composed of terminal 1402 and server 1404 shown in FIG. Figure 1 As shown, server 1404 is connected to terminal 1402 via a network, and can be used to provide services (such as game services, application services, etc.) for the terminal or a client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 1404.
[0063] The above network may include but is not limited to at least one of the following: wired network, wireless network. The above wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the above wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal may not be limited to a PC, a mobile phone, a tablet computer, etc.
[0064] The virtual machine scheduling method of the embodiment of the present application can be executed by a server, a terminal, or a server and a terminal together. The terminal can also execute the virtual machine scheduling method of the embodiment of the present application by a client installed thereon.
[0065] Taking the virtual machine scheduling method in this embodiment executed by the server as an example, Figure 2 An optional virtual machine scheduling method provided in an embodiment of the present application includes the following steps:
[0066] Step S101, obtaining a target virtual machine scheduling tag of a virtual machine to be scheduled, wherein the target virtual machine scheduling tag is used to indicate a computing node type of a computing node to which the virtual machine to be scheduled needs to be scheduled.
[0067] The virtual machine scheduling method in this embodiment can be applied to a scenario where a virtual machine needs to be scheduled from a current computing node to another computing node.
[0068] Specifically, the virtual machine to be scheduled may be a virtual machine that needs to be scheduled from the current computing node to another computing node.
[0069] The target virtual machine scheduling tag of the virtual machine to be scheduled includes at least the computing node type. In addition, it may include but is not limited to at least one of the following information: storage type (for example, local disk, cloud disk) and virtual machine type (for example, ordinary type virtual machine), etc.
[0070] Step S102: determining a target cluster corresponding to the virtual machine to be scheduled according to the target virtual machine scheduling label and the cluster label of each candidate cluster, wherein the cluster label is used to correspond to one or more computing node types.
[0071] Specifically, after obtaining the target virtual machine scheduling tag of the virtual machine to be scheduled, in order to determine the target cluster to be scheduled, the target virtual machine scheduling tag and the cluster tag of each candidate cluster may be obtained.
[0072] The cluster label of each candidate cluster can correspond to one or more computing node types. Therefore, the cluster label includes at least the computing node type. In addition, it can also include but is not limited to at least one of the following information: storage type (for example, local disk, cloud disk) and virtual machine type (for example, ordinary type virtual machine), etc.
[0073] like Figure 3 As shown, as an optional embodiment, as in the above method, step S102 determines the target cluster corresponding to the virtual machine to be scheduled according to the target virtual machine scheduling label and the cluster label of each candidate cluster, including the following steps:
[0074] Step S201, matching the candidate cluster label of each candidate cluster with the target virtual machine scheduling label to obtain a matching result corresponding to each candidate cluster;
[0075] Step S202: determining a target cluster from all candidate clusters according to all matching results, wherein the target matching result corresponding to the target cluster satisfies the matching success requirement corresponding to the target cluster.
[0076] Specifically, the target virtual machine scheduling label can be matched with the candidate cluster label of each candidate cluster. When the target virtual machine scheduling label and the target cluster label among all candidate cluster labels meet the preset logical relationship, it is determined that the target matching result corresponding to the target cluster meets the matching success requirement corresponding to the target cluster; the candidate cluster corresponding to the target cluster label is determined as the target cluster.
[0077] The preset logical relationship must at least satisfy: the target cluster tag includes the target virtual machine scheduling tag, that is, the parameter value of each cluster parameter in the target cluster tag includes the parameter value of each scheduling parameter in the target virtual machine scheduling tag. For example, when the target cluster tag includes: computing node type sub-tag (parameter value: C3 and S3), storage type sub-tag (parameter value: SSD (i.e., local disk)), virtual machine type sub-tag (parameter value: ordinary type virtual machine), user type sub-tag (parameter value: test (i.e., test user)), etc.; when the target virtual machine scheduling tag includes: computing node type sub-tag (parameter value: C3), storage type sub-tag (parameter value: SSD (i.e., local disk)), virtual machine type sub-tag (parameter value: ordinary type virtual machine), then the parameter value of each sub-tag in the target virtual machine scheduling tag is included in the target cluster tag; it can be determined that the target virtual machine scheduling tag and the target cluster tag meet the preset logical relationship. Then, the candidate cluster corresponding to the target cluster tag can be determined as the target cluster.
[0078] Step S103: in the target cluster, determine the target computing node to which the virtual machine to be scheduled needs to be scheduled.
[0079] Specifically, generally, computing nodes under the same Aggregate have the same resource configuration. Therefore, after determining the target cluster, any idle computing node in the target cluster is determined as the target computing node.
[0080] Step S104, scheduling the virtual machine to be scheduled to the target computing node.
[0081] Specifically, after the target computing node is determined, the virtual machine to be scheduled can be scheduled to the target computing node.
[0082] The method of this embodiment adopts the method of obtaining the target virtual machine scheduling tag of the virtual machine to be scheduled; and according to the target virtual machine scheduling tag and the cluster tag of each candidate cluster, determining the target cluster corresponding to the virtual machine to be scheduled, and then determining the method of scheduling the virtual machine to be scheduled to the target computing node in the target cluster; and making the target virtual machine scheduling tag used to indicate the computing node type of the computing node to which the virtual machine to be scheduled needs to be scheduled, and the cluster tag is used to correspond to one or more computing node types; thereby, the target computing node in a cluster can be used to schedule virtual machines required by one or more computing node types, thereby balancing the utilization rate of computing node resources in the virtual machine, and realizing virtual machine migration between different models; thereby overcoming the technical problems existing in the related art that when most customers prefer a certain type of target model for the computing node model selection, the computing node resources in other clusters except the cluster supporting the target model will be idle, while the resource usage of the target model will be tight; and the current model needs to be kept the same during the scheduling process, so the migration between different models cannot be completed.
[0083] As an optional embodiment, as in the above method, before determining the target cluster corresponding to the virtual machine to be scheduled according to the target virtual machine scheduling tag and the cluster tag of each candidate cluster in step S102, the method further includes the following steps:
[0084] Step S301 : when the candidate cluster is a first cluster, obtain a first cluster label of the candidate cluster, wherein the first cluster supports multiple computing node types.
[0085] Specifically, the first cluster can be a weak tag cluster, and the weak tag cluster can be a corresponding weak cluster tag (i.e., the first cluster tag) that is not assigned special logic (for example, the cluster tag must be completely consistent with the scheduling tag, the cluster tag includes tenant parameters (the tenant is a user who rents a specific server host), etc.), then the newly added scheduling tags are all weak cluster tags. The first cluster tag can be passed into the first cluster by the console.
[0086] like Figure 4 As shown, if the cluster label of the candidate cluster is a weak cluster label, as long as the value of each sub-label in the scheduling label corresponding to the virtual machine is included in the weak cluster label, it can be considered that the scheduling label and the weak cluster label are matched successfully.
[0087] In addition, the first cluster supports multiple computing node types, so the first cluster can be suitable for scheduling virtual machines that require multiple computing node types. For example, when the computing node types supported by the first cluster I (characterized by the computing node type sub-tag) include: C3 and S3, the first virtual machine that needs to use the computing node type of C3 and the second virtual machine that needs to use the computing node type of S3 can both be scheduled to the first cluster I.
[0088] When the candidate cluster is a weakly labeled cluster, because the first cluster label contains the scheduling label of the virtual machine to be scheduled, multiple values can be set in a cluster label key to achieve the purpose of migrating virtual machines with different model requirements in different computing clusters.
[0089] Step S302: when the candidate cluster is the second cluster, obtain a second cluster label of the candidate cluster, wherein the second cluster supports only one corresponding computing node type.
[0090] The second cluster may be a strong tag cluster, and the strong tag cluster may be a cluster in which the corresponding strong cluster tag (i.e., the second cluster tag) needs to be completely consistent with the tag of the virtual machine before the virtual machine can be scheduled to the strong tag cluster. The second cluster tag may be passed into the second cluster by the console.
[0091] like Figure 5 As shown, only virtual machines that are suitable for the scheduled computing node type can be scheduled in the strong label cluster. For example, when the computing node type supported by the second cluster II is: C3, the first virtual machine that needs to use the computing node type C3 can be scheduled to the second cluster II, while the second virtual machine that needs to use the computing node type S3 cannot be scheduled to the second cluster II.
[0092] Generally, clusters that use strong tags are computing clusters with specific configurations or special services, such as KMR services and GPU services.
[0093] Step S303: when the candidate cluster is the third cluster, obtain a third cluster label of the candidate cluster, wherein the third cluster label includes a correspondence between users and computing nodes.
[0094] The third cluster may be a dedicated cloud tag, which may be a tag used to indicate the correspondence between computing nodes in the cluster and users. For example, when computing nodes 1 and 2 have a correspondence with user a, user a's virtual machine can only be scheduled to computing nodes 1 and 2, and computing nodes 1 and 2 can only be scheduled to user a's virtual machine. The third cluster tag may be passed into the third cluster by the console.
[0095] like Figure 6 As shown in the figure, the dedicated cloud tag cluster is a special model. Like other common virtual machines, dedicated cloud virtual machines need to be scheduled by AZ and Aggregate, but the dedicated cloud cluster tag has a strong sub-tag {"KSC_user": "dedicated"}. The dedicated cloud tag cluster has two more scheduling sub-tags than the common instance cluster (i.e., the tag cluster and the strong tag cluster): model (i.e., the purpose sub-tag) and project (i.e., the user sub-tag).
[0096] Through the method of this embodiment, different cluster labels can be configured for different types of clusters.
[0097] As an optional embodiment, as in the aforementioned method, the step of matching the candidate cluster label of each candidate cluster with the target virtual machine scheduling label to obtain a matching result corresponding to each candidate cluster includes the following steps:
[0098] When the type of the target virtual machine scheduling tag is the first scheduling tag, the target virtual machine scheduling tag is matched with the first designated cluster tag of the first designated cluster to obtain a first matching result corresponding to the first designated cluster, wherein the first designated cluster is any first cluster among all first clusters.
[0099] Specifically, when the type of the target virtual machine scheduling tag is a weak scheduling tag (i.e., the first scheduling tag), the target virtual machine scheduling tag is matched among all first cluster tags; the target virtual machine scheduling tag can be matched with the first designated cluster tag of the first designated cluster in the first cluster, and then a first matching result can be obtained after the target virtual machine scheduling tag is matched with the first designated cluster tag.
[0100] According to all matching results, the target cluster is determined from all candidate clusters, including:
[0101] When the first matching result indicates that the first designated cluster tag includes the target virtual machine scheduling tag, it is determined that the first matching result meets the first matching success requirement corresponding to the first designated cluster; and the first designated cluster is determined as the target cluster.
[0102] Specifically, after obtaining the first matching result, if the first matching result indicates that the first designated cluster tag contains the target virtual machine scheduling tag, it can be determined that the first matching result meets the first matching success requirement corresponding to the first designated cluster, that is, the first designated cluster successfully matches the virtual machine to be scheduled. Therefore, the first designated cluster can be determined as the target cluster.
[0103] As an optional embodiment, as in the aforementioned method, the step of matching the candidate cluster label of each candidate cluster with the target virtual machine scheduling label to obtain a matching result corresponding to each candidate cluster includes:
[0104] When the type of the target virtual machine scheduling tag is the second scheduling tag, the target virtual machine scheduling tag is matched with the second designated cluster tag of the second designated cluster to obtain a second matching result corresponding to the second designated cluster, wherein the second designated cluster is any second cluster among all second clusters.
[0105] Specifically, when the type of the target virtual machine scheduling tag is an emphasis tag (i.e., a second scheduling tag), the target virtual machine scheduling tag is matched in all second cluster tags. The target virtual machine scheduling tag can be matched with the second designated cluster tag of any second designated cluster in the second cluster, and then a second matching result after the target virtual machine scheduling tag is matched with the second designated cluster tag can be obtained. For other clusters in all second clusters, matching can also be performed in this manner.
[0106] According to all matching results, the target cluster is determined from all candidate clusters, including:
[0107] When the second matching result indicates that the second designated cluster tag is completely consistent with the target virtual machine scheduling tag, it is determined that the second matching result meets the second matching success requirement corresponding to the second designated cluster; and the second designated cluster is determined as the target cluster.
[0108] Specifically, after obtaining the second matching result, if the second matching result indicates that the second designated cluster tag is completely consistent with the target virtual machine scheduling tag, it can be determined that the second matching result meets the second matching success requirement corresponding to the second designated cluster, that is, the second designated cluster successfully matches the virtual machine to be scheduled. Therefore, the second designated cluster can be determined as the target cluster.
[0109] As an optional embodiment, as in the aforementioned method, the step of matching the candidate cluster label of each candidate cluster with the target virtual machine scheduling label to obtain a matching result corresponding to each candidate cluster includes:
[0110] When the type of the target virtual machine scheduling tag is the third scheduling tag, the target virtual machine scheduling tag is matched with the third designated cluster tag of the third designated cluster to obtain a third matching result corresponding to the third designated cluster, wherein the third designated cluster is any third cluster among all third clusters.
[0111] Specifically, when the type of the target virtual machine scheduling tag is a dedicated cloud scheduling tag (i.e., the third scheduling tag), the target virtual machine scheduling tag is matched in all third cluster tags. The target virtual machine scheduling tag can be matched with the third designated cluster tag of any third designated cluster in the third cluster, and then a third matching result after the target virtual machine scheduling tag is matched with the third designated cluster tag can be obtained. For other clusters in all third clusters, matching can also be performed in this manner.
[0112] According to all matching results, the target cluster is determined from all candidate clusters, including:
[0113] When the third matching result indicates that the designated purpose subtag in the third designated cluster tag is consistent with the target purpose subtag in the target virtual machine scheduling tag, and the designated user subtag in the third designated cluster tag is consistent with the target user subtag in the target virtual machine scheduling tag, it is determined that the third matching result meets the third matching success requirement corresponding to the third designated cluster; and the third designated cluster is determined as the target cluster.
[0114] Specifically, after obtaining the third matching result, if the third matching result indicates that the specified purpose subtag in the third specified cluster tag is consistent with the target purpose subtag in the target virtual machine scheduling tag, and the specified user subtag in the third specified cluster tag is consistent with the target user subtag in the target virtual machine scheduling tag, then it can be determined that the second matching result meets the second matching success requirement corresponding to the second specified cluster.
[0115] The designated user sub-tag may be a sub-tag in the third designated cluster tag used to indicate the purpose of the cluster: for example, big data, cloud server type, database type, etc.
[0116] The target usage sub-label in the target VM scheduling label is used to indicate the usage that the VM to be scheduled should satisfy: for example, big data, cloud server type, database type, etc.
[0117] The designated user sub-tag in the third designated cluster tag is used to indicate information about users in the third designated cluster.
[0118] The target user sub-tag in the target virtual machine scheduling tag is used to indicate the information of the user corresponding to the virtual machine to be scheduled.
[0119] After determining that the third matching result meets the third matching success requirement corresponding to the third designated cluster, the second designated cluster may be determined as the target cluster.
[0120] The step S103 determines the target computing node to which the virtual machine to be scheduled needs to be scheduled in the target cluster, including:
[0121] In the third designated cluster label, a computing node label uniquely corresponding to the designated purpose sub-label and the designated user sub-label is determined; and a computing node indicated by the computing node label is determined as a target computing node.
[0122] Furthermore, after determining the third designated cluster as the target cluster, all candidate computing node labels corresponding to the designated purpose sub-label can be determined according to the correspondence between the designated purpose sub-label and the computing node, and then, according to the correspondence between users and computing nodes in the third designated cluster and the target user sub-label in the target virtual machine scheduling label, the computing node label corresponding to the target user sub-label can be determined from all candidate computing node labels, and then the computing node indicated by the computing node label can be determined as the target computing node.
[0123] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM (Read-Only Memory) / RAM (Random Access Memory), a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0125] According to another aspect of an embodiment of the present application, a virtual machine scheduling device for implementing the above virtual machine scheduling method is also provided. Figure 7 is a structural block diagram of an optional virtual machine scheduling device according to an embodiment of the present application, such as Figure 7 As shown, the device may include:
[0126] Acquisition module 1, used to obtain the target virtual machine scheduling tag of the virtual machine to be scheduled, wherein the target virtual machine scheduling tag is used to indicate the computing node type of the computing node to which the virtual machine to be scheduled needs to be scheduled;
[0127] Cluster determination module 2, used to determine the target cluster corresponding to the virtual machine to be scheduled according to the target virtual machine scheduling label and the cluster label of each candidate cluster, wherein the cluster label is used to correspond to one or more computing node types;
[0128] The node determination module 3 is used to determine the target computing node to which the virtual machine to be scheduled needs to be scheduled in the target cluster;
[0129] The scheduling module 4 is used to schedule the virtual machine to be scheduled to the target computing node.
[0130] It should be noted that the acquisition module 1 in this embodiment can be used to execute the above step S101, the cluster determination module 2 in this embodiment can be used to execute the above step S102, the node determination module 3 in this embodiment can be used to execute the above step S103, and the scheduling module 4 in this embodiment can be used to execute the above step S104.
[0131] The device in this embodiment, in addition to the above modules, may also include a module for executing any method in any of the aforementioned virtual machine scheduling method embodiments.
[0132] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be run in Figure 1 In the hardware environment shown, it can be implemented by software or by hardware, wherein the hardware environment includes a network environment.
[0133] According to another aspect of an embodiment of the present application, an electronic device for implementing the above-mentioned virtual machine scheduling method is also provided. The electronic device may be a server, a terminal, or a combination thereof.
[0134] According to another embodiment of the present application, there is also provided an electronic device, including: Figure 8 As shown, the electronic device may include: a processor 1501 , a communication interface 1502 , a memory 1503 and a communication bus 1504 , wherein the processor 1501 , the communication interface 1502 , and the memory 1503 communicate with each other via the communication bus 1504 .
[0135] Memory 1503, used for storing computer programs;
[0136] The processor 1501 is used to implement the following steps when executing the program stored in the memory 1503:
[0137] Step S101, obtaining a target virtual machine scheduling tag of a virtual machine to be scheduled, wherein the target virtual machine scheduling tag is used to indicate a computing node type of a computing node to which the virtual machine to be scheduled needs to be scheduled.
[0138] Step S102: determining a target cluster corresponding to the virtual machine to be scheduled according to the target virtual machine scheduling label and the cluster label of each candidate cluster, wherein the cluster label is used to correspond to one or more computing node types.
[0139] Step S103: in the target cluster, determine the target computing node to which the virtual machine to be scheduled needs to be scheduled.
[0140] Step S104, scheduling the virtual machine to be scheduled to the target computing node.
[0141] Optionally, in this embodiment, the above-mentioned communication bus can be a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used for communication between the above-mentioned electronic device and other devices.
[0142] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0143] As an example, the memory 1503 may include but is not limited to the acquisition module 1, cluster determination module 2, determination module 3 and scheduling module 4 in the virtual machine scheduling device. In addition, it may also include but is not limited to other module units in the virtual machine scheduling device, which will not be repeated in this example.
[0144] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0145] An embodiment of the present application further provides a computer-readable storage medium, the storage medium including a stored program, wherein the method steps of the above method embodiment are executed when the program is run.
[0146] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.
[0147] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0148] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0149] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0150] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0151] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.
[0152] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0153] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A virtual machine scheduling method, characterized in that: include: Obtain a target virtual machine scheduling tag of the virtual machine to be scheduled, wherein the target virtual machine scheduling tag is used to indicate the computing node type of the computing node to which the virtual machine to be scheduled needs to be scheduled; Determine a target cluster corresponding to the virtual machine to be scheduled according to the target virtual machine scheduling label and the cluster label of each candidate cluster, wherein the cluster label is used to correspond to one or more computing node types; In the target cluster, determining the target computing node to which the virtual machine to be scheduled needs to be scheduled; Schedule the virtual machine to be scheduled to the target computing node.
2. The method according to claim 1, characterized in that The step of determining a target cluster corresponding to the virtual machine to be scheduled according to the target virtual machine scheduling label and the cluster label of each candidate cluster includes: Matching the candidate cluster label of each candidate cluster with the target virtual machine scheduling label to obtain a matching result corresponding to each candidate cluster; According to all the matching results, the target cluster is determined from all the candidate clusters, wherein the target matching results corresponding to the target cluster meet the matching success requirements corresponding to the target cluster.
3. The method according to claim 2, characterized in that Before determining the target cluster corresponding to the virtual machine to be scheduled according to the target virtual machine scheduling tag and the cluster tag of each candidate cluster, the method further includes: When the candidate cluster is a first cluster, obtaining a first cluster label of the candidate cluster, wherein the first cluster supports multiple computing node types; When the candidate cluster is a second cluster, obtaining a second cluster label of the candidate cluster, wherein the second cluster supports only one corresponding computing node type; In the case that the candidate cluster is the third cluster, a third cluster label of the candidate cluster is acquired, wherein the third cluster label includes a correspondence between users and computing nodes.
4. The method according to claim 3, characterized in that The step of matching the candidate cluster label of each candidate cluster with the target virtual machine scheduling label to obtain a matching result corresponding to each candidate cluster includes: When the type of the target virtual machine scheduling tag is a first scheduling tag, matching the target virtual machine scheduling tag with a first designated cluster tag of a first designated cluster to obtain a first matching result corresponding to the first designated cluster, wherein the first designated cluster is any first cluster among all first clusters; Determining the target cluster from all candidate clusters according to all matching results includes: When the first matching result indicates that the first designated cluster tag includes the target virtual machine scheduling tag, determining that the first matching result satisfies a first matching success requirement corresponding to the first designated cluster; The first designated cluster is determined as the target cluster.
5. The method according to claim 3, characterized in that: The step of matching the candidate cluster label of each candidate cluster with the target virtual machine scheduling label to obtain a matching result corresponding to each candidate cluster includes: When the type of the target virtual machine scheduling tag is a second scheduling tag, matching the target virtual machine scheduling tag with a second designated cluster tag of a second designated cluster to obtain a second matching result corresponding to the second designated cluster, wherein the second designated cluster is any second cluster among all second clusters; Determining the target cluster from all candidate clusters according to all matching results includes: When the second matching result indicates that the second designated cluster tag is completely consistent with the target virtual machine scheduling tag, determining that the second matching result meets a second matching success requirement corresponding to the second designated cluster; The second designated cluster is determined as the target cluster.
6. The method according to claim 3, characterized in that The step of matching the candidate cluster label of each candidate cluster with the target virtual machine scheduling label to obtain a matching result corresponding to each candidate cluster includes: When the type of the target virtual machine scheduling tag is a third scheduling tag, matching the target virtual machine scheduling tag with a third designated cluster tag of a third designated cluster to obtain a third matching result corresponding to the third designated cluster, wherein the third designated cluster is any one of all third clusters; Determining the target cluster from all candidate clusters according to all matching results includes: When the third matching result indicates that the designated usage subtag in the third designated cluster tag is consistent with the target usage subtag in the target virtual machine scheduling tag, and the designated user subtag in the third designated cluster tag is consistent with the target user subtag in the target virtual machine scheduling tag, it is determined that the third matching result meets the third matching success requirement corresponding to the third designated cluster; The third designated cluster is determined as the target cluster.
7. The method according to claim 6, characterized in that Determining, in the target cluster, a target computing node to which the virtual machine to be scheduled needs to be scheduled includes: In the third designated cluster label, determine the computing node label that uniquely corresponds to the designated purpose sub-label and the designated user sub-label; The computing node indicated by the computing node label is determined as the target computing node.
8. A virtual machine scheduling device, characterized in that: include: An acquisition module, used to acquire a target virtual machine scheduling tag of a virtual machine to be scheduled, wherein the target virtual machine scheduling tag is used to indicate a computing node type of a computing node to which the virtual machine to be scheduled needs to be scheduled; A cluster determination module, configured to determine a target cluster corresponding to the virtual machine to be scheduled according to the target virtual machine scheduling label and the cluster label of each candidate cluster, wherein the cluster label is used to correspond to one or more computing node types; A node determination module, used to determine, in the target cluster, the target computing node to which the virtual machine to be scheduled needs to be scheduled; The scheduling module is used to schedule the virtual machine to be scheduled to the target computing node.
9. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein: The processor, the communication interface and the memory communicate with each other via the communication bus, wherein: The memory is used to store computer programs; The processor is configured to execute the method steps of any one of claims 1 to 7 by running the computer program stored in the memory.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method steps described in any one of claims 1 to 7 when run.
