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

By dividing the virtual machine classification results and conducting simulated live migration evaluation, uninterrupted business operations are achieved when restarting the host, solving the problem of too long business interruption time in the existing technology, and improving business reliability and upgrade efficiency.

WO2024198762A1PCT designated stage expired Publication Date: 2024-10-03HUAWEI TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/077543
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-24
Filing Date
2024-02-19
Publication Date
2024-10-03

AI Technical Summary

Technical Problem

The existing technology requires shutting down all virtual machines when restarting the host, causing business interruption for a long time and reducing business reliability.

Method used

By classifying multiple classification results based on the anti-affinity relationship between virtual machines and the maximum number of virtual machines that can be shut down on a network element, and conducting a simulated live migration evaluation, the target classification results are determined to restart hosts in batches, ensuring no business interruption and reducing the upgrade time. .

Benefits of technology

It effectively reduces the business interruption time during cloud OS upgrade, ensures that the business is not damaged during the restart process, and shortens the upgrade time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024077543_03102024_PF_FP_ABST
    Figure CN2024077543_03102024_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a method and device for restarting hosts in batches, and a storage medium. The method comprises: according to an anti-affinity relationship of virtual machines, corresponding relationships between the virtual machines and hosts, and the maximum proportion of the number of closeable virtual machines of network elements, obtaining a plurality of classification results between the hosts and the virtual machines in a cloud OS to be restarted and conflict virtual machines corresponding to hosts in each batch in the number of batches in each classification result; performing simulated live migration evaluation on the conflict virtual machines corresponding to the hosts in each batch in the number of batches in each of the plurality of classification results to obtain a target classification result, wherein the target classification result is a classification result in which the number of batches is the minimum in the plurality of classification results, and the conflict virtual machines corresponding to the hosts in each batch can be migrated to hosts in another batch; and performing a restart operation on the hosts in each batch on the cloud OS according to the target classification result. In this way, the duration required by a service can be shortened, and moreover, it is ensured that the service is uninterrupted.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device, and storage medium for batch restarting hosts

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on March 24, 2023, with application number 202310333863.X and application name “Method, device and storage medium for batch restarting hosts”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] 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

[0003] 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. NFV transforms these network elements into independent applications that can be flexibly deployed on a unified infrastructure platform built with standard servers, storage, switches, and other devices. Through virtualization technology, infrastructure hardware resources are pooled and virtualized, providing virtual resources to upper-layer applications, achieving decoupling between applications and hardware. This allows each application to quickly add virtual resources to expand system capacity or quickly reduce virtual resources to shrink system capacity, significantly improving network resiliency. By using general-purpose COTS servers to form a shared resource pool, newly developed services no longer require the deployment of separate hardware, significantly shortening the time it takes to bring new services online.

[0004] The foundation of NFV technology lies in cloud computing and virtualization. Virtualization allows generic COTS computing, storage, and network hardware to be broken down into multiple virtual resources for use by various upper-layer applications. Virtualization decouples applications from hardware, significantly accelerating the provisioning of virtual resources. Cloud computing enables elastic scaling of applications, matching virtual resources to service loads, and improving both virtual resource utilization efficiency and system responsiveness.

[0005] In the existing technology, 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 again. 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 the higher version. Step 3: Start all virtual machines on the 4 hosts. However, after shutting down the virtual machines, this method will interrupt the services provided by all virtual machines for more than 30 minutes, and the entire site needs to be switched to other sites, which reduces service reliability.

[0006] Summary of the Invention

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

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

[0009] 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;

[0010] Performing a simulated hot migration evaluation on the conflicting virtual machines corresponding to each batch of hosts for 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 the hosts in each batch can all be migrated to hosts in other batches;

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

[0012] In the embodiment of the present application, according to the anti-affinity relationship of the virtual machines 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 virtual machines in the cloud OS to be restarted and the conflicting virtual machines corresponding to each batch of hosts in each classification result are obtained, and the conflicting virtual machines corresponding to each batch of hosts in each classification result are simulated and hot migration evaluated, thereby determining the target classification result with the least batch number and meeting the resource requirements. Then, according to the target classification result, each batch of hosts on the cloud OS is restarted separately. 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 performing batch replacement of stopped operation and maintenance servers and other operation and maintenance operations of the cloud OS that require batch restart of hosts, it can also ensure that the business is lossless and the time required for the business is the shortest.

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

[0014] 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;

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

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

[0017] According to the conflicting virtual machines corresponding to the number of hosts in each batch in 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 number of hosts in each batch in 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 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;

[0018] 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, among which, when i=1, the first classification result is the classification result with the largest batch number.

[0019] In this example, the cloud server first obtains the classification result with the largest batch size. For example, this classification result with the largest batch size satisfies the VM anti-affinity relationship and the maximum ratio of VMs that can be shut down by the network element. Then, based on this classification result, processing is performed to obtain the classification result with the second largest batch size. This classification result is then processed again to obtain a classification result with a smaller batch size than the previous classification result. This process can be repeated to obtain multiple classification results.

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

[0021] Based on the anti-affinity relationship of virtual machines, the correspondence between virtual machines and hosts, the ratio of the maximum 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.

[0022] In this example, by setting multiple preset values, multiple classification results can be obtained simultaneously based on VM anti-affinity relationships, the correspondence between VMs and hosts, and the maximum ratio of VMs that can be shut down on a network element. For example, a convex optimization algorithm can be used to iteratively combine hosts to minimize the number of host batches and the number of conflicting VMs, thereby obtaining multiple classification results.

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

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

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

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

[0027] 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.

[0028] In this example, the optimal batch is selected by evaluating whether other batches of hosts in the live network have sufficient resources to meet the hot migration requirements of the conflicting VMs in the batch of hosts to be restarted. This optimal batch has the smallest number of batches among the various classification results described above. This ensures that the upgrade time is minimized without disrupting services.

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

[0030] A partitioning module is configured to obtain, based on 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, wherein the batch number of hosts corresponding to each classification result is different, and each batch of hosts includes at least one host;

[0031] An evaluation module is configured to simulate hot migration evaluation of conflicting virtual machines corresponding to each batch of hosts for 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 the hosts in each batch can all be migrated to hosts in other batches;

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

[0033] In a possible implementation, the partitioning module is configured to:

[0034] 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;

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

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

[0037] According to the conflicting virtual machines corresponding to the number of hosts in each batch in 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 number of hosts in each batch in 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 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;

[0038] 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, among which, when i=1, the first classification result is the classification result with the largest batch number.

[0039] In a possible implementation, the partitioning module is configured to:

[0040] Based on the anti-affinity relationship of virtual machines, the correspondence between virtual machines and hosts, the ratio of the maximum 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.

[0041] In a possible implementation, the evaluation module is configured to:

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

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

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

[0045] 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.

[0046] In a third aspect, the present application provides a device for restarting hosts in batches, 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.

[0047] 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 of the first aspect.

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

[0049] 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 the 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 the method provided in any possible implementation manner of the first aspect.

[0050] It is understandable that the apparatus described in the second aspect, the apparatus 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 perform any of the methods provided in the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the corresponding methods and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0052] FIG1a is a schematic diagram of the architecture of a system for batch restarting hosts provided by an embodiment of the present application;

[0053] FIG1b is a schematic diagram of the architecture of another system for batch restarting hosts provided by an embodiment of the present application;

[0054] FIG2 is a flow chart of a method for restarting hosts in batches provided by an embodiment of the present application;

[0055] FIG3 is a schematic diagram of a method for simulating thermal migration assessment provided in an embodiment of the present application;

[0056] FIG4 is a flow chart of a method for batch upgrading hosts provided in an embodiment of the present application;

[0057] FIG5 is a flow chart of a method for batch replacing servers that have stopped operation and maintenance, provided in an embodiment of the present application;

[0058] FIG6 is a schematic structural diagram of an apparatus for batch restarting hosts provided in an embodiment of the present application;

[0059] FIG7 is a schematic structural diagram of another apparatus for restarting hosts in batches provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] The following describes the embodiments of the present application in conjunction with the accompanying drawings. The terms used in the implementation methods 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.

[0061] For ease of understanding, the following examples provide some explanations of concepts related to the embodiments of the present application for reference.

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

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

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

[0065] 4. Non-Uniform Memory Access (NUMA)-Affine VMs: Deploying VMs across NUMA nodes can lead to significant performance loss. NUMA-Affine VMs automatically perform initial NUMA placement and load balancing for VMs, distributing the VM's virtual CPU and memory within a single NUMA node to reduce memory access latency and improve performance.

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

[0067] 6. Cloud Operating System (OS): Also known as the cloud computing operating system or cloud computing center operating system, this operating system is powered by cloud computing and cloud storage technologies and serves as the overall management and operations system for cloud computing backend data centers. It refers to a comprehensive cloud platform management system built on foundational hardware resources such as servers, storage, and networks, and basic software such as stand-alone operating systems, middleware, and databases, managing massive amounts of basic hardware and software resources.

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

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

[0070] The system architecture of the embodiment of the present application will be described in detail below with reference to the accompanying drawings. Please refer to Figure 1a, which is a schematic diagram of the architecture of a system for batch restarting hosts applicable to the embodiment of the present application. The system can 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, memory, a peripheral component interconnect standard (PCI) device, and a disk. The processor, memory, PCI device, and disk all communicate via a bus.

[0071] Please refer to Figure 1b, which is a schematic diagram of another system for batch restarting hosts applicable to an embodiment of the present application, the system including 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.

[0072] The above describes the architecture of the embodiment of the present application. The following describes the method of the embodiment of the present application in detail.

[0073] Referring to Figure 2, it 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, such as the system for batch restarting hosts shown in Figure 1a. The method for batch restarting hosts shown in Figure 2 may include steps 201-203. It should be understood that this application is described in the order of 201-203 for the convenience of description, 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 batch restarting hosts as an example, and this application is also applicable to other execution subjects. Steps 201-203 are as follows:

[0074] 201. Based on the anti-affinity relationship of virtual machines, the correspondence between virtual machines and 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 virtual machines in the cloud 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 contains at least one host.

[0075] This virtual machine anti-affinity relationship can be understood as virtual machines that cannot be deployed on the same physical host. For example, virtual machines A and B have an anti-affinity relationship and cannot be deployed on the same host at the same time.

[0076] In one possible implementation, virtual machine anti-affinity types may include the following two categories:

[0077] 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.

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

[0079] The cloud server divides the primary and backup VMs into different batches, so that when the primary VM is powered off, services are switched to the backup VM. Furthermore, the cloud server divides the load balancing VMs into different batches, so that when 30% of the VMs are powered off, the remaining 70% of the VMs can still carry 100% of the services.

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

[0081] 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'.

[0082] 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.

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

[0084] In one possible implementation, after dividing the virtual machine batches, the hosts are also divided into batches, and 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.

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

[0086] Table 1

[0087] In one possible implementation, the cloud server can use greedy algorithms, convex optimization algorithms, and other methods to partition various virtual machines into the smallest possible host range. Hosts are then restarted according to the resulting batches to enable the newer cloud OS version. The larger the batch size, the longer the upgrade takes. The smaller the batch size, the faster the upgrade takes.

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

[0089] 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;

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

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

[0092] According to the conflicting virtual machines corresponding to the number of hosts in each batch in 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 number of hosts in each batch in 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 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;

[0093] 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, among which, when i=1, the first classification result is the classification result with the largest batch number.

[0094] In other words, the cloud server first obtains the classification result with the largest batch size. For example, this classification result with the largest batch size satisfies VM anti-affinity and the maximum ratio of VMs that can be shut down by a network element. It then processes this classification result to obtain the classification result with the next largest batch size. This classification result is then processed again to obtain a classification result with a smaller batch size than the previous classification result. This process continues in this manner, resulting in multiple classification results.

[0095] Among them, the above-mentioned processing is performed based on the classification result with the largest batch number to obtain the classification result with the second largest batch number. For example, the hosts in the batch with the smallest 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 smaller than the classification result with the largest batch number. Optionally, when the hosts in the batch with the smallest 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 smallest 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 a classification result with an arbitrary batch number such as 5, there can be multiple division methods, and this solution does not impose strict restrictions on this.

[0096] Among them, after the host is added to other batches, the virtual machines with active and standby virtual machines on the host and in the same batch with a load balancing ratio exceeding 30% will be marked as conflicting virtual machines until all hosts in the batch are re-divided into other batches.

[0097] Optionally, the above steps are repeated until three batches are optimized. In other words, the iteration stops when the hosts are divided into three batches. This results in obtaining multiple classification results and the conflicting virtual machines corresponding to each classification result.

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

[0099] Based on the anti-affinity relationship of virtual machines, the correspondence between virtual machines and hosts, the ratio of the maximum 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.

[0100] 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.

[0101] In this example, by setting multiple preset values, multiple classification results can be obtained simultaneously based on virtual machine anti-affinity relationships, the correspondence between virtual machines and hosts, and the maximum ratio of virtual machines that can be shut down by the network element. For example, a convex optimization algorithm can be used to iteratively combine hosts to minimize the number of host batches and the number of conflicting virtual machines, thereby obtaining multiple classification results. For an introduction to this part, please refer to the description of the previous embodiment and will not be repeated here.

[0102] 202. Perform a simulated hot migration evaluation on the conflicting virtual machines corresponding to each batch of hosts in each classification result among 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 in each batch can all be migrated to hosts in other batches.

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

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

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

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

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

[0108] 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.

[0109] That is to say, simulated hot migration evaluation is first performed on 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 on 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 started 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 started 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 result corresponding to the certain batch is determined as the target classification result.

[0110] The aforementioned preconditions require that the target host and the host corresponding to the conflicting VM be from different batches, and that the target host's remaining resources are no less than the migration resources corresponding to the conflicting VM. In other words, the optimal batch is ultimately selected by evaluating whether other batches of hosts in the live network have sufficient resources to meet the hot migration requirements for the conflicting VMs in the batch of the host to be restarted. This optimal batch has the smallest number of batches among the various classification results described above. This ensures the shortest upgrade time without disrupting services.

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

[0112] As shown in Figure 3, a schematic diagram of a method for simulating hot migration evaluation provided in an embodiment of the present application is provided. Among them, the hot migration process of the virtual machine is iteratively simulated based on the virtual machine identity (ID), batch ID and target host list. Within a specific target host range, a 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. Based on batch compression, the conflicting virtual machines in each batch of each classification result are simulated and estimated. Among them, the simulated hot migration estimation method may include the following steps:

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

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

[0115] 2. Perform simulated hot migration of the conflicting virtual machines in the first batch (e.g., VM2) in memory, where the target host corresponding to VM2 is a list of all hosts outside this batch (e.g., the second batch).

[0116] 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.

[0117] 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.

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

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

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

[0121] Based on this, we can complete the simulated hot migration estimation of each batch of conflicting virtual machines in the classification result. Repeat the process to determine the target classification result.

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

[0123] Based on the host batch division results determined in the target classification results above, the hosts in each batch are then restarted separately. For example, if the target classification result corresponds to batch 5, it will take 5 batches to complete the restart operation for all hosts. Optionally, the hosts in the first batch are restarted first, followed by the hosts in the second batch, then the hosts in the third batch, then the hosts in the fourth batch, and finally the hosts in the fifth batch, thereby completing the restart operation for all hosts.

[0124] The restart operation may include restarting all hosts to complete the upgrade, or restarting host configurations to take effect, or replacing servers that are no longer under maintenance with new servers. This solution does not impose any restrictions on this.

[0125] In the embodiment of the present application, according to the anti-affinity relationship of the virtual machines 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 virtual machines in the cloud OS to be restarted and the conflicting virtual machines corresponding to each batch of hosts in each classification result are obtained, and the conflicting virtual machines corresponding to each batch of hosts in each classification result are simulated and hot migration evaluated, thereby determining the target classification result with the least batch number and meeting the resource requirements. Then, according to the target classification result, each batch of hosts on the cloud OS is restarted separately. 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 performing batch replacement of stopped operation and maintenance servers and other operation and maintenance operations of the cloud OS that require batch restart of hosts, it can also ensure that the business is lossless and the time required for the business is the shortest.

[0126] Referring to Figure 4, it 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, such as the system for batch restarting hosts shown in Figure 1a. The method for batch upgrading hosts shown in Figure 4 can correspond to the following steps 1-7. It should be understood that this application is described in the order of steps 1-7 for the convenience of description, and is not intended to be limited to execution in 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-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:

[0127] Step 1. Before the upgrade, based on the service anti-affinity relationships between virtual machines collected by the upgrade tool, import them into the batch tool for processing, divide all hosts into batches, and obtain multiple classification results and the conflicting virtual machines corresponding to the hosts in each batch in each classification result.

[0128] For the introduction of dividing all hosts into batches, please refer to the description in the embodiment shown in FIG2 , which will not be repeated here.

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

[0130] Step 2. Import the compressed batch results generated by the batching tool into the upgrade tool to evaluate the feasibility of hot migration to reduce batch size and automatically calculate the batch with the shortest duration.

[0131] For an introduction to determining the shortest batch, please refer to the description in the embodiment shown in FIG2 , which will not be repeated here.

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

[0133] For example, based on the hot migration prediction 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 first.

[0134] Step 4. Before the host restarts, the upgrade tool notifies the Virtualized Network Function Manager (VNFM) to migrate the virtual machine service data on the hosts in the batch to be upgraded to other batches.

[0135] After migrating the conflicting virtual machines on the hosts in the first batch to hosts in other batches, the virtual machine business data on the hosts in this batch is also migrated to other batches.

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

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

[0138] 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.

[0139] After the host restarts, the upgrade is complete. You can then migrate the migrated business data back to the virtual machines corresponding to the hosts in this batch.

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

[0141] For example, the 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.

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

[0143] Referring to Figure 5, it is a flow chart of a method for batch replacement of stopped operation and maintenance servers provided by an embodiment of the present application. Optionally, the method can be applied to the aforementioned system for batch restarting hosts, such as the system for batch restarting hosts shown in Figure 1a. The method for batch replacement of servers shown in Figure 5 can correspond to the following steps 1-5. It should be understood that this application is described in the order of steps 1-5 for the convenience of description, and is not intended to be limited to execution in 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 stopped operation and maintenance servers may include the following steps:

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

[0145] Step 2. The host replacement tool collects anti-affinity information about virtual machines in the environment.

[0146] 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.

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

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

[0149] 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.

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

[0151] This example, based on the batch replacement of stopped operation and maintenance servers, can ensure that virtual machine services are not affected while minimizing the time required for related services. 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.

[0152] 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 by each other. The technical features in different embodiments can be combined to form new embodiments according to their internal logical relationships.

[0153] The above describes in detail the method of the embodiment of the present application, and the following provides the device of the embodiment of the present application. It will be understood that in the various device embodiments of the present application, the division of multiple units or modules is only a logical division based on function, and is not intended to limit 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 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 include 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. Typically, each unit corresponds to its own program code (or program instructions), and when the program code corresponding to each of these units runs on the processor, the unit is controlled by the processing unit to execute the corresponding process to implement the corresponding function.

[0154] An embodiment of the present application also provides an apparatus for implementing any of the above methods. For example, an apparatus for batch restarting hosts is provided, comprising modules (or means) for implementing each step performed by the server in any of the above methods.

[0155] For example, referring to Figure 6, which is a schematic diagram of a 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, such as the method for batch restarting hosts shown in Figures 2, 4, and 5.

[0156] As shown in FIG6 , the apparatus may include a division module 601 , an evaluation module 602 , and an operation module 603 , specifically as follows:

[0157] A classification module 601 is configured to obtain, based on the virtual machine anti-affinity relationship, the correspondence 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, multiple classification results between the host and the virtual machine in the cloud operating system (OS) to be restarted, and 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 includes at least one host;

[0158] Evaluation module 602 is configured to perform 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 having the smallest batch number among the multiple classification results and wherein all conflicting virtual machines corresponding to hosts in each batch can be migrated to hosts in other batches;

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

[0160] In a possible implementation, the division module 601 is configured to:

[0161] 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;

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

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

[0164] According to the conflicting virtual machines corresponding to the number of hosts in each batch in 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 number of hosts in each batch in 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 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;

[0165] 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, among which, when i=1, the first classification result is the classification result with the largest batch number.

[0166] In another possible implementation, the division module 601 is configured to:

[0167] Based on the anti-affinity relationship of virtual machines, the correspondence between virtual machines and hosts, the ratio of the maximum 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.

[0168] In a possible implementation, the evaluation module 602 is configured to:

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

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

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

[0172] 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.

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

[0174] It should be understood that the division of the modules in the above-mentioned devices is only a division of logical functions. 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 the memory stores instructions. The processor calls the instructions stored in the memory to implement any of the above methods or realize 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 within 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. The hardware circuit can be understood as one or more processors. For example, in one implementation, the hardware circuit is an application-specific integrated circuit (ASIC), which realizes the functions of some or all of the above units by designing the logical relationship of the components in the circuit. For another example, in another implementation, the hardware circuit can be implemented by a programmable logic device (PLD). Taking a field programmable gate array (FPGA) as an example, it can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by configuring the configuration file, thereby realizing the functions of some or all of the above units. All modules of the above devices can be implemented in the form of software called by the processor, or in the form of hardware circuits, or in part by the form of software called by the processor, and the rest by hardware circuits.

[0175] Referring to FIG7 , a schematic diagram of the hardware structure of another apparatus for batch restarting hosts provided in an embodiment of the present application is shown. The apparatus 700 for batch restarting hosts shown in FIG7 (the apparatus 700 may specifically be a computer device) includes a memory 701, a processor 702, a communication interface 703, and a bus 704. The memory 701, processor 702, and communication interface 703 are connected to each other via bus 704.

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

[0177] 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 perform the various steps of the method for batch restarting hosts in the embodiment of the present application.

[0178] The processor 702 is a circuit with signal processing capabilities. In one implementation, the processor 702 can be a circuit with instruction reading and execution capabilities, such as a central processing unit (CPU), a microprocessor, a graphics processing unit (GPU) (which can be understood as a microprocessor), or a digital signal processor (DSP). In another implementation, the processor 702 can implement certain functions through the logical relationship of a hardware circuit. The logical relationship of the hardware circuit is fixed or reconfigurable. For example, the processor 702 is 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 file and implementing the hardware circuit configuration can 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 can also be a hardware circuit designed for artificial intelligence, which can 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.

[0179] 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.

[0180] 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 can be different, for example, including a CPU and FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.

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

[0182] 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 ).

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

[0184] 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 processor executes one or more steps in any of the above methods.

[0185] The present application also provides a computer program product comprising instructions, which, when executed on a computer or processor, causes the computer or processor to execute one or more steps in any of the above methods.

[0186] It should be understood that in the description of this application, unless otherwise specified, " / " indicates that the objects associated with each other are in an "or" relationship. For example, A / B can mean A or B; where A and B can be singular or plural. Also, in the description of this application, unless otherwise specified, "multiple" means 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 or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or plural. In addition, to facilitate the clear description of the technical solutions of the embodiments of this application, in the embodiments of this application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity or execution order, and words such as "first" and "second" do not necessarily mean different. At the same time, in the embodiments of this 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 this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner to facilitate understanding.

[0187] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the division of the units 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 interface, indirect coupling or communication connection of devices or units, and can be electrical, mechanical or other forms.

[0188] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0189] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented 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, all or part of the processes or functions according to the embodiments of the present application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted via the computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a read-only memory (ROM), a random access memory (RAM), 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).

[0190] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection 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: The partitioning module is used to divide the virtual machines according to the anti-affinity relationship of the virtual machines, the correspondence between the virtual machines and the host, and the maximum number of virtual machines that can be shut down by the network element. ratio, 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, 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

Patent Citations

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

    CN118694675A

  • Computing node online upgrading method and device, electronic equipment and storage medium

    CN114356378A

  • Scheduling method and device for batch installation of virtual machines

    CN115617452A

  • Virtual machine migration within a hybrid cloud system

    US20170060628A1

  • Fault tolerant hyper-converged infrastructure upgrades in an environment with no additional physical infrastructure

    US20200201664A1