Method and device for restarting hosts in batches and storage medium

Through the method of batch division and simulated live migration evaluation, the problem of long interruption time of virtual machine services is solved, the restart operation of virtual machine services without interruption is realized, the upgrade time is reduced, and the service reliability is improved.

CN118694675APending Publication Date: 2024-09-24HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310333863.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-24
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

In the existing technology, when the host is restarted, the virtual machine service is interrupted for too long, resulting in reduced service reliability and unable to effectively reduce the upgrade time.

Method used

By dividing the batches and simulating live migration evaluation according to the anti-affinity relationship of virtual machines and the maximum number of virtual machines that can be shut down by a network element, the target classification results are determined, the restart operation of virtual machine services is achieved without interruption, and the upgrade time is reduced.

Benefits of technology

This ensures that the business is not interrupted during the upgrade process, minimizes the upgrade time, and improves the reliability and efficiency of the business.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000
    Figure 00000000_0000
Patent Text Reader

Abstract

The embodiment of the invention provides a method and device for restarting hosts in batches and a storage medium. The method comprises the following steps: obtaining various classification results between hosts and virtual machines in a cloud OS to be restarted and conflicting virtual machines corresponding to hosts of each batch number in each classification result according to a virtual machine anti-affinity relationship, a corresponding relationship between the virtual machines and the hosts and a maximum number proportion of virtual machines which can be turned off by a network element; simulation live migration evaluation is conducted on conflicting virtual machines corresponding to hosts of each batch number of each classification result in the multiple classification results, so that a target classification result is obtained, and the target classification result is that the number of batches in the multiple classification results is the smallest. The conflicting virtual machines corresponding to the hosts of each batch can be migrated to the classification results of the hosts of other batches; and restarting each batch of hosts on the cloud OS according to the target classification result. Therefore, the duration required by the service can be reduced, and the service is ensured not to be interrupted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a method and device for batch restarting hosts, and a storage medium. Background Art

[0002] Network Function Virtualization (NFV) technology can be simply understood as migrating the functions of various network elements used in telecommunications networks from current dedicated hardware platforms to general-purpose commercial-off-the-shelf (COTS) servers. Through NFV technology, various network elements used in telecommunications networks are transformed into independent applications, which can be flexibly deployed on a unified infrastructure platform built on standard servers, storage, switches and other devices. Through virtualization technology, the infrastructure hardware equipment resources are pooled and virtualized, and virtual resources are provided to upper-layer applications to achieve application and hardware decoupling, so that each application can quickly increase virtual resources to achieve the purpose of rapidly expanding system capacity, or can quickly reduce virtual resources to achieve the purpose of shrinking system capacity, greatly improving the elasticity of the network. Using general-purpose COTS servers to form a shared resource pool, newly developed services do not need to deploy hardware equipment separately, greatly shortening the time it takes to launch new services.

[0003] The foundation of NFV technology includes cloud computing technology and virtualization technology. General COTS computing / storage / network hardware devices can be decomposed into multiple virtual resources through virtualization technology for use by various upper-layer applications. Through virtualization technology, the decoupling between applications and hardware is achieved, which greatly increases the speed of virtual resource provision; through cloud computing technology, the elastic scaling of applications can be achieved, and virtual resources can be matched with business loads, which not only improves the utilization efficiency of virtual resources, but also improves the response rate of the system.

[0004] In the prior art, all virtual machines on the host are shut down in advance, and after the host is restarted to take effect to the higher version, these shut down virtual machines are started. For example, there are 4 hosts, and 2 virtual machines are deployed on each host. Step 1: Shut down all virtual machines on the 4 hosts. Step 2: Restart the 4 hosts and upgrade the cloud OS to a higher version. Step 3: Start all virtual machines on the 4 hosts. However, in this way, after shutting down the virtual machines, the services provided by all virtual machines are interrupted for more than 30 minutes, and the entire service site needs to be switched to other sites, which reduces service reliability. Summary of the invention

[0005] The present application discloses a method and device for batch restarting hosts, and a storage medium, which can reduce the time required for services while ensuring uninterrupted services.

[0006] In a first aspect, an embodiment of the present application provides a method for restarting hosts in batches. The method may include:

[0007] According to the anti-affinity relationship of the virtual machines, the correspondence between the virtual machines and the hosts, and the ratio of the maximum number of virtual machines that can be shut down by the network element, multiple classification results between the hosts and the virtual machines in the cloud operating system OS to be restarted and the conflicting virtual machines corresponding to each batch of hosts in each classification result are obtained, wherein the batch number of hosts corresponding to each classification result is different, and each batch of hosts includes at least one host;

[0008] Performing simulated hot migration evaluation on the conflicting virtual machines corresponding to each batch of hosts of each classification result in the multiple classification results to obtain a target classification result, wherein the target classification result is a classification result with the least batch number among the multiple classification results, and the conflicting virtual machines corresponding to the hosts of each batch can all be migrated to hosts of other batches;

[0009] Restart each batch of hosts on the cloud OS according to the target classification result.

[0010] In the embodiment of the present application, multiple classification results between the host and the virtual machine in the cloud OS to be restarted and the conflicting virtual machines corresponding to each batch of hosts in each classification result are obtained according to the anti-affinity relationship of the virtual machine and the ratio of the maximum number of virtual machines that can be shut down by the network element, and the conflicting virtual machines corresponding to each batch of hosts in each classification result are simulated hot migration evaluations are performed respectively, and the target classification result with the least batch number and meeting the resource requirements is determined. Then, according to the target classification result, each batch of hosts on the cloud OS is restarted respectively. By adopting this method, by introducing batch division and batch compression algorithms (such as greedy algorithms or convex optimization algorithms, etc.), it is ensured that the virtual machine business is not affected when the cloud OS is upgraded, and at the same time, the upgrade time is minimized. Alternatively, when the operation and maintenance operations of the stopped operation and maintenance servers and other cloud OS operations that require batch restart of the hosts are carried out, it can also ensure that the business is lossless and the time required for the business is the shortest.

[0011] In a possible implementation, the method of obtaining multiple classification results between hosts and virtual machines in the cloud operating system OS to be restarted and conflicting virtual machines corresponding to each batch of hosts in each classification result according to the virtual machine anti-affinity relationship, the corresponding relationship between the virtual machine and the host, and the ratio of the maximum number of virtual machines that can be shut down by the network element includes:

[0012] According to the anti-affinity relationship of the virtual machines, the corresponding relationship between the virtual machines and the hosts, and the ratio of the maximum number of virtual machines that can be shut down by the network element, N classification results and the conflicting virtual machines corresponding to each batch of hosts in each classification result in the N classification results are obtained;

[0013] Among them, for the i-th classification result:

[0014] Obtaining a batch with the least number of hosts in the i-th classification result, where i is not less than 1;

[0015] According to the conflicting virtual machines corresponding to the hosts in each batch of the i-th classification result, the hosts in the batch with the least number of hosts are transferred to the target batch to obtain the i+1-th classification result and the conflicting virtual machines corresponding to the hosts in each batch of the i+1-th classification result, the batch number of the i+1-th classification result is less than the batch number of the i-th classification result, the target batch is the other batches in the i-th classification result except the batch with the least number of hosts, and the hosts in the batch with the least number of hosts have the least conflicting virtual machines with the hosts in the target batch;

[0016] If i+1 is less than the preset value, set i=i+1 and repeat the above steps; if the i+1 is equal to the preset value, obtain multiple classification results between the network element virtual machines and the conflicting virtual machines corresponding to each batch of hosts in each classification result, wherein when i=1, the first classification result is the classification result with the largest batch number.

[0017] In this example, for example, the cloud server first obtains the classification result with the largest batch number. For example, the classification result with the largest batch number can meet the anti-affinity relationship of virtual machines and the principle of the maximum ratio of the number of virtual machines that can be shut down by the network element. Then, based on the classification result, processing is performed to obtain the classification result with the second largest batch number, and then processing is performed based on the classification result with the second largest batch number to obtain a classification result with a batch number smaller than the previous classification result. By analogy, multiple classification results can be obtained.

[0018] In a possible implementation, the method of obtaining multiple classification results between hosts and virtual machines in the cloud operating system OS to be restarted and conflicting virtual machines corresponding to each batch of hosts in each classification result according to the virtual machine anti-affinity relationship, the corresponding relationship between the virtual machine and the host, and the ratio of the maximum number of virtual machines that can be shut down by the network element includes:

[0019] Based on the anti-affinity relationship of virtual machines, the corresponding relationship between virtual machines and hosts, the maximum ratio of the number of virtual machines that can be shut down by the network element, and multiple preset values, multiple classification results between hosts and virtual machines in the cloud operating system OS to be restarted and the conflicting virtual machines corresponding to each batch of hosts in each classification result are obtained, and the multiple preset values ​​correspond to the multiple classification results.

[0020] In this example, by setting multiple preset values, multiple classification results can be obtained based on the anti-affinity relationship of virtual machines, the correspondence between virtual machines and hosts, and the maximum ratio of the number of virtual machines that can be shut down by the network element. For example, through the convex optimization algorithm, the hosts are repeatedly iterated and combined to minimize the number of batches of hosts and the number of conflicting virtual machines, thereby obtaining multiple classification results.

[0021] In a possible implementation, the performing of simulated hot migration evaluation on conflicting virtual machines corresponding to each batch of hosts of each classification result in the multiple classification results to obtain a target classification result includes:

[0022] Performing simulated hot migration evaluation on conflicting virtual machines corresponding to each batch of hosts of each classification result in the plurality of classification results in ascending order of batch number, so as to obtain a target classification result;

[0023] Wherein, when performing simulated thermal migration evaluation on the j-th classification result among the multiple classification results:

[0024] Simulating hot migration of conflicting virtual machines corresponding to each batch of hosts in the j-th classification result in turn;

[0025] Among them, if the j-th classification result does not satisfy that the conflicting virtual machines corresponding to each batch of hosts respectively correspond to target hosts, let j=j+1, and repeat the above steps; if the conflicting virtual machines corresponding to each batch of hosts in the j-th classification result respectively correspond to target hosts, take the j-th classification result as the target classification result, wherein the target host and the host corresponding to the conflicting virtual machine are from different batches, and the remaining resources corresponding to the target host are not less than the migration resources corresponding to the conflicting virtual machine; when j=1, the first classification result is the classification result with the least number of batches among the multiple classification results.

[0026] In this example, the best batch is selected by evaluating whether there are sufficient resources on other batches of hosts in the existing network environment to meet the hot migration conditions of the conflicting virtual machines in the batch of hosts to be restarted. The batch number corresponding to the best batch is the smallest among the batch numbers corresponding to the above multiple classification results. This ensures that the upgrade time is the shortest without loss of business.

[0027] In a second aspect, the present application provides a device for restarting hosts in batches, comprising:

[0028] A partitioning module is used to obtain multiple classification results between hosts and virtual machines in the cloud operating system OS to be restarted and conflicting virtual machines corresponding to each batch of hosts in each classification result according to the anti-affinity relationship of the virtual machines, the corresponding relationship between the virtual machines and the hosts, and the ratio of the maximum number of virtual machines that can be shut down by the network element, wherein the batch number of hosts corresponding to each classification result is different, and each batch of hosts includes at least one host;

[0029] An evaluation module is used to simulate hot migration evaluation of conflicting virtual machines corresponding to each batch of hosts of each classification result in the multiple classification results to obtain a target classification result, wherein the target classification result is a classification result with the least batch number among the multiple classification results, and the conflicting virtual machines corresponding to the hosts of each batch can be migrated to hosts of other batches;

[0030] An operation module is used to restart each batch of hosts on the cloud OS according to the target classification result.

[0031] In a possible implementation, the partitioning module is used to:

[0032] According to the anti-affinity relationship of the virtual machines, the corresponding relationship between the virtual machines and the hosts, and the ratio of the maximum number of virtual machines that can be shut down by the network element, N classification results and the conflicting virtual machines corresponding to each batch of hosts in each classification result in the N classification results are obtained;

[0033] Among them, for the i-th classification result:

[0034] Obtaining a batch with the least number of hosts in the i-th classification result, where i is not less than 1;

[0035] According to the conflicting virtual machines corresponding to the hosts in each batch of the i-th classification result, the hosts in the batch with the least number of hosts are transferred to the target batch to obtain the i+1-th classification result and the conflicting virtual machines corresponding to the hosts in each batch of the i+1-th classification result, the batch number of the i+1-th classification result is less than the batch number of the i-th classification result, the target batch is the other batches in the i-th classification result except the batch with the least number of hosts, and the hosts in the batch with the least number of hosts have the least conflicting virtual machines with the hosts in the target batch;

[0036] If i+1 is less than the preset value, set i=i+1 and repeat the above steps; if the i+1 is equal to the preset value, obtain multiple classification results between the network element virtual machines and the conflicting virtual machines corresponding to each batch of hosts in each classification result, wherein when i=1, the first classification result is the classification result with the largest batch number.

[0037] In a possible implementation, the partitioning module is used to:

[0038] Based on the anti-affinity relationship of virtual machines, the corresponding relationship between virtual machines and hosts, the maximum ratio of the number of virtual machines that can be shut down by the network element, and multiple preset values, multiple classification results between hosts and virtual machines in the cloud operating system OS to be restarted and the conflicting virtual machines corresponding to each batch of hosts in each classification result are obtained, and the multiple preset values ​​correspond to the multiple classification results.

[0039] In a possible implementation, the evaluation module is used to:

[0040] Performing simulated hot migration evaluation on conflicting virtual machines corresponding to each batch of hosts of each classification result in the plurality of classification results in ascending order of batch number, so as to obtain a target classification result;

[0041] Wherein, when performing simulated thermal migration evaluation on the j-th classification result among the multiple classification results:

[0042] Simulating hot migration of conflicting virtual machines corresponding to each batch of hosts in the j-th classification result in turn;

[0043] Among them, if the j-th classification result does not satisfy that the conflicting virtual machines corresponding to each batch of hosts respectively correspond to target hosts, let j=j+1, and repeat the above steps; if the conflicting virtual machines corresponding to each batch of hosts in the j-th classification result respectively correspond to target hosts, take the j-th classification result as the target classification result, wherein the target host and the host corresponding to the conflicting virtual machine are from different batches, and the remaining resources corresponding to the target host are not less than the migration resources corresponding to the conflicting virtual machine; when j=1, the first classification result is the classification result with the least number of batches among the multiple classification results.

[0044] In a third aspect, the present application provides a device for batch restarting hosts, comprising a processor and a memory; wherein the memory is used to store program code, and the processor is used to call the program code to execute a method provided in any possible implementation manner of the first aspect.

[0045] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor as a method provided in any possible implementation manner of the first aspect.

[0046] In a fifth aspect, the present application provides a computer program product, which, when executed on a computer, enables the computer to execute a method provided in any possible implementation of the first aspect.

[0047] In a sixth aspect, the present application provides a chip system, which is applied to an electronic device; the chip system includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through lines; the interface circuit is used to receive a signal from a memory of the electronic device and send the signal to the processor, the signal including computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device executes a method provided in any possible implementation manner of the first aspect.

[0048] It can be understood that the device described in the second aspect, the device described in the third aspect, the computer storage medium described in the fourth aspect, the computer program product described in the fifth aspect, or the chip system described in the sixth aspect are all used to execute any method provided in the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The following is an introduction to the drawings used in the embodiments of the present application.

[0050] Figure 1a It is a schematic diagram of the architecture of a system for batch restarting hosts provided in an embodiment of the present application;

[0051] Figure 1b It is a schematic diagram of the architecture of another system for batch restarting hosts provided in an embodiment of the present application;

[0052] Figure 2 It is a flowchart of a method for restarting hosts in batches provided in an embodiment of the present application;

[0053] Figure 3 It is a schematic diagram of a method for simulating thermal migration assessment provided in an embodiment of the present application;

[0054] Figure 4 It is a flowchart of a method for batch upgrading hosts provided in an embodiment of the present application;

[0055] Figure 5 It is a flowchart of a method for batch replacing servers that have stopped operation and maintenance provided by an embodiment of the present application;

[0056] Figure 6 It is a structural diagram of a device for batch restarting hosts provided in an embodiment of the present application;

[0057] Figure 7 It is a structural diagram of another device for batch restarting hosts provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method part of the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.

[0059] For ease of understanding, the following examples provide some explanations of concepts related to the embodiments of the present application for reference. As described below:

[0060] 1. Virtual machine hot migration: Migrate a virtual machine from one physical server to another. During the migration process, the virtual machine service will not be affected.

[0061] 2. Hard-wired network card to virtual machine: Mapping the physical network card directly to the virtual machine can improve the network forwarding performance of the virtual machine.

[0062] 3. Local hard disk virtual machine: A virtual machine whose operating system is deployed on the local disk of a physical server.

[0063] 4. Non-Uniform Memory Access (NUMA)-friendly virtual machines: If virtual machines are deployed across NUMA nodes, it will cause more performance loss. NUMA-friendly virtual machines can support automatic NUMA initial placement and load balancing of virtual machines, distributing the virtual CPU and memory of the virtual machine within a NUMA node to reduce memory access latency and improve performance.

[0064] 5. Anti-affinity virtual machines: virtual machines that cannot be deployed on the same physical host.

[0065] 6. Cloud Operating System (OS): Also known as cloud computing operating system or cloud computing center operating system, it is an operating system supported by cloud computing and cloud storage technology, and is the overall management and operation system of the cloud computing backend data center. It refers to a cloud platform integrated management system that manages massive amounts of basic hardware and software resources, built on basic hardware resources such as servers, storage, and networks, and basic software such as stand-alone operating systems, middleware, and databases.

[0066] The above exemplary description of the concepts can be applied in the following embodiments.

[0067] The prior art requires shutting down all virtual machines when restarting the host. This results in a long service interruption time for all virtual machines, and reduces service reliability. In view of this, the present application provides a method for restarting hosts in batches, which can reduce the upgrade time while ensuring uninterrupted services.

[0068] The following will describe the system architecture of the embodiment of the present application in detail with reference to the accompanying drawings. Figure 1a , Figure 1a1 is a schematic diagram of the architecture of a system for batch restarting hosts applicable to an embodiment of the present application. The system may be a server, for example, the server includes a software layer and a hardware layer. The software layer includes a virtual machine and a host operating system. The hardware layer includes a processor, a memory, a peripheral component interconnect standard (PCI) device, and a disk. The processor, memory, PCI device, and disk all communicate via a bus.

[0069] See also Figure 1b , Figure 1b It is a schematic diagram of another system for batch restarting hosts applicable to an embodiment of the present application, and the system includes a batch calculation module of a server. Among them, the corresponding relationship between VM and host, the anti-affinity relationship of VM and the maximum ratio of virtual machines that can be shut down by the network element are provided to the batch calculation module of the server. So that the batch calculation module of the server can process based on the above information, and then output the host batch relationship (i.e., the multiple classification results below) and the conflicting virtual machine relationship in each batch of hosts. For example, the conflicting virtual machine relationship in each batch of hosts can be displayed in the form of a list of conflicting virtual machines in each batch.

[0070] The architecture of the embodiment of the present application is described above, and the method of the embodiment of the present application is described in detail below.

[0071] Reference Figure 2 FIG. 1 is a flow chart of a method for batch restarting hosts provided by an embodiment of the present application. Optionally, the method can be applied to the aforementioned system for batch restarting hosts, for example Figure 1a Restart the host systems in batches as shown. Figure 2 The method for restarting hosts in batches shown may include steps 201-203. It should be understood that for the convenience of description, this application is described in the order of 201-203, and is not intended to limit execution to the above order. The embodiment of the present application does not limit the order of execution, execution time, number of executions, etc. of the above one or more steps. The following description takes the execution subject of steps 201-203 of the method for restarting hosts in batches as a server as an example, and this application is also applicable to other execution subjects. Steps 201-203 are as follows:

[0072] 201. Based on the anti-affinity relationship of virtual machines, the corresponding relationship between virtual machines and hosts, and the ratio of the maximum number of virtual machines that can be shut down by the network element, obtain multiple classification results between the hosts and virtual machines in the cloud OS to be restarted and the conflicting virtual machines corresponding to each batch of hosts in each classification result, wherein the batch number of hosts corresponding to each classification result is different, and each batch of hosts contains at least one host.

[0073] The virtual machine anti-affinity relationship can be understood as virtual machines that cannot be deployed on the same physical host. For example, virtual machine A and virtual machine B are in an anti-affinity relationship and cannot be deployed on a host at the same time.

[0074] In a possible implementation, the virtual machine anti-affinity type may include the following two categories:

[0075] 1. Primary and backup virtual machines: One virtual machine carries all services, and the other virtual machine serves as a backup. When the primary virtual machine fails, the services are switched to the backup virtual machine.

[0076] 2. Load balancing virtual machines: All virtual machines carry all services. When some virtual machines are abnormal, the remaining virtual machines carry all services.

[0077] The cloud server divides the primary and backup virtual machines into different batches so that when the primary virtual machine is powered off, the service is switched to the backup virtual machine. The cloud server divides the load balancing virtual machines into different batches so that when 30% of the virtual machines are powered off, the remaining 70% of the virtual machines carry 100% of the service.

[0078] That is, the virtual machines are divided into batches based on the virtual machine anti-affinity type so that they satisfy the virtual machine anti-affinity relationship.

[0079] The correspondence between the virtual machine and the host, for example, virtual machine A is deployed on host A', then virtual machine A corresponds to host A'.

[0080] The maximum ratio of the number of virtual machines that can be shut down by the network element can be understood as the ratio between the number of virtual machines that can be shut down by the network element and the total number of such virtual machines.

[0081] When performing virtual machine batch division, the virtual machine batch division can be achieved based on the anti-affinity relationship of the virtual machines and the maximum ratio of the number of virtual machines that can be shut down by the network element.

[0082] In a possible implementation, after the virtual machine batches are divided, the hosts are also divided into batches, so that a variety of classification results can be obtained. For example, there are 8 hosts, namely host 1, host 2, host 3, host 4, host 5, host 6, host 7 and host 8. One of the classification results can be host 1 / host 2 and host 3 / host 4, host 5 and host 6 / host 7 and host 8. This classification result divides the 8 hosts into four batches, that is, this classification result includes four batches of hosts. For another example, another classification result can be host 5 / host 1, host 3, host 4 and host 8 / host 2, host 6 and host 7. This classification result divides the 8 hosts into three batches, that is, this classification result includes three batches of hosts. The above is only an example, and it can also be other division methods, which are not limited by this solution.

[0083] As shown in Table 1, this is a classification result provided in an embodiment of the present application.

[0084] Table 1

[0085]

[0086] In a possible implementation, the cloud server can use greedy algorithms, convex optimization algorithms, etc. to divide various virtual machines into the smallest possible host range. According to the results of the divided batches, the hosts are restarted separately to make the higher version of the cloud OS effective. Among them, the more batches, the longer the upgrade time. The fewer batches, the shorter the upgrade time.

[0087] For example, in the first possible implementation, the cloud server may use a greedy algorithm to divide the classification results. Specifically:

[0088] According to the anti-affinity relationship of the virtual machines, the correspondence between the virtual machines and the hosts, and the ratio of the maximum number of virtual machines that can be shut down by the network element, N classification results and the conflicting virtual machines corresponding to each batch of hosts in each classification result in the N classification results are obtained in sequence;

[0089] Among them, for the i-th classification result:

[0090] Obtaining a batch with the least number of hosts in the i-th classification result, where i is not less than 1;

[0091] According to the conflicting virtual machines corresponding to the hosts in each batch of the i-th classification result, the hosts in the batch with the least number of hosts are transferred to the target batch to obtain the i+1-th classification result and the conflicting virtual machines corresponding to the hosts in each batch of the i+1-th classification result, the batch number of the i+1-th classification result is less than the batch number of the i-th classification result, the target batch is the other batches in the i-th classification result except the batch with the least number of hosts, and the hosts in the batch with the least number of hosts have the least conflicting virtual machines with the hosts in the target batch;

[0092] If i+1 is less than the preset value, set i=i+1 and repeat the above steps; if the i+1 is equal to the preset value, obtain multiple classification results between the network element virtual machines and the conflicting virtual machines corresponding to each batch of hosts in each classification result, wherein when i=1, the first classification result is the classification result with the largest batch number.

[0093] That is to say, the cloud server first obtains the classification result with the largest batch number. For example, the classification result with the largest batch number can meet the principle of virtual machine anti-affinity relationship and the maximum ratio of virtual machines that can be shut down by the network element. Then, based on the classification result, processing is performed to obtain the classification result with the second largest batch number, and then processing is performed based on the classification result with the second largest batch number to obtain the classification result with a batch number smaller than the previous classification result. And so on, multiple classification results can be obtained.

[0094] Among them, the above-mentioned classification result based on the largest batch number is processed to obtain the classification result with the second largest batch number. For example, the hosts in the batch with the least number of hosts in the classification result with the largest batch number can be divided into other batches in the classification result with the largest batch number, so that a new batch result can be obtained, and the batch number corresponding to the new batch result is less than the classification result with the largest batch number. Optionally, when the hosts in the batch with the least number of hosts in the classification result with the largest batch number are divided into other batches in the classification result with the largest batch number, the batch with the least conflicting virtual machines corresponding to the hosts in the batch is selected so that the hosts in the batch with the least number of hosts can be divided into the batch. And so on, multiple classification results can be obtained. The number of host batches contained in the multiple classification results is different. Of course, the number of host batches contained in the multiple classification results can also be the same. For example, for the classification result with an arbitrary batch number such as 5, there can be multiple division methods, and this scheme does not impose strict restrictions on this.

[0095] Among them, after the host is added to other batches, the virtual machines on the host that have active and standby virtual machines and are in the same batch and have a load balancing ratio of more than 30% are marked as conflicting virtual machines until all hosts in the batch are re-divided into other batches.

[0096] Optionally, the above steps are repeated until three batches are optimized. That is, the iteration is stopped when the hosts are divided into three batches. Then, multiple classification results and conflicting virtual machines corresponding to each classification result are obtained.

[0097] For example, in the second possible implementation, the cloud server may use a convex optimization algorithm to divide the classification results. Specifically:

[0098] Based on the anti-affinity relationship of virtual machines, the corresponding relationship between virtual machines and hosts, the maximum ratio of the number of virtual machines that can be shut down by the network element, and multiple preset values, multiple classification results between hosts and virtual machines in the cloud operating system OS to be restarted and the conflicting virtual machines corresponding to each batch of hosts in each classification result are obtained, and the multiple preset values ​​correspond to the multiple classification results.

[0099] The multiple preset values ​​may be, for example, integers such as 3, 4, 5, etc. Based on each different preset value, classification results containing different batch quantities may be obtained.

[0100] In this example, by setting multiple preset values, multiple classification results can be obtained at the same time based on the anti-affinity relationship of the virtual machine, the corresponding relationship between the virtual machine and the host, and the maximum ratio of the number of virtual machines that can be shut down by the network element. For example, through the convex optimization algorithm, the hosts are repeatedly iterated and combined to minimize the number of batches of hosts and the number of conflicting virtual machines, thereby obtaining multiple classification results. For the introduction of this part, please refer to the records of the aforementioned embodiments, which will not be repeated here.

[0101] 202. Perform a simulated hot migration evaluation on the conflicting virtual machines corresponding to each batch of hosts in each of the multiple classification results to obtain a target classification result, wherein the target classification result is a classification result with the least batch number among the multiple classification results, and the conflicting virtual machines corresponding to each batch of hosts can be migrated to hosts in other batches.

[0102] Based on the multiple classification results obtained above, a target classification result is determined by processing, so that multiple hosts can be restarted in batches according to the batch divisions corresponding to the target classification results.

[0103] In a possible implementation, the performing of simulated hot migration evaluation on conflicting virtual machines corresponding to each batch of hosts of each classification result in the multiple classification results to obtain a target classification result includes:

[0104] Performing simulated hot migration evaluation on conflicting virtual machines corresponding to each batch of hosts of each classification result in the plurality of classification results in ascending order of batch number, so as to obtain a target classification result;

[0105] Wherein, when performing simulated thermal migration evaluation on the j-th classification result among the multiple classification results:

[0106] Simulating hot migration of conflicting virtual machines corresponding to each batch of hosts in the j-th classification result in turn;

[0107] Among them, if the j-th classification result does not satisfy that the conflicting virtual machines corresponding to each batch of hosts respectively correspond to target hosts, let j=j+1, and repeat the above steps; if the conflicting virtual machines corresponding to each batch of hosts in the j-th classification result respectively correspond to target hosts, take the j-th classification result as the target classification result, wherein the target host and the host corresponding to the conflicting virtual machine are from different batches, and the remaining resources corresponding to the target host are not less than the migration resources corresponding to the conflicting virtual machine; when j=1, the first classification result is the classification result with the least number of batches among the multiple classification results.

[0108] That is to say, simulated hot migration evaluation is first performed from the conflicting virtual machines corresponding to the classification results with a small number of batches. If the hot migration evaluation results of the classification results with a small number of batches meet the preset conditions, the classification results with a small number of batches are directly used as the target classification results. If the hot migration evaluation results of the classification results with a small number of batches do not meet the preset conditions, simulated hot migration evaluation is performed on the conflicting virtual machines corresponding to the classification results with a slightly larger number of batches. For example, the multiple classification results obtained in step 201 may include 16 batches, 15 batches, 14 batches, 13 batches... 4 batches, 3 batches, etc., then simulated hot migration evaluation is first performed from the 3 batches with a small number of batches. If the hot migration evaluation results of the 3 batches do not meet the preset conditions, simulated hot migration evaluation is performed on the 4th batch. If the hot migration evaluation results of the 4th batch do not meet the preset conditions, simulated hot migration evaluation is performed on the 5th batch... Repeat the above steps until the hot migration evaluation results of a certain batch meet the preset conditions, and then the classification results corresponding to the certain batch are determined as the target classification results.

[0109] The above preset conditions are that the target host and the host corresponding to the conflicting virtual machine are in different batches, and the remaining resources corresponding to the target host are not less than the migration resources corresponding to the conflicting virtual machine. In other words, by evaluating whether there are sufficient resources on other batches of hosts in the existing network environment to meet the hot migration conditions of the conflicting virtual machines in the effective batch of the host to be restarted, the best batch can be finally selected. The batch number corresponding to the best batch is the smallest among the batch numbers corresponding to the above multiple classification results. This ensures that the upgrade time is the shortest without loss of business.

[0110] The above example only uses the example of simulating hot migration evaluation of conflicting virtual machines corresponding to each batch of hosts in each of the multiple classification results in order from small to large batch quantity. Other orders can also be used, and this solution does not limit this.

[0111] like Figure 3 As shown, it is a schematic diagram of a method for simulating hot migration evaluation provided by an embodiment of the present application. Among them, the hot migration process of the virtual machine is iterated and simulated according to the virtual machine identity (ID), batch ID and target host list. Within the specific target host range, the host that meets the resource requirements is selected, and finally the target host of all virtual machines to be hot migrated in the global range is output. On the basis of batch compression, the conflicting virtual machines in each batch in each classification result are simulated and estimated for hot migration. Among them, the simulated hot migration estimation method may include the following steps:

[0112] 1. Before upgrading, read all virtual machine specifications and host resource information in the environment from the database and store them in memory.

[0113] The virtual machine specification may be, for example, information such as the central processing unit (CPU), memory, bandwidth, anti-affinity group, etc. of the virtual machine, and the host resource information may be, for example, resource information such as the CPU and memory of each node of the host.

[0114] 2. Perform simulated hot migration of the conflicting virtual machines in the first batch (eg, VM2) in memory, wherein the target host corresponding to VM2 is a list of all hosts not in this batch (eg, the second batch).

[0115] 3. The NUMA information of the source host and the target host of the hot migration are recorded in the memory, and the CPU, memory, bandwidth and other resources of the conflicting virtual machine VM2 are deducted from the source host, and the corresponding resources are increased on the target host.

[0116] The source host NUMA information and the target host NUMA information may be, for example, location information of each CPU hardware. For example, the information may be a CPU number, such as CPU number 2, namely numa2.

[0117] 4. Perform simulated hot migration in memory for the conflicting virtual machines in the second batch (for example, VM5) and VM2 migrated to this batch, and the target host is a list of all hosts not in this batch.

[0118] 5. Similar to step 3, record the virtual machine migration information and increase or decrease the resources of the corresponding host.

[0119] 6. Repeat the above steps to complete the thermal migration simulation and calculation of the remaining batches.

[0120] Based on this, the simulated hot migration estimation of the conflicting virtual machines in each batch of the classification result can be completed. Repeated execution can then determine the target classification result.

[0121] 203. Restart each batch of hosts on the cloud OS according to the target classification result.

[0122] Based on the host batch division results in the target classification results determined above, the hosts in each batch are restarted separately. For example, the batch corresponding to the target classification result is 5, so it takes 5 batches to complete the restart operation of all hosts. Optionally, the hosts in the first batch are restarted first, and then the hosts in the second batch are restarted, and then the hosts in the third batch are restarted, and then the hosts in the fourth batch are restarted, and finally the hosts in the fifth batch are restarted, so as to complete the restart operation of all hosts.

[0123] The restart operation may include restarting all hosts to complete the upgrade, or restarting the host configuration to take effect, or replacing the server that is no longer under maintenance with a new server. This solution does not limit this.

[0124] In the embodiment of the present application, multiple classification results between the host and the virtual machine in the cloud OS to be restarted and the conflicting virtual machines corresponding to each batch of hosts in each classification result are obtained according to the anti-affinity relationship of the virtual machine and the ratio of the maximum number of virtual machines that can be shut down by the network element, and the conflicting virtual machines corresponding to each batch of hosts in each classification result are simulated hot migration evaluations are performed respectively, and the target classification result with the least batch number and meeting the resource requirements is determined. Then, according to the target classification result, each batch of hosts on the cloud OS is restarted respectively. By adopting this method, by introducing batch division and batch compression algorithms (such as greedy algorithms or convex optimization algorithms, etc.), it is ensured that the virtual machine business is not affected when the cloud OS is upgraded, and at the same time, the upgrade time is minimized. Alternatively, when the operation and maintenance operations of the stopped operation and maintenance servers and other cloud OS operations that require batch restart of the hosts are carried out, it can also ensure that the business is lossless and the time required for the business is the shortest.

[0125] Reference Figure 4 FIG. 1 is a flow chart of a method for batch upgrading hosts provided by an embodiment of the present application. Optionally, the method can be applied to the aforementioned system for batch restarting hosts, for example Figure 1a Restart the host systems in batches as shown. Figure 4The method for batch upgrading hosts shown can correspond to the following steps 1-7. It should be understood that for the convenience of description, this application is described in the order of steps 1-7, and is not intended to limit the execution to the above order. The embodiment of the present application does not limit the execution order, execution time, execution number, etc. of the above one or more steps. The following description takes the execution subject of steps 1-7 of the method for batch upgrading hosts as an example, and this application is also applicable to other execution subjects. Steps 1-7 are as follows:

[0126] Step 1. Before upgrading, based on the service anti-affinity relationship between virtual machines collected by the upgrade tool, all hosts are divided into batches by importing them into the batch tool for processing, and multiple classification results and conflicting virtual machines corresponding to the hosts in each batch in each classification result are obtained.

[0127] For an introduction to dividing all hosts into batches, see Figure 2 The description in the illustrated embodiment will not be repeated here.

[0128] It should be noted that the upgrade tool in the embodiment of the present application may be a configuration adjustment module or a server replacement module, etc. The batch tool may be a cloud server or other processing module, etc. This solution does not limit this.

[0129] Step 2. Import the compressed batch results generated by the batch tool into the upgrade tool to evaluate the feasibility of hot migration for reducing batches and automatically calculate the batch with the shortest duration.

[0130] For an introduction to determining the shortest batch, please refer to the above Figure 2 The description in the illustrated embodiment will not be repeated here.

[0131] Step 3. Before the host is restarted, hot migrate a small number of virtual machines to hosts in other batches according to the hot migration estimate results in the batch results.

[0132] For example, according to the hot migration estimation result, the conflicting virtual machines corresponding to the hosts in each batch in the corresponding classification result are migrated to hosts in other batches. Optionally, the conflicting virtual machines on the hosts in the first batch can be migrated to hosts in other batches.

[0133] Step 4. Before the host is restarted, the upgrade tool notifies the virtualized network function module manager (Virtualised Network Function Manager, VNFM) to migrate the virtual machine service data on the hosts in the batch to be upgraded to other batches.

[0134] After migrating the conflicting virtual machines on the hosts of the first batch to the hosts of other batches, the business data of the virtual machines on the hosts of this batch are also migrated to other batches.

[0135] Step 5. Restart the host and upgrade the cloud OS to a higher version.

[0136] After the conflicting virtual machines corresponding to the first batch of hosts are migrated, the first batch of hosts are restarted to upgrade the hosts.

[0137] Step 6. After the host restarts, the upgrade tool notifies VNFM to migrate the migrated service data back to the virtual machines corresponding to the hosts in this batch, completing a batch upgrade process.

[0138] After the host is restarted, the host upgrade is complete. The migrated business data can be further migrated back to the virtual machine corresponding to the host in this batch.

[0139] Step 7. Repeat steps 3 to 6 to complete the upgrade process for other batches.

[0140] For example, conflicting virtual machines corresponding to the second batch, third batch, fourth batch, etc. of hosts are migrated in sequence, so that the hosts in each batch are upgraded respectively.

[0141] This method can ensure that the virtual machine business is not affected when the cloud OS is upgraded, while minimizing the upgrade time.

[0142] Reference Figure 5 FIG. 1 is a flow chart of a method for batch replacing stopped servers provided by an embodiment of the present application. Optionally, the method can be applied to the aforementioned system for batch restarting hosts, for example Figure 1a Restart the host systems in batches as shown. Figure 5 The method for batch replacement of servers shown can correspond to the following steps 1-5. It should be understood that for the convenience of description, this application is described in the order of steps 1-5, and is not intended to limit the execution to the above order. The embodiment of the present application does not limit the order of execution, execution time, number of executions, etc. of the above one or more steps. The following description takes the execution subject of steps 1-5 of the method for batch upgrading hosts as an example of a server, and this application is also applicable to other execution subjects. The method for batch replacement of servers that have stopped operation and maintenance may include the following steps:

[0143] Step 1. According to the plan, expand the capacity of hosts with the same CPU and memory resource capacity in advance and manage them in the same cloud OS.

[0144] Step 2. The host replacement tool collects anti-affinity relationships of virtual machines in the environment.

[0145] Step 3. The host replacement tool imports the collected virtual machine anti-affinity relationships into the batch tool so that the batch tool generates compressed batch results.

[0146] The compressed batch result is Figure 2 The target classification result in the embodiment shown. For the introduction of this part, please refer to the above Figure 2 The description of step 201 and step 202 in the illustrated embodiment will not be repeated here.

[0147] Step 4. Migrate the virtual machines on the host to the new server with expanded capacity in batches.

[0148] Based on the divided batches corresponding to the target classification results, the virtual machines on the host are migrated to the new server with expanded capacity in batches.

[0149] Step 5. Reduce the capacity of the server that has stopped operation and maintenance in the cloud OS.

[0150] This example, based on the batch replacement of stopped operation and maintenance servers, can ensure that the virtual machine business is not affected, while maximizing the reduction of the time required for related business. It should be noted that the embodiment of the present application can also be used for other cloud OS operation and maintenance operations that require batch restart of hosts, and this solution does not limit this.

[0151] It should be noted that in the various embodiments of the present application, unless otherwise specified or there is a logical conflict, the terms and / or descriptions between the various embodiments are consistent and can be referenced mutually, and the technical features in different embodiments can be combined to form new embodiments according to their internal logical relationships.

[0152] The above detailed description of the method of the embodiment of the present application, the following provides a device of the embodiment of the present application. It can be understood that in the various device embodiments of the present application, the division of multiple units or modules is only a logical division according to function, and is not used as a limitation on the specific structure of the device. In a specific implementation, some functional modules may be subdivided into more small functional modules, and some functional modules may also be combined into one functional module, but no matter whether these functional modules are subdivided or combined, the general process performed by the device is the same. For example, some devices contain a receiving unit and a sending unit. In some designs, the sending unit and the receiving unit can also be integrated into a communication unit, which can implement the functions implemented by the receiving unit and the sending unit. Usually, each unit corresponds to its own program code (or program instruction), and when the program code corresponding to each of these units is run on the processor, the unit is controlled by the processing unit to execute the corresponding process to implement the corresponding function.

[0153] The embodiments of the present application also provide a device for implementing any of the above methods. For example, a device for batch restarting hosts is provided, which includes a module (or means) for implementing each step performed by the server in any of the above methods.

[0154] For example, refer to Figure 6 , which is a schematic diagram of the structure of a device for batch restarting hosts provided by an embodiment of the present application. The device for batch restarting hosts is used to implement the aforementioned method for batch restarting hosts, for example Figure 2 , Figure 4 , Figure 5 The method for restarting hosts in batches is shown in the figure.

[0155] like Figure 6 As shown, the device may include a division module 601, an evaluation module 602 and an operation module 603, which are specifically as follows:

[0156] The classification module 601 is used to obtain multiple classification results between the host and the virtual machine in the cloud operating system OS to be restarted and the conflicting virtual machines corresponding to each batch of hosts in each classification result according to the anti-affinity relationship of the virtual machine, the corresponding relationship between the virtual machine and the host, and the ratio of the maximum number of virtual machines that can be shut down by the network element, wherein the batch number of hosts corresponding to each classification result is different, and each batch of hosts includes at least one host;

[0157] Evaluation module 602, used to simulate hot migration evaluation of conflicting virtual machines corresponding to each batch of hosts of each classification result in the multiple classification results, so as to obtain a target classification result, wherein the target classification result is a classification result with the least batch number among the multiple classification results, and conflicting virtual machines corresponding to hosts in each batch can be migrated to hosts in other batches;

[0158] The operation module 603 is used to restart each batch of hosts on the cloud OS according to the target classification result.

[0159] In a possible implementation, the division module 601 is used to:

[0160] According to the anti-affinity relationship of the virtual machines, the corresponding relationship between the virtual machines and the hosts, and the ratio of the maximum number of virtual machines that can be shut down by the network element, N classification results and the conflicting virtual machines corresponding to each batch of hosts in each classification result in the N classification results are obtained;

[0161] Among them, for the i-th classification result:

[0162] Obtaining a batch with the least number of hosts in the i-th classification result, where i is not less than 1;

[0163] According to the conflicting virtual machines corresponding to the hosts in each batch of the i-th classification result, the hosts in the batch with the least number of hosts are transferred to the target batch to obtain the i+1-th classification result and the conflicting virtual machines corresponding to the hosts in each batch of the i+1-th classification result, the batch number of the i+1-th classification result is less than the batch number of the i-th classification result, the target batch is the other batches in the i-th classification result except the batch with the least number of hosts, and the hosts in the batch with the least number of hosts have the least conflicting virtual machines with the hosts in the target batch;

[0164] If i+1 is less than the preset value, set i=i+1 and repeat the above steps; if the i+1 is equal to the preset value, obtain multiple classification results between the network element virtual machines and the conflicting virtual machines corresponding to each batch of hosts in each classification result, wherein when i=1, the first classification result is the classification result with the largest batch number.

[0165] In another possible implementation, the division module 601 is used to:

[0166] Based on the anti-affinity relationship of virtual machines, the corresponding relationship between virtual machines and hosts, the maximum ratio of the number of virtual machines that can be shut down by the network element, and multiple preset values, multiple classification results between hosts and virtual machines in the cloud operating system OS to be restarted and the conflicting virtual machines corresponding to each batch of hosts in each classification result are obtained, and the multiple preset values ​​correspond to the multiple classification results.

[0167] In a possible implementation, the evaluation module 602 is used to:

[0168] Performing simulated hot migration evaluation on conflicting virtual machines corresponding to each batch of hosts of each classification result in the plurality of classification results in ascending order of batch number, so as to obtain a target classification result;

[0169] Wherein, when performing simulated thermal migration evaluation on the j-th classification result among the multiple classification results:

[0170] Simulating hot migration of conflicting virtual machines corresponding to each batch of hosts in the j-th classification result in turn;

[0171] Among them, if the j-th classification result does not satisfy that the conflicting virtual machines corresponding to each batch of hosts respectively correspond to target hosts, let j=j+1, and repeat the above steps; if the conflicting virtual machines corresponding to each batch of hosts in the j-th classification result respectively correspond to target hosts, take the j-th classification result as the target classification result, wherein the target host and the host corresponding to the conflicting virtual machine are from different batches, and the remaining resources corresponding to the target host are not less than the migration resources corresponding to the conflicting virtual machine; when j=1, the first classification result is the classification result with the least number of batches among the multiple classification results.

[0172] For the introduction of the above modules, please refer to the description of the aforementioned method embodiment, which will not be repeated here.

[0173] It should be understood that the division of the modules in the above devices is only a division of logical functions, and in actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. In addition, the modules in the device for batch restarting hosts can be implemented in the form of a processor calling software; for example, the device for batch restarting hosts includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or implement the functions of the modules of the device, wherein the processor is, for example, a general-purpose processor, such as a central processing unit (CPU) or a microprocessor, and the memory is a memory inside the device or a memory outside the device. Alternatively, the modules in the device can be implemented in the form of hardware circuits, and the functions of some or all units can be realized by designing the hardware circuits, and the hardware circuits can be understood as one or more processors; for example, in one implementation, the hardware circuit is an application-specific integrated circuit (ASIC), and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be realized by a programmable logic device (PLD), taking a field programmable gate array (FPGA) as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by a configuration file, so as to realize the functions of some or all of the above units. All modules of the above devices can be realized in the form of a processor calling software, or in the form of hardware circuits, or in part by a processor calling software, and the rest by hardware circuits.

[0174] Reference Figure 7As shown in FIG. 1 , it is a schematic diagram of the hardware structure of another device for batch restarting hosts provided in an embodiment of the present application. Figure 7 The apparatus 700 for restarting hosts in batches (the apparatus 700 may be a computer device) includes a memory 701, a processor 702, a communication interface 703, and a bus 704. The memory 701, the processor 702, and the communication interface 703 are connected to each other through the bus 704.

[0175] The memory 701 may be a read only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM).

[0176] The memory 701 can store programs. When the program stored in the memory 701 is executed by the processor 702, the processor 702 and the communication interface 703 are used to execute the various steps of the method for batch restarting hosts in the embodiment of the present application.

[0177] The processor 702 is a circuit with signal processing capability. In one implementation, the processor 702 may be a circuit with instruction reading and running capability, such as a central processing unit CPU, a microprocessor, a graphics processing unit (GPU) (which may be understood as a microprocessor), or a digital signal processor (DSP), etc.; in another implementation, the processor 702 may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit may be fixed or reconfigurable, such as the processor 702 being a hardware circuit implemented by an ASIC or a programmable logic device PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration may be understood as the process of the processor loading instructions to implement the functions of some or all of the above modules. In addition, it may also be a hardware circuit designed for artificial intelligence, which may be understood as an ASIC, such as a neural network processing unit (NPU), a tensor processing unit (TPU), a deep learning processing unit (DPU), etc. The processor 702 is used to execute relevant programs to implement the functions required to be performed by the units in the device for batch restarting hosts in the embodiment of the present application, or to execute the method for batch restarting hosts in the method embodiment of the present application.

[0178] It can be seen that each module in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.

[0179] In addition, the modules in the above device can be fully or partially integrated together, or can be implemented independently. In one implementation, these modules are integrated together and implemented in the form of a system-on-a-chip (SOC). The SOC may include at least one processor for implementing any of the above methods or implementing the functions of the modules of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.

[0180] The communication interface 703 uses a transceiver device such as, but not limited to, a transceiver to implement communication between the device 700 and other devices or a communication network. For example, data can be obtained through the communication interface 703.

[0181] The bus 704 may include a path for transmitting information between various components of the device 700 (eg, the memory 701 , the processor 702 , and the communication interface 703 ).

[0182] It should be noted that although Figure 7 The device 700 shown only shows a memory, a processor, and a communication interface, but in the specific implementation process, those skilled in the art should understand that the device 700 also includes other devices necessary for normal operation. At the same time, according to specific needs, those skilled in the art should understand that the device 700 may also include hardware devices for implementing other additional functions. In addition, those skilled in the art should understand that the device 700 may also only include the devices necessary to implement the embodiments of the present application, and does not necessarily include Figure 7 All devices shown in .

[0183] An embodiment of the present application also provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is executed on a computer or a processor, the computer or the processor executes one or more steps in any of the above methods.

[0184] The embodiment of the present application further provides a computer program product including instructions. When the computer program product is executed on a computer or a processor, the computer or the processor executes one or more steps in any of the above methods.

[0185] It should be understood that in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; wherein A and B can be singular or plural. Also, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, wherein a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", etc. are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art can understand that the words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be necessarily different. Meanwhile, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.

[0186] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the division of the unit is only a logical function division, and 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. The mutual coupling, direct coupling, or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0187] 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 of this embodiment.

[0188] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integrations. The available medium may be a read-only memory (ROM), or a random access memory (RAM), or a magnetic medium, such as a floppy disk, a hard disk, a tape, a magnetic disk, or an optical medium, such as a digital versatile disc (DVD), or a semiconductor medium, such as a solid state disk (SSD), etc.

[0189] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.

Claims

1. A method for restarting hosts in batches, characterized in that: include: According to the anti-affinity relationship of the virtual machines, the correspondence between the virtual machines and the hosts, and the ratio of the maximum number of virtual machines that can be shut down by the network element, multiple classification results between the hosts and the virtual machines in the cloud operating system OS to be restarted and the conflicting virtual machines corresponding to each batch of hosts in each classification result are obtained, wherein the batch number of hosts corresponding to each classification result is different, and each batch of hosts includes at least one host; Performing simulated hot migration evaluation on the conflicting virtual machines corresponding to each batch of hosts of each classification result in the multiple classification results to obtain a target classification result, wherein the target classification result is a classification result with the least batch number among the multiple classification results, and the conflicting virtual machines corresponding to the hosts of each batch can all be migrated to hosts of other batches; Restart each batch of hosts on the cloud OS according to the target classification result.

2. The method according to claim 1, characterized in that: The method of obtaining multiple classification results between hosts and virtual machines in the cloud operating system OS to be restarted and conflicting virtual machines corresponding to each batch of hosts in each classification result according to the virtual machine anti-affinity relationship, the corresponding relationship between the virtual machine and the host, and the ratio of the maximum number of virtual machines that can be shut down by the network element includes: According to the anti-affinity relationship of the virtual machines, the corresponding relationship between the virtual machines and the hosts, and the ratio of the maximum number of virtual machines that can be shut down by the network element, N classification results and the conflicting virtual machines corresponding to each batch of hosts in each classification result in the N classification results are obtained; Among them, for the i-th classification result: Obtaining a batch with the least number of hosts in the i-th classification result, where i is not less than 1; According to the conflicting virtual machines corresponding to the hosts in each batch of the i-th classification result, the hosts in the batch with the least number of hosts are transferred to the target batch to obtain the i+1-th classification result and the conflicting virtual machines corresponding to the hosts in each batch of the i+1-th classification result, the batch number of the i+1-th classification result is less than the batch number of the i-th classification result, the target batch is the other batches in the i-th classification result except the batch with the least number of hosts, and the hosts in the batch with the least number of hosts have the least conflicting virtual machines with the hosts in the target batch; If i+1 is less than the preset value, set i=i+1 and repeat the above steps; if the i+1 is equal to the preset value, obtain multiple classification results between the network element virtual machines and the conflicting virtual machines corresponding to each batch of hosts in each classification result, wherein when i=1, the first classification result is the classification result with the largest batch number.

3. The method according to claim 1, characterized in that The method of obtaining multiple classification results between hosts and virtual machines in the cloud operating system OS to be restarted and conflicting virtual machines corresponding to each batch of hosts in each classification result according to the virtual machine anti-affinity relationship, the corresponding relationship between the virtual machine and the host, and the ratio of the maximum number of virtual machines that can be shut down by the network element includes: Based on the anti-affinity relationship of virtual machines, the corresponding relationship between virtual machines and hosts, the maximum ratio of the number of virtual machines that can be shut down by the network element, and multiple preset values, multiple classification results between hosts and virtual machines in the cloud operating system OS to be restarted and the conflicting virtual machines corresponding to each batch of hosts in each classification result are obtained, and the multiple preset values ​​correspond to the multiple classification results.

4. The method according to any one of claims 1 to 3, characterized in that: The step of performing simulated hot migration evaluation on conflicting virtual machines corresponding to each batch of hosts of each classification result in the multiple classification results to obtain a target classification result includes: Performing simulated hot migration evaluation on conflicting virtual machines corresponding to each batch of hosts of each classification result in the plurality of classification results in ascending order of batch number, so as to obtain a target classification result; Wherein, when performing simulated thermal migration evaluation on the j-th classification result among the multiple classification results: Simulating hot migration of conflicting virtual machines corresponding to each batch of hosts in the j-th classification result in turn; Among them, if the j-th classification result does not satisfy that the conflicting virtual machines corresponding to each batch of hosts respectively correspond to target hosts, let j=j+1, and repeat the above steps; if the conflicting virtual machines corresponding to each batch of hosts in the j-th classification result respectively correspond to target hosts, take the j-th classification result as the target classification result, wherein the target host and the host corresponding to the conflicting virtual machine are from different batches, and the remaining resources corresponding to the target host are not less than the migration resources corresponding to the conflicting virtual machine; when j=1, the first classification result is the classification result with the least number of batches among the multiple classification results.

5. A device for restarting hosts in batches, characterized in that: include: A partitioning module is used to obtain multiple classification results between hosts and virtual machines in the cloud operating system OS to be restarted and conflicting virtual machines corresponding to each batch of hosts in each classification result according to the anti-affinity relationship of the virtual machines, the corresponding relationship between the virtual machines and the hosts, and the ratio of the maximum number of virtual machines that can be shut down by the network element, wherein the batch number of hosts corresponding to each classification result is different, and each batch of hosts includes at least one host; An evaluation module is used to simulate hot migration evaluation of conflicting virtual machines corresponding to each batch of hosts of each classification result in the multiple classification results to obtain a target classification result, wherein the target classification result is a classification result with the least batch number among the multiple classification results, and the conflicting virtual machines corresponding to the hosts of each batch can be migrated to hosts of other batches; An operation module is used to restart each batch of hosts on the cloud OS according to the target classification result.

6. The device according to claim 5, characterized in that The partitioning module is used for: According to the anti-affinity relationship of the virtual machines, the corresponding relationship between the virtual machines and the hosts, and the ratio of the maximum number of virtual machines that can be shut down by the network element, N classification results and the conflicting virtual machines corresponding to each batch of hosts in each classification result in the N classification results are obtained; Among them, for the i-th classification result: Obtaining a batch with the least number of hosts in the i-th classification result, where i is not less than 1; According to the conflicting virtual machines corresponding to the hosts in each batch of the i-th classification result, the hosts in the batch with the least number of hosts are transferred to the target batch to obtain the i+1-th classification result and the conflicting virtual machines corresponding to the hosts in each batch of the i+1-th classification result, the batch number of the i+1-th classification result is less than the batch number of the i-th classification result, the target batch is the other batches in the i-th classification result except the batch with the least number of hosts, and the hosts in the batch with the least number of hosts have the least conflicting virtual machines with the hosts in the target batch; If i+1 is less than the preset value, set i=i+1 and repeat the above steps; if the i+1 is equal to the preset value, obtain multiple classification results between the network element virtual machines and the conflicting virtual machines corresponding to each batch of hosts in each classification result, wherein when i=1, the first classification result is the classification result with the largest batch number.

7. The device according to claim 5, characterized in that The partitioning module is used for: Based on the anti-affinity relationship of virtual machines, the corresponding relationship between virtual machines and hosts, the maximum ratio of the number of virtual machines that can be shut down by the network element, and multiple preset values, multiple classification results between hosts and virtual machines in the cloud operating system OS to be restarted and the conflicting virtual machines corresponding to each batch of hosts in each classification result are obtained, and the multiple preset values ​​correspond to the multiple classification results.

8. The device according to any one of claims 5 to 7, characterized in that The evaluation module is used to: Performing simulated hot migration evaluation on conflicting virtual machines corresponding to each batch of hosts of each classification result in the plurality of classification results in ascending order of batch number, so as to obtain a target classification result; Wherein, when performing simulated thermal migration evaluation on the j-th classification result among the multiple classification results: Simulating hot migration of conflicting virtual machines corresponding to each batch of hosts in the j-th classification result in turn; Among them, if the j-th classification result does not satisfy that the conflicting virtual machines corresponding to each batch of hosts respectively correspond to target hosts, let j=j+1, and repeat the above steps; if the conflicting virtual machines corresponding to each batch of hosts in the j-th classification result respectively correspond to target hosts, take the j-th classification result as the target classification result, wherein the target host and the host corresponding to the conflicting virtual machine are from different batches, and the remaining resources corresponding to the target host are not less than the migration resources corresponding to the conflicting virtual machine; when j=1, the first classification result is the classification result with the least number of batches among the multiple classification results.

9. A device for restarting hosts in batches, characterized in that: It comprises a processor and a memory; wherein the memory is used to store program code, and the processor is used to call the program code to execute the method according to any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 4.

11. A computer program product, characterized in that When the computer program product runs on a computer, the computer is caused to execute the method according to any one of claims 1 to 4.

12. A chip system, characterized in that: The chip system is applied to an electronic device; the chip system includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through lines; the interface circuit is used to receive a signal from a memory of the electronic device and send the signal to the processor, the signal including a computer instruction stored in the memory; when the processor executes the computer instruction, the electronic device executes the method as described in any one of claims 1 to 4.

Citation Information

Cited By

  • Method and device for restarting hosts in batches, and storage medium

    EP4618498A1

  • Method and device for restarting hosts in batches, and storage medium

    WO2024198762A1