Hibernation method and related device thereof
The virtual machine monitor saves and compresses the running data of the virtual machine and reads it when waking up, which solves the problem of virtual machine sleep delay, realizes efficient sleep and wake-up processes, and improves resource utilization and user experience.
Patent Information
- Application Number
- PCT/CN2024/087278
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-18
- Filing Date
- 2024-04-11
- Publication Date
- 2024-10-24
AI Technical Summary
There is a long delay during the hibernation process of the virtual machine, which leads to hibernation failure and wake-up delay, affecting resource utilization and user experience.
Use the virtual machine monitor to stop the running of the virtual machine to be hibernated, determine the memory page used to save the running data, compress it and store it in a predetermined storage object, so that the data can be read when waking up to ensure that the virtual machine inherits the data before it stops running. status, and select an appropriate target server to wake up, reducing the read and write pressure on storage objects.
It effectively reduces sleep and wake-up delays, improves sleep performance, ensures the virtual machine's sleep success rate and state consistency when waking up, and improves resource utilization and user experience.
Smart Images

Figure CN2024087278_24102024_PF_FP_ABST
Abstract
Description
Sleep method and related equipment
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on April 18, 2023, with application number 202310422540.8 and invention name “Hibernation method and related equipment”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of computer technology, and in particular to a sleep method and related devices. Background Art
[0003] This section is intended to provide a background or context for the embodiments of the present application as recited in the claims. No admission is made that the description herein is prior art by virtue of its inclusion in this section.
[0004] Due to service characteristics or user habits, cloud virtual machines aren't always used continuously. During periods of idle resources, users want to release virtual machines; before a service is operational, they want to quickly create virtual machines to start it up. From a user's perspective, on-demand virtual machine usage significantly reduces costs. From the cloud service provider's perspective, different tenants can time-multiplex computing resources, thereby improving resource utilization.
[0005] Currently, one method for releasing underlying resources on demand while preserving computing state is virtual machine hibernation. Traditional computer system hibernation operations have been standardized as the Advanced Configuration and Power Management Interface (ACPI). The ACPI specification defines the G1 / S4 states as 'Suspend-to-Disk'. This means that before hibernation, the operating system persists information in memory and peripherals to disk and reloads this information to initialize memory and peripherals before waking up, thus maintaining the computing system state before and after hibernation. In virtual machine scenarios, hibernation can still be achieved by relying on this capability, but doing so can cause hibernation failure. Another hibernation solution is hypervisor-based hibernation, in which the hypervisor stops the virtual machine during hibernation. However, current hypervisor-based hibernation suffers from long hibernation latency.
[0006] Summary of the Invention
[0007] The sleep method and related devices provided in the embodiments of the present application at least solve the problem of long sleep delay of the virtual machine.
[0008] According to one aspect of the present application, a dormancy method is provided, comprising:
[0009] When the virtual machine to be hibernated is stopped by the first virtual machine monitor of the first target server where the virtual machine to be hibernated is located, a memory page of the virtual machine to be hibernated in the memory of the first target server for storing running data of the virtual machine to be hibernated is determined;
[0010] After the first virtual machine monitor compresses the running data saved in the memory page, the running data is transferred to a predetermined storage object, so that when the to-be-hibernated virtual machine is awakened, the running data read from the storage object is used to enable the awakened to-be-hibernated virtual machine to inherit the running state before stopping.
[0011] Beneficial effects of the embodiments of the present application:
[0012] The hibernation method provided in the embodiment of the present application stops the operation of the virtual machine to be hibernated by the virtual machine monitor by scheduling the virtual processor of the virtual machine to be hibernated to run on the physical processor of the first target server, thereby stopping the operation of the virtual machine to be hibernated. The method determines the memory page in the memory on the first target server for storing the operation data of the virtual machine to be hibernated, and compresses the operation data stored in the memory page through the virtual machine monitor and stores it in the storage object, thereby reducing the read and write pressure of the storage object, thereby reducing the hibernation delay and wake-up delay, and improving the hibernation performance.
[0013] The details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar components or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in this application and should not be construed as limiting the scope of this application.
[0015] FIG1 is a schematic diagram of a process of a sleep method according to an embodiment of the present application;
[0016] FIG2 is a schematic diagram of a process for creating a target virtual machine according to an embodiment of the present application;
[0017] FIG3 is a schematic diagram of a process for selecting a second target server according to an embodiment of the present application;
[0018] FIG4 is a schematic diagram of a process for selecting a second target server according to an embodiment of the present application;
[0019] FIG5 is a schematic diagram of a hibernation system provided in one embodiment of the present application;
[0020] FIG6 is a schematic diagram of reducing latency based on a lightly loaded server according to an embodiment of the present application;
[0021] FIG7 is a schematic diagram of waking up a dormant virtual machine of an original specification by resizing it to a target specification, provided by an embodiment of the present application;
[0022] FIG8 is a schematic diagram of parallel transmission of running data between a Hypervisor and a storage object provided by an embodiment of the present application.
[0023] In the figure: 11. Cloud management and control platform; 12. Storage objects; 13. Inventory service. DETAILED DESCRIPTION
[0024] The following describes embodiments of the present invention in more detail with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the accompanying drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0025] In view of the fact that the existing virtual machine wake-up method relies on the wake-up capability of the virtual machine operating system, which may lead to sleep failure and long sleep delay, the first embodiment of the present application provides a sleep method, as shown in Figure 1, which includes the following steps:
[0026] Step S11: When the first virtual machine monitor of the first target server where the virtual machine to be dormant resides stops running the virtual machine to be dormant, memory pages in the memory of the first target server used to store the running data of the virtual machine to be dormant are determined. The hypervisor, also known as a virtual machine monitor (VMM), is software, firmware, or hardware used to create and execute virtual machines (VMs). The hypervisor is the core of virtual machine technology, a layer of code located between the operating system and computer hardware, used to partition the hardware platform into multiple virtual machines. The hypervisor runs in privileged mode and primarily isolates and manages multiple virtual machines running on the upper layer, arbitrates their access to the underlying hardware, and creates a virtual hardware environment (including physical processors, memory, and I / O read / write devices) for each client operating system that is independent of the actual hardware. The hypervisor uses a scheduling algorithm, such as a time-slice round-robin scheduling algorithm, to share the physical processor (CPU) between the virtual machines. In short, the hypervisor is a virtualization management component that allows multiple user operating systems to share the same physical host (server). The hypervisor can be used to manage the lifecycle of virtual machines, such as creating, pausing, and releasing virtual machines. After receiving a hibernation instruction from a user for a virtual machine to be hibernated, the embodiment of the present application first determines which virtual machine monitor is used to build the virtual machine to be hibernated. During the subsequent hibernation process, the virtual machine monitor is used to stop the operation of the corresponding virtual machine to be hibernated.
[0027] Step S12: After the first virtual machine monitor compresses the operating data stored in the memory page, the operating data is transferred to a predetermined storage object 12. When the dormant virtual machine is awakened, the operating data read from the storage object 12 is used to cause the awakened dormant virtual machine to inherit the operating state before it was stopped. The storage objects in the embodiments of the present application include memory, object storage services, file storage services, cloud disk services, etc., and the desired storage object can be selected according to actual needs.
[0028] Specifically, for memory pages used to store runtime data in the memory of the first target server, a virtual machine typically does not consume all of the memory pages occupied by the dormant virtual machine on the first target server. Therefore, during dormancy, before compressing the runtime data, the valid memory pages actually occupied by the dormant virtual machine can be exported from the dormant virtual machine. The hypervisor then compresses and persists only the runtime data stored in the valid memory pages. To export valid memory pages, a device (such as a virtio balloon) can be established in the dormant virtual machine. This device can export the valid memory pages actually occupied by the dormant virtual machine to the hypervisor, which then compresses and persists only the runtime data stored in these valid memory pages. Storing and reading the compressed runtime data reduces the read and write pressure on the storage object, thereby reducing dormancy latency and wakeup latency, and improving dormancy performance. The virtio balloon described in the embodiments of the present application is a virtual device that can be used to transmit the virtual machine's memory usage status to the hypervisor, allowing the hypervisor to identify and release inactive virtual machine memory. Virtio balloon is usually used to accelerate hot migration and memory overselling scenarios.
[0029] Therefore, in the process of stopping the operation of the virtual machine to be hibernated, the virtual machine monitor stops scheduling the virtual processor of the virtual machine to be hibernated to run on the physical processor of the first target server, determines the memory page in the memory on the first target server for storing the operation data of the virtual machine to be hibernated, and compresses the operation data stored in the memory page through the virtual machine monitor and stores it in the storage object, so that the virtual machine can be hibernated without relying on the hibernation capability of the virtual machine operating system, ensuring the hibernation success rate of the virtual machine while reducing the read and write pressure of the storage object, thereby reducing the hibernation delay and wake-up delay, and improving the hibernation performance.
[0030] The running data of the embodiment of the present application includes the memory data of the virtual machine. If the virtual machine also mounts virtual peripherals such as a graphics processing unit (GPU) and an accelerator, the running data includes, in addition to the memory data, the device context information of the virtual peripherals such as the graphics processing unit (GPU) and the accelerator. Correspondingly, when waking up the corresponding virtual machine to be dormant, the second virtual machine monitor, in addition to using the memory data to initialize the memory of the virtual machine, also needs to use the corresponding device context information to further initialize the virtual peripherals, so as to ensure the consistency of the running state of the virtual machine when waking up and the running state before dormancy. To this end, the embodiment of the present application needs to transfer the memory data and device context information in the running data from the memory of the first target server to a predetermined storage object 12 through the first virtual machine monitor. Because the server needs to be rescheduled after waking up to establish the virtual machine to be dormant that needs to be awakened, in order to ensure the consistency of the running state of the virtual machine before and after dormancy, the embodiment of the present application uses the storage object 12 for persistent storage of the running data of the virtual machine to be dormant. The storage object 12 is such as an object storage object 12, a file storage object, or a cloud disk service, as long as it can ensure the safe storage of the running data without loss. Then, as shown in FIG2 , the method provided in the embodiment of the present application further includes:
[0031] Step S21: In response to the wake-up instruction for the virtual machine to be hibernated, a creation instruction for instructing to rebuild the virtual machine to be hibernated is sent to the second virtual machine monitor of the second target server.
[0032] Step S22: The second virtual machine monitor responds to the creation instruction, uses the second target server to rebuild the virtual machine to be hibernated to obtain the target virtual machine, and uses the running data read from the storage object 12 to make the target virtual machine inherit the running state of the virtual machine to be hibernated before it stops running. Specifically, the second virtual machine monitor writes the running data read from the storage object 12 into the memory allocated to the target virtual machine by the second target server, and uses the running data (such as memory data and / or device context information) to initialize the memory of the target virtual machine, thereby ensuring the consistency of the running state of the target virtual machine established by awakening and the running state of the virtual machine to be hibernated before hibernation. Therefore, in the wake-up phase of the virtual machine, the embodiment of the present application reschedules the server required to wake up the virtual machine to ensure that the virtual machine can be successfully awakened.
[0033] As shown in FIG3 , in step S22 , before the second virtual machine monitor responds to the creation instruction and uses the second target server to recreate the virtual machine to be dormant to obtain the target virtual machine, the method provided in the embodiment of the present application further includes:
[0034] Step S31: Determine the concurrent wake-up number of each server in the physical server pool. The concurrent wake-up number is the number of virtual machines that need to be woken up on the server. The physical server pool is a collection of multiple servers, that is, the physical server pool is used to provide the required servers for the virtual machine monitor to produce virtual machines.
[0035] Step S32: Select a second target server from the physical server pool based on the concurrent wakeup count, so that the second virtual machine monitor can use the second target server to rebuild the target virtual machine and write the running data to a predetermined memory page in the memory of the second target server, so that the target virtual machine inherits the running state of the virtual machine to be dormant before it stopped running. In the embodiment of the present application, the second target server can be the first target server or a server of other specifications, so that the virtual machine to be dormant can be rebuilt in place or rebuilt and woken up on a server of other specifications.
[0036] Specifically, the embodiment of the present application can select the second target server from the physical server pool according to the concurrent wake-up number through the inventory service 13. The inventory service 13 will track the unoccupied physical resources of each server in the physical server pool, and when the second virtual machine monitor establishes a virtual machine, select a suitable server for the second virtual machine monitor to wake up the virtual machine to be dormant. The unoccupied physical resources of the server are at least used to indicate whether the physical resources of the server are virtual machines, the remaining physical resources, etc. Among them, the concurrent wake-up number of the second target server is less than the concurrent wake-up number of other servers. The embodiment of the present application selects a server with a small concurrent wake-up number to wake up the virtual machine to be dormant by considering the concurrent wake-up number of the server, thereby reducing the load of each server and reducing the wake-up delay.
[0037] Therefore, the embodiment of the present application selects a server with a small number of concurrent wake-ups, creates a target virtual machine through a virtual machine monitor to wake up the virtual machine, reduces the concurrent wake-up number of a single server, and thus reduces the wake-up queuing delay of a single server, as well as the computing resources consumed by the wake-up, the download delay of the running data from the storage object 12, etc.
[0038] The method provided by the embodiment of the present application also includes: when the running data of the virtual machine to be dormant is transferred to the storage object through the first virtual machine monitor, it is determined whether there is another virtual machine on the first target server that needs to be awakened. If so, after writing the running data of the other virtual machine to the first target server, the running data of the virtual machine to be dormant is transferred to the storage object. Therefore, the embodiment of the present application performs service classification for operations related to dormancy and wake-up through the first virtual machine monitor. In actual applications, the delay of wake-up is more important. Therefore, if a single server has queues of dormancy and wake-up tasks at the same time, that is, a single server has both running data that needs to be transferred and write operations for running data required for wake-up, the write operation of the running data required for wake-up takes priority, thereby reducing the wake-up delay and improving the user experience.
[0039] As shown in FIG4 , in step S32 , before the second virtual machine monitor uses the second target server to reconstruct and obtain the target virtual machine, the method provided in the embodiment of the present application further includes:
[0040] Step S41: Obtain pre-saved attribute information of the virtual machine to be hibernated, the attribute information including the original specifications of the virtual machine to be hibernated, the original specifications including at least the specifications of the virtual processor and virtual memory of the virtual machine to be hibernated. The specifications of the virtual processor are generally distinguished by determining the number of cores of the physical processor occupied by the virtual machine to be hibernated (i.e., the number of CPU cores), and the specifications of the virtual memory are distinguished by the memory size of the virtual machine to be hibernated on the corresponding first target server. The original specifications may also include specification information such as whether the virtual machine to be hibernated has mounted virtual peripherals and the model of the physical processor.
[0041] Step S42: Determine the physical server pool's inventory information. This inventory information reflects the unused physical resources of each server in the physical server pool. This inventory information is managed by the inventory service 13, which updates it in real time based on the creation, hibernation, and termination of each virtual machine. Based on the server's unused physical resources (i.e., physical processor and memory resources), it is determined whether the server currently has the physical resources to wake up the dormant virtual machine.
[0042] Step S43: Based on the attribute information and inventory information, determine whether there is a server in the physical server pool that meets the requirements for establishing a target virtual machine with the original specifications. If not, select a second target server from the physical server pool that meets the requirements for establishing a target virtual machine with the target specifications, where the target specifications are different from the original specifications.
[0043] Then, in step S32, the step of the second virtual machine monitor using the second target server to reconstruct the target virtual machine includes: the second virtual machine monitor responds to the creation instruction, creates a target virtual machine with the target specifications using the second target server, and makes the created target virtual machine have the same specifications of virtual processor and virtual memory as the virtual machine to be dormant. Therefore, in the wake-up phase of the embodiment of the present application, the virtual machine may fail to wake up successfully due to insufficient inventory of idle servers in the physical server pool. In addition to rescheduling the target server during wake-up, the embodiment of the present application also allows the virtual machine to be hot-allocated to other specifications through the above steps S41 to S43, thereby achieving the purpose of rebuilding and waking up the virtual machine to be dormant on a server of other specifications. It is only necessary to ensure that the target virtual machine and the virtual machine to be dormant have the same specifications of virtual processor and memory to achieve successful wake-up of the virtual machine, and the specifications such as whether the virtual peripherals are mounted and the model of the physical processor do not need to be the same. In this way, by merging pools of different specifications, the inventory capacity of servers in the physical server pool can be greatly improved, and the probability of wake-up failure can be reduced.
[0044] In an embodiment of the present application, the step of the second virtual machine monitor writing the operating data to a predetermined memory page in the memory of the second target server includes: the second virtual machine monitor reads the operating data from the storage object 12, decompresses the operating data, and then writes it to the predetermined memory page of the second target server. In an embodiment of the present application, the read and write pressure of the storage object 12 is reduced by compressing the operating data such as the memory data of the virtual machine to be dormant, thereby reducing the size of the storage content, thereby reducing the latency of dormancy and wakeup. The operating data obtained from the storage object 12 is decompressed to the predetermined memory page in the memory on the second target server to implement the memory initialization operation of the awakened target virtual machine, thereby ensuring the consistency of the target virtual machine and the running state of the virtual machine to be dormant before dormancy.
[0045] The method provided in the embodiment of the present application also includes: using a parallel transmission strategy through the first virtual machine monitor to save the operating data of multiple virtual machines to be dormant to the storage object 12. Secondly, using a parallel transmission strategy through the second virtual machine monitor to decompress the operating data of multiple virtual machines to be dormant read from the storage object 12 and write it to a predetermined memory page of the second target server. Parallel transmission is the transmission of multiple data bits (operating data in the embodiment of the present application) between the virtual machine monitor and the storage object 12 at the same time. Therefore, the embodiment of the present application improves the storage / reading throughput of operating data by using a multi-stream parallel transmission strategy through the virtual machine monitor.
[0046] The method provided in the embodiment of the present application further includes: allocating the bandwidth resources that the virtual machine to be dormant had before it stopped running to the second virtual machine monitor, so that the second virtual machine monitor uses the bandwidth resources to read and / or save the running data from the storage object 12. Therefore, in view of the fact that the second virtual machine monitor needs to consume a certain amount of network / storage bandwidth resources when storing and / or reading the running data, and because the virtual machine to be dormant is in a stopped state during the memory storage and / or reading process, the second virtual machine monitor can reuse all the network / storage bandwidth resources allocated to the virtual machine to be dormant, thereby avoiding interference with dormancy caused by the consumption of additional resources and ensuring the success rate of dormancy awakening.
[0047] The method provided in the embodiment of the present application further includes: the first virtual machine monitor releasing the physical resources of the virtual machine to be hibernated on the first target server, and causing the second virtual machine monitor to compress and / or decompress the running data by reusing the physical resources, and read and / or save the running data to the storage object 12. In the embodiment of the present application, the first virtual machine monitor releases the physical resources of the virtual machine to be hibernated on the first target server, thereby reducing resource consumption costs, avoiding interference with hibernation caused by additional resource consumption, and ensuring the success rate of hibernation awakening.
[0048] The method provided in the embodiment of the present application also includes: providing services to the first virtual machine monitor and the second virtual machine monitor through a domain-based deployment of multiple storage objects 12, wherein the domain-based deployment is a deployment method in which the storage object 12 stores the operating data of a predetermined number of virtual machines to be dormant. The embodiment of the present application deploys the storage objects 12 in a domain-based manner to reduce the number of dormant / awakened virtual machines connected within a single domain, thereby reducing the sudden incast read and write traffic pressure caused by the concurrent dormancy / awakening of multiple virtual machines. Incast refers to a many-to-one communication mode, which is commonly found in data centers that deploy a large number of distributed storage or computing services. The embodiment of the present application is mainly used to describe the read and write traffic pressure of a storage object 12 corresponding to multiple virtual machines exceeding a predetermined number.
[0049] Since the virtual machine to be hibernated may cache cloud disk I / O data in memory when it is in hibernation, in order to further ensure that the virtual machine to be hibernated can be awakened normally, the method provided in the embodiment of the present application also includes: saving the cloud disk data of the cloud disk originally mounted on the virtual machine to be hibernated, so that after the second virtual machine monitor uses the second target server to create a target virtual machine, the target cloud disk with cloud disk data is mounted on the target virtual machine. Since the method of saving the cloud disk data of the virtual machine to be hibernated includes not releasing the cloud disk, or taking a snapshot of the cloud disk data and releasing the cloud disk resources, etc., if the cloud disk data is saved without releasing the cloud disk, the target cloud disk mentioned in the embodiment of the present application is the cloud disk originally mounted on the virtual machine to be hibernated, otherwise it is another cloud disk that obtains the cloud disk data of the virtual machine to be hibernated.
[0050] The second embodiment of the present application also provides a sleep device, wherein the device is used to execute a sleep method. For the specific content of the sleep method, please refer to the content provided in the first embodiment of the present application, and the embodiments of the present application will not be repeated here.
[0051] The third embodiment of the present application also provides a hibernation system, wherein the system includes the above-mentioned hibernation device. For the specific content of the hibernation device, please refer to the content provided in the first embodiment of the present application, and the embodiment of the present application will not be repeated here. The hibernation system provided by the embodiment of the present application also includes a storage object 12 and an inventory service 13. Because the server needs to be rescheduled after waking up to establish the dormant virtual machine that needs to be awakened, in order to ensure the consistency of the virtual machine's running state before and after hibernation, the embodiment of the present application uses the storage object 12 to persistently store the running data of the dormant virtual machine. To this end, when the dormant virtual machine is put into hibernation (i.e., stops running), the hibernation device transfers the running data from the memory of the first target server to the predetermined storage object 12 through the first virtual machine monitor. When the dormant virtual machine is awakened, the second virtual machine monitor rewrites the running data read from the storage object 12 into the predetermined memory page of the second target server required for awakening. Because the inventory service 13 tracks the unoccupied physical resources of each server in the physical server pool, the hibernation device provided in the embodiment of the present application responds to the wake-up instruction for the virtual machine to be hibernated. After selecting the second target server required to rebuild the virtual machine to be hibernated from the physical server pool by calling the inventory service 13, the hibernation device sends a creation instruction for instructing the second virtual machine monitor of the second target server to rebuild the virtual machine to be hibernated. When the hibernation device in the embodiment of the present application establishes a virtual machine on the second virtual machine monitor through the inventory service 13, it selects a suitable server for the virtual machine monitor to wake up the virtual machine to be hibernated. Afterwards, the second virtual machine monitor responds to the creation instruction and uses the second target server to rebuild the virtual machine to be hibernated to obtain the target virtual machine. The second virtual machine monitor also writes the operating data read from the storage object 12 to the predetermined memory page of the second target server, and uses the operating data (such as memory data and / or device context information) to initialize the memory of the target virtual machine, thereby ensuring the consistency of the operating state of the target virtual machine established by awakening and the virtual machine to be hibernated before hibernation.
[0052] Specifically, as shown in FIG5 , when the virtual machine monitor is a hypervisor and the hibernation device is a cloud control platform 11 (the cloud control platform 11 is a platform that provides comprehensive cloud resource supply, operation and maintenance, and operational management capabilities, and has core competitiveness such as integrated control, automated operation and maintenance, intelligent analysis, and personalized expansion), the hibernation system provided in the embodiment of the present application mainly includes two processes when performing hibernation processing of the virtual machine based on the hypervisor: a hibernation operation process and a wake-up operation process, which are detailed as follows:
[0053] Hibernation operation process: When the user issues a hibernation command, the cloud management and control platform 11 sends a pause command "pouse VM" to the first virtual machine monitor Hypervisor of the first target server where the virtual machine to be hibernated is located, notifying the first virtual machine monitor Hypervisor to pause the virtual machine to be hibernated, and compresses the memory data of the virtual machine to be hibernated through the first virtual machine monitor and stores it persistently in the storage object 12, and then releases the physical processor CPU and memory resources occupied by the virtual machine to be hibernated on the first target server. Compressing the memory data reduces the size of the storage content and reduces the read and write pressure of the storage object 12. Among them, the storage object 12 includes object storage object 12, file storage object, and cloud disk service. To ensure that dormant VMs can be awakened normally, the cloud management and control platform layer 11 needs to retain the attribute information of the dormant VMs. This attribute information includes the original specifications of the dormant VMs, the devices mounted to the VMs (network card, cloud disk, virtual graphics processor vGPU, etc.), the region / availability zone where the VMs are located, etc. At the same time, since cloud disk data may be cached in the memory of the dormant VMs during the dormant period, the cloud disk data corresponding to the dormant VMs must be retained and the cloud disk data of the corresponding dormant VMs must be matched one-to-one with the memory data. Methods for retaining cloud disk data include not releasing the cloud disk, or taking a snapshot of the cloud disk data and releasing the cloud disk resources.
[0054] Wake-up operation process: When the user issues a wake-up instruction, the cloud management and control platform 11 calls the inventory service 13 to select a suitable second target server to recreate the virtual machine to be dormant based on the attribute information of the stored virtual machine. In addition to considering the constraints such as the server inventory and server specifications of the physical server pool, the inventory service 13 also needs to consider the number of concurrent sleeps and wake-ups on each server to schedule the servers required for reconstruction, so as to reduce the server load and reduce the delay of sleep / wake-up. After the second target server is selected, the cloud management and control platform 11 sends a creation instruction to the second virtual machine monitor Hypervisor of the second target server to create a target virtual machine. The creation instruction is an instruction for instructing the second virtual machine monitor Hypervisor to rebuild the virtual machine to be dormant. At this time, the second virtual machine monitor Hypervisor will read the memory persistence information (i.e., the memory data saved during sleep) from the storage object 12 and use the read memory data to initialize the target virtual machine memory. After the second virtual machine monitor Hypervisor remounts the cloud disk, it starts the target virtual machine, thereby completing the reconstruction of the virtual machine to be dormant. After the virtual machine to be dormant is rebuilt and awakened, its persistent memory data can be deleted from the storage object 12, thereby alleviating the reading and writing pressure of the storage object 12.
[0055] Latency is a core indicator of sleep / wake-up. As shown in Figure 6, QoS in Figure 6 refers to a network's ability to use various basic technologies to provide better service capabilities for specified network communications. It is a network security mechanism and a technology used to solve problems such as network delay and congestion. The embodiment of the present application mainly refers to a method for reducing sleep / wake-up latency. Specifically, the embodiment of the present application uses the following method to reduce the sleep or wake-up latency of a virtual machine to be dormant:
[0056] 1) When waking up a dormant virtual machine, select a server with a lower concurrent wakeup count through the inventory service, reducing the concurrent wakeup count of a single server. This reduces the sleep / wakeup queue delay, computing resources consumed by the sleep / wakeup, and memory data upload and download delays for a single server.
[0057] 2) The first virtual monitor, the Hypervisor, performs service grading for sleep and wake-up operations. In actual applications, the wake-up delay may be more important. Therefore, if a single server has both sleep and wake-up tasks queued, that is, if a single server has both running data that needs to be transferred and running data required for wake-up that needs to be written, the write operation of the running data required for wake-up will be given priority, thereby reducing the wake-up delay and improving the user experience.
[0058] 3) The embodiment of the present application also deploys the storage object 12 in different domains to reduce the number of dormant / awakened virtual machines connected in a single domain, thereby reducing the sudden incast read and write traffic pressure caused by the concurrent dormancy / awakening of multiple virtual machines.
[0059] 4) Compress the memory data of the dormant virtual machine during the dormant operation process to reduce the size of the stored content and reduce the reading and writing pressure of the storage object 12.
[0060] The optimization method for the wake-up success rate in the embodiment of the present application is as follows:
[0061] Because the underlying physical resources of a virtual machine are released during hibernation, insufficient server inventory in the physical server pool may cause the virtual machine to fail to wake up during the wakeup phase. To address this issue, embodiments of the present application reschedule the target server during wakeup to rebuild and wake up the virtual machine, allowing the virtual machine's original specifications to be hot-shifted to the target specifications. This way, by combining pools of different specifications, the physical server pool's inventory capacity can be greatly increased and the probability of wakeup failures reduced. As shown in Figure 7, the original specification of the dormant virtual machine is A. During the wakeup phase, due to insufficient server inventory that meets the requirements for creating a virtual machine of original specification A, the inventory service 13 selects another server compatible with creating a target virtual machine of target specification B for the wakeup operation. Based on the target server selected by the inventory service 13, the cloud management and control platform 11 performs the necessary virtual machine instance attribute changes and sends a create command to the second hypervisor, which creates a target virtual machine of target specification B. Generally speaking, original specification A and target specification B have the same virtual processor and virtual memory specifications, but the specifications such as whether virtual peripherals are mounted and the physical processor model do not need to be the same. Therefore, virtual machines can be woken up by combining pools of different specifications.
[0062] To address the high concurrency of dormant / wake-up virtual machines, the server needs to reserve sufficient resources for the second virtual machine monitor (Hypervisor) to quickly store / read memory data while avoiding interference with the computing / IO performance of other virtual machines on the same server. To address this issue, the present embodiment uses a method of compressing memory data to reduce data transmission volume, i.e., trading computing resources for network resources. Furthermore, as shown in FIG8 , network transmission uses a multi-stream parallel transmission strategy to maximize the throughput of memory data storage / reading.
[0063] In addition, the embodiment of the present application can reuse the resources of the dormant virtual machine to be dormant, avoiding interference caused by the consumption of additional resources. For this reason, the second virtual machine monitor Hypervisor needs to consume a certain amount of network bandwidth when storing / reading memory data. Since the virtual machine to be dormant is in a shutdown state during the memory storage / reading process, the second virtual machine monitor can reuse all network / storage bandwidth resources allocated to the virtual machine to be dormant. The second virtual machine monitor Hypervisor requires certain physical resources when compressing and / or decompressing memory data, and storing and / or reading memory data. Since the virtual machine to be dormant is in a shutdown state during the wake-up operation process, the second virtual machine monitor can reuse all physical processor CPU resources and part of the memory resources of the virtual machine to be dormant to compress and / or decompress memory data, and store and / or read memory data.
[0064] In the embodiment of the present application, the process of waking up the to-be-hibernated virtual machine is actually the process of creating a new target virtual machine. In the embodiment of the present application, the target virtual machine integrates all the physical properties, memory data, and cloud disk data of the source virtual machine (i.e., the to-be-hibernated virtual machine before hibernation). Therefore, the target virtual machine does not need to correct any information, that is, it can continue to run in the state before hibernation. However, due to the long-term shutdown of the virtual machine, the network status will expire, and the time of the target virtual machine will be inconsistent with the time of the to-be-hibernated virtual machine before hibernation (i.e., the clock is incorrect and out of sync). In the embodiment of the present application, the network relies on application self-recovery, such as an expired TCP connection that needs to be reconnected. As for time correction, the built-in time synchronization service (such as NTP service) of the target virtual machine is used to force clock synchronization to ensure time consistency.
[0065] The content of the above-mentioned hibernation operation process of this application only considers network / storage peripherals, so only memory data is persisted. In fact, the virtual machine to be hibernated may also mount other virtual peripherals. Therefore, when rebuilding the target virtual machine, it is also necessary to rebuild the virtual peripherals, such as graphics processing devices GPU or accelerators. In this scenario, in addition to persisting memory data, it is also necessary to persist the device context information of the virtual peripherals, that is, the first virtual machine monitor is required to store the device context information to the storage object 12. Correspondingly, when waking up the virtual machine to be hibernated, the second virtual machine monitor Hypervisor, in addition to using the persisted memory data to initialize the memory, also needs to use the device context information read from the storage object 12 to further initialize the virtual peripherals to ensure the consistency of the running status of the current virtual machine and the source virtual machine when waking up.
[0066] It can be seen that the Hypervisor-based hibernation system proposed in the embodiment of the present application has the advantages of high concurrency, low latency, and high wake-up success rate, and is suitable for large-scale deployment on the cloud.
[0067] The fourth embodiment of the present application also provides an electronic device, including: a processor, and a memory for storing a program, wherein the program includes instructions, and when the instructions are executed by the processor, the processor executes the above-mentioned sleep method. For details of the sleep method, please refer to the content provided in the first embodiment of the present application, and the embodiments of the present application will not be repeated here.
[0068] The fifth embodiment of the present application further provides a non-transitory machine-readable medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the above-mentioned sleep method. For details of the sleep method, please refer to the content provided in the first embodiment of the present application, and the embodiments of the present application will not be repeated here.
[0069] The sixth embodiment of the present application also provides a computer program product, including a computer program, wherein the computer program, when executed by the computer's processor, is used to enable the computer to execute the above-mentioned sleep method. For details of the sleep method, please refer to the content provided in the first embodiment of the present application, and the embodiments of the present application will not be repeated here.
[0070] The computer programs for implementing the methods of the embodiments of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0071] In the context of the present application embodiment, machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable signal medium can include but is not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0072] It should be noted that the term "including" and its variations used in the embodiments of the present application are open inclusions, that is, "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The modifications of "one" and "multiple" mentioned in the embodiments of the present application are illustrative and not restrictive. Those skilled in the art should understand that unless the context clearly indicates otherwise, it should be understood as "one or more".
[0073] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0074] The various steps described in the method implementation schemes provided in the embodiments of the present application can be performed in different orders and / or in parallel. In addition, the method implementation schemes may include additional steps and / or omit the steps shown. The scope of protection of the present application is not limited in this respect.
[0075] The term "embodiment" in this specification refers to specific features, structures or characteristics described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. The various embodiments in this specification are described in a related manner, and the same or similar parts between the various embodiments are referenced to each other. In particular, for the device, equipment, and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts are referred to the partial description of the method embodiment.
[0076] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A dormancy method, comprising: When the virtual machine to be dormant is stopped by the first virtual machine monitor of the first target server where the virtual machine to be dormant is located, a memory page of the virtual machine to be dormant in the memory of the first target server for storing the running data of the virtual machine to be dormant is determined; After the operating data saved in the memory page is compressed by the first virtual machine monitor, the operating data is transferred to a predetermined storage object, so that when the to-be-hibernated virtual machine is awakened, the operating data read from the storage object is used to make the awakened to-be-hibernated virtual machine inherit the operating state before stopping operation.
2. The method according to claim 1, wherein: The method further comprises: In response to the wake-up instruction for the virtual machine to be dormant, sending a creation instruction for instructing to rebuild the virtual machine to be dormant to a second virtual machine monitor of a second target server; The second virtual machine monitor responds to the creation instruction, uses the second target server to rebuild the virtual machine to be hibernated to obtain the target virtual machine, and uses the running data read from the storage object to make the target virtual machine inherit the running state of the virtual machine to be hibernated before it stops running.
3. The method according to claim 2, wherein: Before the second virtual machine monitor responds to the creation instruction and uses the second target server to rebuild the virtual machine to be dormant to obtain the target virtual machine, the method further includes: Determine the concurrent wake-up number of each server in the physical server pool, where the concurrent wake-up number is the number of virtual machines that need to be woken up on the server, wherein the physical server pool is a collection of multiple servers; The second target server is selected from the physical server pool according to the concurrent wake-up number, so that the second virtual machine monitor uses the second target server to rebuild the target virtual machine, and writes the running data into a predetermined memory page in the memory of the second target server, so that the target virtual machine inherits the running state of the virtual machine to be hibernated before it stops running.
4. The method according to claim 3, wherein: The concurrent wake-up number of the second target server is smaller than the concurrent wake-up number of the other servers.
5. The method according to claim 3, wherein: The method further comprises: When the running data of the virtual machine to be hibernated is transferred to the storage object through the first virtual machine monitor, it is determined whether there is another virtual machine that needs to be awakened on the first target server. If so, after writing the running data of the other virtual machine to the first target server, the running data of the virtual machine to be hibernated is transferred to the storage object.
6. The method according to any one of claims 3 to 5, wherein: Before the second virtual machine monitor uses the second target server to reconstruct and obtain the target virtual machine, the method further includes: Acquire pre-saved attribute information of the virtual machine to be dormant, the attribute information including original specifications of the virtual machine to be dormant, the original specifications including at least specifications of the virtual processor and virtual memory of the virtual machine to be dormant; Determine inventory information of the physical server pool, where the inventory information is information used to reflect unoccupied physical resources of each server in the physical server pool; According to the attribute information and the inventory information, it is determined whether there is a server in the physical server pool that meets the requirements for establishing the target virtual machine with the original specifications. If not, a server that meets the requirements for establishing the target virtual machine with the original specifications is selected from the physical server pool. the second target server being sufficient to establish the target virtual machine having target specifications, wherein the target specifications are different from the original specifications; Then, the step of reconstructing the target virtual machine by the second virtual machine monitor using the second target server includes: The second virtual machine monitor responds to the creation instruction and uses the second target server to create the target virtual machine with the target specifications, and makes the created target virtual machine have the same specifications of the virtual processor and the virtual memory as the virtual machine to be hibernated.
7. The method according to claim 3, wherein: The step of the second virtual machine monitor writing the running data into a predetermined memory page in the memory of the second target server comprises: The second virtual machine monitor reads the operating data from the storage object, decompresses the operating data, and writes the decompressed data into the predetermined memory page of the second target server.
8. The method according to claim 7, wherein: The method further comprises: The first virtual machine monitor adopts a parallel transmission strategy to save the operating data of the multiple virtual machines to be hibernated to the storage object; and / or the second virtual machine monitor adopts a parallel transmission strategy to decompress the operating data of the multiple virtual machines to be hibernated read from the storage object and write them into the predetermined memory page of the second target server.
9. The method according to claim 8, wherein: The method further comprises: The bandwidth resources that the to-be-hibernated virtual machine has before stopping operation are allocated to the second virtual machine monitor for use, so that the second virtual machine monitor uses the bandwidth resources to read and / or save the operation data to the storage object.
10. The method according to claim 6, wherein: The method further comprises: The first virtual machine monitor releases the physical resources occupied by the virtual machine to be hibernated on the first target server, and enables the second virtual machine monitor to compress and / or decompress the running data and read and / or save the running data to the storage object by reusing the physical resources.
11. The method according to any one of claims 7 to 10, wherein: The method further comprises: The plurality of storage objects provide services to the first virtual machine monitor and the second virtual machine monitor in a domain-divided deployment manner, wherein the domain-divided deployment is a deployment manner in which the storage objects store the operating data of a predetermined number of the virtual machines to be dormant.
12. The method according to claim 3, wherein: The method further comprises: The cloud disk data of the cloud disk originally mounted on the to-be-hibernated virtual machine is saved, so that after the second virtual machine monitor creates a target virtual machine using the second target server, the target cloud disk having the cloud disk data is mounted on the target virtual machine.
13. A sleep device, wherein: The device is used to execute the sleep method according to any one of claims 1 to 12.
14. A hibernation system, wherein: The system comprises the hibernation device according to claim 13.
15. An electronic device, comprising: A processor, and a memory storing a program, wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 12.
16. A non-transitory machine-readable medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Dormancy method and related equipment thereof
CN117075971A
A method and system for adaptive on-demand resource allocation in a virtualized environment
CN102279771A
Elastic scalability method and system
CN106227582A
Method and system for making virtual machine sleep and waking virtual machine up
CN107220102A
Virtual machine creation method and device, and computer device
CN110704161A
