A method and apparatus for booting a virtual machine

By dividing the virtual machine boot process into multiple stages and controlling the boot order of virtual machines according to throughput requirements, the system overload problem caused by the simultaneous startup of multiple virtual machines in the cloud computing environment is solved, and a stable boot process is achieved.

CN115809114BActive Publication Date: 2025-11-04FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211474924.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-23
Publication Date
2025-11-04
Estimated Expiration
2042-11-23

AI Technical Summary

Technical Problem

In a cloud computing environment, when multiple virtual machines start up simultaneously, the system CPU load becomes too high, the throughput exceeds the system's capacity, and problems such as virtual machine startup failure, network congestion, and storage anomalies occur.

Method used

The virtual machine boot process is divided into multiple stages, and the boot process is selected to continue or pause the virtual machine booting according to the throughput requirements of each stage. The boot progress of the virtual machine is controlled by the global priority boot order to ensure that the system throughput does not exceed the preset threshold.

Benefits of technology

It effectively avoids system overload, ensures the normal operation of the virtual machine boot process, reduces virtual machine boot failures and network congestion, and improves system stability and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115809114B_ABST
    Figure CN115809114B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of cloud computing, and provides a virtual machine booting method and device. The method comprises the following steps: dividing the booting process of a virtual machine into multiple booting stages; according to the required throughput of the virtual machine in each booting stage, selecting the corresponding virtual machine to continue booting to enter the next booting stage, and suspending the booting of other virtual machines to release resources, so as to ensure that the throughput of the system does not exceed a first preset throughput during the booting process of each virtual machine. The present application divides the booting process of a virtual machine into multiple booting stages, and controls the booting progress of the virtual machine by controlling the continuous booting and suspended booting of the virtual machine, so as to ensure that the throughput of the system does not exceed the range that can be borne by the system, and at the same time, the normal booting of each virtual machine is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cloud computing technology, and in particular to a method and apparatus for booting a virtual machine. Background Technology

[0002] In large-scale cloud computing or desktop cloud environments, the startup and operation of each virtual machine (VM) are closely related to the IOPS (Input / Output Operations Per Second) of the backend storage and the CPU load of each compute node. Starting a VM is extremely resource-intensive; the operating system and applications need to read large amounts of data from the disk for loading and execution, significantly increasing CPU utilization. When a large number of VMs start simultaneously within a short period, it places a heavy CPU load on the compute nodes, drastically reducing VM performance. Furthermore, the resulting surge in throughput can easily overwhelm the system, leading to VM startup failures, black screens, network congestion, VM storage anomalies, VM lag, and a series of other problems—a phenomenon known as a startup storm.

[0003] Therefore, overcoming the shortcomings of the existing technology is an urgent problem to be solved in this technical field. Summary of the Invention

[0004] The technical problem this invention aims to solve is that when a large number of virtual machines start up simultaneously in a short period of time, it will result in a large throughput, leading to a series of problems such as virtual machine black screen during startup, network congestion, virtual machine storage abnormalities, and virtual machine lag.

[0005] The present invention adopts the following technical solution:

[0006] In a first aspect, the present invention provides a method for booting a virtual machine, comprising:

[0007] The virtual machine boot process is divided into multiple boot stages;

[0008] Based on the throughput required by the virtual machines in each boot stage, select the appropriate virtual machine to continue booting to the next boot stage, and pause the booting of other virtual machines to release resources, so as to ensure that the system throughput does not exceed the first preset throughput during the boot process of each virtual machine.

[0009] Preferably, the step of selecting the appropriate virtual machine to continue booting to the next boot stage based on the throughput required by the virtual machine in each boot stage specifically includes:

[0010] Determine the global priority boot order of each virtual machine based on the load of each compute node and / or the current boot stage of each virtual machine under the compute node;

[0011] According to the throughput required by each virtual machine in each booting stage, the current throughput of the system and the first preset throughput, selecting N virtual machines in the front position in the global priority booting sequence, and continuing to boot the selected virtual machines to enter the next booting stage, wherein N is a positive integer.

[0012] Preferably, the global priority booting sequence of each virtual machine is determined according to the load of each computing node and / or the current booting stage of each virtual machine under the computing node, and specifically includes:

[0013] Prioritizing each computing node according to the load of the computing node; wherein the smaller the load of the computing node, the higher the priority of the computing node;

[0014] Prioritizing each virtual machine on the computing node according to the current booting stage of the virtual machine; wherein among the virtual machines on the same computing node, the virtual machine whose current booting stage is closer to the end of the booting is higher in priority;

[0015] Determining the global priority booting sequence of each virtual machine according to the priority of the computing node and the priority of the virtual machine on the computing node.

[0016] Preferably, the load of each computing node is calculated according to the CPU usage rate and the memory usage rate of the computing node, and specifically includes:

[0017] Multiplying the CPU weight value by the current CPU usage rate of the computing node to obtain a first value;

[0018] Multiplying the memory weight value by the current memory usage rate of the computing node to obtain a second value;

[0019] Adding the first value and the second value to obtain the load of the computing node.

[0020] Preferably, the global priority booting sequence of each virtual machine is determined according to the priority of the computing node and the priority of the virtual machine on the computing node, and specifically includes:

[0021] Considering all virtual machines on the same computing node as a whole, sorting the multiple wholes in the order of the priority of the computing node from high to low;

[0022] Then, reordering each virtual machine in the whole in the order of the priority of the virtual machine on the computing node from high to low, and finally obtaining the global priority booting sequence.

[0023] Preferably, the N virtual machines in the front position in the global priority booting sequence are selected according to the throughput required by each virtual machine in each booting stage, the current throughput of the system and the first preset throughput, and the selected virtual machines are continued to be booted to enter the next booting stage, and specifically includes:

[0024] According to the global priority booting order from front to back, take each virtual machine as the first virtual machine, calculate the sum of the required throughput of the next booting stage of the first virtual machine and the required throughput of the next booting stage of all second virtual machines before the first virtual machine, until the sum is greater than the throughput that the system can provide, to select the top N second virtual machines; wherein, the first preset throughput minus the current throughput of the system is taken as the throughput that the system can provide;

[0025] Continue to boot all second virtual machines into the next booting stage.

[0026] Preferably, the booting method further comprises:

[0027] After the next booting stage of all selected virtual machines ends, reselect the corresponding virtual machines to continue booting into the next booting stage, until all virtual machines in the system are booted or enter the last booting stage before the booting ends.

[0028] Preferably, the booting method further comprises:

[0029] If the next booting stage of the virtual machine does not end after the corresponding virtual machine is continuously booted for a first preset time, the booting of the virtual machine is suspended;

[0030] And the virtual machine does not participate in the subsequent booting, until the booting of other virtual machines ends, and then the booting of the virtual machine is continued;

[0031] If the next booting stage of the virtual machine does not end after the booting of the virtual machine is continued for a second preset time, the virtual machine is powered off.

[0032] Preferably, the booting process of the virtual machine is divided into multiple booting stages, specifically comprising:

[0033] According to the operating system used by the virtual machine, the booting process of the virtual machine is divided into multiple booting stages, when the operating system used by the virtual machine is the windows operating system, the virtual machine is divided into the pre-booting stage, the system starter loading stage, the kernel loading stage, the kernel initialization stage, the system initialization stage, the session manager starting stage, the advanced subsystem and service starting stage, the login manager starting stage and the background task loading stage.

[0034] When the operating system used by the virtual machine is a Linux operating system, the virtual machine is divided into a pre-boot stage, a GRUB boot program starting stage, a boot Loader executing stage, a kernel loading stage, a hardware driver loading stage, a starting process initializing stage, a system initializing stage, and a terminal establishing stage.

[0035] In a second aspect, the present application further provides a virtual machine booting device for implementing the virtual machine booting method in the first aspect, and the device comprises:

[0036] at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the virtual machine booting method in the first aspect.

[0037] In a third aspect, the present application further provides a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are executed by one or more processors to complete the virtual machine booting method in the first aspect.

[0038] The present application divides the virtual machine booting process into multiple booting stages, and controls the virtual machine booting progress by controlling the continuous booting and the pause booting of the virtual machine, so as to ensure that the system throughput does not exceed the range that can be borne by the system, and guarantee the normal booting of each virtual machine. BRIEF DESCRIPTION OF DRAWINGS

[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. Obviously, the drawings described below are only some of the embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0040] Figure 1 is a flowchart of a virtual machine booting method provided by the embodiments of the present application;

[0041] Figure 2 is a schematic diagram of each booting stage divided for a virtual machine provided by the embodiments of the present application;

[0042] Figure 3 is a schematic diagram of each booting stage divided for a virtual machine provided by the embodiments of the present application;

[0043] Figure 4 is a schematic diagram of each booting stage divided for a virtual machine provided by the embodiments of the present application;

[0044] Figure 5 is a flow diagram of a virtual machine booting method provided by an embodiment of the present application;

[0045] Figure 6 is a flow diagram of a virtual machine booting method provided by an embodiment of the present application;

[0046] Figure 7 is a flow diagram of a virtual machine booting method provided by an embodiment of the present application;

[0047] Figure 8 is an application scenario diagram of a virtual machine booting method provided by an embodiment of the present application;

[0048] Figure 9 is a flow diagram of a virtual machine booting method provided by an embodiment of the present application;

[0049] Figure 10 is a diagram of a booting stage of each virtual machine in a virtual machine booting method provided by an embodiment of the present application;

[0050] Figure 11 is a diagram of a booting stage of each virtual machine in a virtual machine booting method provided by an embodiment of the present application;

[0051] Figure 12 is a diagram of a virtual machine booting system provided by an embodiment of the present application;

[0052] Figure 13 is an architecture diagram of a virtual machine booting apparatus provided by an embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.

[0054] In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as there is no conflict.

[0055] Embodiment 1:

[0056] In a cloud computing scenario, a system can include multiple computing nodes, and each computing node can include multiple virtual machines. When a large number of virtual machines are started simultaneously in a short time, a large amount of throughput can be generated, and even the generated throughput can exceed the carrying range of the system, thereby causing a series of problems such as black screen of the virtual machine, network congestion, virtual machine storage exception, and virtual machine lag. To solve this problem, an embodiment of the present application provides a virtual machine booting method, as shown in Figure 1 The method includes the following steps.

[0057] In step 201, the booting process of the virtual machine is divided into multiple booting stages.

[0058] In step 202, according to the required throughput of the virtual machine in each booting stage, the corresponding virtual machine is selected to continue booting to enter the next booting stage, and the other virtual machines are suspended to release resources, so as to ensure that the throughput of the system does not exceed the first preset throughput during the booting process of each virtual machine.

[0059] It should be noted that in the present embodiment and subsequent embodiments, if not specifically stated, the mentioned virtual machine is a virtual machine that needs to be started, and the virtual machine that has successfully booted and the virtual machine that does not need to be started are not included.

[0060] The next booting stage is not a specific booting stage, but a relative expression with respect to the current booting stage of the virtual machine. For example, if the booting process of the virtual machine is divided into three booting stages, namely, the first booting stage, the second booting stage, and the third booting stage, if the virtual machine is currently in the second booting stage, the current booting stage of the virtual machine is the second booting stage, and the next booting stage of the virtual machine is the third booting stage.

[0061] The multiple booting stages are divided by a person skilled in the art according to the specific virtual machine booting process. The basis for dividing the booting stage is that the virtual machine can suspend booting without affecting the normal progress of the virtual machine booting process between the corresponding booting stage and the next booting stage of the booting stage.

[0062] As an optional implementation, the required throughput of the virtual machine in each booting stage can be preset by a person skilled in the art for each booting stage according to the task execution of each booting stage after dividing the booting stages.

[0063] The first preset throughput is obtained by a person skilled in the art according to the maximum throughput that can be carried by the system.

[0064] Once the throughput of the system exceeds the range that the system can bear, the system will be jammed, and even be crashed in serious cases. The embodiment divides the booting process of the virtual machine into multiple booting stages, and controls the booting progress of the virtual machine by continuing booting and pausing booting of the virtual machine, so as to ensure that the throughput of the system does not exceed the range that the system can bear, and at the same time, ensure the normal booting of the virtual machine.

[0065] In actual use, the booting process can be different according to different operating systems used by the virtual machine. In order to adapt to the booting process of different operating systems, the embodiment further provides a preferred implementation to further limit the division of the booting stage, that is, the booting process of the virtual machine is divided into multiple booting stages, which specifically includes:

[0066] According to the operating system used by the virtual machine, the booting process of the virtual machine is divided into multiple booting stages. For example, as shown in Figure 2 When the operating system used by the virtual machine is a windows operating system, the booting process of the virtual machine is divided into a pre-booting stage (the stage corresponding to serial number 0), a system starter loading stage (the stage corresponding to serial number 1), a kernel loading stage (the stage corresponding to serial number 2), a kernel initialization stage (the stage corresponding to serial number 3), a system initialization stage (the stage corresponding to serial number 4), a session manager starting stage (the stage corresponding to serial number 5), an advanced subsystem and service starting stage (the stage corresponding to serial number 6), a login manager starting stage (the stage corresponding to serial number 7), and a background task loading stage (the stage corresponding to serial number 8).

[0067] When the operating system used by the virtual machine is a linux operating system, as shown in Figure 3 The virtual machine is divided into a pre-booting stage (the stage corresponding to serial number 0), a GRUB (Grand Unified Bootloader, multi-boot manager) boot program starting stage (the stage corresponding to serial number 1), a boot Loader execution stage (the stage corresponding to serial number 2), a kernel loading stage (the stage corresponding to serial number 3), a hardware driver loading stage (the stage corresponding to serial number 4), a starting process initialization stage (the stage corresponding to serial number 5), a system initialization stage (the stage corresponding to serial number 6), and a terminal establishment stage (the stage corresponding to serial number 7).

[0068] There can also be a case that multiple operating systems are installed in a virtual machine, in which case, the division of the booting stage is based on the operating system that needs to be booted, for example, both windows operating system and linux operating system are installed in the virtual machine, but the user selects to start the linux operating system, then the division of the booting stage is performed according to the linux operating system during the booting process.

[0069] In actual use, users often need to start the virtual machine faster, in order to meet this demand, the embodiment further provides the following preferred implementation, that is, according to the throughput required by the virtual machine in each booting stage, the selected virtual machine is continuously booted to enter the next booting stage, for example, Figure 4 As shown in the figure, specifically includes:

[0070] In step 301, the global priority booting order of each virtual machine is determined according to the load of each computing node and / or the current booting stage of each virtual machine under the computing node.

[0071] In step 302, according to the throughput required by the virtual machine in each booting stage, the current system throughput and the first preset throughput, the selected virtual machine is continuously booted to enter the next booting stage in the N virtual machines with higher position in the global priority booting order; wherein, the N is a positive integer.

[0072] The system throughput is obtained by the real-time monitoring module in real time, the start speed of the virtual machine is related to the load of the computing node where the virtual machine is located, the lower the load, the better the performance of the computing node, the faster the start speed of the virtual machine, and under the same start speed, the closer the current booting stage of the virtual machine to the end of the booting, the fewer the booting stages required by the virtual machine to reach the end of the booting, and relatively speaking, the virtual machine can be started faster, this embodiment formulates the booting priority order of the virtual machine by the load of the computing node and the current booting stage of the virtual machine, so that the virtual machine that can be started faster is started first, in order to meet the demand of the user to start the virtual machine as fast as possible, at the same time, the system resources are released after the virtual machine is started, so that the subsequent booting of the virtual machine can have more available resources, thereby ensuring the normal booting of the subsequent virtual machine.

[0073] As a specific implementation of the above embodiment, there are the following four modes:

[0074] Manner one: the global priority booting sequence is determined only according to the load of the computing node, such as the virtual machine under the computing node with low load has a priority booting sequence in front. For example, there are two virtual machines VM5-1 and VM5-2 on the computing node compute5, there is a virtual machine VM3-1 on the computing node compute3, and the load of the computing node compute5 is less than the load of the computing node compute3, then the global priority booting sequence is: VM5-1>VM5-2>VM3-1, or VM5-2>VM5-1>VM3-1, and the priority booting sequence of VM5-1 and VM5-2 can directly use the default sorting of the virtual machines managed by the computing node.

[0075] Manner two: the global priority booting sequence is determined only according to the current booting stage of each virtual machine, such as the virtual machine with a current booting stage closer to the end of the booting is preferentially booted, for example, the current booting stage of VM5-1 on the computing node compute5 is the fourth stage, the current booting stage of VM5-2 is the first stage, and the current booting stage of VM3-1 under the computing node compute3 is the second stage, then the global priority booting sequence is: VM5-1>VM3-1>VM5-2.

[0076] Manner three: balancing is performed in the load of the computing node and the current booting stage of each virtual machine, such as a manner obtained by a person skilled in the art according to experience analysis or experiment, the load of the computing node, the number of virtual machines under the computing node, and the current booting stage of the virtual machine are respectively set with corresponding weight values, a corresponding value M is calculated, M is used to represent the length of time required for the virtual machine to end the booting, the greater M is, the longer the time required is, the smaller M is, the shorter the time required is, and the global priority booting sequence of the virtual machine is in the order from small to large according to the value M of the virtual machine.

[0077] The value M is specifically:

[0078] M=W×k1+N×k2-G×k3

[0079] Wherein, W is the load of the computing node, k1 is the weight value corresponding to the load of the computing node, N is the number of virtual machines under the computing node, k2 is the weight value corresponding to the number of virtual machines under the computing node, G is the current booting stage of the virtual machine, and k3 is the weight value corresponding to the current booting stage of the virtual machine, wherein, as a more accurate expression manner, according to the different booting stages of the virtual machine or the different current booting stages, different k3 can be used, and the following formula is obtained:

[0080] M=W×k1+N×k2-G v ×k3 (v,G)

[0081] Wherein, v represents a virtual machine, the G v is a current boot stage of the virtual machine v, k3 (v,G) represents a weight value corresponding to the virtual machine v in the boot stage G.

[0082] Method four: as shown in the figure, specifically includes: Figure 5

[0083] In step 401, the computing nodes are prioritized according to the load of each computing node; the smaller the load of the computing node, the higher the priority.

[0084] In step 402, the virtual machines on the computing nodes are prioritized according to the current boot stage of each virtual machine; among the virtual machines located on the same computing node, the virtual machine whose current boot stage is closer to the end of the startup has a higher priority.

[0085] In step 403, the global priority boot order of each virtual machine is determined according to the priority of the computing node and the priority of the virtual machine on the computing node.

[0086] Wherein, the determination of the global priority boot order of each virtual machine, as shown in the figure, specifically includes: Figure 6

[0087] In step 501, all virtual machines located on the same computing node are regarded as a whole, and the multiple wholes are sorted in order of the priority of the computing node from high to low.

[0088] In step 502, each virtual machine in the whole is re-sequenced in order of the priority of the virtual machine on the computing node from high to low, and finally the global priority boot order is obtained.

[0089] For example, there are two computing nodes, compute5 and compute3, the priority order of the virtual machines under compute5 is: VM5-1> VM5-3> VM5-2, the priority order of the virtual machines under compute3 is: VM3-4> VM3-5> VM3-1> VM3-2> VM3-3, and the priority of compute5 is higher than that of compute3, then the final global priority boot order is: VM5-1> VM5-3> VM5-2> VM3-4> VM3-5> VM3-1> VM3-2> VM3-3.

[0090] ​​The above-mentioned mode one and mode two are simple and easy to implement, and can reduce the system resources occupied by the control process. The mode three can more accurately represent the time required for starting the virtual machine, and thus can start the virtual machine more quickly.

[0091] The mode four is the implementation mode after the mode one, mode two and mode three. In the implementation mode, on one hand, the load of the computing node is used to ensure that the virtual machine is started quickly, and on the other hand, the implementation is relatively simple and does not occupy too many system resources.

[0092] The embodiment also provides an optional implementation mode for obtaining the current stage of the virtual machine. Specifically, an agent program is set in the virtual machine, the agent program reports the current state of the virtual machine and the current booting progress of the virtual machine to the virtualization layer, the virtualization layer reports the current state of the virtual machine and the current booting progress to the management node, and the management node controls the booting progress of each computing node.

[0093] In order to measure the size of the load of each computing node, the embodiment further provides the following preferred implementation mode to represent the load of each computing node as a specific measurable value, wherein the load of each computing node is calculated according to the CPU usage rate and the memory usage rate of each computing node, and specifically includes:

[0094] The CPU weight value is multiplied by the current CPU usage rate of the computing node to obtain a first value.

[0095] The memory weight value is multiplied by the current memory usage rate of the computing node to obtain a second value.

[0096] The load of the computing node is obtained by adding the first value and the second value.

[0097] The CPU weight value and the memory weight value are obtained by a person skilled in the art according to the working environment of the system and the demand analysis of the virtual machine booting. For example, when the speed of starting each virtual machine in the system is more affected by the CPU, that is, the CPU usage rate is more dependent, the CPU weight value is higher. When the speed of starting each virtual machine in the system is more affected by the memory, that is, the memory usage rate is more dependent, the memory weight value is higher. The CPU weight value can also be represented by cpu_weight, and the memory weight value can also be represented by mem_weight. The subsequent content of the embodiment of the application will be directly described by using cpu_weight as the representative form of the CPU weight value. Correspondingly, the memory weight value is also represented as mem_weight.

[0098] The embodiment also provides two optional implementations in different working environments:

[0099] Method one: when the virtual machine in the working environment of the system is a CPU-intensive application, cpu_weight=80% and mem_weight=20% can be set.

[0100] Method two: when the virtual machine in the working environment of the system is a memory-intensive application, cpu_weight=20% and mem_weight=80% can be set.

[0101] In actual cases, there are also cases where the working environment of the system is opened CPU over-commit or memory over-commit, in which case the values of cpu_weight and mem_weight also need to be obtained by the person skilled in the art according to the specific business scenario and the over-commit ratio under the system.

[0102] In the above implementations, in order to ensure that the throughput of the system does not exceed the first preset throughput, as an optional implementation, the first virtual machine is sequentially selected as the first virtual machine in the order of the global priority guiding sequence, and the next guiding stage required by the corresponding virtual machine is guided into the next guiding stage, and the specific method comprises:

[0103] The next guiding stage required by the first virtual machine and the sum of the next guiding stage required by all second virtual machines before the first virtual machine are calculated in the order of the global priority guiding sequence from front to back, until the sum is greater than the throughput that can be provided by the system, so as to select the N second virtual machines in the front position; wherein the first preset throughput minus the current throughput of the system is taken as the throughput that can be provided by the system.

[0104] The second virtual machine is guided into the next guiding stage.

[0105] The value of N is the number of the second virtual machine corresponding to the final sum greater than the throughput that can be provided by the system.

[0106] It needs to be explained here that the second virtual machine does not refer to a specific virtual machine, but all virtual machines before the first virtual machine in the global priority boot order are collectively referred to as the second virtual machine according to the decision of the first virtual machine. For example, if the global priority boot order is VM5-1>VM5-3>VM5-2, then VM5-1, VM5-3, and VM5-2 are sequentially used as the first virtual machine. When VM5-1 is used as the first virtual machine, there is no second virtual machine. When VM5-3 is used as the first virtual machine, VM5-1 is the second virtual machine. When VM5-2 is used as the first virtual machine, VM5-1 and VM5-3 are collectively referred to as the second virtual machine.

[0107] When the boot of the next boot phase of all selected virtual machines ends, the corresponding virtual machine is reselected to continue booting into the next boot phase until all virtual machines in the system are powered on or enter the last boot phase before the power-on ends.

[0108] Among them, the end of the boot of the next boot phase of the virtual machine is specifically manifested as: the virtual machine enters the next boot phase, and the tasks required to be executed in the next boot phase are all executed. For example, if the current boot phase of the corresponding virtual machine VM5-1 is the first boot phase, in a round of boot control, the selection is made to continue booting VM5-1 to enter the second boot phase. If the tasks of VM5-1 in the second phase are all executed and it is in a state of waiting to enter the third phase, then the next boot phase of VM5-1 ends.

[0109] It needs to be explained here that the current boot phase and the next boot phase are both relative to the moment when the virtual machine is selected and the virtual machine is continued to be booted, and not relative to the virtual machine itself. Specifically, before the moment when the virtual machine is continued to be booted, the boot phase in which the virtual machine is located is the current boot phase, and after the moment when the virtual machine is continued to be booted, the boot phase in which the virtual machine is located is the next boot phase.

[0110] For example, at the first moment when the virtual machine is selected to continue to boot to enter the next phase, the selection is made to continue to boot the virtual machine VM5-1 to make the virtual machine VM5-1 enter the second boot phase from the first boot phase. After the end of the second boot phase. At this time, the next phase of the virtual machine VM5-1 is the second boot phase.

[0111] When the next stage of the virtual machine VM5-1 ends, i.e. at a time after the end of the second boot stage, if the virtual machine continues to boot to enter the next stage at the second time, the current boot stage of the virtual machine VM5-1 is the second boot stage, the next stage of the virtual machine is the third boot stage, and if the virtual machine VM5-1 continues to boot, the virtual machine VM5-1 enters the third boot stage from the second boot stage.

[0112] In actual use, the virtual machine can also have some abnormal reasons, causing the boot progress to stop, i.e. always being in the corresponding boot stage and unable to end. In the above embodiment, since all the selected virtual machines need to be booted after the end of the next boot stage, if the progress of one virtual machine stops, the virtual machine cannot be selected and booted. To solve this problem, the embodiment also provides a preferred embodiment, which specifically comprises:

[0113] The boot progress of the virtual machine is monitored, and if the next boot stage of the virtual machine does not end after the corresponding virtual machine continues to boot for a first preset time, the virtual machine is suspended.

[0114] The virtual machine does not participate in subsequent boot, and the boot of the virtual machine is continued after the boot of other virtual machines ends.

[0115] If the next boot stage of the virtual machine does not end after the virtual machine continues to boot for a second preset time, the virtual machine is powered off and shut down, and an abnormal start error of the virtual machine is reported.

[0116] The first preset time and the second preset time are obtained by technicians in the art according to the speed of the virtual machine start.

[0117] The embodiment suspends the boot of the virtual machine with a stopped boot progress, and attempts to boot the virtual machine with a stopped boot progress after the boot of other virtual machines ends. On the one hand, it ensures that the boot of the global virtual machine can still proceed normally when the boot progress of the corresponding virtual machine stops. On the other hand, after the boot of other virtual machines ends, the resources for booting are largely released, so as to provide sufficient boot resources for the virtual machine with a stopped boot progress and ensure the resource conditions for normal boot start.

[0118] There is also a preferred embodiment:

[0119] The virtual machine reports booting progress information to the system every preset period. If the system has not received booting progress information from the virtual machine for more than a preset number of preset periods since the last time the system received booting progress information from the virtual machine, the virtual machine is considered unresponsive, the virtual machine is forcibly powered off and shut down, and the management node is reported to record the abnormally started virtual machine.

[0120] Embodiment 2:

[0121] In actual use, boot control of the virtual machine also needs to consume system resources, and because of the suspension operation of the virtual machine in the boot process, when the number of virtual machines that need to be booted is small, the average boot time of a single virtual machine may increase instead. To solve this problem, the embodiment limits the timing of boot control of the virtual machine on the basis of Embodiment 1, as shown in Figure 7 The method further includes:

[0122] In step 601, the throughput of the system in the boot process of each virtual machine is monitored.

[0123] In step 602, if the throughput of the system does not reach a second preset throughput, the boot of all virtual machines is performed concurrently.

[0124] In step 603, when the throughput of the system reaches the second preset throughput, the boot method of the virtual machine described in Embodiment 1 is performed, that is, the boot of each virtual machine is controlled, and the corresponding virtual machine is selected to continue booting to enter the next boot stage, and other virtual machines are suspended to release resources.

[0125] The second preset throughput is obtained by a person skilled in the art according to the maximum throughput that the system can bear. The second preset throughput should be less than or equal to the first preset throughput.

[0126] In actual use, when the throughput of the system reaches the second preset throughput and the boot of each virtual machine is controlled for the first time, some virtual machines may still be in the corresponding boot stage, and the boot stage has not ended and cannot enter the next boot stage. To solve this problem, the following preferred embodiments exist, which specifically include:

[0127] When the boot of each virtual machine is controlled for the first time, if the current boot stage of the virtual machine has not ended, the current boot stage of the virtual machine is taken as the next boot stage of the virtual machine, the throughput required by the current boot stage of the virtual machine is taken as the throughput required by the next boot stage of the virtual machine, the corresponding virtual machine is selected to continue booting, and other virtual machines are suspended.

[0128] And when the corresponding virtual machine continues to be guided, the virtual machine actually continues to guide the current booting stage until the current booting stage ends.

[0129] For example, if the system's throughput reaches the second preset throughput, the virtual machine VM5-1 is in the middle of the second booting stage, the virtual machine VM5-2 is in the middle of the first booting stage, and the fourth booting stage of the virtual machine VM5-3 ends, when the virtual machine VM5-1 and the virtual machine VM5-3 are selected to continue to be guided at the first time, the virtual machine VM5-1 continues to be guided in the second booting stage, and the virtual machine VM5-3 enters the fifth booting stage, when the second booting stage of the virtual machine VM5-1 ends and the fifth booting stage of the virtual machine VM5-3 ends, the selection of the virtual machine is re-performed, if the virtual machine VM5-1 and the virtual machine VM5-2 are selected at this time, the virtual machine VM5-1 enters the third booting stage, and the virtual machine VM5-2 continues to be guided in the first booting stage until the virtual machine VM5-2 continues to be guided in the first booting stage ends and the third booting stage of the virtual machine VM5-1 ends.

[0130] In the process of controlling the booting of the virtual machines, when the system's throughput recovers to the bearable range after the booting of some virtual machines ends and the occupied throughput is released, if the control of the booting is continued, the average booting time of a single virtual machine may increase. To solve this problem, the following preferred embodiments are provided, which specifically include:

[0131] In the process of controlling the booting of the virtual machines, if the current throughput C of the system recovers to be lower than the third preset throughput and lasts for the third preset time, after the current booting stage of all the virtual machines being guided ends (i.e. waiting for entering the next booting stage), the control of the booting is exited, and the virtual machines in the system are guided concurrently.

[0132] After the fourth preset time of entering the concurrent booting, if the current throughput C of the system is higher than the second preset throughput, the control of the booting of the virtual machines is not performed until the fourth preset time ends, if the current throughput C of the system is still higher than the second preset throughput, the control of the booting is continued to avoid the repeated switching between the concurrent booting and the control of the booting.

[0133] The third preset throughput is obtained by the person skilled in the art according to the maximum throughput that the system can bear, and the third preset throughput is less than the second preset throughput. The third preset time and the fourth preset time are obtained by the person skilled in the art according to experience.

[0134] The preferred embodiment sets the second preset throughput, the third preset throughput, the third preset time and the fourth preset time, so that the system throughput is switched between the boot control strategy and the parallel boot strategy, to balance the virtual machine boot rate and the system bearable throughput, and prevent the strategy from being frequently switched due to the system throughput mutation, to ensure the stable virtual machine boot process.

[0135] Embodiment 3:

[0136] Based on the method described in embodiment 1, the specific application scenario is combined, and the implementation process in the specific scenario is described by the technical description in the specific scenario.

[0137] As shown in Figure 8 , there are 100 computing nodes in the data center, and in this scenario, the system throughput during the boot process of each virtual machine is monitored in real time.

[0138] When the system throughput does not reach the second preset throughput, the boot of all virtual machines is performed concurrently, and the boot of each virtual machine is not controlled. When the number of simultaneously started virtual machines is large, so that the system throughput reaches the second preset throughput, the boot of each virtual machine is controlled, as shown in Figure 9 , which specifically includes:

[0139] In step 701, the load of each computing node is calculated, and each computing node is prioritized according to the load of each computing node.

[0140] In step 702, each virtual machine on the computing node is prioritized according to the current boot stage of each virtual machine.

[0141] In step 703, according to the priority of the computing node from high to low, each virtual machine is sequentially taken as a first virtual machine, and the cumulative value of the throughput required by the next boot stage of the first virtual machine and all second virtual machines accessed before the first virtual machine is calculated, until the cumulative value is greater than or equal to the throughput that the system can provide. All second virtual machines are added to the virtual machine boot list, and the virtual machines in the virtual machine boot list continue to be booted into the next boot stage, and the other virtual machines are suspended.

[0142] In step 704, after the next boot stage of all virtual machines in the virtual boot list is booted, return to step 602 to reorder and enter the next round of booting until all virtual machines are booted or enter the last boot stage before the booting is completed.

[0143] The load of each computing node is calculated, and the load W of the corresponding computing node is:

[0144] W = cpu_util x cpu_weight + mem_util x mem_weight

[0145] Wherein, the cpu_util is the CPU usage of the computing node, the cpu_weight is the CPU weight value, the mem_util is the memory usage of the computing node, and the mem_weight is the memory weight value.

[0146] The priority of each computing node is sorted according to the calculated load of each computing node. For example, the priority of each computing node is: compute5 > compute3 > compute7 >... > compute100.

[0147] It should be noted that, in the usual parlance of those skilled in the art, throughput can be represented by IOPS, and in the subsequent content of the embodiments of the present application, IOPS will also be directly used as a representative form of throughput description.

[0148] For example, assuming that all virtual machines in the data center use the same operating system, the boot process of the virtual machine is divided into 8 boot stages. In order to facilitate program implementation and subsequent embodiment description, each boot stage is described in numerical form, i.e. the 0th stage, the 1st stage, the 2nd stage, the 3rd stage, the 4th stage, the 5th stage, the 6th stage and the 7th stage.

[0149] Suppose that at this time, there are 3 virtual machines on the computing node compute5, namely VM5-1, VM5-2 and VM5-3, and there are 5 virtual machines on the computing node compute3, namely VM3-1, VM3-2, VM3-3, VM3-4 and VM3-5, and the boot stages of each virtual machine are as shown in Figure 10 Specifically, it includes:

[0150] VM5-1: the current boot stage is the 5th stage, the IOPS requirement of the current boot stage is 20 (i.e. the required throughput of the current boot stage), and the next boot stage is the 6th stage, the IOPS requirement of the next boot stage is 60 (i.e. the required throughput of the next boot stage).

[0151] VM5-2: the current boot stage is the 2nd stage, the IOPS requirement of the current boot stage is 20, and the next boot stage is the 3rd stage, the IOPS requirement of the next boot stage is 10.

[0152] VM5-3: the current boot stage is the 3rd stage, the IOPS requirement of the current boot stage is 10, and the next boot stage is the 4th stage, the IOPS requirement of the next boot stage is 30.

[0153] VM3-1: the current stage is stage 2, the IOPS requirement of the current boot stage is 20, the next boot stage is stage 3, and the IOPS requirement of the next boot stage is 10.

[0154] VM3-2: the current stage is stage 1, the IOPS requirement of the current boot stage is 10, the next boot stage is stage 2, and the IOPS requirement of the next boot stage is 20.

[0155] VM3-3: the current stage is stage 0, the IOPS requirement of the current boot stage is 5, the next boot stage is stage 1, and the IOPS requirement of the next boot stage is 10.

[0156] VM3-4: the current stage is stage 5, the IOPS requirement of the current boot stage is 20, the next boot stage is stage 6, and the IOPS requirement of the next boot stage is 60.

[0157] VM3-5: the current stage is stage 3, the IOPS requirement of the current boot stage is 10, the next boot stage is stage 4, and the IOPS requirement of the next boot stage is 30.

[0158] Then, according to the current boot stage of the virtual machine, the priority order of the virtual machines under the computing node compute5 is obtained in turn as: VM5-1>VM5-3>VM5-2. The priority order of the virtual machines under the computing node compute3 is obtained in turn as: VM3-4>VM3-5>VM3-1>VM3-2>VM3-3.

[0159] The global priority boot order of the virtual machines is determined in turn as: VM5-1>VM5-3>VM5-2>VM3-4>VM3-5>VM3-1>VM3-2>VM3-3>…>VM7-n>…>VM100-n.

[0160] According to the global priority boot order, each virtual machine is taken in turn as a first virtual machine, and the sum of the IOPS requirement of the next boot stage of the first virtual machine and the IOPS requirement of the next boot stage of all second virtual machines before the first virtual machine is calculated, and the sum is the total IOPS requirement required for the first virtual machine and the second virtual machines to enter the next boot stage, for example, taking VM3-4 as the first virtual machine, and the total IOPS requirement is:

[0161] V VM3-4 =IOPS(VM5-1)+IOPS(VM5-3)+IOPS(VM5-2)+IOPS(VM3-4)

[0162] wherein, V VM3-4The total IOPS requirement is calculated when VM3-4 is the first virtual machine. IOPS(VM5-1) is the IOPS requirement for the next boot stage of VM5-1, and so on.

[0163] For ease of illustration, assume the first preset throughput M = 300 and the system's current throughput C = 100. Subtract the system's current throughput from the first preset throughput to obtain the system's achievable throughput, i.e., MC. Here, the calculated value of MC is 200. When VM3-1 is the first virtual machine, the calculated total IOPS requirement is 60 + 30 + 10 + 60 + 30 + 10 = 200, which is equal to the value of MC. When VM3-2 is the first virtual machine, the calculated total IOPS requirement is 220, which is greater than the value of MC. This yields the virtual machine boot list for this round of boot control. The list contains six virtual machines that can enter the next boot stage: VM5-1, VM5-3, VM5-2, VM3-4, VM3-5, and VM3-1. Continue booting the virtual machines in the boot list to enter the next boot stage. Suspend the booting of other virtual machines besides these six to release resources and ensure that the virtual machines in the list can be successfully booted to the next stage.

[0164] All virtual machines in the virtual machine boot list have entered the next boot stage, and all tasks in the next boot stage have been completed, such as... Figure 11 As shown, VM5-1 enters stage 6, VM5-3 enters stage 4, VM5-2 enters stage 3, VM3-4 enters stage 6, VM3-5 enters stage 4, and VM3-1 enters stage 3. All virtual machine tasks in the list have finished execution and are waiting to enter the next boot stage. At this stage, the priority of the virtual nodes is recalculated, and a global priority boot order is sorted. Finally, a virtual machine boot list is calculated, and the next round of virtual machine boot control is entered based on this list. In this round, the calculated virtual machine boot list includes VM5-1, VM5-3, VM5-2, VM3-4, and VM3-5. The booting continues for these five virtual machines. It should be noted that, for ease of distinction, this boot round of continuing to boot these five virtual machines is subsequently referred to as the second round.

[0165] It should be noted that, Figure 10 and Figure 11 In the diagram, shaded areas indicate the boot stages the virtual machine has already gone through. The end of a shaded area represents the current boot stage, and blank areas following the shaded areas represent boot stages the virtual machine has not yet gone through. The beginning of a blank area indicates the next boot stage. For visual clarity, the throughput required by the virtual machine at each stage is also listed.

[0166] If the booting of the virtual machine ends, the virtual machine is no longer counted in the sequencing, as in the second round, VM5-1 is continued to be booted into the 7th stage, after the end of the task execution in the 7th stage, the booting of VM5-1 ends, when entering the next round of the second round, i.e. the third round, VM5-1 no longer participates in the booting, and the resources released by VM5-1 are used to boot other virtual machines.

[0167] Embodiment 4:

[0168] Based on the embodiments 1-3, the embodiment further provides a system for booting a virtual machine, which is used to execute the method for booting a virtual machine according to any one of the embodiments 1-3.

[0169] The method for booting a virtual machine is also described in detail in the embodiments 1-3, which is not described herein.

[0170] The embodiment further provides an optional architecture of the system for booting a virtual machine, as shown in Figure 12 The system includes a booting progress reporting module, a real-time monitoring module and a booting progress control module.

[0171] In actual application, the booting progress reporting module is an agent software installed on each computing node, which is used to report the current state and the booting progress of the virtual machine to the virtualization layer, and the virtualization layer reports the progress to the management node control module in real time.

[0172] The real-time monitoring module is used to obtain the current storage load and the computing node monitoring information, to calculate the system load and the resource usage in real time, and to deliver the system load and the resource usage to the progress control module for decision-making.

[0173] The booting progress control module is used to control the global virtual machine booting progress according to the global booting progress and the current load and resource usage, to calculate the maximum number of virtual machines allowed to enter the next stage and the priority computing node according to the preset maximum resource value of each booting stage. The control module suspends the virtual machines in other booting stages to release resources, and preferentially guarantees the virtual machines with fast progress to enter the next stage. The booting progress control module serves as a global control hub to control the global booting progress. When a virtual machine is booted, the booting progress control module first judges whether the virtual machine can enter the next stage. After the virtual machine is booted, the agent software in the virtual machine reports the progress in real time, and in combination with the current load and resource usage data of the real-time monitoring module, judges whether the virtual machine can be continuously booted. In the case that the system resources are sufficient, the global concurrent booting is performed. In the case that the system resources are insufficient, the booting stages of the virtual machines are controlled.

[0174] Embodiment 5:

[0175] As Figure 13As shown is a schematic diagram of an architecture of a virtual machine booting device according to an embodiment of the present application. The virtual machine booting device according to the embodiment comprises one or more processors 21 and a memory 22. Wherein, Figure 13 The processor 21 is taken as an example in the embodiment.

[0176] The processor 21 and the memory 22 can be connected through a bus or other means, Figure 13 The connection through the bus is taken as an example in the embodiment.

[0177] The memory 22 is a non-volatile computer readable storage medium, which can be used to store non-volatile software programs and non-volatile computer executable programs, such as the virtual machine booting method in the embodiment 1. The processor 21 executes the virtual machine booting method by running the non-volatile software programs and instructions stored in the memory 22.

[0178] The memory 22 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 22 can optionally include a memory remotely arranged relative to the processor 21, and these remote memories can be connected to the processor 21 through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0179] The program instructions / modules are stored in the memory 22, and when executed by the one or more processors 21, the virtual machine booting method in the above embodiment 1 is executed, such as the execution of the above-described Figure 1 、 Figures 4-7 and Figure 9 each step shown.

[0180] It is worth noting that the information interaction, execution process, etc. between the modules and units in the above device and system are based on the same concept as the processing method embodiments of the present application, and the specific content can be referred to the description in the method embodiments of the present application, which will not be described here.

[0181] Those skilled in the art can understand that all or part of the steps in the various methods of the embodiments can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer readable storage medium, which can include a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0182] The above merely describes preferred embodiments of the present application, and is not used to limit the present application, any modification, equivalent replacement and improvement within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A method of booting a virtual machine, the method comprising: The method comprises the steps of: dividing the booting process of the virtual machines into multiple booting stages; selecting the virtual machines to continue booting to enter the next booting stage according to the required throughput of the virtual machines in each booting stage, and suspending the booting of other virtual machines to release resources, so as to ensure that the throughput of the system does not exceed the first preset throughput during the booting process of the virtual machines.

2. The method of claim 1, wherein, The step of selecting the virtual machines to continue booting to enter the next booting stage according to the required throughput of the virtual machines in each booting stage comprises the steps of: determining a global priority booting order of the virtual machines according to the load of each computing node and / or the current booting stage of each virtual machine under the computing node; selecting the virtual machines in the front N positions in the global priority booting order according to the required throughput of the virtual machines in each booting stage, the current throughput of the system and the first preset throughput, and continuing to boot the selected virtual machines to enter the next booting stage, wherein the N is a positive integer.

3. The method of claim 2, wherein, The step of determining a global priority booting order of the virtual machines according to the load of each computing node and / or the current booting stage of each virtual machine under the computing node comprises the steps of: performing priority sorting on each computing node according to the load of the computing node; wherein the priority of the computing node is higher when the load of the computing node is smaller; performing priority sorting on each virtual machine on the computing node according to the current booting stage of the virtual machine; wherein the priority of the virtual machine is higher when the current booting stage of the virtual machine is closer to the end of the booting; determining the global priority booting order of the virtual machines according to the priority of the computing node and the priority of the virtual machine on the computing node.

4. The method of claim 2, wherein, The load of each computing node is calculated according to the CPU usage rate and the memory usage rate of the computing node, and the step comprises the steps of: multiplying the CPU weight value by the current CPU usage rate of the computing node to obtain a first value; multiplying the memory weight value by the current memory usage rate of the computing node to obtain a second value; adding the first value and the second value to obtain the load of the computing node.

5. The method of claim 3, wherein, The step of determining the global priority booting order of the virtual machines according to the priority of the computing node and the priority of the virtual machine on the computing node comprises the steps of: sorting multiple groups according to the priority of the computing node from high to low, wherein all the virtual machines on the same computing node are regarded as a group; sequentially sorting each virtual machine in the group according to the priority of the virtual machine on the computing node from high to low, and finally obtaining the global priority booting order.

6. The method of claim 2, wherein, The step of selecting the virtual machines in the front N positions in the global priority booting order according to the required throughput of the virtual machines in each booting stage, the current throughput of the system and the first preset throughput, and continuing to boot the selected virtual machines to enter the next booting stage comprises the steps of: According to the global priority booting order from front to back, the first virtual machine is taken as a first virtual machine, and a sum of a required throughput of a next booting stage of the first virtual machine and required throughputs of next booting stages of all second virtual machines before the first virtual machine is calculated until the sum is greater than a throughput that can be provided by the system, so as to select N second virtual machines in front positions; wherein the first preset throughput minus a current throughput of the system is taken as the throughput that can be provided by the system; All the second virtual machines are continuously booted into the next booting stage.

7. The method of claim 1 to 6, wherein, The booting method further comprises: After the next booting stage of all the selected virtual machines ends, the corresponding virtual machines are re-selected to continue to be booted into the next booting stage until all the virtual machines in the system are booted or enter a last booting stage before the booting ends.

8. The method of claim 1 to 6, wherein, The booting method further comprises: If the next booting stage of the virtual machine does not end after the corresponding virtual machine is continuously booted for a first preset time, the virtual machine is suspended; And the virtual machine does not participate in subsequent booting until the virtual machine is continuously booted after other virtual machines are booted. If the next booting stage of the virtual machine does not end after the virtual machine is continuously booted for a second preset time, the virtual machine is powered off.

9. The method of claim 1 to 6, wherein, The booting process of the virtual machine is divided into multiple booting stages, and the method comprises: According to an operating system used by the virtual machine, the booting process of the virtual machine is divided into multiple booting stages, when the operating system used by the virtual machine is a windows operating system, the virtual machine is divided into a pre-booting stage, a system starter loading stage, a kernel loading stage, a kernel initialization stage, a system initialization stage, a session manager starting stage, an advanced subsystem and service starting stage, a login manager starting stage and a background task loading stage; When the operating system used by the virtual machine is a linux operating system, the virtual machine is divided into a pre-booting stage, a GRUB booting program starting stage, a boot Loader executing stage, a kernel loading stage, a hardware driver loading stage, a starting point process initialization stage, a system initialization stage and a terminal establishing stage.

10. A virtual machine bootloader, characterized in that, The apparatus comprises: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the booting method of the virtual machine in any one of claims 1-9.

Citation Information

Patent Citations

  • Method for defending cloud platform virtual machines against storm starting

    CN106775931A