Virtual machine live migration method and device, electronic equipment and storage medium

By transforming data storage and memory transfer, hot migration of virtual machines across middleware types is achieved, solving the problem of uneven migration in existing technologies and ensuring service continuity and high availability.

CN115167988BActive Publication Date: 2025-10-21INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210959104.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-11
Publication Date
2025-10-21
Estimated Expiration
2042-08-11

AI Technical Summary

Technical Problem

Existing virtual machine migration technologies cannot achieve hot migration across middleware types, resulting in a poor user experience and making it impossible to migrate virtual machines without interrupting services.

Method used

By converting the source virtual machine's data storage to suit the target middleware type and transferring the source virtual machine's memory to the target host, the target middleware can reference the source virtual machine's memory, thus achieving hot migration across middleware types.

Benefits of technology

It enables hot migration across middleware types, ensuring smooth operation of service programs during the migration process, improving high availability, and avoiding planned server maintenance interruptions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115167988B_ABST
    Figure CN115167988B_ABST
Patent Text Reader

Abstract

The present disclosure provides a virtual machine live migration method, relating to the financial field. The method comprises: if the types of the source middleware and the target middleware are different, performing the following operations to migrate the source virtual machine with a running state to the target host: converting data storage of the source virtual machine to adapt to the type of the target middleware, the data storage comprising source middleware configuration data and application storage data; starting the target middleware on the target host according to the converted data storage; transferring the memory of the source virtual machine to the target host; and making the virtual machine memory referenced by the target middleware point to the memory of the source virtual machine. The present disclosure also provides a virtual machine live migration device, equipment, storage medium and program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the financial field, and more specifically to a virtual machine hot migration method, apparatus, device, medium, and program product. Background Art

[0002] Live VM migration is the process of migrating a running VM from one host to another, without service interruption or user awareness. Existing VM live migration technologies target target hosts with essentially the same storage and memory as the source host, as well as the same middleware type. Existing migration methods across different middleware types typically involve cold migration, such as manual user interface modifications or direct configuration file changes, or automated configuration and deployment scripts executed using command-line tools provided by the middleware product. Summary of the Invention

[0003] In the process of implementing the inventive concept of the present disclosure, the inventors discovered that there are at least the following problems in the related art:

[0004] The virtual machine migration method in the related art cannot achieve the purpose of smoothness and difficulty for users to notice, that is, it cannot achieve the effect of hot migration across middleware types.

[0005] In view of the problem that the migration methods in the above-mentioned related technologies cannot realize hot migration, a method, apparatus, device, medium and program product for hot migration of virtual machines with state across middleware types are provided.

[0006] One aspect of an embodiment of the present disclosure provides a method for hot migration of a virtual machine, wherein a source middleware and a target middleware are Web application servers in a source host and a target host, respectively, and the source middleware is installed on a source virtual machine in the source host. The method comprises: if the source middleware and the target middleware are of different types, performing the following operations to migrate the source virtual machine in a running state to the target host: converting the data storage of the source virtual machine to adapt to the type of the target middleware, the data storage including source middleware configuration data and application storage data; starting the target middleware on the target host according to the converted data storage; transferring the memory of the source virtual machine to the target host; and making the virtual machine memory referenced by the target middleware point to the memory of the source virtual machine.

[0007] According to an embodiment of the present disclosure, converting the data storage of the source virtual machine to adapt to the type of the target middleware includes: extracting the information to be converted in the data storage of the source virtual machine according to the type of the source middleware; writing the information to be converted into a general template; and extracting the information to be converted from the general template for conversion according to the type of the target middleware.

[0008] According to an embodiment of the present disclosure, after extracting the information to be converted from the general template and converting it, the method also includes: mounting the storage of the source virtual machine to the target host, wherein the storage of the source virtual machine includes the converted data storage; and allowing the source host and the target host to share the storage of the source virtual machine.

[0009] According to an embodiment of the present disclosure, starting the target middleware on the target host includes: making the runtime memory of the target middleware use the memory when the target middleware is started.

[0010] According to an embodiment of the present disclosure, making the virtual machine memory referenced by the target middleware point to the memory of the source virtual machine includes: making the memory of the source virtual machine overwrite the virtual machine memory referenced by the target middleware.

[0011] According to an embodiment of the present disclosure, transferring the memory of the source virtual machine to the target host includes: transferring the memory of the source virtual machine to the first memory space of the target host; making the virtual machine memory referenced by the target middleware point to the memory of the source virtual machine includes: modifying the virtual machine memory referenced by the target middleware to point to the memory of the source virtual machine in the first memory space.

[0012] According to an embodiment of the present disclosure, before migrating the source virtual machine in the running state to the target host, the method further includes: respectively obtaining the first installation path of the source middleware and the second installation path of the target middleware; determining the type of the source middleware according to the first installation path, and determining the type of the target middleware according to the second installation path; and comparing the types of the source middleware and the target middleware.

[0013] Another aspect of an embodiment of the present disclosure provides a virtual machine hot migration device, wherein the source middleware and the target middleware are Web application servers in the source host and the target host respectively, the source middleware is installed on the source virtual machine in the source host, and the device is used to migrate the source virtual machine in a running state to the target host when the types of the source middleware and the target middleware are different. The device includes: a data conversion module, which is used to convert the data storage of the source virtual machine to adapt to the type of the target middleware, and the data storage includes source middleware configuration data and application storage data; a middleware startup module, which is used to start the target middleware on the target host according to the converted data storage; a memory transfer module, which is used to transfer the memory of the source virtual machine to the target host; and a memory reference module, which is used to make the virtual machine memory referenced by the target middleware point to the memory of the source virtual machine.

[0014] According to an embodiment of the present disclosure, the virtual machine hot migration device includes modules respectively used to execute each step of any one of the methods described above.

[0015] Another aspect of an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the method described above.

[0016] Another aspect of the embodiments of the present disclosure further provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method described above.

[0017] Another aspect of the embodiments of the present disclosure further provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0018] One or more of the above-described embodiments have the following beneficial effects: based on the different types of the source middleware and the target middleware, the data storage of the source virtual machine is converted to adapt to the type of the target middleware, and then the target middleware can be started on the target host based on the converted data storage. After the memory of the source virtual machine is transferred to the target host, the virtual machine memory referenced by the target middleware is directed to the memory of the source virtual machine. This allows the purpose of cross-middleware hot migration to be achieved by combining the cross-middleware conversion process, eliminating the need to arrange application interruptions for planned server maintenance, and enabling real-time migration of virtual machines without affecting user use, so that service programs can continue to run smoothly during the migration process, thereby improving high availability. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0020] Figure 1 The following schematically illustrates an application scenario of a method for hot migration of a virtual machine according to an embodiment of the present disclosure;

[0021] Figure 2 The flowchart of the method for hot migration of a virtual machine according to an embodiment of the present disclosure is schematically shown;

[0022] Figure 3 Schematically shows a flow chart of comparing middleware types according to an embodiment of the present disclosure;

[0023] Figure 4 Schematically shows a flow chart of converting data storage according to an embodiment of the present disclosure;

[0024] Figure 5Schematically illustrates a flow chart of a source host and a target host sharing storage according to an embodiment of the present disclosure;

[0025] Figure 6 A flowchart of modifying a virtual machine memory referenced by a target middleware according to an embodiment of the present disclosure is schematically shown;

[0026] Figure 7 Schematically shows a flow chart of a virtual machine live migration method according to another embodiment of the present disclosure;

[0027] Figure 8 A block diagram schematically illustrates a structure of a virtual machine hot migration device according to an embodiment of the present disclosure; and

[0028] Figure 9 A block diagram of an electronic device suitable for implementing a method for hot migration of a virtual machine according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0029] In order to facilitate understanding of the technical solutions of the embodiments of the present application, some technical terms involved in the present application are first introduced.

[0030] Java virtual machine (JVM): The Java language runtime environment is created and managed by the JVM.

[0031] Live Migration: Also known as dynamic migration or real-time migration, it refers to virtual machine preservation and restoration. This typically preserves the entire virtual machine's operating state and allows for rapid restoration to the original hardware platform, or even to a different one. After restoration, the virtual machine continues to run smoothly, and users won't notice any difference.

[0032] Middleware, also known as a Web application server, is a combination of a Web server and an application server. Application server middleware can be considered software infrastructure, leveraging component-based technology to integrate application software into a defined collaborative environment. It also provides various communication mechanisms, transaction processing capabilities, and application development and management functions. It directly supports the development of three-tier or multi-tier application systems, and the J2EE architecture is the mainstream standard for application servers.

[0033] Data storage: refers to middleware configuration files (including middleware configuration data) and application files (including application storage data).

[0034] The source virtual machine's storage refers to the disk (or data storage medium such as a database or hard disk) based on the source host, and the storage space in the disk is allocated to the source virtual machine.

[0035] Shared storage: Both the source and target hosts can access the virtual machine's disk (or data storage medium such as a database or hard disk). That is, the data storage in the virtual machine's disk is associated with both the source and target hosts.

[0036] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0037] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise," "include," etc. used herein indicate the presence of the features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0038] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0039] When expressions such as "at least one of A, B and C, etc." are used, they should generally be interpreted in accordance with the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0040] It should be noted that the virtual machine hot migration method, device, equipment, medium and program product of the embodiments of the present disclosure can be used in the financial field, and can also be used in any field other than the financial field. The embodiments of the present disclosure do not limit the application field of the virtual machine hot migration method, device, equipment, medium and program product.

[0041] Figure 1 The following schematically illustrates an application scenario of a method for hot migration of a virtual machine according to an embodiment of the present disclosure.

[0042] like Figure 1As shown, the application scenario 100 according to this embodiment may include a source host 110 and a target host 120. The source host 110 and the target host 120 may be virtual hosts or physical hosts. The source host is installed with a source virtual machine, and the source virtual machine is installed with a Web application server to deploy applications to provide application services to users. In order to achieve cross-middleware type migration, the entire machine can be hot migrated, that is, both the data storage and the virtual machine memory must be hot migrated, for example Figure 1 The source virtual machine JVM memory (i.e. the memory of the source virtual machine), the source middleware configuration and application files (i.e. data storage).

[0043] For example, before starting the migration, the source host and the target host can be in the same cluster (e.g., a server cluster) or across clusters. The source host and the target host can use the same shared storage (e.g., the same disk space). The source virtual machine is in the running state. The networks of the source host and the target host are interconnected, that is, the uplink of the distributed switch to which the port group to which the virtual machine's network interface card belongs is associated with both the source host and the target host.

[0044] The following will be based on Figure 1 The scene described by Figures 2 to 7 The virtual machine hot migration method according to the embodiment of the present disclosure is described in detail.

[0045] Figure 2 The flowchart of the virtual machine live migration method according to the embodiment of the present disclosure is schematically shown.

[0046] The source middleware and target middleware are the Web application servers in the source host and target host respectively. The source middleware is installed on the source virtual machine in the source host. If the source middleware and target middleware are of different types, such as Figure 2 As shown, operations S210 to S240 are performed to migrate the source virtual machine in the running state to the target host.

[0047] In operation S210 , data storage of the source virtual machine is converted to adapt to the type of the target middleware, where the data storage includes source middleware configuration data and application storage data.

[0048] Exemplarily, the virtual machine can be a JVM virtual machine, a KVM virtual machine or a VMware virtual machine, etc. The type of middleware is the type of Web application server, such as Apache, Nginx, Jboss and Tomcat. Applications can be deployed in the source middleware, and users can generate application storage data when using the applications. The source middleware configuration data is configured to ensure the normal operation of the source middleware. The content or data format of the configuration data and application storage data of different middleware types may be different. Therefore, the purpose of converting data storage is to convert the configuration data and application storage data generated under the type of source middleware (such as Nginx) into data that can be used by the target middleware (such as Tomcat).

[0049] In operation S220 , target middleware is started on the target host according to the converted data storage.

[0050] Exemplarily, the converted application storage data can be applicable to the type of the target middleware and can be used as a startup reference for the target middleware.

[0051] In operation S230 , the memory of the source virtual machine is transferred to the target host.

[0052] Exemplarily, the memory of the source virtual machine includes data in memory space allocated for the source virtual machine, wherein the application uses the memory of the source virtual machine during operation. The transfer may include synchronizing the data in the memory before the migration starts and the memory written after the migration starts to the target host.

[0053] Memory transfer can be achieved using iterative migration and memory sharding technologies. Iterative migration refers to a multiple migration process similar to the iterative update of an application. Memory sharding means: for the first memory shard, at the moment the migration starts, the memory used at that point in time is locked as read-only, and a new memory space is opened up to write new data with read-write permissions. For the second memory shard, after the memory migration before the migration starts is completed, the first memory shard is locked as read-only, and then a second memory shard is created to write new data with read-write permissions. Data is paused until the last memory shard is very small, and the last memory shard is migrated over. Finally, the business mapping is changed to the new virtual machine.

[0054] In operation S240 , the virtual machine memory referenced by the target middleware is directed to the memory of the source virtual machine.

[0055] For example, based on the whole-machine hot migration method, the application storage data and referenced virtual machine memory after the target middleware is started are all from the source virtual machine, so stateful hot migration across middleware types can be achieved without user perception.

[0056] According to the embodiments of the present disclosure, the purpose of cross-middleware hot migration is achieved by combining the process of cross-middleware conversion. There is no need to arrange application interruption for planned server maintenance. Virtual machines can be migrated in real time without affecting user use, so that service programs can still run smoothly during the migration process, thereby improving high availability.

[0057] Figure 3 The flowchart of comparing middleware types according to an embodiment of the present disclosure is schematically shown.

[0058] Before migrating a source VM in the running state to the destination host, Figure 3 As shown, the process also includes comparing the middleware types to identify whether the types of the source middleware and the target middleware are the same, which may include operations S310 to S330.

[0059] In operation S310 , a first installation path of a source middleware and a second installation path of a target middleware are respectively acquired.

[0060] In operation S320 , a type of source middleware is determined according to the first installation path, and a type of target middleware is determined according to the second installation path.

[0061] For example, if the source middleware and the target middleware have been installed on a storage (eg, a disk), the middleware type and version may be identified in the corresponding middleware installation path.

[0062] In operation S330 , types of the source middleware and the target middleware are compared.

[0063] Exemplarily, if the source middleware and the target middleware are of the same type, the existing hot migration technology in the related art is used; if the source middleware and the target middleware are of different types, operations S210 to S240 are performed.

[0064] According to the embodiments of the present disclosure, the middleware type is automatically identified, and the corresponding hot migration technology can be flexibly selected, thereby improving user experience and migration efficiency.

[0065] Figure 4 The flowchart of converting data storage according to an embodiment of the present disclosure is schematically shown.

[0066] like Figure 4 As shown, converting the data storage of the source virtual machine to adapt to the type of the target middleware in operation S210 includes operations S410 to S430.

[0067] In operation S410 , information to be converted is extracted from the data storage of the source virtual machine according to the type of the source middleware.

[0068] Exemplarily, the information to be converted may include source middleware configuration data and / or application storage data, such as one or more of log configuration, JVM parameter configuration, HTTP channel thread pool, data source configuration, and application deployment configuration.

[0069] In operation S420, the information to be converted is written into the general template.

[0070] For example, the general template serves as a transfer file between the two types of middleware. For example, the data store from the source virtual machine can be parsed to extract key information and written into the general template in the form of key-value pairs (for example only).

[0071] In operation S430 , information to be converted is extracted from the general template and converted according to the type of the target middleware.

[0072] Exemplarily, information to be converted is taken from the general template, and new data storage is generated according to the data storage format of the target middleware, such as middleware configuration data and application storage data adapted to the target middleware type.

[0073] According to the embodiments of the present disclosure, there are many types of Web application servers. By using a universal template as a transfer file, data storage conversion between any two types can be applied. It has a wide range of applications and high convenience and conversion efficiency.

[0074] Figure 5 The flowchart of sharing storage between a source host and a target host according to an embodiment of the present disclosure is schematically shown.

[0075] After extracting the information to be converted from the general template and converting it, Figure 5 As shown, the source host and the target host sharing storage in this embodiment includes operations S510 to S520.

[0076] In operation S510 , the storage of the source virtual machine is mounted to the target host, wherein the storage of the source virtual machine includes the converted data storage.

[0077] Exemplarily, the storage of the source virtual machine may be a disk of the source virtual machine, and the disk contains the converted source middleware configuration data and application storage data.

[0078] In operation S520 , the source host and the target host are enabled to share storage of the source virtual machine.

[0079] According to an embodiment of the present disclosure, the target host can access the converted source middleware configuration data and application storage data, so that the target middleware can be started on the target host.

[0080] According to an embodiment of the present disclosure, starting the target middleware on the target host in operation S220 includes: enabling the runtime memory of the target middleware to use the memory when the target middleware is started.

[0081] For example, the middleware memory is different from the application memory (ie, the virtual machine memory) and is used by the middleware when it is running. When the target middleware server program (eg, Tomcat server program) is started, memory can be allocated to it on the target host.

[0082] In some embodiments, in operation S240 , making the virtual machine memory referenced by the target middleware point to the memory of the source virtual machine includes: making the memory of the source virtual machine overwrite the virtual machine memory referenced by the target middleware.

[0083] Exemplarily, the target middleware may overwrite the memory of the virtual machine referenced by the target middleware with the memory data in the memory of the source virtual machine, for example, by overwriting based on memory slicing technology, so that the target middleware can access the memory of the source virtual machine.

[0084] According to an embodiment of the present disclosure, the target middleware references the memory of the source virtual machine by overwriting, ensuring that the memory state of the application running on the target host is consistent with that of the source host, thereby achieving the purpose of hot migration.

[0085] In other embodiments, the following Figure 6 The content shown makes the virtual machine memory referenced by the target middleware point to the memory of the source virtual machine.

[0086] Figure 6 The flowchart of modifying the virtual machine memory referenced by the target middleware according to an embodiment of the present disclosure is schematically shown.

[0087] like Figure 6 As shown, the modification of the virtual machine memory referenced by the target middleware in this embodiment includes operations S610 to S620. Operation S610 is one embodiment of operation S230, and operation S620 is one embodiment of operation S240.

[0088] In operation S610 , the memory of the source virtual machine is transferred to a first memory space of the target host.

[0089] Illustratively, when transferring the memory of the source virtual machine, a new memory space may be opened on the target host as a first memory space to accommodate the memory data in the memory of the source virtual machine.

[0090] In operation S620 , the virtual machine memory referenced by the target middleware is modified to point to the memory of the source virtual machine in the first memory space.

[0091] For example, when the target middleware is started, the virtual machine memory referenced by the target middleware points to the second memory space, or when the target middleware is started, the virtual machine memory referenced by the target middleware is empty. During the transfer of the source virtual machine's memory slice, or after the transfer of the source virtual machine's memory is completed, the virtual machine memory referenced by the target middleware is modified so that the target middleware references the source virtual machine's memory.

[0092] According to an embodiment of the present disclosure, by modifying the reference, the target middleware references the memory of the source virtual machine, ensuring that the memory state of the application running on the target host is consistent with that of the source host, thereby achieving the purpose of hot migration.

[0093] Figure 7 The flowchart of a virtual machine live migration method according to another embodiment of the present disclosure is schematically shown.

[0094] like Figure 7 As shown, the virtual machine live migration method of this embodiment includes operations S701 to S713.

[0095] In operation S701 , a connection is established between the source host and the target host: the source host and the target host are interconnected, that is, the uplink of the distributed switch where the port group to which the virtual machine network card belongs is located is associated with both the source host and the target host.

[0096] In operation S702 , the virtual machine configuration and device information is transmitted: this part transmits the information in the registry, notifies the target server of the resources required by the virtual machine, and allocates the required resources.

[0097] In operation S703 , the middleware types of the source host and the target host are identified: the source host middleware and the target host middleware are installed on the storage, and the middleware types and versions are identified in the middleware installation path.

[0098] In operation S704 , the application storage data is copied: a copy of the application data file is used as a reference for starting the target middleware.

[0099] In operation S705, it is determined whether the source host middleware and the target host middleware are of the same type. If they are, no storage conversion is required and the existing virtual machine hot migration technology can be used to directly migrate the entire machine to execute operation S711. If they are not the same, storage conversion is required and operation S706 is executed.

[0100] In operation S706 , the middleware configuration data and the application storage data are converted, for example, including the data copied in operation S704 .

[0101] In operation S707 , the storage is notified to mount the storage to the target server: in order to start the middleware server on the target host, the storage needs to be mounted to the target host. At this time, the source host still shares the storage.

[0102] In operation S708 , the target host middleware service is started: the middleware runtime memory uses the memory when the middleware server program is started.

[0103] In operation S709, the source virtual machine JVM memory is transferred using iterative migration and memory sharding technology. The JVM virtual machine used here is only an example.

[0104] In operation S710 , the changed segment of the virtual machine JVM memory data is overwritten, and the operation ends.

[0105] Exemplarily, operation S709 and operation S710 may be performed simultaneously in a process of using iterative migration and memory sharding technology.

[0106] In operation S711, the JVM memory referenced by the middleware memory is modified to point to the JVM memory migrated in the previous step, and the operation is terminated.

[0107] In some embodiments, operation S710 may be performed first and then operation S711, and the modification operation may be performed after the overwriting is completed. In some embodiments, operation S710 and operation S711 may be two parallel schemes, one of which may be selected. The implementation method in the above embodiment may be flexibly selected according to the functions supported by the type of target middleware.

[0108] In operation S712 , if the middleware types are the same, the storage is directly notified to mount the storage to the target host.

[0109] In operation S713 , the source virtual machine memory change segment is directly transmitted (without performing memory transformation), and the operation ends.

[0110] According to the embodiments of the present disclosure, application servers can be automatically migrated across different middleware types, avoiding the troublesome issues caused by manual configuration errors. By utilizing virtual machine hot migration technology and combining it with the cross-middleware conversion process, hot migration across middleware is achieved, ensuring that service programs can continue to run smoothly during the migration process, thus improving high availability.

[0111] Based on the above virtual machine hot migration method, the present disclosure also provides a virtual machine hot migration device. Figure 8 The device is described in detail.

[0112] Figure 8 The structure block diagram of the virtual machine hot migration device according to an embodiment of the present disclosure is schematically shown.

[0113] The device is used to migrate a source virtual machine in a running state to a target host when the source middleware and the target middleware are of different types, such as Figure 8As shown, the virtual machine live migration device 800 of this embodiment includes a data conversion module 810 , a middleware startup module 820 , a memory transfer module 830 and a memory reference module 840 .

[0114] The data conversion module 810 may perform operation S210 to convert the data storage of the source virtual machine to adapt to the type of the target middleware, where the data storage includes the source middleware configuration data and application storage data.

[0115] Illustratively, the data conversion module 810 may perform operations S410 to S430 , which will not be described in detail herein.

[0116] The middleware starting module 820 may perform operation S220 for starting the target middleware on the target host according to the converted data storage.

[0117] The memory transfer module 830 may perform operation S230 to transfer the memory of the source virtual machine to the target host.

[0118] Illustratively, the memory transfer module 830 may perform operations S610 to S620, which will not be described in detail herein.

[0119] The memory referencing module 840 may perform operation S240 to direct the virtual machine memory referenced by the target middleware to the memory of the source virtual machine.

[0120] The virtual machine hot migration device 800 may include two parts for performing the above Figures 2 to 7 A module for each step of any one of the described embodiments.

[0121] Exemplarily, the virtual machine live migration apparatus 800 includes a type comparison module, which is used to perform operations S310 to S330 and will not be described in detail here.

[0122] Exemplarily, the virtual machine live migration apparatus 800 includes a shared storage module, which is used to perform operations S310 to S330, and will not be described in detail here.

[0123] It should be noted that the implementation methods, technical problems solved, functions implemented, and technical effects achieved of each module / unit / sub-unit in the device part embodiment are the same or similar to the implementation methods, technical problems solved, functions implemented, and technical effects achieved of each corresponding step in the method part embodiment, and will not be repeated here.

[0124] According to an embodiment of the present disclosure, any multiple modules among the data conversion module 810, the middleware startup module 820, the memory transfer module 830, and the memory reference module 840 can be combined into a single module for implementation, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in a single module.

[0125] According to an embodiment of the present disclosure, at least one of the data conversion module 810, the middleware startup module 820, the memory transfer module 830, and the memory reference module 840 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented in hardware or firmware by any other reasonable means of integrating or packaging circuits, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, at least one of the data conversion module 810, the middleware startup module 820, the memory transfer module 830, and the memory reference module 840 can be at least partially implemented as a computer program module, which can perform the corresponding function when executed.

[0126] Figure 9 A block diagram of an electronic device suitable for implementing a method for hot migration of a virtual machine according to an embodiment of the present disclosure is schematically shown.

[0127] like Figure 9 As shown, the electronic device 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. The processor 901 may, for example, include a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include an onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0128] Various programs and data required for the operation of the electronic device 900 are stored in the RAM 903. The processor 901, ROM 902, and RAM 903 are connected to each other via a bus 904. The processor 901 performs various operations of the method flow according to the embodiment of the present disclosure by executing the programs in the ROM 902 and / or RAM 903. It should be noted that the programs may also be stored in one or more memories other than the ROM 902 and RAM 903. The processor 901 may also perform various operations of the method flow according to the embodiment of the present disclosure by executing the programs stored in one or more memories.

[0129] According to an embodiment of the present disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to the bus 904. The electronic device 900 may further include one or more of the following components connected to the I / O interface 905: an input portion 906 including a keyboard, a mouse, etc.; an output portion 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), a speaker, etc.; a storage portion 908 including a hard disk, etc.; and a communication portion 909 including a network interface card such as a LAN card, a modem, etc. The communication portion 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed in the drive 910 as needed so that a computer program read therefrom can be installed into the storage portion 908 as needed.

[0130] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments. Alternatively, the computer-readable storage medium may exist independently, without being incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the methods according to the embodiments of the present disclosure.

[0131] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 902 and / or RAM 903 described above and / or one or more memories other than ROM 902 and RAM 903.

[0132] The embodiments of the present disclosure also include a computer program product, which includes a computer program containing program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the method provided by the embodiments of the present disclosure.

[0133] The computer program executes the above functions defined in the system / device of the embodiment of the present disclosure when the processor 901 executes the computer program. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0134] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 909, and / or installed from a removable medium 911. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0135] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 909, and / or installed from a removable medium 911. When the computer program is executed by the processor 901, the above-described functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the systems, devices, means, modules, units, etc. described above can be implemented by computer program modules.

[0136] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).

[0137] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0138] Those skilled in the art will appreciate that the features described in the various embodiments and / or claims of this disclosure may be combined and / or coupled in various ways, even if such combinations and / or couplings are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure may be combined and / or coupled in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or couplings are intended to fall within the scope of this disclosure.

[0139] The embodiments of the present disclosure are described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be used in combination to advantage. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A method for hot migration of a virtual machine, wherein: The source middleware and the target middleware are respectively Web application servers in the source host and the target host, the source middleware is installed on the source virtual machine in the source host, and the method includes: If the source middleware and the target middleware are of different types, perform the following operations to migrate the source virtual machine in a running state to the target host: Converting the data storage of the source virtual machine to adapt to the type of the target middleware, the data storage including source middleware configuration data and application storage data; Starting the target middleware on the target host according to the converted data storage; Transferring the memory of the source virtual machine to the target host; Making the virtual machine memory referenced by the target middleware point to the memory of the source virtual machine; in: The transferring the memory of the source virtual machine to the target host comprises: Transferring the memory of the source virtual machine to the first memory space of the target host; The step of making the virtual machine memory referenced by the target middleware point to the memory of the source virtual machine includes: The virtual machine memory referenced by the target middleware is modified to point to the memory of the source virtual machine in the first memory space.

2. The method according to claim 1, wherein Converting the data storage of the source virtual machine to adapt to the type of the target middleware includes: extracting information to be converted from the data storage of the source virtual machine according to the type of the source middleware; Writing the information to be converted into a general template; The information to be converted is extracted from the general template and converted according to the type of the target middleware.

3. The method according to claim 2, wherein: After extracting the information to be converted from the general template and converting it, the method further includes: Mounting the storage of the source virtual machine to the target host, wherein the storage of the source virtual machine includes the converted data storage; The source host and the target host are enabled to share the storage of the source virtual machine.

4. The method according to claim 1, wherein Starting the target middleware on the target host includes: The runtime memory of the target middleware is made to use the memory when the target middleware is started.

5. The method according to claim 4, wherein The step of making the virtual machine memory referenced by the target middleware point to the memory of the source virtual machine includes: The memory of the source virtual machine is made to overwrite the memory of the virtual machine referenced by the target middleware.

6. The method according to claim 1, wherein Before migrating the source virtual machine in the running state to the target host, the method further includes: Respectively obtaining a first installation path of the source middleware and a second installation path of the target middleware; Determining the type of the source middleware according to the first installation path, and determining the type of the target middleware according to the second installation path; Compare the types of the source middleware and the target middleware.

7. A virtual machine hot migration device, wherein: The source middleware and the target middleware are respectively Web application servers in a source host and a target host, the source middleware being installed on a source virtual machine in the source host, and the apparatus being used to migrate the running source virtual machine to the target host when the source middleware and the target middleware are of different types, the apparatus comprising: a data conversion module, configured to convert the data storage of the source virtual machine to adapt to the type of the target middleware, the data storage including source middleware configuration data and application storage data; A middleware startup module, configured to start the target middleware on the target host according to the converted data storage; A memory transfer module, configured to transfer the memory of the source virtual machine to the target host; A memory reference module, configured to point the virtual machine memory referenced by the target middleware to the memory of the source virtual machine; in: The transferring the memory of the source virtual machine to the target host comprises: Transferring the memory of the source virtual machine to the first memory space of the target host; The step of making the virtual machine memory referenced by the target middleware point to the memory of the source virtual machine includes: The virtual machine memory referenced by the target middleware is modified to point to the memory of the source virtual machine in the first memory space.

8. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are enabled to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to perform the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Command processing method, device and physical host of virtual machine

    CN103455363A

  • Virtual machine thermal migration method, device and system, storage medium and equipment

    CN107247619A