Instance migration method and device, equipment, storage medium and program product
By creating target instances in the target physical machine, the problem of complex maintenance of two sets of business systems and data synchronization in disaster recovery across the Availability Zone is solved, and an efficient disaster recovery solution is achieved, reducing complexity and ensuring business continuity.
Patent Information
- Application Number
- CN202410139833.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-31
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, disaster recovery across the availability zone requires maintenance of two business systems with the same functions, resulting in high disaster recovery complexity and complex data synchronization.
By determining the target physical machine and network configuration information of the target instance, the reserved resources are used to create the target instance in the target physical machine to realize instance migration, avoiding the maintenance of two sets of business systems and data bidirectional synchronization.
Reduces disaster recovery complexity, ensures business continuity, and reduces the complexity of data synchronization.
Smart Images

Figure CN120407298A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and in particular, to a method, apparatus, device, storage medium, and program product for instance migration. Background Art
[0002] Disaster recovery across availability zones (AZs) can ensure business continuity and improve business reliability.
[0003] Currently, a user can maintain a set of business systems in two availability zones respectively, and the functions of the business systems maintained in the two availability zones are the same. That is to say, the user can maintain two identical business systems. If any set of business systems stops working due to an accident, the business requests of the stopped business system can be switched to the business system in another availability zone to achieve the purpose of disaster recovery across availability zones. However, in the above method, it is necessary to maintain two sets of business systems with the same functions, and the maintenance complexity of the business systems is relatively high, resulting in a relatively high disaster recovery complexity. Summary of the Invention
[0004] Multiple aspects of this application provide a method, apparatus, device, storage medium, and program product for instance migration to reduce the disaster recovery complexity.
[0005] In a first aspect, an embodiment of this application provides an instance migration method, including:
[0006] Determine the target physical machine corresponding to the target instance to be migrated. The target instance is currently located on the source physical machine, and the source physical machine is used to periodically synchronize the data generated by the target instance on the source physical machine to the target physical machine;
[0007] Determine the target network configuration information of the target instance in the target physical machine;
[0008] Create the target instance in the target physical machine based on the reserved resources corresponding to the target instance in the target physical machine and the target network configuration information. The target instance in the target physical machine is used to take over the business processing of the target instance in the source physical machine.
[0009] In a possible implementation, creating the target instance in the target physical machine based on the reserved resources corresponding to the target instance in the target physical machine and the target network configuration information includes:
[0010] Determine the instance configuration information corresponding to the target instance;
[0011] Create the target instance in the reserved resources of the target physical machine according to the instance configuration information.
[0012] In a possible implementation, creating the target instance in the reserved resources of the target physical machine according to the instance configuration information and the target network configuration information includes:
[0013] Sending an instance creation request to the target physical machine, where the instance creation request includes the instance configuration information, the target network configuration information, and a target instance identifier of the target instance, and the target instance identifier is used for the target physical machine to determine the reserved resources;
[0014] Receiving an instance creation success response sent by the target physical machine, where the instance creation success response is used to indicate that the target instance has been successfully created in the reserved resources of the target physical machine.
[0015] In a possible implementation, determining the target network configuration information of the target instance in the target physical machine includes:
[0016] Determining the source network configuration information of the target instance in the source physical machine;
[0017] Determining the target network configuration information according to the source network configuration information.
[0018] In a possible implementation, the source network configuration information includes the source network address of the target instance in the source physical machine, and the target network information includes the target network address of the target instance in the target physical machine; determining the target network configuration information according to the source network configuration information includes:
[0019] Setting the target network address to the source network address.
[0020] In a possible implementation, determining the target physical machine corresponding to the target instance to be migrated includes:
[0021] Determining the source physical machine, where the source physical machine satisfies at least one of the following: the physical machine state of the source physical machine is a preset state, the services in the source physical machine are updated, or the computer room where the source physical machine is located is to be migrated;
[0022] Determining the instance running in the source physical machine as the target instance;
[0023] Determining the target physical machine corresponding to the target instance according to the target instance identifier of the target instance.
[0024] In a possible implementation, determining the target physical machine corresponding to the target instance according to the target instance identifier of the target instance includes:
[0025] Obtain a preset correspondence relationship, where the preset correspondence relationship includes multiple instance identifiers and the physical machine corresponding to each instance identifier;
[0026] Determine the target physical machine according to the target instance identifier and the preset correspondence relationship.
[0027] In a possible implementation manner, the method further includes:
[0028] Determine the resource occupancy information of the resources occupied by the target instance in the source physical machine, where the resource occupancy information includes multiple resource types and the historical resource occupancy amounts corresponding to each resource type;
[0029] Determine the reserved resource amounts corresponding to each resource type according to the resource occupancy information;
[0030] Request the target physical machine to reserve resources for the target instance according to the reserved resource amounts corresponding to each resource type.
[0031] In a possible implementation manner, the method further includes:
[0032] Deregister the target instance in the source physical machine.
[0033] In a possible implementation manner, the method further includes:
[0034] The source physical machine and the target physical machine are set in different availability zones.
[0035] In a possible implementation manner,
[0036] The source physical machine is used to synchronize the data generated by the target instance in the source physical machine to the target physical machine periodically through a dedicated line network.
[0037] In a second aspect, an embodiment of the present application provides an instance migration device, where the device includes a determination module and a creation module, where,
[0038] The determination module is configured to determine the target physical machine corresponding to the target instance to be migrated, where the target instance is currently located in the source physical machine, and the source physical machine is used to synchronize the data generated by the target instance in the source physical machine to the target physical machine periodically;
[0039] The determination module is further configured to determine the target network configuration information of the target instance in the target physical machine;
[0040] The creation module is configured to create the target instance in the target physical machine based on the reserved resources corresponding to the target instance in the target physical machine and the target network configuration information; the target instance in the target physical machine is used to take over the target instance in the source physical machine for business processing.
[0041] In a possible implementation, the creation module is specifically configured to,
[0042] Determine the instance configuration information corresponding to the target instance;
[0043] Create the target instance in the reserved resources of the target physical machine according to the instance configuration information.
[0044] In a possible implementation, the creation module is specifically configured to,
[0045] Send an instance creation request to the target physical machine, where the instance creation request includes the instance configuration information, the target network configuration information, and the target instance identifier of the target instance, and the target instance identifier is used for the target physical machine to determine the reserved resources;
[0046] Receive an instance creation success response sent by the target physical machine, where the instance creation success response is used to indicate that the target instance has been successfully created in the reserved resources of the target physical machine.
[0047] In a possible implementation, the determination module is specifically configured to,
[0048] Determine the source network configuration information of the target instance in the source physical machine;
[0049] Determine the target network configuration information according to the source network configuration information.
[0050] In a possible implementation, the source network configuration information includes the source network address of the target instance in the source physical machine, and the target network information includes the target network address of the target instance in the target physical machine; the determination module is specifically configured to,
[0051] Set the target network address as the source network address.
[0052] In a possible implementation, the determination module is specifically configured to,
[0053] Determine the source physical machine, where the source physical machine satisfies at least one of the following: the physical machine state of the source physical machine is a preset state, the business in the source physical machine has been updated, or the computer room where the source physical machine is located is to be migrated;
[0054] Determine the instance running in the source physical machine as the target instance;
[0055] Determine the target physical machine corresponding to the target instance according to the target instance identifier of the target instance.
[0056] In a possible implementation manner, the determining module is specifically configured to,
[0057] Obtain a preset correspondence relationship, where the preset correspondence relationship includes a plurality of instance identifiers and the physical machine corresponding to each instance identifier;
[0058] Determine the target physical machine according to the target instance identifier and the preset correspondence relationship.
[0059] In a possible implementation manner, the device further includes a sending module and a cancellation module, where,
[0060] The determining module is further configured to determine resource occupancy information of the resources occupied by the target instance in the source physical machine, where the resource occupancy information includes a plurality of resource types and the historical resource occupancy amounts corresponding to the respective resource types;
[0061] The determining module is further configured to determine the reserved resource amounts corresponding to the respective resource types according to the resource occupancy information;
[0062] The sending module is configured to request the target physical machine to reserve resources for the target instance according to the reserved resource amounts corresponding to the respective resource types.
[0063] In a possible implementation manner, the cancellation module is configured to,
[0064] Cancel the target instance in the source physical machine.
[0065] In a possible implementation manner,
[0066] The source physical machine and the target physical machine are set in different availability zones.
[0067] In a possible implementation manner,
[0068] The source physical machine is used to synchronize the data generated by the target instance in the source physical machine to the target physical machine periodically through a dedicated line network.
[0069] In a third aspect, an embodiment of the present application provides an instance migration device, including: a memory and a processor;
[0070] The memory stores computer execution instructions;
[0071] The processor executes the computer-executable instructions stored in the memory, so that the instance migration device executes the method according to any one of the first aspect.
[0072] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the method according to any one of the first aspect.
[0073] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which when executed by a processor implements the method according to any one of the first aspect.
[0074] An embodiment of the present application provides an instance migration method, device, equipment, storage medium and program product. The instance migration device can determine the target physical machine corresponding to the target instance to be migrated; can determine the target network configuration information of the target instance in the target physical machine; and can create the target instance in the target physical machine based on the reserved resources corresponding to the target instance in the target physical machine and the target network configuration information. In the above method, the source physical machine can synchronize the data of the target instance to the target physical machine, and the target physical machine can pre-configure reserved resources for the target instance. If the source physical machine cannot continue to run the target instance, the instance migration device can determine the target network configuration information, and can create the target instance in the target physical machine according to the target network configuration information and the reserved resources corresponding to the target instance, so as to realize the migration of the target instance. Through the above method, it is not necessary to maintain two sets of business systems with the same functions at the same time, and the data does not need to be synchronized bidirectionally, reducing the complexity of disaster recovery. In addition, the source physical machine can synchronize the data generated by the target instance to the target physical machine in real time; after the source physical machine cannot continue to run the target instance, the instance migration device can immediately create the target instance in the target physical machine, so that the business continuity is better. Description of the Drawings
[0075] 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 of the present application. In the drawings:
[0076] Figure 1 It is a schematic diagram of a disaster recovery architecture provided by an exemplary embodiment of the present application;
[0077] Figure 2 It is another schematic diagram of a disaster recovery architecture provided by an exemplary embodiment of the present application;
[0078] Figure 3 It is a schematic diagram of the process of an instance migration provided by an exemplary embodiment of the present application;
[0079] Figure 4 A flowchart of another instance migration method provided by an exemplary embodiment of the present application;
[0080] Figure 5 A schematic diagram of instance migration provided by an exemplary embodiment of the present application;
[0081] Figure 6 A schematic diagram of the structure of an instance migration device provided by an exemplary embodiment of the present application;
[0082] Figure 7 A schematic diagram of the structure of another instance migration device provided by an exemplary embodiment of the present application;
[0083] Figure 8 A schematic diagram of the structure of an instance migration device provided by an exemplary embodiment of the present application. Detailed implementation manners
[0084] 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 for analysis, stored data, displayed data, etc.) involved in the present application are all information and data that have been authorized by the user or fully authorized by all parties. And the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards, and corresponding operation entrances are provided for the user to choose to authorize or refuse.
[0085] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0086] For ease of understanding, the technical terms involved in the embodiments of the present application are first explained.
[0087] Live migration: Also known as dynamic migration or real-time migration, generally refers to the save / restore of a virtual machine. Usually, the running state of the entire virtual machine is completely saved, and it can be quickly restored to the original hardware platform or even a different hardware platform. After restoration, the virtual machine still runs smoothly, and the user will not notice any difference.
[0088] Available zone: Refers to a physical area within the same region where power and network are independent of each other. Generally, it is a computer room.
[0089] Elastic Compute Service (ECS): A secure, reliable, and elastically scalable cloud computing service.
[0090] The application scenario of the embodiments of this application can be a cross-availability zone disaster recovery scenario. It should be noted that the instance migration method provided by the embodiments of this application is not only applicable to the above-mentioned disaster recovery scenario, but also can be applied to other disaster recovery scenarios, and this application does not make any limitations in this regard.
[0091] Next, in combination with Figure 1 , the disaster recovery methods in the related technologies will be described.
[0092] Figure 1 It is a schematic diagram of a disaster recovery architecture provided by an exemplary embodiment of this application. Please refer to Figure 1 ,
[0093] In availability zone A, multiple availability zone Server Load Balancing (SLB) instances, ECS World Wide Web (Web) servers, ECS Application (APP) servers, Object Storage Service (OSS) instances, and multiple availability zone Relational Database Service (RDS) instances can be set up. In availability zone B, multiple availability zone SLB instances, ECS Web servers, ECS APP servers, OSS instances, and multiple availability zone RDS instances can also be set up.
[0094] The functions that the above systems set up in availability zone A can achieve are the same as those that the above systems set up in availability zone B. The business data in availability zone A can be synchronized to availability zone B, and at the same time, the business data in availability zone B can also be synchronized to availability zone A.
[0095] If any one of availability zone A and availability zone B stops working unexpectedly, the Domain Name System (DNS) can switch the business requests of the stopped working availability zone to the other availability zone to achieve the purpose of cross-availability zone disaster recovery.
[0096] However, in the above architecture, the business data in availability zone A needs to be synchronized to availability zone B, and the business data in availability zone B needs to be synchronized to availability zone A. That is to say, two-way synchronization of business data needs to be achieved, which makes the data synchronization complexity of the business side relatively high; in addition, users need to maintain two sets of business systems with the same functions in two availability zones at the same time, and the maintenance complexity of the business systems is relatively high, resulting in relatively high disaster recovery complexity.
[0097] In view of this, an embodiment of the present application provides an instance migration method to reduce the complexity of disaster recovery.
[0098] Next, in combination with Figure 2 , the disaster recovery architecture related to the embodiment of the present application will be described.
[0099] Figure 2 Another schematic diagram of a disaster recovery architecture provided for an exemplary embodiment of the present application. Please refer to Figure 2 , a physical machine 1 can be set in availability zone A, and instance 1 can run on physical machine 1. A physical machine 2 can be set in availability zone B. For example, availability zone 1 can be computer room 1, availability zone 2 can be computer room 2, and instance 1 can be an ECS instance.
[0100] It should be noted that in the above disaster recovery architecture, the number of physical machines in availability zone A and the number of physical machines in availability zone B can both be one or more. Figure 2 Only taking the number of physical machines in availability zone A and the number of physical machines in availability zone B both being one as an example for illustration does not constitute a limitation on the embodiment of the present application.
[0101] As Figure 2 shown, if physical machine 1 fails, instance 1 can be migrated to physical machine 2, so that instance 1 can run on physical machine 2 and can take over instance 1 in physical machine 1 for business processing. Thus, the purpose of cross-availability zone disaster recovery can be achieved.
[0102] In the above disaster recovery architecture, business data does not need to be synchronously replicated in both directions, and users do not need to maintain two sets of business systems with the same functions at the same time, reducing the complexity of disaster recovery.
[0103] Next, the technical solution shown in the present application will be described in detail through specific embodiments. It should be noted that the following several embodiments can exist independently or be combined with each other. For the same or similar content, it will not be repeated in different embodiments.
[0104] Figure 3 A flowchart of an instance migration provided for an exemplary embodiment of the present application. Please refer to Figure 3 , the method may include:
[0105] S301. Determine the target physical machine corresponding to the target instance to be migrated.
[0106] The execution subject of the embodiment of the present application can be an instance migration device or an instance migration apparatus set in the instance migration device. The instance migration apparatus can be implemented by software or by a combination of software and hardware. For the convenience of understanding, hereinafter, the execution subject is taken as an example of an instance migration device for description.
[0107] In this embodiment, the target instance is currently located on the source physical machine. If the source physical machine cannot continue to run the target instance, the target physical machine corresponding to the target instance can be determined. For example, when the status of the source physical machine is a fault status or the computer room where the source physical machine is located is to be migrated, the target physical machine corresponding to the target instance can be determined.
[0108] Both the source physical machine and the target physical machine can be electronic devices capable of running business instances. For example, both the source physical machine and the target physical machine can be servers, computers, etc.
[0109] The source physical machine and the target physical machine can be respectively set in different availability zones. For example, the source physical machine can be a server in Availability Zone 1, and the target physical machine can be a server in Availability Zone 2. Availability Zone 1 can be, for example, Computer Room 1, and Availability Zone 2 can be, for example, Computer Room 2.
[0110] It should be understood that one or more computer rooms can be set in an availability zone. Among them, "more" can be two or more.
[0111] The target instance can be any business instance running on the source physical machine. For example, the target instance can be an ECS instance.
[0112] The target physical machine can be a disaster recovery physical machine pre-configured for the target instance. That is to say, the target physical machine can be a standby physical machine for running the target instance.
[0113] In this embodiment, there can be a preset correspondence between the target instance and the target physical machine. In the specific implementation process, the target physical machine corresponding to the target instance can be determined according to the preset correspondence between the target instance and the target physical machine.
[0114] In this embodiment, the source physical machine is used to periodically synchronize the data generated by the target instance in the source physical machine to the target physical machine. That is to say, during the operation of the target instance on the source physical machine, the source physical machine can synchronize the data generated by the target instance to the target physical machine.
[0115] It should be noted that the data synchronization period can be set according to actual needs, and this embodiment does not limit it. For example, the source physical machine can synchronize the data to the target physical machine immediately after the target instance generates the data.
[0116] Optionally, during the operation of the target instance on the source physical machine, the source physical machine can store the data generated by the target instance in the cloud disk of the source physical machine, and can copy the data in the cloud disk of the source physical machine to the cloud disk of the target physical machine through a data copy process.
[0117] It should be noted that in this embodiment, the source physical machine can synchronize the data generated by the target instance in the source physical machine to the target physical machine through a dedicated network, which results in better network stability and higher data security.
[0118] The dedicated network can be a dedicated network line between the availability zone where the source physical machine is located and the availability zone where the target physical machine is located. For ease of description, hereinafter, the availability zone where the source physical machine is located will be denoted as the source availability zone, and the availability zone where the target physical machine is located will be denoted as the target availability zone. One or more physical machines can be set in the source availability zone, and one or more physical machines can also be set in the target availability zone.
[0119] Data can be transmitted between the physical machines in the source availability zone and the physical machines in the target availability zone through the dedicated network. Other devices cannot transmit data through the dedicated network.
[0120] In this embodiment, the instance migration device can monitor the source physical machine and the computer room where the source physical machine is located to determine whether the source physical machine can continue to run the target instance. It should be noted that this embodiment does not limit the monitoring method of the source physical machine and the monitoring method of the computer room where the source physical machine is located. In the specific implementation process, corresponding monitoring methods can be set according to actual needs. For example, the instance migration device can monitor the heartbeat information of the source physical machine. If the heartbeat information of the source physical machine is abnormal, it can be determined that the source physical machine has failed and cannot continue to run the target instance; the instance migration device can also monitor whether the power supply of the computer room where the source physical machine is located is normal. If the power supply of the computer room where the source physical machine is located stops, it can be determined that the source physical machine cannot continue to run the target instance.
[0121] S302. Determine the target network configuration information of the target instance in the target physical machine.
[0122] In this embodiment, before creating the target instance in the target physical machine, the target network configuration information of the target instance in the target physical machine can be determined to facilitate the creation of the target instance in the target physical machine according to the network configuration information.
[0123] In this embodiment, the target network configuration information can be determined according to the source network configuration information of the target instance in the source physical machine.
[0124] Specifically, the source network configuration information can include the source network address of the target instance in the source physical machine, and the target network configuration information can include the target network address of the target instance in the target physical machine. The instance migration device can determine the target network address according to the source network address. The target network address can be the same as the source network address.
[0125] It should be noted that the target instance can use a virtual private cloud (VPC). The instance migration device can obtain the Internet Protocol (IP) address of the target instance used in the source physical machine (i.e., the source network address) from the source physical machine, and can determine the Internet Protocol IP address of the target instance used in the source physical machine as the target network address.
[0126] Exemplarily, assume that the private network IP address of the target instance in the source physical machine is IP address 1, then the target network address can be determined as IP address 1.
[0127] S303. Create a target instance in the target physical machine based on the reserved resources corresponding to the target instance in the target physical machine and the target network configuration information.
[0128] The target instance in the target physical machine can be used to take over the target instance in the source physical machine for business processing.
[0129] The reserved resources corresponding to the target instance in the target physical machine can be the memory resources reserved for the target instance in the target physical machine, and the central processing unit (CPU) resources, etc.
[0130] In this embodiment, the instance migration device can store or obtain the instance configuration information of the target instance. After the source physical machine where the target instance is located fails, the instance migration device can create the target instance in the reserved resources corresponding to the target instance according to the instance configuration information of the target instance.
[0131] Optionally, the instance migration device can also request the target physical machine to configure reserved resources for the target instance according to the resource occupancy information of the resources occupied by the target instance in the source physical machine.
[0132] Specifically, the instance migration device can determine the resource occupancy information of the resources occupied by the target instance in the source physical machine. The resource occupancy information includes multiple resource types and the corresponding historical resource occupancy of each resource type; determine the reserved resource amount corresponding to each resource type according to the resource occupancy information; and request the target physical machine to reserve resources for the target instance according to the reserved resource amount corresponding to each resource type.
[0133] The resource type can be a memory resource type or a CPU resource type, etc.
[0134] For any resource type, the historical resource occupancy corresponding to the resource type can be the amount of the resource of this type occupied by the target instance in the source physical machine. For example, the historical resource occupancy corresponding to the memory resource can be the amount of memory resource occupied by the target instance in the source physical machine.
[0135] For any resource type, the reserved resource amount corresponding to the resource type can be the amount of the resource of this type that needs to be reserved for the target instance. It should be understood that for any resource type, the reserved resource amount corresponding to the resource type is greater than or equal to the historical resource occupancy corresponding to the resource type.
[0136] In this embodiment, the instance migration device can determine the target physical machine corresponding to the target instance to be migrated; can determine the target network configuration information of the target instance in the target physical machine; and can create the target instance in the target physical machine based on the reserved resources corresponding to the target instance in the target physical machine and the target network configuration information. In the above method, the source physical machine can synchronize the data of the target instance to the target physical machine, and the target physical machine can pre-configure reserved resources for the target instance. If the source physical machine cannot continue to run the target instance, the instance migration device can determine the target network configuration information, and can create the target instance in the target physical machine according to the target network configuration information and the reserved resources corresponding to the target instance, so as to realize the migration of the target instance. Through the above method, there is no need to maintain two sets of business systems with the same functions at the same time, and the data does not need to be synchronously bidirectional, reducing the complexity of disaster recovery. In addition, the source physical machine can synchronize the data generated by the target instance to the target physical machine in real time; after the source physical machine cannot run the target instance, the instance migration device can immediately create the target instance in the target physical machine, making the business continuity better.
[0137] Next, on the basis of the above Figure 3 illustrated embodiment, in combination with Figure 4 this, the instance migration method provided in the embodiments of the present application will be described in detail.
[0138] Figure 4 It is a schematic flowchart of another instance migration method provided by an exemplary embodiment of the present application. Please refer to Figure 4 this, the method may include:
[0139] S401. Determine the source physical machine.
[0140] The execution subject of the embodiments of the present application can be an instance migration device, or an instance migration device provided in the instance migration device. The instance migration device can be implemented by software, or by a combination of software and hardware. For the sake of easy understanding, hereinafter, the execution subject is taken as an example of an instance migration device for description.
[0141] In this embodiment, the source physical machine satisfies at least one of the following: the physical machine state of the source physical machine is a preset state, the service in the source physical machine is updated, or the computer room where the source physical machine is located is to be migrated.
[0142] The preset state may include a fault state, a full-load state, etc. It should be understood that if the state of the source physical machine is a fault state or a full-load state, the source physical machine cannot continue to run the target instance.
[0143] In this embodiment, the instance migration device can monitor the physical machine state of the source physical machine to determine whether the physical machine state of the source physical machine is a preset state.
[0144] Specifically, the instance migration device can monitor the heartbeat message of the source physical machine and the load condition of the source physical machine. If the heartbeat message of the source physical machine is normal, it can be determined that the physical machine state of the source physical machine is a normal state. If the heartbeat message of the source physical machine is abnormal, it can be determined that the physical machine state of the source physical machine is a fault state. If the load of the source physical machine is greater than the preset threshold, it can be determined that the physical machine state of the source physical machine is a full-load state. If the load of the source physical machine is less than or equal to the preset threshold, it can be determined that the physical machine state of the source physical machine is a non-full-load state.
[0145] The situation where the service in the source physical machine is updated can be that the source physical machine needs to move out the target instance to release the resources occupied by the target instance.
[0146] In this embodiment, if the service in the source physical machine is updated, the source physical machine can send an instance migration request to the instance migration device so that the instance migration device can determine that the service in the source physical machine is updated. The instance migration request may include the identifier of the source physical machine, the identifier of the target instance, etc.
[0147] The situation where the computer room where the source physical machine is located is to be migrated can be accidental situations such as power failure, fire, or flood in the computer room where the source physical machine is located.
[0148] In this embodiment, the instance migration device can monitor the computer room where the source physical machine is located to determine whether there is a power failure, whether there is a fire, and whether there is a flood, etc. in the computer room where the source physical machine is located. For example, the instance migration device can monitor whether there is a power failure in the computer room where the source physical machine is located through a voltage sensor, can monitor whether there is a fire in the computer room where the source physical machine is located through a temperature sensor or a smoke sensor, and can monitor whether there is a flood in the computer room where the source physical machine is located through a water level sensor, etc.
[0149] S402. Determine the instance running in the source physical machine as the target instance.
[0150] In this embodiment, at least one service instance can run on the source physical machine. The target instance can be any service instance running on the source physical machine.
[0151] It should be noted that the migration method for each service instance in the source physical machine is the same. In the embodiment of this application, any service instance in the source physical machine is taken as an example to illustrate the instance migration method.
[0152] S403. Determine the target physical machine corresponding to the target instance according to the target instance identifier of the target instance.
[0153] The target instance identifier can be the name of the target instance, or the unique code (identity document, ID) of the target instance, etc. It should be understood that the target instance identifier can be used to uniquely identify the target instance.
[0154] In this embodiment, a disaster recovery physical machine can be configured for each service instance in the source physical machine. If the source physical machine cannot run any service instance, the service instance can be migrated to the corresponding disaster recovery physical machine. For any service instance in the source physical machine, the disaster recovery physical machine configured for the service instance can be the physical machine corresponding to the service instance.
[0155] In this embodiment, a preset correspondence relationship can be set between each instance in the source physical machine and the physical machine corresponding to each instance. The preset correspondence relationship can include multiple instance identifiers and the physical machine corresponding to each instance identifier. The above preset correspondence relationship can be stored in the instance migration device.
[0156] In the specific implementation process, the instance migration device can obtain the preset correspondence relationship from the local. The preset correspondence relationship includes multiple instance identifiers and the physical machine corresponding to each instance identifier; according to the target instance identifier and the preset correspondence relationship, determine the target physical machine.
[0157] Specifically, the instance migration device can search for the target instance identifier in the preset correspondence relationship, and can determine the physical machine corresponding to the target instance identifier in the preset correspondence relationship as the target physical machine.
[0158] S404. Determine the source network configuration information of the target instance in the source physical machine.
[0159] The source network configuration information of the target instance in the source physical machine can be the dedicated network IP address used when the target instance runs in the source physical machine, etc.
[0160] In this embodiment, the instance migration device may pre-obtain the source network configuration information of the target instance from the source physical machine and store the source network configuration information of the target instance. In the specific implementation process, the instance migration device may determine the source network configuration information of the target instance in the source physical machine according to the target instance identifier.
[0161] S405. Determine the target network configuration information according to the source network configuration information.
[0162] The target network configuration information may be, for example, the dedicated network IP address used when the target instance runs on the target physical machine.
[0163] In this embodiment, the source network configuration information includes the source network address of the target instance in the source physical machine, and the target network configuration information includes the target network address of the target instance in the target physical machine. When determining the target network configuration information according to the source network configuration information, the target network address may be determined as the source network address.
[0164] Specifically, the instance migration device may configure the dedicated network IP address of the target instance in the target physical machine as the target network address.
[0165] S406. Determine the instance configuration information corresponding to the target instance.
[0166] The instance configuration information corresponding to the target instance may be the information required when creating the target instance. For example, the instance configuration information corresponding to the target instance may include the number of virtual CPU cores of the target instance and the network type of the target instance.
[0167] In this embodiment, the instance migration device may store the instance configuration information of the target instance. The instance migration device may determine the configuration information corresponding to the target instance according to the target instance identifier of the target instance.
[0168] S407. Create the target instance in the reserved resources of the target physical machine according to the instance configuration information and the target network configuration information.
[0169] In this embodiment, the instance migration device may send an instance creation request to the target physical machine. The instance creation request includes the instance configuration information, the target network configuration information, and the target instance identifier of the target instance. The target instance identifier is used for the target physical machine to determine the reserved resources; receive the instance creation success response sent by the target physical machine. The instance creation success response is used to indicate that the target instance has been successfully created in the reserved resources of the target physical machine.
[0170] Specifically, the instance migration device may send the target instance identifier, the target network configuration information, and the instance configuration information corresponding to the target instance to the target device. The target physical machine may determine the reserved resources of the target instance according to the target instance identifier, create the target instance in the reserved resources of the target instance according to the target network configuration information and the instance configuration information corresponding to the target instance, and send a creation success response to the instance migration device after the creation is completed, so that the instance migration device can determine that the target instance migration is successful.
[0171] Optionally, the instance migration device may also cancel the target instance in the source physical machine.
[0172] In this embodiment, the instance migration device may determine the source physical machine, and determine the instance running in the source physical machine as the target instance; may determine the target physical machine corresponding to the target instance according to the target instance identifier of the target instance; may determine the source network configuration information of the target instance in the source physical machine, and determine the target network configuration information according to the source network configuration information; may determine the instance configuration information corresponding to the target instance, and create the target instance in the reserved resources of the target physical machine according to the instance configuration information and the target network configuration information. In the above method, the target physical machine may create the target instance in the reserved resources of the target instance. The IP address of the target instance created in the target physical machine may be the same as the IP address of the target instance in the source physical machine. Through the above method, the service side may not perceive the migration of the target instance, and may continue to request the target instance in the target physical machine for service processing, reducing the disaster recovery complexity.
[0173] Based on any of the above embodiments, below, in combination with Figure 5 , a specific example is used to illustrate the instance migration method provided by the embodiments of the present application.
[0174] Figure 5 FIG. is a schematic diagram of instance migration provided by an exemplary embodiment of the present application. Please refer to Figure 5 , in computer room A, server 1 may be set, and cloud disk 1 and ECS instance 1 may run on server 1. In computer room B, server 2 may be set, and cloud disk 2 may run on server 2.
[0175] When ECS instance 1 is running normally in server 1, the service data generated by ECS instance 1 may be stored in cloud disk 1. At the same time, server 1 may periodically synchronize the service data generated by ECS instance 1 to cloud disk 2 of server 2, so that server 2 can obtain the service data generated during the operation of ECS instance 1.
[0176] In Server 2, there may be reserved resources configured for ECS Instance 1. The reserved resources may include reserved memory resources and reserved CPU resources. If due to unexpected reasons, Machine Room A stops operating, an ECS Instance 1 can be created in Server 2 according to the instance migration method provided in any of the above embodiments. The IP address of ECS Instance 1 in Server 2 can be the same as the IP address of ECS Instance 1 in Server 1. For example, the unexpected reasons can be fire, flood, etc. Through the above method, the migration of ECS Instance 1 can be achieved, and the ECS Instance 1 in Server 2 can take over the business processing of ECS Instance 1 in Server 1.
[0177] In this embodiment, Server 1 can synchronize the business data of ECS Instance 1 to Server 2, and Server 2 can pre-configure reserved resources for ECS Instance 1. If Server 1 fails, an ECS Instance 1 can be created in Server 2 to achieve the migration of ECS Instance 1. In the above method, there is no need to maintain two sets of business systems with the same functions at the same time, and the data does not need to be synchronized bidirectionally, reducing the complexity of disaster recovery.
[0178] Figure 6 The following is a schematic structural diagram of an instance migration device provided by an exemplary embodiment of the present application. Please refer to Figure 6 , the instance migration device 10 includes: a determination module 11 and a creation module 12, where,
[0179] The determination module 11 is configured to determine the target physical machine corresponding to the target instance to be migrated. The target instance is currently located in the source physical machine, and the source physical machine is used to periodically synchronize the data generated by the target instance in the source physical machine to the target physical machine;
[0180] The determination module 11 is further configured to determine the target network configuration information of the target instance in the target physical machine;
[0181] The creation module 12 is configured to create the target instance in the target physical machine based on the reserved resources corresponding to the target instance in the target physical machine and the target network configuration information; the target instance in the target physical machine is used to take over the business processing of the target instance in the source physical machine.
[0182] The instance migration device provided by the embodiments of the present application can execute the technical solutions shown in the above method embodiments, and its implementation principle and beneficial effects are similar, so details are not described here again.
[0183] In a possible implementation manner, the creation module 12 is specifically configured to,
[0184] determine the instance configuration information corresponding to the target instance;
[0185] Create the target instance in the reserved resources of the target physical machine according to the instance configuration information.
[0186] In a possible implementation, the creating module 12 is specifically configured to,
[0187] Send an instance creation request to the target physical machine, where the instance creation request includes the instance configuration information, the target network configuration information, and the target instance identifier of the target instance, and the target instance identifier is used by the target physical machine to determine the reserved resources;
[0188] Receive an instance creation success response sent by the target physical machine, where the instance creation success response is used to indicate that the target physical machine has successfully created the target instance in the reserved resources.
[0189] In a possible implementation, the determining module 11 is specifically configured to,
[0190] Determine the source network configuration information of the target instance in the source physical machine;
[0191] Determine the target network configuration information according to the source network configuration information.
[0192] In a possible implementation, the source network configuration information includes the source network address of the target instance in the source physical machine, and the target network information includes the target network address of the target instance in the target physical machine; the determining module 11 is specifically configured to,
[0193] Set the target network address as the source network address.
[0194] In a possible implementation, the determining module 11 is specifically configured to,
[0195] Determine the source physical machine, where the source physical machine satisfies at least one of the following: the physical machine state of the source physical machine is a preset state, the services in the source physical machine are updated, or the computer room where the source physical machine is located is to be migrated;
[0196] Determine the instance running in the source physical machine as the target instance;
[0197] Determine the target physical machine corresponding to the target instance according to the target instance identifier of the target instance.
[0198] In a possible implementation, the determining module 11 is specifically configured to,
[0199] Obtain a preset correspondence relationship, where the preset correspondence relationship includes a plurality of instance identifiers and the physical machine corresponding to each instance identifier;
[0200] Determine the target physical machine according to the target instance identifier and the preset corresponding relationship.
[0201] The instance migration device provided in the embodiments of this application can execute the technical solutions shown in the above method embodiments. The implementation principles and beneficial effects are similar and will not be elaborated here.
[0202] Figure 7 It is a schematic structural diagram of another instance migration device provided for an exemplary embodiment of this application. On Figure 6 this basis, the instance migration device 10 may further include a sending module 13 and a cancellation module 14, where
[0203] the determining module 11 is further configured to determine resource occupancy information of the resources occupied by the target instance in the source physical machine, where the resource occupancy information includes multiple resource types and the corresponding historical resource occupancy of each resource type;
[0204] the determining module 11 is further configured to determine the reserved resource amount corresponding to each resource type according to the resource occupancy information;
[0205] the sending module 13 is configured to request the target physical machine to reserve resources for the target instance according to the reserved resource amount corresponding to each resource type.
[0206] In a possible implementation manner, the cancellation module 14 is configured to
[0207] cancel the target instance in the source physical machine.
[0208] In a possible implementation manner,
[0209] the source physical machine and the target physical machine are set in different availability zones.
[0210] In a possible implementation manner,
[0211] the source physical machine is used to synchronize the data generated by the target instance in the source physical machine to the target physical machine periodically through a dedicated line network.
[0212] The instance migration device provided in the embodiments of this application can execute the technical solutions shown in the above method embodiments. The implementation principles and beneficial effects are similar and will not be elaborated here.
[0213] Figure 8 It is a schematic structural diagram of an instance migration device provided for an exemplary embodiment of this application. Please refer to Figure 8The instance migration device 20 may include a processor 21 and a memory 22. Exemplarily, the processor 21 and the memory 22 are connected to each other via a bus 23.
[0214] The memory 22 stores computer-executable instructions;
[0215] The processor 21 executes the computer-executable instructions stored in the memory 22 , so that the processor 21 performs the method shown in the above method embodiment.
[0216] Figure 8 The example migration device shown in FIG may be a server, a computer or other electronic device.
[0217] The example migration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principles and beneficial effects are similar and will not be repeated here.
[0218] Accordingly, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method described in the above method embodiment.
[0219] Accordingly, an embodiment of the present application may also provide a computer program product, including a computer program, which, when executed by a processor, may implement the method shown in the above method embodiment.
[0220] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0221] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented 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 processor, 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 generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0222] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to work in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction device that implements the functions specified in one or more of the processes and / or blocks Figure 1 in one or more of the processes and / or blocks Figure 1 specified in one or more of the blocks or blocks.
[0223] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, such that a series of operation steps are performed on the computer or other programmable apparatus to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in one or more of the processes and / or blocks Figure 1 in one or more of the processes and / or blocks Figure 1 specified in one or more of the blocks or blocks.
[0224] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0225] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM) and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
[0226] Computer-readable media includes both permanent and non-permanent, removable and non-removable media implemented by any method or technology for storing information. The 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 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 technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0227] It should also be noted that the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, commodity or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the phrase "comprising an..." does not exclude the presence of additional identical elements in the process, method, commodity or device comprising said element.
[0228] The above description is only for the embodiments of the present application and is not intended to limit the present application. For those skilled in the art, various modifications and changes can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. An instance migration method, characterized in that, Including: Determine the target physical machine corresponding to the target instance to be migrated, where the target instance is currently located on the source physical machine, and the source physical machine is used to synchronize the data generated by the target instance on the source physical machine to the target physical machine periodically; Determine the target network configuration information of the target instance on the target physical machine; Create the target instance on the target physical machine based on the reserved resources corresponding to the target instance on the target physical machine and the target network configuration information; the target instance on the target physical machine is used to take over the target instance on the source physical machine for business processing.
2. The method according to claim 1, wherein Creating the target instance on the target physical machine based on the reserved resources corresponding to the target instance on the target physical machine and the target network configuration information includes: Determine the instance configuration information corresponding to the target instance; Create the target instance in the reserved resources of the target physical machine according to the instance configuration information and the target network configuration information.
3. The method according to claim 2, wherein Creating the target instance in the reserved resources of the target physical machine according to the instance configuration information and the target network configuration information includes: Send an instance creation request to the target physical machine, where the instance creation request includes the instance configuration information, the target network configuration information, and the target instance identifier of the target instance, and the target instance identifier is used for the target physical machine to determine the reserved resources; Receive the instance creation success response sent by the target physical machine, where the instance creation success response is used to indicate that the target instance has been successfully created in the reserved resources of the target physical machine.
4. The method according to any one of claims 1 to 3, characterized in that Determining the target network configuration information of the target instance on the target physical machine includes: Determine the source network configuration information of the target instance on the source physical machine; Determine the target network configuration information according to the source network configuration information.
5. The method according to claim 4, characterized in that The source network configuration information includes the source network address of the target instance on the source physical machine, and the target network information includes the target network address of the target instance on the target physical machine; determining the target network configuration information according to the source network configuration information includes: Set the target network address to the source network address.
6. The method according to any one of claims 1-5, characterized in that, Determining the target physical machine corresponding to the target instance to be migrated includes: Determine the source physical machine, where the source physical machine satisfies at least one of the following: the physical machine state of the source physical machine is a preset state, the business in the source physical machine has been updated, or the computer room where the source physical machine is located is to be migrated; Determine the instance running on the source physical machine as the target instance; Determine the target physical machine corresponding to the target instance according to the target instance identifier of the target instance.
7. The method according to claim 6, characterized in that Determining the target physical machine corresponding to the target instance according to the target instance identifier of the target instance includes: Obtain a preset correspondence relationship, where the preset correspondence relationship includes multiple instance identifiers and the physical machine corresponding to each instance identifier; Determine the target physical machine according to the target instance identifier and the preset correspondence relationship.
8. The method according to any one of claims 1-7, characterized in that, The method further includes: Determine the resource occupancy information of the resources occupied by the target instance in the source physical machine, where the resource occupancy information includes multiple resource types and the historical resource occupancy amounts corresponding to each resource type; Determine the reserved resource amounts corresponding to each resource type according to the resource occupancy information; Request the target physical machine to reserve resources for the target instance according to the reserved resource amounts corresponding to each resource type.
9. The method according to any one of claims 1-8, characterized in that, The method further includes: Deregister the target instance in the source physical machine.
10. The method according to any one of claims 1-9, characterized in that The source physical machine and the target physical machine are set in different availability zones.
11. The method according to any one of claims 1 to 10, characterized in that The source physical machine is used to synchronize the data generated by the target instance in the source physical machine to the target physical machine periodically through a dedicated line network.
12. An instance migration device, characterized in that, The device includes: a determination module and a creation module, where The determination module is configured to determine the target physical machine corresponding to the target instance to be migrated, the target instance is currently located in the source physical machine, and the source physical machine is used to synchronize the data generated by the target instance in the source physical machine to the target physical machine periodically; The determination module is further configured to determine the target network configuration information of the target instance in the target physical machine; The creation module is configured to create the target instance in the target physical machine based on the reserved resources corresponding to the target instance in the target physical machine and the target network configuration information; the target instance in the target physical machine is used to take over the target instance in the source physical machine for business processing.
13. An instance migration device, characterized in that, Includes: At least one processor; And A memory communicatively connected to the at least one processor; Wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the instance migration device to execute the method according to any one of claims 1-11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1-11 is implemented.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the method according to any one of claims 1-11 is implemented.