A method for starting up virtual machines in batches and a computing host
By dividing memory snapshots into small objects and downloading them from the storage system and other hosts together, the problem of high storage system and network load when virtual machines are started is solved, and faster and more stable batch startup of virtual machines is achieved.
Patent Information
- Application Number
- CN202111334944.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-11
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-11-11
AI Technical Summary
In existing desktop cloud systems, the startup performance of virtual machines is limited by the mechanical disk read and write speed of the underlying storage device, resulting in high storage system and network loads, which affects the startup speed of virtual machines.
Through the application of memory snapshot objects, the memory snapshot is divided into multiple small objects of fixed size and downloaded from the storage system and other hosts to generate and control the virtual machine to read the memory snapshot, reducing the amount of data and network resource consumption.
It effectively reduces the storage system and network load, and improves the speed and stability of batch startup of virtual machines.
Smart Images

Figure CN113986473B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of virtual machines, and in particular to a method for starting up virtual machines in batches and a computing host. Background Art
[0002] In the existing desktop cloud system, the startup performance of the desktop virtual machine is mainly determined by the performance of the underlying storage device. The current underlying storage device mainly uses a disk with large storage space. However, since the disk uses mechanical devices for addressing and reading and writing, it often has the problem of slow reading and writing speed, which seriously affects the read and write performance of the virtual machine. More importantly, a large number of read requests are often required when the virtual machine is started. When a large number of virtual machines are started at the same time, it will inevitably cause the storage system and network load to be particularly high, which seriously affects the startup speed of the virtual machine. Summary of the invention
[0003] The purpose of this application is to provide a method for batch starting virtual machines and a computing host, which can significantly reduce the amount of downloaded data through the application of memory snapshot objects, and can also significantly reduce network resource consumption through two-way downloading, thereby effectively solving the problem of high storage system and network load.
[0004] A first aspect of an embodiment of the present application provides a method for starting a virtual machine in batches, the method being applied to a computing host, the method comprising:
[0005] Creating multiple virtual machines and initializing the multiple virtual machines;
[0006] Downloading a plurality of first memory snapshot objects in a storage system;
[0007] receiving a second memory snapshot object sent by another host;
[0008] Generate multiple memory snapshots according to the first memory snapshot object and the second memory snapshot object;
[0009] The multiple virtual machines are controlled to read multiple memory snapshots; the multiple virtual machines correspond to the multiple memory snapshots one by one.
[0010] It can be seen that by implementing this implementation method, the memory snapshot can be divided into multiple small objects of fixed size and downloaded from the storage system and other hosts, thereby effectively reducing the amount of data uploaded and downloaded by the memory snapshot and reducing the network resource consumption of the storage system, thereby effectively solving the problem of high storage system and network load. At the same time, the batch startup of virtual machines in this way is faster and more stable.
[0011] Furthermore, before the step of creating multiple virtual machines, the method further includes:
[0012] Get multiple memory snapshots;
[0013] Dividing the multiple memory snapshots according to a preset capacity to obtain multiple small files;
[0014] Deduplication is performed on the multiple small files to obtain multiple memory snapshot objects;
[0015] The multiple memory snapshot objects are sent to the storage system.
[0016] Furthermore, the step of deduplicating the multiple small files to obtain multiple memory snapshot objects includes:
[0017] Calculate multiple hash values corresponding to the multiple small files one by one;
[0018] Small files corresponding to the same hash value among the multiple hash values are deleted to obtain multiple memory snapshot objects.
[0019] Furthermore, the step of downloading a plurality of first memory snapshot objects in the storage system includes:
[0020] Generate an object access matrix according to the multiple memory snapshot objects, the computing host and other hosts;
[0021] Sort the multiple memory snapshot objects by the number of access times from high to low to obtain an object access order;
[0022] Calculating according to the object access matrix and the object access sequence to obtain a multi-host cooperative downloading solution;
[0023] According to the multi-host cooperative downloading solution, multiple first memory snapshot objects are downloaded in the storage system.
[0024] Furthermore, the step of receiving the second memory snapshot object sent by other hosts includes:
[0025] According to the multi-host cooperative downloading solution, a second memory snapshot object sent by other hosts is received, and a third memory snapshot object required by the other hosts is sent.
[0026] A second aspect of an embodiment of the present application provides a computing host, the computing host comprising:
[0027] A creation unit, used to create a plurality of virtual machines and initialize the plurality of virtual machines;
[0028] A downloading unit, configured to download a plurality of first memory snapshot objects from a storage system;
[0029] A transmission unit, used for receiving a second memory snapshot object sent by another host;
[0030] A generating unit, configured to generate a plurality of memory snapshots according to the first memory snapshot object and the second memory snapshot object;
[0031] The startup unit is used to control the multiple virtual machines to read the multiple memory snapshots; the multiple virtual machines correspond to the multiple memory snapshots one by one.
[0032] It can be seen that by implementing this implementation method, the computing host can create multiple virtual machines and establish a memory snapshot object pool; specifically, the computing host downloads multiple memory snapshot objects from the storage system and other hosts, and sends the corresponding memory snapshot objects to each virtual machine, so that each virtual machine combines the corresponding memory snapshot, and then each virtual machine is started according to the memory snapshot. It can be seen that during the operation, the computing host no longer obtains the memory snapshot of each virtual machine as before, but obtains a large number of small-capacity memory snapshot objects in multiple directions, so that all virtual machines can be started stably and quickly. It should be noted that when there are multiple computing hosts, except for the current computing host, other computing hosts will be regarded as other hosts; when batch computing hosts exist, this type of computing host can better complete the task of batch starting virtual machines.
[0033] Furthermore, the computing host further includes:
[0034] An acquisition unit, used to acquire multiple memory snapshots;
[0035] A partitioning unit, configured to partition the plurality of memory snapshots according to a preset capacity to obtain a plurality of small files;
[0036] A deduplication unit, used for deduplicating the multiple small files to obtain multiple memory snapshot objects;
[0037] A sending unit is used to send the multiple memory snapshot objects to the storage system.
[0038] Furthermore, the deduplication unit comprises:
[0039] A calculation subunit, used for calculating a plurality of hash values corresponding to the plurality of small files one by one;
[0040] The deduplication subunit is used to delete small files corresponding to the same hash value among the multiple hash values to obtain multiple memory snapshot objects.
[0041] A third aspect of an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the virtual machine batch startup method described in any one of the first aspect of the embodiment of the present application.
[0042] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium storing computer program instructions. When the computer program instructions are read and executed by a processor, the method for batch starting virtual machines described in any one of the first aspect of the embodiment of the present application is executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 A flowchart of a method for starting up a virtual machine in batches provided in an embodiment of the present application;
[0045] Figure 2 A flowchart of another method for starting up virtual machines in batches provided in an embodiment of the present application;
[0046] Figure 3 A schematic diagram of the structure of a computing host provided in an embodiment of the present application;
[0047] Figure 4 A schematic diagram of the structure of another computing host provided in an embodiment of the present application;
[0048] Figure 5 An example schematic diagram of dividing and deduplicating memory snapshots to obtain memory snapshot objects provided in an embodiment of the present application;
[0049] Figure 6 A schematic diagram of memory snapshot downloading provided in an embodiment of the present application;
[0050] Figure 7 A schematic diagram of downloading and pushing a memory snapshot object pool provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0052] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0053] Example 1
[0054] Please see Figure 1 , Figure 1 A flow chart of a method for starting a virtual machine batch is provided for an embodiment of the present application. The method for starting a virtual machine batch is applied to a computing host, and the method comprises:
[0055] S101. Create multiple virtual machines and initialize the multiple virtual machines.
[0056] In this embodiment, multiple virtual machines are created in a computing host, and each virtual machine has a memory snapshot.
[0057] In this embodiment, the initialization is the initialization of various simulation devices in each virtual machine.
[0058] S102: Download multiple first memory snapshot objects in a storage system.
[0059] In this embodiment, the first memory snapshot object refers to a memory snapshot object downloaded from the storage system.
[0060] In this embodiment, the storage system may include multiple storage hosts, and there is no limitation in this embodiment on which storage host the operation is performed.
[0061] In this embodiment, the memory snapshot includes a plurality of memory snapshot objects. It is understandable that when the memory snapshot is 100 mb, a memory snapshot object may be only 1 mb.
[0062] For example, when there are two virtual machines, the first virtual machine has 50 memory snapshot objects, and the second virtual machine has 70 memory snapshot objects, wherein there are 20 duplicate memory snapshot objects between the first virtual machine and the second virtual machine. It can be seen that at this time, the computing host only needs to download 70+50-20=100 memory snapshot objects, instead of 120 memory snapshot objects. This is conducive to improving the download speed.
[0063] S103: Receive a second memory snapshot object sent by another host.
[0064] In this embodiment, the method not only downloads the first memory snapshot object from the storage system, but also obtains the second memory snapshot object from other hosts.
[0065] For example, the computing host needs to download 100 memory snapshot objects, but specifically, the computing host only downloads 60 memory snapshot objects in the storage system, and obtains 40 memory snapshot objects in other hosts. It can be seen that this method can reduce the number of transmissions in the storage system, thereby avoiding bandwidth limitations and improving the stability and efficiency of obtaining memory snapshot objects.
[0066] S104: Generate multiple memory snapshots according to the first memory snapshot object and the second memory snapshot object.
[0067] In this embodiment, the method combines the first memory snapshot object and the second memory snapshot object in the computing host respectively to obtain a memory snapshot that meets the requirements of each virtual machine.
[0068] S105, controlling the multiple virtual machines to read the multiple memory snapshots; the multiple virtual machines correspond to the multiple memory snapshots one by one.
[0069] In this embodiment, the computing host can control each virtual machine to load the corresponding memory snapshot, thereby achieving a fast and reliable batch startup effect.
[0070] For example, see Figure 6 and Figure 7 , VM is a virtual machine. Since the memory snapshots of virtual machines started on the same computing host have many identical small objects, the computing host first downloads the objects to the memory snapshot object pool, and then downloads the small objects to the virtual machine through the memory snapshot object pool. In this way, many identical data do not need to be downloaded multiple times. A computing host only needs to download once to allow multiple virtual machines to access them together, reducing the number of visits to the storage system and reducing network and storage resource consumption.
[0071] At the same time, in order to avoid all objects being downloaded directly by the computing host through the storage system, the network of the storage system may become a bottleneck problem of the system due to high usage rate. This method takes into account that the network between multiple computing hosts is still idle. Some objects may need to be accessed by multiple computing hosts. In this case, the object can be downloaded by one computing host and then pushed to other computing hosts that need the object. In this way, the object only needs to access the storage system once, reducing the number of accesses to the storage system. For objects that only need to be accessed by one computing host, the computing host directly accesses the storage system, and the computing network consumption is 0. For objects that need to be accessed by N (N>1) computing hosts, one of the computing hosts accesses the storage cluster to download the object and then pushes it to other N-1 hosts. The computing network consumption of the host that initiates the download and push operations is N-1 times, and the computing network consumption of other hosts is 1 time. In order to make the computing network consumption more balanced, a greedy algorithm can be used to select the download host.
[0072] In the embodiment of the present application, the execution subject of the method can be a computing device such as a computer or a server, and no limitation is made in this embodiment.
[0073] In the embodiment of the present application, the execution subject of the method can also be a smart device such as a smart phone, a tablet computer, etc., and there is no limitation on this in the present embodiment.
[0074] It can be seen that the implementation of the virtual machine batch startup method described in this embodiment can divide the memory snapshot into multiple small objects of fixed size and download them from the storage system and other hosts, thereby effectively reducing the amount of data uploaded and downloaded by the memory snapshot and reducing the network resource consumption of the storage system, thereby effectively solving the problem of high storage system and network load. At the same time, the virtual machine batch startup performed in this way is faster and more stable.
[0075] Example 2
[0076] Please see Figure 2 , Figure 2 A flow chart of a method for starting a batch of virtual machines provided in an embodiment of the present application. Figure 2 As shown, the method for starting virtual machines in batches includes:
[0077] S201. Acquire multiple memory snapshots.
[0078] In this embodiment, after the user finishes using the cloud desktop, the current interface will be retained, and the current interface is usually the start interface used by the user next time. Therefore, the memory snapshot of the current interface can be saved, which is conducive to the quick start of the virtual machine next time.
[0079] S202: Divide the multiple memory snapshots according to a preset capacity to obtain multiple small files.
[0080] In this embodiment, in order to start a virtual machine through a memory snapshot, each virtual machine needs to generate and save a memory snapshot in the storage system. Generally, memory snapshots are large files of hundreds to several gigabytes. If the memory snapshot of each virtual machine is stored independently, a large amount of data will need to be downloaded when starting virtual machines in batches. Since many virtual machines are created through templates, the memory snapshot data when the virtual machines are started is very similar. Therefore, this method reduces the storage and downloading amount of memory snapshots by implementing file deduplication compression.
[0081] As an optional implementation, after the step of dividing the multiple memory snapshots according to the preset capacity to obtain multiple small files, the method further includes:
[0082] De-duplicate multiple small files to obtain multiple memory snapshot objects.
[0083] See also Figure 5 ,exist Figure 5 This method divides the memory snapshot into multiple small files of 128KB in size, and then stores the multiple small files in the object storage, where each object can be compressed before being stored on the hard disk. At this time, only one copy of the same small file is saved, and no duplicate storage is performed. At this time, multiple memory snapshot objects are stored and downloaded.
[0084] In this embodiment, each memory snapshot object has a reference count to count how many memory snapshots the memory snapshot object is used by. Only when all memory snapshots using the object are deleted, the reference count will become 0, and then the memory snapshot object can be deleted.
[0085] In this embodiment, since many virtual machines are cloned from the same template, the data of the memory snapshots are all familiar, so many small files can point to multiple virtual machines, thereby having a high deduplication rate. By using the above deduplication method, the total amount of data storage can be greatly reduced, saving the space usage of object storage.
[0086] As a further optional implementation, the step of deduplicating multiple small files to obtain multiple memory snapshot objects includes steps S203 to S204.
[0087] S203, calculating multiple hash values corresponding to the multiple small files one by one.
[0088] S204: Delete small files corresponding to the same hash value among the multiple hash values to obtain multiple memory snapshot objects.
[0089] In this embodiment, the method can calculate the hash value of each small file, and each hash value retains a small file.
[0090] S205: Send multiple memory snapshot objects to the storage system.
[0091] S206: Create multiple virtual machines and initialize the multiple virtual machines.
[0092] S207: Generate an object access matrix according to multiple memory snapshot objects, computing hosts and other hosts.
[0093] For example, assuming a memory snapshot is 1GB, then starting 100 virtual machines at the same time requires access to 100GB of data in the storage system to start successfully. Assume that there are 5 computing hosts, and each computing host needs to access 20GB of data. Through data deduplication, if the data access volume of each computing host is halved, then the access volume to the storage cluster is reduced by half, leaving only 50GB. Since many objects are accessed by multiple computing hosts, accessing the storage system through one host and then pushing it to other computing hosts through the computing network can greatly reduce the access volume of the storage cluster, so that objects in the object storage system will only be accessed once. For those objects accessed by multiple computing hosts, by selecting the appropriate host to download and push, the computing network utilization can be more balanced. For example, Table 1 shows an object access matrix.
[0094] Table 1
[0095] Object Host A Host B Host C Host D Host E a 0 1 1 0 0 b 0 0 1 1 1 c 1 1 1 1 0 d 0 0 0 1 1 e 1 1 1 0 1 f 1 1 0 1 0 g 1 1 0 0 0 h 0 1 1 1 1 i 0 0 1 1 1 j 1 0 0 1 0
[0096] It can be seen that Table 1 shows the access matrix of 10 objects a to j, and the matrix value 1 indicates that the object is accessed by the host corresponding to the column head, and 0 indicates that the object is not accessed.
[0097] S208 , sorting the multiple memory snapshot objects from high to low according to the number of access times to obtain an object access order.
[0098] Taking another example, this method sorts all objects in reverse order based on the number of computing hosts accessed, and obtains the selection order of the objects, as shown in Table 2.
[0099] Table 2
[0100] c e h b f i a d g j 4 4 4 3 3 3 2 2 2 2
[0101] S209: Calculate according to the object access matrix and the object access sequence to obtain a multi-host cooperative downloading solution.
[0102] For further example, according to the sorting results in Table 2, a suitable download host is selected for the object in turn, and the selection results are shown in Table 3.
[0103] Table 3
[0104]
[0105] Among them, the method first selects a host for object c, and selects one from ABCD hosts. Since the number of visits to each host is 0 at this time, a random one is selected. Assuming A is selected, the number of visits to A is increased by 3, and the number of visits to BCD hosts is increased by 1. The second time, a host is selected for object e, and one is selected from ABCE hosts. At this time, host E has the lowest number of visits, so host E is selected as the download host, and the number of visits to E is increased by 3, and the number of visits to ABC hosts is increased by 1. The selection of other objects is carried out in sequence.
[0106] In this embodiment, for example, the multi-host cooperative downloading plan is that host A downloads object c, host E downloads object e, host D downloads object h, host C downloads object b, host B downloads object f, host E downloads object i, host B downloads object a, host D downloads object d, host A downloads object g, and host A downloads object j.
[0107] In this embodiment, the calculation rules of the multi-host cooperative download solution are as follows:
[0108] ① At the beginning of each computing host, the computing network consumption is 0 times, and the corresponding number is added each time an object is selected. For example, if an object needs to be accessed by three hosts A, B, and C, if host A is selected to download, then the computing network consumption of host A will be increased by 2(N-1) times, and hosts B and C will be increased by 1 time, and other hosts do not need to be changed;
[0109] ② Sort all objects in reverse order based on the number of computing hosts they access, that is, objects accessed by more hosts are given priority;
[0110] ③ Select a download host for the object in turn according to the sorting results;
[0111] ④ The selection rule is to select the host with the smallest current computing network consumption among all the hosts that need to be accessed by the object.
[0112] S210: Download multiple first memory snapshot objects in the storage system according to a multi-host cooperative downloading solution.
[0113] S211. According to the multi-host cooperative downloading solution, receive the second memory snapshot object sent by other hosts, and send the third memory snapshot object required by other hosts.
[0114] S212: Generate multiple memory snapshots according to the first memory snapshot object and the second memory snapshot object.
[0115] S213, controlling the multiple virtual machines to read the multiple memory snapshots; the multiple virtual machines correspond to the multiple memory snapshots one by one.
[0116] It can be seen that the implementation of the virtual machine batch startup method described in this embodiment can reduce the number of data uploads and downloads by splitting the virtual machine memory snapshots into small objects and storing them in the storage system, and realizing data deduplication through hash values. And by selecting a suitable host for downloading and using the network between computing hosts to transmit the same data, the bandwidth consumption of the storage system can be reduced.
[0117] Example 3
[0118] Please see Figure 3 , Figure 3 A schematic diagram of the structure of a computing host provided in an embodiment of the present application. Figure 3 As shown, the computing host includes:
[0119] A creation unit 310, configured to create a plurality of virtual machines and initialize the plurality of virtual machines;
[0120] The downloading unit 320 is used to download a plurality of first memory snapshot objects in the storage system;
[0121] A transmission unit 330, configured to receive a second memory snapshot object sent by another host;
[0122] A generating unit 340, configured to generate a plurality of memory snapshots according to the first memory snapshot object and the second memory snapshot object;
[0123] The startup unit 350 is used to control the multiple virtual machines to read the multiple memory snapshots; the multiple virtual machines correspond to the multiple memory snapshots one by one.
[0124] In the embodiments of the present application, the explanation of the computing host can refer to the description in Embodiment 1 or Embodiment 2, and will not be further elaborated in this embodiment.
[0125] It can be seen that the computing host described in this embodiment is implemented, and the computing host can create multiple virtual machines and establish a memory snapshot object pool; specifically, the computing host downloads multiple memory snapshot objects from the storage system and other hosts, and sends the corresponding memory snapshot objects to each virtual machine, so that each virtual machine combines the corresponding memory snapshot, and then each virtual machine is started according to the memory snapshot. It can be seen that during the operation, the computing host no longer obtains the memory snapshot of each virtual machine as before, but obtains a large number of small-capacity memory snapshot objects in multiple directions, so that all virtual machines can be started stably and quickly. It should be noted that when there are multiple computing hosts, except for the current computing host, other computing hosts will be regarded as other hosts; when batch computing hosts exist, this type of computing host can better complete the task of batch starting virtual machines.
[0126] Example 4
[0127] Please also read Figure 4 , Figure 4 : is a schematic diagram of the structure of a computing host provided in an embodiment of the present application. Figure 4 The compute host shown is composed of Figure 3 The calculation host shown is optimized. Figure 4 As shown, the computing host also includes:
[0128] An acquisition unit 360, configured to acquire multiple memory snapshots;
[0129] A division unit 370, configured to divide the plurality of memory snapshots according to a preset capacity to obtain a plurality of small files;
[0130] A deduplication unit 380, configured to deduplicate multiple small files to obtain multiple memory snapshot objects;
[0131] The sending unit 390 is used to send multiple memory snapshot objects to the storage system.
[0132] As an optional implementation, the deduplication unit 380 includes:
[0133] A calculation subunit 381, used for calculating a plurality of hash values corresponding to a plurality of small files one by one;
[0134] The deduplication subunit 382 is used to delete small files corresponding to the same hash value among multiple hash values to obtain multiple memory snapshot objects.
[0135] As an optional implementation, the downloading unit 320 includes:
[0136] A generating subunit 321, configured to generate an object access matrix according to a plurality of memory snapshot objects, computing hosts and other hosts;
[0137] The sorting subunit 322 is used to sort the multiple memory snapshot objects from high to low according to the number of access times to obtain the object access order;
[0138] A calculation subunit 323, used to calculate according to the object access matrix and the object access sequence to obtain a multi-host cooperative download solution;
[0139] The downloading subunit 324 is configured to download a plurality of first memory snapshot objects in the storage system according to a multi-host cooperative downloading solution.
[0140] As an optional implementation, the transmission unit 330 is specifically configured to receive the second memory snapshot object sent by other hosts and send the third memory snapshot object required by other hosts according to the multi-host cooperative download solution.
[0141] In the embodiments of the present application, the explanation of the computing host can refer to the description in Embodiment 1 or Embodiment 2, and will not be further elaborated in this embodiment.
[0142] It can be seen that the computing host described in this embodiment can reduce the amount of data uploaded and downloaded by the memory snapshot and reduce the network resource consumption of the storage system.
[0143] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute any one of the virtual machine batch startup methods in Embodiment 1 or Embodiment 2 of the present application.
[0144] An embodiment of the present application provides a computer-readable storage medium storing computer program instructions. When the computer program instructions are read and executed by a processor, any one of the virtual machine batch startup methods in Embodiment 1 or Embodiment 2 of the present application is executed.
[0145] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0146] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0147] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0148] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0149] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0150] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A method for starting virtual machines in batches, characterized in that: The method is applied to a computing host, and the method comprises: Creating multiple virtual machines and initializing the multiple virtual machines; Downloading a plurality of first memory snapshot objects in a storage system; receiving a second memory snapshot object sent by another host; Generate multiple memory snapshots according to the first memory snapshot object and the second memory snapshot object; Controlling the multiple virtual machines to read multiple memory snapshots; the multiple virtual machines correspond to the multiple memory snapshots one by one; Before the step of creating multiple virtual machines, the method further includes: Get multiple memory snapshots; Dividing the multiple memory snapshots according to a preset capacity to obtain multiple small files; Deduplication is performed on the multiple small files to obtain multiple memory snapshot objects; Sending the multiple memory snapshot objects to the storage system; The step of downloading a plurality of first memory snapshot objects in the storage system includes: Generate an object access matrix according to the multiple memory snapshot objects, the computing host and other hosts; Sort the multiple memory snapshot objects by the number of access times from high to low to obtain an object access order; Calculating according to the object access matrix and the object access sequence to obtain a multi-host cooperative downloading solution; According to the multi-host cooperative downloading solution, multiple first memory snapshot objects are downloaded in the storage system.
2. The method for starting up virtual machines in batches according to claim 1, characterized in that: The step of removing duplicates from the multiple small files to obtain multiple memory snapshot objects includes: Calculate multiple hash values corresponding to the multiple small files one by one; Small files corresponding to the same hash value among the multiple hash values are deleted to obtain multiple memory snapshot objects.
3. The method for starting up virtual machines in batches according to claim 1, characterized in that: The step of receiving the second memory snapshot object sent by other hosts comprises: According to the multi-host cooperative downloading solution, a second memory snapshot object sent by other hosts is received, and a third memory snapshot object required by the other hosts is sent.
4. A computing host, characterized in that: The computing host comprises: A creation unit, used to create a plurality of virtual machines and initialize the plurality of virtual machines; A downloading unit, configured to download a plurality of first memory snapshot objects from a storage system; A transmission unit, used for receiving a second memory snapshot object sent by another host; A generating unit, configured to generate a plurality of memory snapshots according to the first memory snapshot object and the second memory snapshot object; A startup unit, used for controlling the multiple virtual machines to read multiple memory snapshots; the multiple virtual machines correspond to the multiple memory snapshots one by one; Wherein, the computing host also includes: An acquisition unit, used to acquire multiple memory snapshots; A partitioning unit, configured to partition the plurality of memory snapshots according to a preset capacity to obtain a plurality of small files; A deduplication unit, used for deduplicating the multiple small files to obtain multiple memory snapshot objects; A sending unit, configured to send the plurality of memory snapshot objects to the storage system; Wherein, the downloading unit comprises: A generating subunit, for generating an object access matrix according to a plurality of memory snapshot objects, computing hosts and other hosts; A sorting subunit is used to sort multiple memory snapshot objects from high to low according to the number of access times to obtain the object access order; A calculation subunit, used for calculating according to the object access matrix and the object access sequence to obtain a multi-host cooperative downloading solution; The download subunit is used to download multiple first memory snapshot objects in the storage system according to a multi-host cooperative download solution.
5. The computing host according to claim 4, characterized in that: The deduplication unit comprises: A calculation subunit, used for calculating a plurality of hash values corresponding to the plurality of small files one by one; The deduplication subunit is used to delete small files corresponding to the same hash value among the multiple hash values to obtain multiple memory snapshot objects.
6. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the method for starting a batch of virtual machines according to any one of claims 1 to 3.
7. A readable storage medium, characterized in that: The readable storage medium stores computer program instructions, and when the computer program instructions are read and executed by a processor, the method for starting up virtual machines in batches according to any one of claims 1 to 3 is executed.
