Virtualization component upgrading and virtualization instance state saving method, physical machine, storage medium and program product
By saving and uninstalling the upgraded virtualization components on virtualized instances, combined with in-place residency technology, the problem of high complexity in the upgrade process of virtualization components is solved, and a fast and unconscious upgrade effect is achieved.
Patent Information
- Application Number
- CN202410182051.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-18
- Publication Date
- 2025-08-19
AI Technical Summary
The upgrade solution of virtualization components in the prior art is not suitable for complex upgrade needs and cannot effectively solve the diversification and complexity of virtualization components, resulting in a great impact on virtualized instances.
By saving the virtualized instance, uninstalling and reinstalling the upgraded virtualization components, and using in-place memory data residency technology during the state recovery process, reducing memory data copy operations and achieving overall replacement of virtualized components, which is suitable for upgrade requirements of various complexity.
It reduces the impact of virtualization component upgrades on virtualized instances, shortens upgrade time, achieves thermal upgrade effect without user perception or in a tolerable time range, and improves upgrade efficiency.
Smart Images

Figure CN120508299A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a method for upgrading a virtualization component and preserving the state of a virtualization instance, a physical machine, a storage medium, and a program product. Background Art
[0002] Virtualization technology is a key technology in cloud computing. Through virtualization technology, various resources of a physical machine can be virtualized, allowing multiple VMs (Virtual Machines) to run on the same physical machine, achieving resource sharing without affecting each other.
[0003] To implement virtualization, a virtual machine monitor (VMM) is deployed on the physical machine. The VMM can be seen as an operating system (OS) designed for virtualization, responsible for virtualizing hardware resources such as the CPU (Central Processing Unit) and memory, as well as creating and managing VMs.
[0004] VMM includes various virtualization-related components, such as components for virtualizing physical resources and components for creating and managing VMs. These components are collectively referred to as virtualization components. In practice, virtualization components may need to be upgraded for bug fixes or feature upgrades.
[0005] However, the upgrade solutions in the prior art are not suitable for virtualization components. Therefore, there is an urgent need for a solution for upgrading virtualization components. Summary of the Invention
[0006] Multiple aspects of the present application provide a virtualization component upgrade and virtualization instance state preservation method, physical machine, storage medium and program product, so as to reduce the impact of virtualization component upgrade on virtualization instance.
[0007] An embodiment of the present application provides a virtualization component upgrade method, comprising: determining a target virtualization component, wherein the target virtualization component is a virtualization component to be upgraded in a virtualization manager running on a physical machine; saving the state of a virtualization instance running on the physical machine, wherein the virtualization instance is created by the virtualization manager; uninstalling the target virtualization component before the upgrade, and reinstalling and loading the upgraded target virtualization component; and restoring the state of the virtualization instance based on the saved state information of the virtualization instance.
[0008] An embodiment of the present application also provides a physical machine, comprising: hardware resources, on which a virtualization manager, a virtualization instance and an upgrade program are running; the virtualization manager includes multiple virtualization components, which are used to realize the virtualization of the hardware resources and the creation and management of the virtualization instances; wherein the upgrade program is used to determine a target virtualization component to be upgraded among the multiple virtualization components; save the state of the virtualization instance; uninstall the target virtualization component before the upgrade, and reinstall and load the upgraded target virtualization component; and restore the state of the virtualization instance based on the saved state information of the virtualization instance.
[0009] An embodiment of the present application provides a method for preserving the state of a virtualized instance, comprising: responding to a virtualized instance state save operation, collecting state data of the virtualized instance, and saving the state data to a specified file; the virtualized instance has a target memory space, the target memory space includes a system memory space, and first memory data generated by the virtualized instance is stored in the system memory space in a file manner; before the virtualized instance is restored, the first memory data is kept in situ in a file sharing manner.
[0010] An embodiment of the present application also provides a physical machine, including hardware resources, which include a memory and a processor; the memory is used to store a computer program, and the processor is coupled to the memory to execute the computer program to implement the steps in the above method.
[0011] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described method.
[0012] An embodiment of the present application further provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the processor is enabled to implement the steps in the above method embodiment.
[0013] In an embodiment of the present application, a method for upgrading a virtualization component is provided, in which the state of the virtualization instance is first saved, then the virtualization component to be upgraded is uninstalled, and the upgraded virtualization component is reinstalled and loaded; and then the state of the virtualization instance is restored. Among them, by uninstalling the virtualization component and then reinstalling and loading the upgraded virtualization component, it is a comprehensive replacement of the virtualization component level, which is not limited by the complexity of the upgrade, can meet upgrade requirements of various complexities, and is suitable for upgrading various virtualization components. In addition, before uninstalling the virtualization component, the state of the virtualization instance that depends on the virtualization component to run is saved in advance, and after the virtualization component upgrade is completed, the state of the virtualization instance is restored again, which can quickly complete the deployment of the virtualization instance, which is conducive to reducing the impact of the virtualization component upgrade process on the virtualization instance. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0015] Figure 1a A schematic diagram of the structure of a physical machine provided as an exemplary embodiment of the present application;
[0016] Figure 1b An exemplary embodiment of the present application provides a structural diagram of a physical machine that uses a combination of QEMU and KVM to implement virtualization;
[0017] Figure 2 A flowchart of a virtualization component upgrade method provided by an exemplary embodiment of the present application;
[0018] Figure 3a A schematic structural diagram of a physical machine provided as another exemplary embodiment of the present application;
[0019] Figure 3b A schematic diagram of the structure of another physical machine provided as yet another exemplary embodiment of the present application;
[0020] Figure 4 A flowchart of a method for preserving virtualized instance state provided by an exemplary embodiment of the present application;
[0021] Figure 5 A schematic structural diagram of a virtualization component upgrading device provided by another exemplary embodiment of the present application;
[0022] Figure 6 A schematic structural diagram of a virtualization instance state storage device provided by another exemplary embodiment of the present application;
[0023] Figure 7 A structural diagram of another physical machine provided as yet another exemplary embodiment of the present application. DETAILED DESCRIPTION
[0024] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0025] It should be noted that 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 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 the relevant countries and regions, and provide corresponding operation portals for users to choose to authorize or refuse. In addition, the various models involved in this application (including but not limited to language models or large models) are in compliance with relevant laws and standards.
[0026] To implement virtualization, a virtualization manager is deployed on a physical machine. This manager includes multiple components related to virtualization processing, referred to as virtualization components. In practice, to fix issues or upgrade features of virtualization components, it is necessary to upgrade the virtualization components in the virtualization manager.
[0027] In the prior art, some kernels provide hotfix mechanisms. Kpatch, as a kernel-provided hotfix mechanism, can perform hotfixes on kernel modules without user awareness. In theory, Kpatch can be used to perform upgrades when a kernel module experiences a security vulnerability, a bug, or requires a functional upgrade. This method can also theoretically be used to perform hot upgrades on various virtualization components within a virtualization manager. However, Kpatch has some limitations. As a hotfix mechanism, it is more suitable for relatively simple repairs. For more complex situations, such as significant changes in data structures, changes in data object names, or the appearance of new data objects, patching alone cannot resolve them. This also means that Kpatch is not suitable for more complex upgrades. However, in real-world applications, virtualization components are not only diverse but also typically have relatively complex functions. The problem fixes and functional upgrades they face are also diverse and complex, necessitating the use of other means to address virtualization component upgrades.
[0028] In an embodiment of the present application, a method for upgrading a virtualization component is provided, in which the state of the virtualization instance is first saved, then the virtualization component to be upgraded is uninstalled, and the upgraded virtualization component is reinstalled and loaded; and then the state of the virtualization instance is restored. Among them, by uninstalling the virtualization component and then reinstalling and loading the upgraded virtualization component, it is a complete replacement of the virtualization component level, so there is no limitation similar to using Kpatch for hot repair, that is, this solution is not limited by the complexity of the virtualization component upgrade, can meet upgrade requirements of various complexities, and is suitable for upgrading various virtualization components; in addition, before uninstalling the virtualization component, the state of the virtualization instance that depends on the virtualization component to run is saved in advance, and after completing the virtualization component upgrade, the state of the virtualization instance is restored again, which can quickly complete the deployment of the virtualization instance, which is conducive to reducing the impact of the virtualization component upgrade on the virtualization instance.
[0029] Furthermore, in an embodiment of the present application, during the state saving and state recovery process of a virtualized instance, the memory data is retained in situ, which can reduce the copying operations of the memory data, reduce the time consumption of state saving and state recovery, and improve the overall recovery efficiency of the virtualized instance. The process of state saving and recovery of the virtualized instance can be made as imperceptible to the user as possible or within a time range that the user can tolerate, thereby achieving a hot upgrade effect.
[0030] Furthermore, in an embodiment of the present application, during the state saving and state recovery process of a virtualized instance, if there are multiple virtualized instances, the state of multiple virtualized instances is saved and recovered in a concurrent operation mode, which is beneficial to further improve the recovery efficiency of the virtualized instance and achieve the hot upgrade effect as much as possible.
[0031] Furthermore, in an embodiment of the present application, when it is necessary to upgrade the driver of the target physical peripheral device used by the virtualization instance, the uninstallation process, installation process, loading process and / or initialization process of the driver can also be optimized to improve the efficiency of the uninstallation, installation and / or loading process, further shorten the time of the entire upgrade process, improve the upgrade efficiency, and reduce the impact of the virtualization component upgrade on the virtualization instance.
[0032] The following describes in detail the technical solutions provided by various embodiments of the present application in conjunction with the accompanying drawings.
[0033] Figure 1aA schematic diagram of the structure of a physical machine is provided for an exemplary embodiment of the present application. As shown in Figure 1, in this embodiment of the present application, the physical machine includes hardware resources 11, a virtualization manager 12 running on the hardware resources 11, and one or more virtualization instances running on the virtualization manager 12. These virtualization instances are created and maintained by the virtualization manager 12.
[0034] Among them, the hardware resources of the physical machine include CPU, memory, network card, GPU (Graphics Processing Unit), etc.; in addition, the hardware resources of the physical machine also include storage, communication components, display, power components, audio components and various external devices, etc., which are not shown in Figure 1a.
[0035] The virtualization manager 12 virtualizes various resources on physical machines and is responsible for creating and managing virtualized instances. Furthermore, it maintains an efficient, isolated operating environment for the virtualized instances. Furthermore, the virtualization manager 12 serves as the core task monitoring system for the virtualized instances, enabling task scheduling, load balancing, reporting hardware and software failures to administrators, and controlling the usage of the virtualized instances. A single virtualization manager 12 can manage one or more virtualized instances simultaneously, without limitation.
[0036] like Figure 1a As shown, the virtualization manager 12 includes a virtualization module 121. The virtualization module 121 virtualizes various resources on the physical machine on the one hand, and is responsible for creating and managing virtualization instances on the other hand. It includes at least components for virtualization, such as components for CPU virtualization, components for memory virtualization, components for IO (Input Output) virtualization, components for VM creation and management, etc.
[0037] In order to facilitate a unified description of components or modules related to virtualization, the traditional OS part of the physical machine is referred to as the host OS 122, and the host OS belongs to the virtualization manager 12 as an example for explanation. That is, in the embodiment of the present application, the virtualization manager includes the virtualization module 121 and the host OS 122. Figure 1a As shown in the figure, the host OS is primarily responsible for device management, file management, memory management, and process management of the physical machine, including device drivers, file systems, memory management modules, and process management modules. Some functions within the host OS are also related to virtualization. For example, I / O virtualization involves drivers for physical external devices (also called I / O devices), which belong to the host OS.
[0038] For ease of description, in the embodiment of the present application, all virtualization-related objects in the virtualization manager 12 are collectively referred to as virtualization components. These virtualization components include components in the virtualization module 121 and virtualization-related drivers in the host OS 122.
[0039] In the embodiment of the present application, the implementation method of the virtualization manager 12 is not limited. For example, it can be implemented as Xen, OpenVZ, KVM (Kernel-based Virtual Machine), or a combination of KVM and QEMU (Quick EMUlator), etc. Among them, Xen is an open source virtualization manager, a software layer that runs directly on the hardware resources of a physical machine to replace the operating system. It allows multiple operating system instances to run on a single physical machine, providing high-performance virtualization without relying on special hardware support. OpenVZ is an operating system-level virtualization technology (or containerization technology) based on the Linux (an open source UNIX-like operating system) kernel, which allows a physical machine to run multiple operating systems and provides a lighter-weight virtualization solution. KVM is an open source virtualization technology based on Linux. Specifically, KVM can transform Linux into a virtualization manager, providing virtual machines with CPU virtualization and memory management capabilities. KVM can use hardware virtualization technology to improve virtual machine performance. Among them, KVM and QEMU are often used in combination. QEMU is a user-mode virtualization software. KVM relies on QEMU to simulate I / O devices, such as virtual network cards, virtual disk controllers, etc. The combination of KVM and QEMU (abbreviated as QEMU-KVM) can provide a complete virtualization solution.
[0040] Among them, when the virtualization manager adopts different implementation methods, the virtualization components it contains will be slightly different. In this embodiment, the virtualization manager is implemented by combining QEMU and KVM as an example to illustrate the virtualization components included in the virtualization manager, but it does not mean that the virtualization manager in the embodiments of this application can only be implemented by combining QEMU and KVM.
[0041] like Figure 1b As shown in FIG, a physical machine virtualized by QEMU-KVM is provided as an exemplary embodiment of the present application. The internal hardware and software architecture of the physical machine includes: application layer, kernel layer and hardware layer from top to bottom. Among them, the hardware layer includes various hardware resources 11 of the physical machine. Figure 1bAs shown, the hardware resources 11 of the physical machine include, but are not limited to, CPU 111, GPU 112, RAM (Random-access memory) 113, and disk 114, etc. In addition, the hardware resources of the physical machine also include network card modules, communication components, displays, power components, audio components, and various external devices, which are not shown in 1b. A kernel layer runs on the hardware resources 11, and the host OS 122 is located in the kernel layer. The host OS 122 includes drivers for various hardware in the hardware layer, such as drivers for physical external devices (referred to as peripherals) such as NIC (Network Interface Card) and GPU (Graphics Processing Unit). In the embodiment of the present application, the physical external device is relative to the CPU111 of the host machine. All hardware modules interconnected with the CPU111 through various types of buses can be used as physical external devices in the embodiment of the present application, and can also be called physical IO devices; among them, the bus interconnected with the CPU111 can be a high-speed peripheral component interconnect bus standard (Peripheral Component Interconnect Express, PCIe) bus or a serial bus, etc., which is not limited to this and depends on the specific physical external device.
[0042] In this embodiment, the kernel layer also includes various kernel-mode virtualization components such as KVM driver, VFIO driver, VFIO_PCI driver, and VFIO_MDEV driver; the application layer includes QEMU. Among them, QEMU is a user-mode virtualization component that can cooperate with the kernel-mode virtualization component to complete the virtualization of various resources of the physical machine and the creation and management of virtualization instances. The virtualization module 121 spans the kernel layer and the application layer. Figure 1b As shown, the virtualization module 121 includes kernel-mode virtualization components such as the VFIO driver, VFIO_PCI driver, VFIO_MDEV driver, and KVM driver at the kernel layer, as well as QEMU at the application layer. The application layer also includes various virtualization instances running on physical machines. The virtualization instances can be cloud hosts, Elastic Compute Service (ECS), virtual machines, or containers, and these virtualization instances can be created by the virtualization module 121.
[0043] Among them, the KVM driver is part of the Linux kernel and runs as a kernel module. Its main function is to manage virtualized instances and realize CPU virtualization, memory virtualization, etc.; QEMU, as a user space component, is mainly responsible for simulating various hardware devices and providing I / O device models and access to peripherals for virtualized instances. Among them, the role of the VFIO driver is to safely map physical peripheral devices to user space, so that user space processes can directly use the VFIO driver to access physical peripheral devices; the VFIO_PCI driver is mainly responsible for directly transmitting PCI devices to virtualized instances, so that virtual machines can directly access the configuration space of PCI devices; the main function of the VFIO_MDEV driver is to allow hardware resources to be safely shared between different virtual machines while ensuring isolation. Here, Figure 1b The kernel-mode virtualization components shown in the figure are merely examples, and do not necessarily include only these components.
[0044] Furthermore, when using VFIO device pass-through, the virtualization instance can directly access the physical peripheral device, but each physical peripheral device can only be exclusively used by one virtualization instance. In order to solve the exclusive problem of physical peripheral devices, SR-IOV (Single Root I / O Virtualization) pass-through technology can be used to support virtualizing multiple VFs (Virtual Functions) from one PF (Physical Function), and pass-through multiple VFs to different virtualization instances for use. In other words, there are relevant virtualization components in the virtualization manager that virtualize the physical external device to obtain various virtual external devices. The virtual external device also has a driver. In order to distinguish the driver of the virtual external device from the driver of the physical external device, the driver in the host OS122 is called a PF driver, for example, including a GPUPF driver and a NIC PF driver. Of course, the PF driver of the physical peripheral device shown here is only an example, and does not mean that only these PF drivers are included, nor does it mean that these PF drivers must be included.
[0045] exist Figure 1b The various PF drivers, KVM drivers, VFIO drivers, VFIO_PCI drivers, VFIO_MDEV drivers, and QEMU shown in the figure are all examples of virtualization components in the embodiments of the present application. For the above-mentioned physical machines, during actual operation, some virtualization components may fail, or some virtualization components may need to be upgraded as virtualization technology is updated. In other words, for problem repair or function upgrade, the virtualization components in the virtualization manager need to be upgraded.
[0046] In order to upgrade the virtualization component, the embodiment of the present application provides a virtualization component upgrade method, such as Figure 2 As shown, the method includes:
[0047] S201: Determine a target virtualization component, where the target virtualization component is a virtualization component to be upgraded in a virtualization manager running on a physical machine;
[0048] S202: Saving the state of a virtualization instance running on a physical machine, where the virtualization instance is created by the virtualization manager;
[0049] S203: Uninstall the target virtualization component before the upgrade, and reinstall and load the upgraded target virtualization component;
[0050] S204: Restore the state of the virtualized instance based on the saved state information of the virtualized instance.
[0051] In this embodiment, the target virtualization component may be one or more virtualization components in the virtualization manager, combined with Figure 1b In the architecture shown, virtualization components such as the GPU PF driver, NIC PF driver, QMEU, KVM driver, or VFIO driver can be used as target virtualization components in this embodiment, and this application does not impose any restrictions on this. It should be noted that the target virtualization component may include one or more virtualization components in the virtualization manager; when upgrading the target virtualization component, if there are other virtualization components in the virtualization manager that do not need to be upgraded and the operation of the other virtualization components does not depend on the target virtualization component, then the other virtualization components that do not need to be upgraded can operate normally and will not be affected by the upgrade process.
[0052] In an optional embodiment, in order to determine the target virtualization component, the hardware resources of the physical machine are further deployed with: an upgrade management component in user mode, which can receive a configuration file for the virtualization component upgrade, the configuration file including identification information of the virtualization component to be upgraded, and determine the target virtualization component based on the configuration file. Alternatively, an interactive interface for configuring the virtualization upgrade can be displayed, on which identification information of each virtualization component, such as the name or icon of the virtualization component, is displayed; in response to the user's selection operation in the identification information of each virtualization component, the virtualization component corresponding to the selected identification information is determined as the target virtualization component. Alternatively, an upgrade command can be sent to the upgrade management component through a command window, the upgrade command including identification information of the virtualization component to be upgraded, and the target virtualization component can be determined based on the upgrade command.
[0053] In this embodiment, upgrading the target virtualization component may affect the normal operation of the virtualized instance. Therefore, before upgrading the target virtualization component, the state of the virtualized instance is saved. After the upgrade is complete, the state of the virtualized instance can be restored based on the saved state information. While saving the state of the virtualized instance, the virtualized instance can be paused to prevent the upgrade of the target virtualization component from impacting the virtualized instance. The virtualized instances requiring state saving and pausing can be all virtualized instances currently running on the physical machine. Of course, some virtualized instances that can operate normally without the target virtualization component can also continue to run without state saving and pausing. Considering that the operation of a virtualized instance is generally inseparable from various virtualization components, a relatively simple implementation approach is to uniformly save and pause the state of each virtualized instance currently running on the physical machine when the target virtualization component needs to be upgraded. After the upgrade of the target virtualization component is complete, the state of each virtualized instance is uniformly restored to allow the virtualized instance to continue running. This is to ensure that the virtualized instance can successfully rely on the upgraded target virtualization component to operate after the state is restored. When upgrading a target virtualization component, the target virtualization component can maintain compatibility in terms of interfaces before and after the upgrade. These interfaces include not only the interfaces through which the target virtualization component provides services to virtualization instances (or access interfaces provided to virtualization instances or applications running in virtualization instances), but also the interfaces required for the target virtualization component to call other virtualization components or non-virtualized kernel components. Maintaining compatibility before and after the upgrade in terms of interfaces primarily involves maintaining the same interface name, input and output parameters, etc., without affecting the virtualization instance's call to the upgraded target virtualization component, nor affecting the upgraded target virtualization component's call to other components or modules it originally depended on.
[0054] Among them, saving the state of a virtualized instance running on a physical machine mainly includes: saving the state data and memory data of the virtualized instance. Among them, the state data of the virtualized instance refers to some data that the virtualized instance depends on for operation and some data that affects the operation state of the virtualized instance, such as the state data of the currently allocated VCPU (Virtual CPU), the state of the currently accessed virtual device, the unique identifier of the virtualized instance, such as the UUID (Universally Unique Identifier) and the currently accessed file handle, etc., which will vary depending on the function of the virtualized instance. The memory data of the virtualized instance refers to the data generated during the operation of the virtualized instance and saved to the memory space allocated to it, referred to as memory data, which will also vary depending on the function of the virtualized instance. Furthermore, when the virtualized instance mounts a persistent storage disk (such as a cloud disk), it also involves the saving operation of the persistent storage disk. This saving operation mainly refers to saving the mounting relationship between the persistent storage disk and the virtualized instance.
[0055] Among them, uninstalling the target virtualization component before the upgrade refers to stopping the relevant services of the target virtualization component, deleting various resource files corresponding to the target virtualization component from the physical machine, and cleaning up related configuration files and runtime data. Among them, deleting various resource files corresponding to the target virtualization component includes: if the target virtualization component is a user-mode virtualization component, its installation package can be uninstalled in a manner similar to the uninstallation of traditional application software. If the target virtualization component is a kernel-mode virtualization component, some uninstall commands can be used to directly delete the kernel-mode virtualization component from the operating system. Reinstalling the upgraded target virtualization component refers to downloading the new version of the installation package (or kernel module). If it is a user-mode virtualization component, the installation package can be run for installation in a manner similar to the installation of traditional application software. If it is a kernel-mode virtualization component, the upgraded kernel-mode virtualization component can be added to the operating system using some installation commands or administrator privileges. Furthermore, for user-state virtualization components, the installation can be completed by executing the installation package. For kernel-state virtualization components, they need to be compiled and added to the kernel. Loading the upgraded target virtualization component refers to the process of starting the newly installed target virtualization component and initializing it. For user-state virtualization components, it means starting the newly installed software service and completing the corresponding initialization process. For kernel-state virtualization components, it means loading the new target virtualization component into the kernel and completing the corresponding initialization process.
[0056] Accordingly, based on the saved state information of the virtualized instance, the state of the virtualized instance is restored, which mainly refers to recreating the virtualized instance according to the resource file corresponding to the virtualized instance, restoring the virtualized instance to the state at the saving moment, and re-providing the saved memory data of the virtualized instance to the restored virtualized instance so that the virtualized instance can continue to run.
[0057] In the embodiments of the present application, the internal implementation structure of the virtualization manager is not limited. Any structure that can create and manage virtualized instances is applicable to the embodiments of the present application. Optionally, the virtualization manager includes a first virtualization component located in the user state, which can be but not limited to: QEMU or a virtualization control component located in the user state, etc. The first virtualization component is located in the user state, which is convenient for interaction and calling, and does not involve more security issues. Based on this, the state of the virtualized instance running on the physical machine can be saved, and the first virtualization component can be called to save the state of the virtualized instance. The first virtualization component can obtain various status information of the virtualized instance and has the authority to access and manage the memory data of the virtualized instance. Accordingly, based on the saved state information of the virtualization instance, the state of the virtualization instance is restored. When the target virtualization component does not include the first virtualization component, the first virtualization component can be called, and the state of the virtualization instance can be restored based on the saved state information of the virtualization instance. When the target virtualization component includes the first virtualization component, after the first virtualization component is reinstalled and loaded, the upgraded first virtualization component can be called, and the state of the virtualization instance can be restored based on the saved state information of the virtualization instance.
[0058] It is explained here that the state of the virtualized instance is saved and restored by the virtualization manager including the first virtualization component in the user state. This is only an example and is not limited to this. Alternatively, the state of the virtualized instance can be saved and restored by executing the upgrade program of the upgrade method provided in the embodiment of the present application. It is only necessary for the upgrade program to obtain the management authority of the various state information and memory data of the virtualized instance. The management authority can be registered and applied to the QEMU or KVM driver in the virtualization manager. Whether it is the upgrade program provided in the embodiment of the present application or the first virtualization module (such as QEMU) that saves and restores the state of the virtualized instance, the detailed implementation method of state saving and restoration can be found in the description in the following embodiments of the present application.
[0059] In an embodiment of the present application, the state of the virtualization instance is saved, and then the target virtualization component that needs to be upgraded is uninstalled, and the upgraded target virtualization component is reinstalled and loaded. This is a comprehensive replacement at the driver module level, which is suitable for upgrade requirements of various complexities. It does not have the limitations similar to using Kpatch for hot repairs, and can upgrade various problems that arise in virtualization components or newly developed functions without worrying about the problem that new functions cannot be applied to existing virtualization instances.
[0060] Furthermore, in an embodiment of the present application, when upgrading the target virtualization component, it is hoped to be able to perform a hot upgrade of the target virtualization component, that is, it is hoped to complete the upgrade of the target virtualization component without the user noticing that the application hosted in the virtualization instance is interrupted or the interruption time or delay is within a tolerable range, so that online problem repairs and the launch of new functions and features can be carried out without notifying the user, greatly reducing the cycle of repairing security vulnerabilities (BUGs) and also reducing the cost of communicating with users.
[0061] To achieve the above objectives, the entire process, from saving the state data and memory data of the virtualized instance to restoring the virtualized instance based on the saved state data and memory data, needs to be completed as quickly as possible and take as little time as possible, so short that the user is basically unaware or within a response delay that the user can tolerate. To minimize the time taken for the above process, the present embodiment adopts at least one of the following technical means:
[0062] (1) Improve the process of saving the state data and memory data of the virtualized instance: By analyzing the more time-consuming operations in the process of saving the state of the virtualized instance, it is determined that the more time-consuming operation is the saving of memory data. During the saving process, in order to save the memory data, the memory data needs to be copied to another memory or persistent storage space (disk file). When the amount of memory data is large, this operation is relatively time-consuming. In the embodiment of the present application, the technology of retaining memory data in situ is adopted to ensure that the memory space where the memory data is located is not cancelled or recycled during the upgrade process of the target virtualization component and the memory space is not modified. In addition, during the recovery process of the virtualization instance, it can be ensured that the memory space is reallocated to the restored virtualization instance to complete the recovery of the memory data. In this way, there is no need to perform any copying operations on the memory data during the entire process, which can save time and improve the upgrade efficiency of the target virtualization component.
[0063] (2) Optimize the uninstallation, installation and / or loading process of the target virtualization component that needs to be upgraded to reduce the downtime of the virtualization instance caused by the upgrade of the target virtualization component, shorten the time of the entire process, and try to achieve the effect of hot upgrade.
[0064] It should be noted that regardless of whether the target virtualization component is a component in the virtualization module or a PF driver in the host OS, as long as there is potential for optimization, it can be optimized. The optimization process can include only the uninstallation process, the installation process, or the loading process, or any two or three processes, regardless of the target virtualization component.
[0065] Further optionally, when the target virtualization component to be upgraded includes a peripheral driver (i.e., the PF driver in the host OS), at least one of the processes of the peripheral driver's uninstallation, installation, loading, and initialization process is optimized. This is specifically determined by the physical peripheral device corresponding to the PF driver. The optimization space for the uninstallation, installation, loading, and initialization processes of the driver corresponding to different physical peripheral devices may be different. This is also related to the hardware manufacturer. The uninstallation, installation, loading, and initialization processes of the hardware drivers provided by different hardware manufacturers may also be different. This embodiment does not limit the specific optimization process. Any optimization method that can shorten the time relative to the traditional uninstallation, installation, loading, or initialization process is applicable to the embodiment of this application.
[0066] (3) Save and restore the state of virtualized instances in a concurrent manner:
[0067] When saving the state of a virtualized instance running on a physical machine, if there are multiple virtualized instances, the state of these instances is saved concurrently, thereby shortening the state save time. Similarly, when restoring the state of a virtualized instance running on a physical machine, if there are multiple virtualized instances, the state of these instances is restored concurrently.
[0068] In the embodiments of the present application, the technical means of retaining memory data in situ is not limited, and corresponding implementation methods can be adopted in combination with the different memory spaces where the memory data is located.
[0069] In an optional embodiment, when creating a virtualized instance, system memory space can be allocated for the virtualized instance. System memory space refers to the physical memory on the host machine, such as RAM (Random Access Memory). For the memory data in the system memory space, in order to achieve the in-situ residence of the memory data, when the virtualized instance generates memory data, these memory data can be written to the system memory space allocated to the virtualized instance in the form of files, rather than directly writing the generated data to the system memory space; in this way, in the process of saving the state of the virtualized instance, the in-situ residence of the memory data can be achieved in the form of file sharing, providing a basis for the memory data to reside in the system memory space.
[0070] Combine Figure 1bThe system architecture shown in the figure provides a detailed description of the detailed process of allocating system memory space, the process of saving the virtualization instance state, and the process of restoring the virtualization instance state.
[0071] Among them, saving the state of a virtualized instance running on a physical machine includes: collecting state data of the virtualized instance and saving the state data to a designated file. Optionally, the designated file can be a memory file or a persistent file (such as a disk file); wherein collecting state data involves capturing and storing sufficient information so that the state of the virtualized instance can be restored from the same point later. Optionally, on the same physical machine, each virtualized instance has a unique identifier, and based on the unique identifier, state data corresponding to the virtualized instance can be collected, including but not limited to configuration information of various resources such as CPU, memory, network devices, and storage devices. In one example, based on the VM instance created by the virtualization manager, on the same physical machine, each VM instance is assigned identification information, such as a virtual machine name (Name), UUID, and ID (Identifier). This identification information can be used to manage, identify, and operate the state of the virtual machine, wherein the UUID is a unique identifier, and the state data of the corresponding VM can be obtained through the UUID.
[0072] The state saving of the virtualized instance running on the physical machine further includes: residing the target memory data in the target memory space of the virtualized instance in situ.
[0073] In an optional embodiment, the target memory space includes the system memory space, and the target memory data includes the first memory data stored in the system memory space in the form of a file. Here, the file used to store the first memory data can be a memory mapping file created in the system memory space based on the memory mapping technology, or a memory file created in the system memory space through the memory file system, and there is no limitation on this. Accordingly, the target memory data in the target memory space of the virtualized instance is kept in situ, including: keeping the first memory data in situ in the form of file sharing. Here, file sharing refers to the new and old processes corresponding to the virtualized instance before and after recovery share the same memory mapping file or the same memory file. Among them, after the state of the virtualized instance is saved, the old process corresponding to the virtualized instance is also released to suspend the operation of the virtualized instance; restoring the state of the virtualized instance also involves the creation of a new process corresponding to the virtualized instance to restore the virtualized instance. Specifically, by allocating or mounting the access path of the memory mapping file or the memory file to the new process, file sharing between the old and new processes can be achieved.
[0074] In this embodiment, the first memory data is stored and resided in situ in a file sharing manner. The memory data can be stored and resided in a memory mapping manner or in a memory file manner. The following are respectively described:
[0075] Memory mapping method: A memory-mapped file is a mapping of a persistent file to a piece of memory space. With the help of this mapping between the persistent file and the memory space, applications (including multiple processes) can directly perform read and write operations on the memory, thereby modifying the persistent file. In this embodiment, the virtualization instance uses a persistent file (such as a disk file) to persist memory data. For the sake of description and distinction, the persistent file is referred to as the target persistent file; at the same time, in order to facilitate read and write operations, the target persistent file can be mapped to the system memory space allocated to the virtualization instance using a memory mapping method, that is, a memory-mapped file is created in the system memory space. The memory-mapped file is a memory mapping of the target persistent file used by the virtualization instance. The memory-mapped file maps the target persistent file to the memory space. When the virtualization instance operates on the mapped memory area (such as reading or writing), these operations will be reflected in the mapped target persistent file.
[0076] The target persistent file is used to persistently store the data in the memory-mapped file. In order to reflect these operations in the mapped target persistent file, the target persistent file can be created for the virtualization instance, and a memory-mapped file corresponding to the target persistent file can be created in the system memory space; in the process of the virtualization instance generating the first memory data, the first memory data is written to the memory-mapped file; and, according to the set persistence policy, the data in the memory-mapped file is stored in the target persistent file. Among them, the set persistence policy can be periodic persistence, that is, writing the first memory data to the persistence file at regular intervals (that is, performing a persistence operation); or, it can also be idle persistence, that is, performing a persistence operation when the CPU is detected to be idle; or, performing a persistence operation after each virtualization instance writes the first memory data to the memory-mapped file; or, performing a persistence operation when clearing the memory-mapped file; or, performing a persistence operation before the virtualization instance is closed or paused. Each persistence strategy has its own applicable scenario and can be selected as needed. This application does not limit this.
[0077] Based on the above, an implementation method of keeping the first memory data in situ in a file sharing manner includes: when storing the first memory data, storing the first memory data in a memory mapping file in the system memory space, and keeping the memory mapping file from being released during the upgrade process of the target virtualization component to achieve the in-situ residence of the first memory data; the memory mapping file is a memory mapping of the target persistent file used by the virtualization instance, and the target persistent file is used to persistently store the data in the memory mapping file.
[0078] Memory file method: Some operating systems provide a memory file system, which can store data in the system memory space in the form of a memory file, wherein the memory file will not be released when the virtualization instance is released, and will only be released when the host machine is powered off. Based on this, in an embodiment of the present application, another implementation method of keeping the first memory data in situ in a file sharing manner includes: when storing the first memory data, calling the memory file system to store the first memory data in the system memory space allocated to the virtualization instance in the form of a memory file. In this way, during the upgrade process of the target virtualization component, the memory file has the characteristic of not being released, so as to achieve the purpose of keeping the memory file from being released, thereby achieving the first memory data in situ.
[0079] Furthermore, Linux memory management adopts a "paging mechanism". The default size of a standard page is 4KB, while HugeTLB provides a larger page size (such as 2MB or 1GB) than the standard page. The mapped memory page becomes larger, thereby reducing the size of the page table used for memory mapping and improving memory access efficiency. Among them, the Hugetlb FS method is used to perform in-place residency of the first memory data between the old and new processes corresponding to the virtualization instance before and after recovery. That is, when the memory file system creates a memory file in the system memory space, the Hugetlb FS method is used to create a larger granularity memory page for storing the first memory data; during the upgrade process of the target virtualization component, the in-place residency of the first memory data is achieved by taking advantage of the characteristic that the memory file will not be released, and the size of the page table used for memory mapping can also be reduced, thereby improving memory access efficiency.
[0080] In the embodiment of the present application, the method of making the target memory data in the target memory space reside in situ is not limited, and any method that can make the target memory data reside in situ is applicable to the embodiment of the present application. In addition to the above-mentioned method, the method of locking the memory space can also be used to achieve the in situ residence of the first memory data. Specifically, in the process of saving the state of the virtualization instance, the system memory space allocated to the virtualization instance can be locked, for example, a lock mark is added to the system memory space, and the lock mark is used to indicate that the system memory space is locked during the suspension of the virtualization instance and is not released or modified; after the virtualization instance is restored, the system memory space is reallocated to the restored virtualization instance according to the lock mark. Further, in order to facilitate the determination of the correspondence between the lock mark and the virtualization instance, in the process of saving the state of the virtualization instance, a lock mark can be first added to the system memory space of the virtualization instance, and the lock mark can be added to the state data of the virtualization instance. In this way, after the virtualized instance is restored, the lock mark can be obtained from its state data, and then the system memory space with the lock mark can be reallocated to the restored virtualized instance, thereby achieving the in-situ residence of the first memory data during the virtualized instance state preservation and recovery process, without the need for memory copying, thereby improving the recovery efficiency of the virtualized instance.
[0081] Further optionally, based on the saved state information of the virtualized instance, the state of the virtualized instance is restored, including: recreating the virtualized instance according to the resource file corresponding to the virtualized instance, and the virtualized instance reusing the unique identifier before the restoration; further, based on the unique identifier of the virtualized instance (such as UUID), reallocating the target memory space to the virtualized instance, the target memory space contains the target memory data that was originally resident when the state was saved; and, based on the state data in the specified file, restoring the virtualized instance to the running state when the state was saved. In one example, the virtualized instance can be specifically implemented as a VM, then based on the saved state information of the virtualized instance (old VM), the state of the virtualized instance (new VM) is restored, including: recreating the VM (called the new VM) according to the resource file corresponding to the old VM, reusing the UUID (unique identifier) of the old VM, the UUID is associated with various resource files of the old VM, and these resource files will be allocated to the restored VM; further, based on the UUID, reallocating the target memory space to the corresponding new VM; and, based on the state data in the specified file, restoring the new VM to the running state when the state was saved.
[0082] In another optional embodiment, the physical machine includes various peripheral devices with memory space and computing capabilities. The peripheral devices here refer to peripheral devices in a broad sense, including devices that are interconnected with the CPU of the physical machine through various interconnection buses (such as PCIe). In actual applications, according to application requirements, corresponding virtual peripherals, such as virtual GPUs, can be created for virtualization instances, and corresponding memory space (such as GPU video memory) will be allocated. For the purpose of distinction, this memory space is referred to as peripheral memory space. During the operation of the virtualization instance, the data generated when using virtual peripherals can be stored in the peripheral memory space.
[0083] Based on this, when saving the memory data of the virtualized instance, it also involves the saving of the memory data of the virtualized instance in the peripheral memory space. In an optional embodiment, the target memory space may also include a peripheral memory space, which is a memory space on the target physical peripheral device used by the virtualized instance. The target physical peripheral device may be a peripheral device with computing power and memory space, such as but not limited to a GPU. Furthermore, the target memory data includes second memory data stored in the peripheral memory space on the target physical peripheral device, and the target memory data in the target memory space of the virtualized instance is kept in situ, which also includes: keeping the second memory data in situ.
[0084] Among them, the in-situ residence of the second memory data first includes: during the state saving and state restoration process of the virtualized instance, ensuring that the second memory data in the peripheral memory space is not modified. Specifically, the state saving process of the virtualized instance involves the release or destruction of the old process, during which the second memory data in the peripheral memory space is not rewritten; the state restoration process of the virtualized instance involves the creation of a new process, during which the peripheral memory space is ensured not to be initialized to ensure that the second memory data is not modified. Further optionally, the in-situ residence of the second memory data will be different depending on whether the driver of the target physical peripheral device is the target virtualization component that needs to be upgraded, and can be determined on a case-by-case basis. Specifically, if the driver of the target physical peripheral device needs to be upgraded, that is, when the target virtualization component includes the driver of the target physical peripheral device, this will involve the uninstallation, installation, and loading process of the driver. During this process, different manufacturers may adopt different strategies to ensure data security and device stability. For example, some manufacturers may erase data when the driver is uninstalled; other manufacturers may initialize memory when the driver is loaded. These operations will affect the second memory data, so keeping the second memory data resident in situ also includes: ensuring that the second memory data does not change before and after the driver is upgraded.
[0085] Based on the above, when the target virtualization component includes a driver for the target physical peripheral device, by improving the unloading and loading processes of the driver for the target physical peripheral device, when the driver is unloaded, rewriting operations on the peripheral memory space are prohibited; when the upgraded driver is reloaded, initialization operations on the peripheral memory space are prohibited, so as to ensure that the second memory data in the peripheral memory space allocated to the virtualized instance does not change before and after the upgrade. Further optionally, when the target virtualization component does not include a driver for the target physical peripheral device, no unloading and reloading are involved, and therefore no related operations are involved.
[0086] In order to cope with the strategies of different manufacturers and ensure that the second memory data in the peripheral memory space can reside in place, the driver can be improved and a memory residency function can be added to the driver. The memory residency function includes not rewriting the peripheral memory space during the uninstallation process and not initializing the peripheral memory space during the loading process; wherein, the upgraded driver has the memory residency function enabled by default. In an optional embodiment, the memory residency function in the driver allows for on-demand activation, that is, before uninstalling the driver, the driver's memory residency function can also be enabled through the interface exposed to the outside by the driver; when the memory residency function is enabled, the peripheral memory space will not be rewritten during the uninstallation process, and accordingly, the peripheral memory space will not be initialized during the loading process; wherein, the upgraded driver has the memory residency function enabled by default.
[0087] Optionally, the kernel module parameters can be passed to control whether the memory residency function of the driver is enabled. When the driver is not upgraded, the memory residency function can be disabled; when the driver is upgraded, it is necessary to ensure that the memory residency function is enabled, for example, during the loading process, the memory residency function of the driver is enabled by passing the kernel module parameters. Of course, the method of controlling whether the memory residency function is enabled is not limited to this. For example, in the Linux system, in addition to passing the kernel module parameters, the enabling of the memory residency function can also be controlled by Linux commands; in the Windows system (an operating system developed by Microsoft based on a graphical user interface), a graphical user interface is provided, and users can configure the memory residency function through the graphical user interface, including enabling or disabling the function.
[0088] Of course, the memory residency function in the driver can also be in a normally open state by default. In this case, the driver can be directly uninstalled, and the peripheral memory space will not be rewritten during the uninstallation process.
[0089] Further optionally, in the case where the target virtualization component includes a driver for a target physical peripheral device used by the virtualization instance, before uninstalling the target virtualization component before the upgrade, the driver's uninstallation process, installation process, loading process and / or initialization process can also be optimized. This can shorten the corresponding time when subsequent drivers involve uninstallation, installation, loading and / or initialization, thereby improving the driver upgrade efficiency.
[0090] It should be noted that, although the above emphasis has been placed on optimizing the uninstallation process, installation process, loading process and / or initialization process of the driver of the target physical peripheral device, this is mainly because the uninstallation process, installation process, loading process and / or initialization process of the driver of the target physical peripheral device are usually more complicated, more time-consuming, and have better optimization space, but it is not limited to this. For other virtualization components, if any process in the uninstallation process, installation process, loading process and initialization process has optimization space, it can also be optimized to further shorten the upgrade time and improve efficiency. In addition, it should be noted that the optimization of the uninstallation process, installation process, loading process and / or initialization process of the target virtualization component all involves specific manufacturers. In the embodiments of the present application, the specific optimization implementation scheme is not the focus. Any optimization method that can shorten the time compared to the traditional scheme is applicable to the embodiments of the present application.
[0091] Further optionally, before the target memory data (first memory data or second memory data) in the target memory space is made resident in situ, resource information for configuring the virtualization instance can be obtained, and whether the virtualization instance uses peripheral devices can be determined based on the resource information. If peripheral devices are used, the second memory data is made resident in situ.
[0092] Further optionally, before the target memory data (the first memory data or the second memory data) in the target memory space is made resident in situ, it can be determined whether the first memory data or the second memory data is greater than or equal to a corresponding threshold value, and if so, it is necessary to make it resident in situ. Optionally, the first memory data and the second memory data can be made resident in situ separately or simultaneously, and this application does not impose any restrictions on this.
[0093] like Figure 3a As shown, the embodiment of the present application further provides a physical machine, including: a hardware resource 11, on which a virtualization manager 12, an upgrade program 13, and a virtualization instance run; the virtualization manager 12 includes multiple virtualization components for implementing virtualization of the hardware resource 11 and creation and management of virtualization instances;
[0094] Among them, the upgrade program 13 can be an upgrade script or a non-script upgrade program in its specific implementation; the upgrade program 13 is used to determine the target virtualization component to be upgraded among multiple virtualization components; save the state of the virtualization instance; uninstall the target virtualization component before the upgrade, and reinstall and load the upgraded target virtualization component; and restore the state of the virtualization instance based on the saved state information of the virtualization instance.
[0095] like Figure 3b As shown, in an optional embodiment, the multiple virtualization components include a first virtualization component 123 in user mode and a second virtualization component 124 in kernel mode. Further, the target virtualization component includes the first virtualization component 123 and / or the second virtualization component 124. Optionally, the first virtualization component 123 in user mode may be QEMU, and the second virtualization component 124 in kernel mode may be KVM.
[0096] In an optional embodiment, the upgrade program 13 is specifically used to: call the first virtualization component 123 to save the state of the virtualization instance; and, when the target virtualization component does not include the first virtualization component 123, call the first virtualization component 123 to restore the state of the virtualization instance based on the saved state information of the virtualization instance; when the target virtualization component includes the first virtualization component 123, call the upgraded first virtualization component 123 to restore the state of the virtualization instance based on the saved state information of the virtualization instance.
[0097] In an optional embodiment, when saving the state of a virtualized instance, the upgrade program 13 is specifically used to: collect the state data of the virtualized instance and save the state data to a specified file; and, keep the target memory data in the target memory space of the virtualized instance resident in situ.
[0098] The detailed implementation and beneficial effects of each step in the method of this embodiment have been described in detail in the aforementioned embodiments and will not be elaborated here.
[0099] like Figure 4 As shown, the embodiment of the present application provides a method for saving the state of a virtualized instance, such as Figure 4 As shown, the method includes:
[0100] S401: In response to a virtualization instance state saving operation, collect state data of the virtualization instance and save the state data to a specified file;
[0101] S402: Before the virtualized instance is restored, first memory data generated by the virtualized instance is stored in situ in a file sharing manner; wherein the virtualized instance has a target memory space, the target memory space includes a system memory space, and the first memory data is stored in the system memory space in a file manner.
[0102] In an optional embodiment, the first memory data is persisted in situ in a file sharing manner, including: when storing the first memory data, the first memory data is stored in a memory mapping file in the system memory space, and during the upgrade process of the target virtualization component, the memory mapping file is kept from being released to achieve the in situ residence of the first memory data; the memory mapping file is a memory mapping of the target persistent file used by the virtualization instance, and the target persistent file is used to persistently store the data in the memory mapping file.
[0103] In an optional embodiment, the above method also includes creating a target persistent file for the virtualization instance, and creating a memory mapping file corresponding to the target persistent file in the system memory space; in the process of the virtualization instance generating first memory data, writing the first memory data into the memory mapping file; and, according to the set persistence policy, storing the data in the memory mapping file into the target persistent file.
[0104] In another optional embodiment, the first memory data is kept in situ in a file sharing manner, including: when storing the first memory data, calling the memory file system to store the first memory data in the system memory space in the form of a memory file, and during the upgrade process of the target virtualization component, keeping the memory file from being released to achieve the in situ residence of the first memory data.
[0105] In an optional embodiment, the target memory space also includes a peripheral memory space, which is a memory space on a target physical peripheral device used by the virtualization instance, and the peripheral memory space stores second memory data generated during the virtualization instance's use of the target physical peripheral device; the above method also includes: when uninstalling the driver of the target physical peripheral device, prohibiting rewriting operations on the peripheral memory space; and when reloading the driver, prohibiting initialization operations on the peripheral memory space, so as to achieve in-situ residence of the second memory data.
[0106] In an optional embodiment, the above method also includes: recreating the virtualization instance based on the resource file corresponding to the virtualization instance, and the virtualization instance reusing the unique identifier before restoration; reallocating the target memory space to the virtualization instance based on the unique identifier; and restoring the virtualization instance to the running state when the state was saved based on the state data in the specified file.
[0107] The detailed implementation and beneficial effects of each step in the method of this embodiment have been described in detail in the aforementioned embodiments and will not be elaborated here.
[0108] It should be noted that the execution entity of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution entity of steps 401 to 403 can be device A; for another example, the execution entity of steps 401 and 402 can be device A, and the execution entity of step 403 can be device B; and so on.
[0109] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or may be executed in parallel. The sequence numbers of the operations, such as 401, 402, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to being different types.
[0110] Figure 5 This is a structural diagram of a virtualization component upgrade device provided by another exemplary embodiment of the present application. Figure 5 As shown, the virtualization component upgrade device 500 includes: a determination module 51, a storage module 52, an upgrade module 53 and a recovery module 54, wherein:
[0111] A determination module 51 is configured to determine a target virtualization component, where the target virtualization component is a virtualization component to be upgraded in a virtualization manager running on a physical machine;
[0112] A saving module 52, configured to save the state of the virtualization instance running on the physical machine, wherein the virtualization instance is created by the virtualization manager;
[0113] An upgrading module 53 is used to uninstall the target virtualization component before the upgrade, and reinstall and load the upgraded target virtualization component;
[0114] The recovery module 54 is configured to restore the state of the virtualized instance based on the saved state information of the virtualized instance.
[0115] In an optional embodiment, when saving the state of the virtualization instance running on the physical machine, the saving module 52 is specifically used to: collect the state data of the virtualization instance and save the state data to a specified file; and keep the target memory data in the target memory space of the virtualization instance resident in situ.
[0116] In an optional embodiment, the target memory space includes a system memory space, and the target memory data includes first memory data stored in the system memory space in a file manner; when the saving module 52 performs in-place residency on the target memory data in the target memory space of the virtualized instance, it is specifically used to: perform in-place residency on the first memory data in a file sharing manner.
[0117] Further optionally, when the saving module 52 makes the first memory data reside in situ in a file sharing manner, it is specifically used to: when storing the first memory data, store the first memory data in a memory mapping file in the system memory space, and during the upgrade process of the target virtualization component, keep the memory mapping file from being released to achieve the in situ residence of the first memory data; the memory mapping file is a memory mapping of the target persistent file used by the virtualization instance, and the target persistent file is used to persistently store the data in the memory mapping file; or, when storing the first memory data, call the memory file system to store the first memory data in the system memory space in the form of a memory file, and during the upgrade process of the target virtualization component, keep the memory file from being released to achieve the in situ residence of the first memory data.
[0118] In an optional embodiment, the saving module 52 is also used to: create the target persistence file for the virtualization instance, and create a memory mapping file corresponding to the target persistence file in the system memory space; write the first memory data into the memory mapping file during the process of the virtualization instance generating the first memory data; and, according to the set persistence policy, store the data in the memory mapping file into the target persistence file.
[0119] In an optional embodiment, the target memory space includes a peripheral memory space, which is a memory space on a target physical peripheral device used by the virtualization instance; the target memory data includes second memory data stored in the peripheral memory space; when the saving module 52 keeps the target memory data in the target memory space of the virtualization instance in situ, it is specifically used to: when the target virtualization component includes a driver of the target physical peripheral device, when the driver is uninstalled, prohibit the rewriting operation on the peripheral memory space; when the upgraded driver is reloaded, prohibit the initialization operation on the peripheral memory space.
[0120] In an optional embodiment, before uninstalling the driver, the saving module 52 is further configured to: enable a memory residency function of the driver through an interface exposed by the driver; the memory residency function includes not rewriting the peripheral memory space during the uninstallation process and not initializing the peripheral memory space during the loading process;
[0121] In an optional embodiment, when the recovery module 54 performs state restoration on the virtualization instance based on the saved state information of the virtualization instance, it is specifically used to: recreate the virtualization instance according to the resource file corresponding to the virtualization instance, and the virtualization instance reuses the unique identifier before the restoration; reallocate the target memory space to the virtualization instance according to the unique identifier; and restore the virtualization instance to the running state when the state was saved according to the state data in the specified file.
[0122] In an optional embodiment, the virtualization manager includes a first virtualization component that creates the virtualization instance; the saving module 52, when saving the state of the virtualization instance running on the physical machine, is specifically used to: call the first virtualization component to save the state of the virtualization instance; accordingly, the recovery module 54, when restoring the state of the virtualization instance based on the saved state information of the virtualization instance, is specifically used to: when the target virtualization component does not include the first virtualization component, call the first virtualization component to restore the state of the virtualization instance based on the saved state information of the virtualization instance; when the target virtualization component includes the first virtualization component, call the upgraded first virtualization component to restore the state of the virtualization instance based on the saved state information of the virtualization instance.
[0123] In an optional embodiment, before uninstalling the target virtualization component before the upgrade, the saving module 52 is also used to: when the target virtualization component includes a driver for the target physical peripheral device used by the virtualization instance, optimize the uninstallation process, installation process, loading process and / or initialization process of the driver.
[0124] In an optional embodiment, when saving the state of the virtualization instance running on the physical machine, the saving module 52 is specifically configured to: when there are multiple virtualization instances, save the state of multiple virtualization instances in a concurrent operation manner.
[0125] Figure 6 This is a structural diagram of a virtualization instance state storage device provided by another exemplary embodiment of the present application. Figure 6 As shown, the virtualization instance state saving device 600 includes: a collection module 61, a saving module 62 and a resident module 63, wherein:
[0126] The collection module 61 is used to respond to the virtualization instance state saving operation, collect state data of the virtualization instance, and save the state data to a specified file;
[0127] A saving module 62 is configured to store the first memory data generated by the virtualization instance in a file in the system memory space, where the virtualization instance has a target memory space, and the target memory space includes the system memory space;
[0128] The resident module 63 is configured to keep the first memory data resident in situ in a file sharing manner before the virtualized instance is restored.
[0129] In an optional embodiment, the resident module 63 is specifically used to: when storing the first memory data, store the first memory data in a memory mapping file in the system memory space, and during the upgrade process of the target virtualization component, keep the memory mapping file from being released to achieve the in-situ residence of the first memory data; the memory mapping file is a memory mapping of the target persistent file used by the virtualization instance, and the target persistent file is used to persistently store the data in the memory mapping file; or, when storing the first memory data, call the memory file system to store the first memory data in the system memory space in the form of a memory file, and during the upgrade process of the target virtualization component, keep the memory file from being released to achieve the in-situ residence of the first memory data.
[0130] In an optional embodiment, the saving module 62 is further used to: create the target persistent file for the virtualization instance, and create a memory mapping file corresponding to the target persistent file in the system memory space; write the first memory data into the memory mapping file during the process of the virtualization instance generating the first memory data; and store the data in the memory mapping file into the target persistent file according to the set persistence policy.
[0131] In an optional embodiment, the target memory space also includes a peripheral memory space, which is a memory space on the target physical peripheral device used by the virtualization instance, and the peripheral memory space stores second memory data generated during the process of the virtualization instance using the target physical peripheral device; the resident module 63 is also used to: prohibit overwriting the peripheral memory space when unloading the driver of the target physical peripheral device; and prohibit initialization operations on the peripheral memory space when reloading the driver, so as to achieve in-situ residence of the second memory data.
[0132] In an optional embodiment, the resident module 63 is further used to: recreate the virtualization instance based on the resource file corresponding to the virtualization instance, and the virtualization instance reuses the unique identifier before restoration; reallocate the target memory space to the virtualization instance based on the unique identifier; and restore the virtualization instance to the running state when the state was saved based on the state data in the specified file.
[0133] Figure 7 A schematic diagram of a physical machine structure provided in an exemplary embodiment of the present application. The physical machine includes hardware resources, including a memory 74 and a processor 75.
[0134] Memory 74 is used to store computer programs and can be configured to store various other data to support operations on the physical machine. Examples of such data include instructions for any application or method operating on the physical machine, contact data, phone book data, messages, pictures, videos, etc.
[0135] The memory 74 can be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0136] The processor 75 is coupled to the memory 74 and is used to execute the computer program in the memory 74 to: determine a target virtualization component, where the target virtualization component is a virtualization component to be upgraded in a virtualization manager running on a physical machine; save the state of a virtualization instance running on the physical machine, where the virtualization instance is created by the virtualization manager; uninstall the target virtualization component before the upgrade, and reinstall and load the upgraded target virtualization component; and restore the state of the virtualization instance based on the saved state information of the virtualization instance.
[0137] In an optional embodiment, when the processor 75 saves the state of the virtualization instance running on the physical machine, it is specifically used to: collect the state data of the virtualization instance and save the state data to a specified file; and keep the target memory data in the target memory space of the virtualization instance resident in place.
[0138] In an optional embodiment, the target memory space includes a system memory space, and the target memory data includes first memory data stored in the system memory space in a file manner; when the processor 75 performs in-place residency on the target memory data in the target memory space of the virtualized instance, it is specifically used to: perform in-place residency on the first memory data in a file sharing manner.
[0139] Further optionally, when the processor 75 performs in-place residency on the first memory data in a file sharing manner, it is specifically used to: when storing the first memory data, store the first memory data in a memory mapping file in the system memory space, and keep the memory mapping file from being released during the upgrade of the target virtualization component to achieve the in-place residency of the first memory data; the memory mapping file is a memory mapping of the target persistent file used by the virtualization instance, and the target persistent file is used to persistently store the data in the memory mapping file; or, when storing the first memory data, call the memory file system to store the first memory data in the system memory space in the form of a memory file, and keep the memory file from being released during the upgrade of the target virtualization component to achieve the in-place residency of the first memory data.
[0140] In an optional embodiment, the processor 75 is further used to: create the target persistent file for the virtualization instance, and create a memory mapping file corresponding to the target persistent file in the system memory space; write the first memory data into the memory mapping file during the process of the virtualization instance generating the first memory data; and store the data in the memory mapping file into the target persistent file according to the set persistence policy.
[0141] In an optional embodiment, the target memory space includes a peripheral memory space, which is a memory space on a target physical peripheral device used by the virtualization instance; the target memory data includes second memory data stored in the peripheral memory space; when the processor 75 performs in-place residency on the target memory data in the target memory space of the virtualization instance, it is specifically used to: when the target virtualization component includes a driver of the target physical peripheral device, when the driver is uninstalled, prohibit overwriting the peripheral memory space; when the upgraded driver is reloaded, prohibit initialization operations on the peripheral memory space.
[0142] In an optional embodiment, before uninstalling the driver, the processor 75 is further configured to: enable a memory residency function of the driver through an interface exposed by the driver; the memory residency function includes not rewriting the peripheral memory space during the uninstallation process and not initializing the peripheral memory space during the loading process;
[0143] In an optional embodiment, when the processor 75 restores the state of the virtualization instance based on the saved state information of the virtualization instance, it is specifically used to: recreate the virtualization instance according to the resource file corresponding to the virtualization instance, and the virtualization instance reuses the unique identifier before the restoration; reallocate the target memory space to the virtualization instance according to the unique identifier; and restore the virtualization instance to the running state when the state was saved according to the state data in the specified file.
[0144] In an optional embodiment, the virtualization manager includes a first virtualization component that creates the virtualization instance; when the processor 75 saves the state of the virtualization instance running on the physical machine, it is specifically used to: call the first virtualization component to save the state of the virtualization instance; accordingly, when the processor 75 restores the state of the virtualization instance based on the saved state information of the virtualization instance, it is specifically used to: when the target virtualization component does not include the first virtualization component, call the first virtualization component to restore the state of the virtualization instance based on the saved state information of the virtualization instance; when the target virtualization component includes the first virtualization component, call the upgraded first virtualization component to restore the state of the virtualization instance based on the saved state information of the virtualization instance.
[0145] In an optional embodiment, before uninstalling the target virtualization component before upgrading, the processor 75 is further used to: when the target virtualization component includes a driver for the target physical peripheral device used by the virtualization instance, optimize the uninstallation process, installation process, loading process and / or initialization process of the driver.
[0146] In an optional embodiment, when the processor 75 saves the state of the virtualization instance running on the physical machine, it is specifically used to: when there are multiple virtualization instances, save the state of multiple virtualization instances in a concurrent operation manner.
[0147] Further, if Figure 7 As shown, the physical machine also includes: a communication component 76, a display 77, a power component 78, an audio component 79 and other components. Figure 7 Only some components are shown schematically, which does not mean that the physical machine only includes Figure 7 In addition, Figure 7 The components in the dotted box are optional components, not mandatory components, and the specific components depend on the product form of the working node. The working node of this embodiment can be implemented as a terminal device such as a desktop computer, laptop computer, smart phone or IOT device, or a server device such as a conventional server, cloud server or server array. If the working node of this embodiment is implemented as a terminal device such as a desktop computer, laptop computer, smart phone, etc., it can include Figure 7 If the working node of this embodiment is implemented as a server device such as a conventional server, a cloud server or a server array, it may not include Figure 7 Components within the dotted box.
[0148] The embodiment of the present application also provides a physical machine, the implementation structure of which is similar to Figure 7 The implementation structure of the physical machine shown is the same or similar, please refer to Figure 7 The physical machine provided in this embodiment is implemented as follows: Figure 7 The physical machines in the illustrated embodiments differ primarily in the functions implemented by the processor executing the computer program stored in the memory. For the physical machine provided in this embodiment, its processor executes the computer program stored in the memory, which can be used to: respond to a virtualization instance state save operation, collect state data of the virtualization instance, and save the state data to a specified file; the virtualization instance has a target memory space, which includes the system memory space, and the first memory data generated by the virtualization instance is stored in the system memory space as a file; and before the virtualization instance is restored, the first memory data is kept in situ in a file-sharing manner.
[0149] In an optional embodiment, when the processor makes the first memory data reside in situ in a file sharing manner, it is specifically used to: when storing the first memory data, store the first memory data in a memory mapping file in the system memory space, and keep the memory mapping file from being released during the upgrade of the target virtualization component to achieve the in situ residence of the first memory data; the memory mapping file is a memory mapping of the target persistent file used by the virtualization instance, and the target persistent file is used to persistently store the data in the memory mapping file; or, when storing the first memory data, call the memory file system to store the first memory data in the system memory space as a memory file, and keep the memory file from being released during the upgrade of the target virtualization component to achieve the in situ residence of the first memory data.
[0150] In an optional embodiment, the processor is also used to: create a target persistent file for the virtualization instance, and create a memory mapping file corresponding to the target persistent file in the system memory space; write the first memory data into the memory mapping file during the process of the virtualization instance generating the first memory data; and, according to the set persistence policy, store the data in the memory mapping file into the target persistent file.
[0151] In an optional embodiment, the target memory space also includes a peripheral memory space, which is a memory space on the target physical peripheral device used by the virtualization instance, and the peripheral memory space stores second memory data generated during the process of the virtualization instance using the target physical peripheral device; the processor is also used to: prohibit overwriting the peripheral memory space when unloading the driver of the target physical peripheral device; and prohibit initialization operations on the peripheral memory space when reloading the driver, so as to achieve in-situ residence of the second memory data.
[0152] In an optional embodiment, the processor is also used to: recreate the virtualization instance based on the resource file corresponding to the virtualization instance, and the virtualization instance reuses the unique identifier before restoration; reallocate the target memory space to the virtualization instance based on the unique identifier; and restore the virtualization instance to the running state when the state was saved based on the state data in the specified file.
[0153] The detailed implementation and beneficial effects of each step in the method of this embodiment have been described in detail in the aforementioned embodiments and will not be elaborated here.
[0154] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor is enabled to implement each step in the above method embodiment.
[0155] Accordingly, an embodiment of the present application further provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the processor is enabled to implement the steps in the above method embodiment.
[0156] The above-mentioned memory can be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random-access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0157] The above-mentioned communication component is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0158] The above-mentioned display includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor can not only sense the boundary of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
[0159] The power supply assembly provides power to various components of the device in which the power supply assembly is located. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply assembly is located.
[0160] The above-mentioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), and when the device where the audio component is located is in an operating mode, such as call mode, recording mode, and voice recognition mode, the microphone is configured to receive external audio signals. The received audio signal can be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.
[0161] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to magnetic disk storage, compact disc read-only memory (CD-ROM), optical storage, etc.) that contain computer-usable program code.
[0162] The present application is described with reference to the flow chart and / or block diagram of the method, device (system), and computer program product according to the embodiment of the present application. It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processing machine or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one flow chart flow or multiple flows and / or one box or multiple boxes of the block diagram.
[0163] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0164] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0165] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), input / output interfaces, network interfaces, and memory.
[0166] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0167] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.
[0168] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0169] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A virtualization component upgrade method, characterized in that: include: Determining a target virtualization component, where the target virtualization component is a virtualization component to be upgraded in a virtualization manager running on a physical machine; Saving the state of a virtualization instance running on the physical machine, where the virtualization instance is created by the virtualization manager; Uninstall the target virtualization component before the upgrade, and reinstall and load the upgraded target virtualization component; Based on the saved state information of the virtualized instance, the state of the virtualized instance is restored.
2. The method according to claim 1, characterized in that Saving the state of the virtualized instance running on the physical machine includes: Collecting state data of the virtualized instance and saving the state data to a specified file; The target memory data in the target memory space of the virtualized instance is kept in situ.
3. The method according to claim 2, characterized in that The target memory space includes a system memory space, and the target memory data includes first memory data stored in the system memory space in a file manner; The target memory data in the target memory space of the virtualized instance is kept in situ, including: keeping the first memory data in situ in a file sharing manner.
4. The method according to claim 3, characterized in that The first memory data is stored in situ in a file sharing manner, including: When storing the first memory data, the first memory data is stored in a memory-mapped file in the system memory space, and during the upgrade process of the target virtualization component, the memory-mapped file is kept from being released to achieve in-situ residence of the first memory data; the memory-mapped file is a memory mapping of a target persistent file used by the virtualization instance, and the target persistent file is used to persistently store the data in the memory-mapped file; or When storing the first memory data, the memory file system is called to store the first memory data in the system memory space in the form of a memory file. During the upgrade process of the target virtualization component, the memory file is kept from being released to achieve the in-situ residence of the first memory data.
5. The method according to claim 2, characterized in that The target memory space includes a peripheral memory space, which is a memory space on a target physical peripheral device used by the virtualization instance; the target memory data includes second memory data stored in the peripheral memory space; The target memory data in the target memory space of the virtualized instance is kept in situ, including: In a case where the target virtualization component includes a driver of the target physical peripheral device, when uninstalling the driver, prohibiting rewriting the peripheral memory space; When reloading the upgraded driver, initialization operation on the peripheral memory space is prohibited.
6. The method according to claim 5, characterized in that Before uninstalling said driver, also include: Enabling a memory resident function of the driver through an interface exposed by the driver; the memory resident function includes not rewriting the peripheral memory space during an unloading process and not initializing the peripheral memory space during a loading process; The upgraded driver program enables the memory resident function by default.
7. The method according to claim 2, characterized in that Restoring the state of the virtualized instance based on the saved state information of the virtualized instance includes: Re-creating the virtualized instance according to the resource file corresponding to the virtualized instance, wherein the virtualized instance reuses the unique identifier before restoration; reallocating the target memory space to the virtualized instance according to the unique identifier; and The virtualized instance is restored to the running state at the time of state saving according to the state data in the specified file.
8. The method according to any one of claims 1 to 7, characterized in that Before uninstalling the target virtualization component before the upgrade, the following steps are also required: In a case where the target virtualization component includes a driver of a target physical peripheral device used by the virtualization instance, an uninstallation process, an installation process, a loading process and / or an initialization process of the driver is optimized.
9. A physical machine, characterized in that: include: Hardware resources, on which a virtualization manager, a virtualization instance, and an upgrade program run; the virtualization manager includes multiple virtualization components for implementing virtualization of the hardware resources and creation and management of the virtualization instance; Among them, the upgrade program is used to determine the target virtualization component to be upgraded among the multiple virtualization components; save the state of the virtualization instance; uninstall the target virtualization component before the upgrade, and reinstall and load the upgraded target virtualization component; and restore the state of the virtualization instance based on the saved state information of the virtualization instance.
10. The physical machine according to claim 9, characterized in that: The multiple virtualization components include a first virtualization component in a user state and a second virtualization component in a kernel state; the target virtualization component includes the first virtualization component and / or the second virtualization component; The upgrade program is specifically used to: call the first virtualization component to save the state of the virtualization instance; and In a case where the target virtualization component does not include the first virtualization component, calling the first virtualization component and restoring the state of the virtualization instance based on the saved state information of the virtualization instance; In a case where the target virtualization component includes the first virtualization component, the upgraded first virtualization component is called, and the state of the virtualization instance is restored based on the saved state information of the virtualization instance.
11. A method for preserving virtualized instance state, characterized in that: include: In response to a virtualization instance state saving operation, collecting state data of the virtualization instance and saving the state data to a specified file; The virtualization instance has a target memory space, the target memory space includes a system memory space, and the first memory data generated by the virtualization instance is stored in the system memory space in a file manner; Before the virtualized instance is restored, the first memory data is kept in situ in a file sharing manner.
12. The method according to claim 11, characterized in that The first memory data is stored in situ in a file sharing manner, including: When storing the first memory data, the first memory data is stored in a memory-mapped file in the system memory space, and during the upgrade process of the target virtualization component, the memory-mapped file is kept from being released to achieve in-situ residence of the first memory data; the memory-mapped file is a memory mapping of a target persistent file used by the virtualization instance, and the target persistent file is used to persistently store the data in the memory-mapped file; or When storing the first memory data, the memory file system is called to store the first memory data in the system memory space in the form of a memory file. During the upgrade process of the target virtualization component, the memory file is kept from being released to achieve the in-situ residence of the first memory data.
13. The method according to claim 11 or 12, characterized in that The target memory space also includes a peripheral memory space, where the peripheral memory space is a memory space on a target physical peripheral device used by the virtualization instance, and the peripheral memory space stores second memory data generated during the virtualization instance using the target physical peripheral device; the method further includes: When the driver of the target physical peripheral device is uninstalled, rewriting operation on the peripheral memory space is prohibited; and when the driver is reloaded, initialization operation on the peripheral memory space is prohibited to achieve in-situ residence of the second memory data.
14. A physical machine, characterized in that: The method comprises hardware resources, wherein the hardware resources include a memory and a processor, wherein the memory stores a computer program, and the processor is coupled to the memory and configured to execute the computer program to implement the steps in the method according to any one of claims 1 to 8 and claims 11 to 13.
15. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is enabled to implement the steps of the method according to any one of claims 1 to 8 and claims 11 to 13.
16. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, enables the processor to implement the steps of the method according to any one of claims 1 to 8 and claims 11 to 13.