A system updating method, device and storage medium
By sending a restart message after both the virtual machine and the physical server have completed system updates, the problem of inconsistent update timing between the operating systems of the virtual machine and the physical server is solved, the number of restarts is reduced, and the service stability and compatibility of the virtual machine are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
- Filing Date
- 2023-02-24
- Publication Date
- 2026-07-31
AI Technical Summary
The virtual machine's operating system and the physical server's operating system are not synchronized in their updates, causing the virtual machine to be unable to stably provide network connectivity services and resulting in unnecessary restarts, which affects the stability and reliability of the virtual machine.
After both the virtual machine and the physical server have completed the system update, the system update device sends a restart message at the same time, causing the virtual machine and the physical server to restart simultaneously. This avoids system incompatibility issues caused by timing inconsistencies, reduces the number of virtual machine restarts, and improves service stability.
By reducing the number of virtual machine restarts, the compatibility of the virtual machine with the physical server's operating system is ensured, problems such as restart failures and unstable network connections are avoided, and the stability of the virtual machine in providing services to the outside world is improved.
Smart Images

Figure CN116339773B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud computing technology, and in particular to a system update method, apparatus, and storage medium. Background Technology
[0002] With the rapid development of computer technology, people's demands for computer central processing units (CPUs), memory, hard drives, and gateways are increasing, leading to higher and higher costs. Currently, due to the advantages of cloud computing networks such as cost savings and high efficiency, multiple virtual machines are typically deployed on physical servers, with the virtual machines providing services such as CPU, memory, hard drives, and gateways to the outside world.
[0003] Because both the physical server's operating system and the operating systems of the virtual machines within it are updated, the virtual machine's operating system restarts upon completion of the update. If the physical server's operating system has not yet been updated or is in the process of updating, the updated virtual machine's operating system may become incompatible with the physical server's operating system. This can lead to virtual machine restart failures or, even if the virtual machine restarts successfully, functional defects that prevent it from reliably providing network connectivity services. Furthermore, after the physical server's operating system update, it restarts, causing each virtual machine's operating system on the physical server to restart again. This double restart of the virtual machine's operating system results in unnecessary restarts, leading to prolonged unavailability of the virtual machine's operating system and consequently affecting its ability to stably provide network connectivity services. Summary of the Invention
[0004] This application provides a system update method, apparatus, and storage medium to solve the problem that the virtual machine cannot stably provide network connection services to the outside world due to the asynchronous update completion times of the virtual machine's operating system and the physical server's operating system.
[0005] In a first aspect, embodiments of this application provide a system update method, the method comprising: a system update device receiving a first message, wherein the first message includes at least one first identifier, at least one first system version identifier corresponding to the at least one first identifier, and a second system version identifier of at least one server to be updated, wherein each of the at least one first identifier is used to identify at least one virtual machine of the same type to be updated. The system update device then determines, according to the first message and a first correspondence, the identifier of each server to be updated and the identifier of the virtual machine to be updated on each of the at least one servers to be updated, wherein the first correspondence includes a correspondence between the identifiers of preset servers and the identifiers of preset virtual machines, and the identifier of the virtual machine to be updated on each server to be updated is at least one of the at least one first identifier. For a first server to be updated, which is any one of the at least one servers to be updated, the method performs the following: sending a second system version identifier to the first server to be updated according to the identifier of the first server to be updated, and then sending a corresponding first system version identifier to the virtual machine to be updated on the first server to be updated according to the identifier of the virtual machine to be updated corresponding to the identifier of the first server to be updated. Then, after receiving update success messages from the first server to be updated and the virtual machine to be updated on the first server to be updated, a restart message is sent to the first server to be updated. The restart message is used to instruct the first server to be updated to restart the system according to the second system version identifier.
[0006] In this method, after receiving update success messages from the first server to be updated and the virtual machines on it, the system update device sends a restart message to the first server to be updated, so that the server can restart its system upon receiving the restart message. When the first server restarts, each virtual machine on it also automatically restarts. Compared to the existing technology where the first server restarts first after updating, causing all virtual machines on it to restart as well, and the virtual machines to be updated later need to restart again, this method, after both the first server and its virtual machines have been updated, allows the system update device to send a restart message to the first server to be updated, thus restarting both the server and its virtual machines individually. This reduces the number of restarts for the virtual machines and improves the stability of their services.
[0007] Furthermore, since the system update device sends a restart message to the first server to be updated only after both the first server to be updated and the virtual machines on the first server to be updated have completed the system update, the first server to be updated and the virtual machines on the first server to be updated can use their respective updated operating systems. Moreover, the updated operating system of the first server to be updated is compatible with the updated operating system of the virtual machines on the first server to be updated. Therefore, the system incompatibility problem caused by one of the first server to be updated and the virtual machines on the first server to be updated restarting first can be avoided. This can also avoid the problem of virtual machine restart failure due to system incompatibility, and the problem of virtual machine restarting successfully but being unable to reliably provide network connection services can also be avoided.
[0008] In one possible design, the first correspondence includes multiple sets of correspondences, each set being a correspondence between the identifier of a preset server and the identifier of at least one preset virtual machine. The system update device determines the identifier of each server to be updated and the identifier of the virtual machine to be updated on each of the at least one servers to be updated, based on the first message and the first correspondence. This can include: for the first set of correspondences in the first correspondence, performing the following: if the identifier of at least one preset virtual machine in the first set of correspondences has the same identifier as at least one first identifier, then the system update device uses the identifier of the preset server in the first set of correspondences as the identifier of the server to be updated, and uses the same identifier as the identifier of the virtual machine to be updated on the server to be updated, wherein the first set of correspondences can be any set of correspondences in the first correspondence. In this method, when the first message includes at least one first identifier, at least one first system version identifier corresponding to at least one first identifier, and at least one second system version identifier of the server to be updated, the identifier of the server to be updated and the identifier of the virtual machine to be updated on the server to be updated can be determined directly based on at least one first identifier and the first correspondence. In the above method, since the first message has no redundant data, the time for the system update device to receive the first message and the space for storing the first message can be saved.
[0009] In one possible design, the first message further includes the identifier of at least one server to be updated. The system update device determines the identifier of each server to be updated and the identifier of the virtual machine to be updated on each server based on the first message and the first correspondence. This can include: the system update device first determines the identifier of each server to be updated from the first message; then, the system update device determines the identifier of the virtual machine to be updated on each server based on the at least one first identifier and the first correspondence. In this method, when the first message includes at least one first identifier, at least one first system version identifier corresponding to the at least one first identifier, and at least one second system version identifier and at least one identifier of the server to be updated, determining at least one set of candidate correspondences from multiple sets of correspondences based on the identifier of the server to be updated can reduce the number of correspondences that need to be checked, thus improving the efficiency of determining the identifier of the server to be updated and the identifier of the virtual machine to be updated on the server.
[0010] In one possible design, before the system update device sends the second system version identifier to the first server to be updated based on its identifier, the method may further include: the system update device first determining the update order of at least one server to be updated; then, the system update device sequentially designates the at least one server to be updated as the first server to be updated according to the update order. This design provides an update method that allows updating at least one server to be updated in an update order.
[0011] In one possible design, the system update device determines the update order of at least one server to be updated, which may include: the system update device determining the update order of at least one server to be updated based on at least one preset factor, wherein the at least one preset factor includes at least one of the following: the identifier of at least one server to be updated, the IP address of at least one server to be updated, and the number of virtual machines deployed on at least one server to be updated. Through this design, the system update device can determine the update order of the servers to be updated based on the identifier of the servers to be updated, the IP address of the servers to be updated, and the number of virtual machines deployed on the servers to be updated, which can effectively improve the diversity of system updates.
[0012] Secondly, embodiments of this application also provide a system update apparatus, which includes modules / units for executing the methods described in the first aspect and any possible design of the first aspect. These modules / units can be implemented in hardware or by hardware executing corresponding software.
[0013] Thirdly, embodiments of this application provide a system update apparatus, including a memory and a processor; wherein the memory is used to store one or more computer programs, and when the computer programs are executed by the processor, the system update apparatus performs the methods described in the first aspect and any possible design of the first aspect.
[0014] Fourthly, this application also provides a computer-readable storage medium, which includes a computer program that, when run on a system update device, causes the system update device to perform the methods described in the first aspect and any possible design of the first aspect.
[0015] Fifthly, embodiments of this application also provide a method comprising a computer program product, which, when running on a system update device, causes the system update device to execute the first aspect and any possible design of the first aspect.
[0016] These or other aspects of this application will become more apparent from the description of the following embodiments. Attached Figure Description
[0017] Figure 1 A schematic diagram of a system architecture provided for an embodiment of this application;
[0018] Figure 2 A schematic flowchart illustrating a system update method provided in an embodiment of this application;
[0019] Figure 3 A schematic diagram of a system architecture provided for an embodiment of this application;
[0020] Figure 4 A flowchart illustrating a method for determining the identifier of a virtual machine to be updated, provided as an embodiment of this application;
[0021] Figure 5 A schematic flowchart illustrating a system update method provided in an embodiment of this application;
[0022] Figure 6 A schematic flowchart illustrating a system update method provided in an embodiment of this application;
[0023] Figure 7 This is a schematic diagram of the structure of a system update device provided in an embodiment of this application;
[0024] Figure 8 This is a schematic diagram of the hardware structure of a system update device provided in an embodiment of this application. Detailed Implementation
[0025] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0026] The following explanations of some terms used in the embodiments of this application are provided to facilitate understanding by those skilled in the art.
[0027] Network address translation (NAT) gateways are used to provide network address translation services, and are divided into public network NAT gateways and private network NAT gateways.
[0028] As an edge service of the cluster, the load balancing (LB) gateway provides load balancing, gateway proxy, application programming interface (API) management, certificate management, routing management, and request management functions for services within the cluster.
[0029] The route gateway is a centralized Virtual Extensible Local Area Network (VXLAN) Layer 3 gateway, which is a VXLAN Layer 3 gateway centrally deployed on a single device.
[0030] This application provides a schematic diagram of a system architecture, as shown in the embodiments below. Figure 1 As shown, the system architecture includes at least terminal device 101, system update device 102, server 103-1, server 103-2, ..., server 103-X, where X is a positive integer.
[0031] Terminal device 101 is connected to system update device 102. The specific connection method can be a direct or indirect connection via wired communication or a direct or indirect connection via wireless communication. This application does not impose any restrictions on this connection.
[0032] The system update device 102 is connected to servers 103-1, 103-2, ..., and 103-X respectively. The specific connection method can be a direct or indirect connection via wired communication or a direct or indirect connection via wireless communication. This application does not impose any restrictions on this.
[0033] In addition, each server deploys at least one virtual machine, which can provide services to the outside world, including but not limited to CPU, graphics processing unit (GPU), field-programmable gate array (FPGA), memory, hard disk, and gateway services. The system update device 102 is also connected to each virtual machine in each server. Taking servers 103-1 as an example, servers 103-1 deploy virtual machine 1 and virtual machine 2, and the system update device 102 is connected to virtual machine 1 and virtual machine 2 respectively. The specific connection method can be direct or indirect connection via wireless communication, which is not limited in this application.
[0034] In the embodiments of this application, the following four aspects are understood regarding the various virtual machines deployed in servers 103-1, 103-2, ..., and 103-X.
[0035] Firstly, all virtual machines deployed on any server provide the same services to the outside world. For example, server 103-1 deploys virtual machine 1 and virtual machine 2, and both virtual machine 1 and virtual machine 2 provide gateway services to the outside world.
[0036] Secondly, virtual machines deployed on any given server can have the same or different identifiers. The identifier of each virtual machine can be determined based on the services it provides. For example, if a virtual machine provides a NAT gateway service, its identifier is NAT-gateway; if it provides a route gateway service, its identifier is route-gateway. Taking the case where the virtual machines deployed on the server have the same identifier, server 103-1 deploys virtual machine 1 and virtual machine 2. Virtual machine 1 can provide a route gateway service, and virtual machine 2 can also provide a route gateway service; therefore, both virtual machine 1 and virtual machine 2 can be identified as route-gateway. Taking the case where the virtual machines deployed on the server have different identifiers, server 103-1 also deploys virtual machine 1 and virtual machine 2. Virtual machine 1 can provide a NAT gateway service, therefore its identifier is NAT-gateway; virtual machine 2 can provide a route gateway service, therefore its identifier is route-gateway.
[0037] Thirdly, the number of virtual machines deployed on any two servers can be the same or different. For example, if the number of virtual machines deployed on any two servers is different, server 103-1 has two virtual machines deployed, namely virtual machine 1 and virtual machine 2; server 103-2 has three virtual machines deployed, namely virtual machine 1, virtual machine 2, and virtual machine 3.
[0038] Fourthly, the services provided by virtual machines deployed on any two servers can be the same or different. For example, if virtual machines deployed on any two servers provide different services, server 103-1 deploys virtual machine 1 and virtual machine 2, both of which provide gateway services; server 103-2 deploys virtual machine 3, virtual machine 4, and virtual machine 5, all of which provide GPU services.
[0039] The terminal device 101 has a target application installed, which may be a pre-installed client, a web application, or a mini-program embedded in other applications. The terminal device 101 may be a smartphone, tablet, laptop, desktop computer, etc., but is not limited to these.
[0040] The system update device 102 can be used to update the operating system in servers 103-1, 103-2, ..., 103-X, and can also be used to update the operating system of each virtual machine in each server.
[0041] In response to a user's system update operation, terminal device 101 sends a first message to system update device 102 via an installed target application. This first message includes at least one first identifier, at least one first system version identifier corresponding to the first first identifier, and a second system version identifier for at least one server to be updated. Each of the at least one first identifier identifies at least one virtual machine of the same type to be updated. Upon receiving the first message, system update device 102 first determines the identifier of each server to be updated and the identifier of each virtual machine to be updated on each server to be updated based on the first message and a first correspondence. This first correspondence includes a correspondence between the identifiers of preset servers and the identifiers of preset virtual machines. Furthermore, the identifier of each virtual machine to be updated on each server to be updated is at least one of the at least one first identifier. Then, for a first server to be updated (which can be any one of the at least one servers to be updated), the device performs the following: sending a second system version identifier to the first server to be updated based on its identifier, and sending a corresponding first system version identifier to the virtual machine to be updated on the first server to be updated based on the identifier of the virtual machine to be updated corresponding to the identifier of the first server to be updated. After receiving update success messages from the first server to be updated and the virtual machine to be updated on the first server to be updated, a restart message is sent to the first server to be updated. This restart message is used to instruct the first server to be updated to restart the system according to the second system version identifier.
[0042] In this embodiment, the system update device 102 may be a server cluster or a distributed system composed of multiple physical servers, or it may be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0043] Servers 103-1, 103-2, ..., 103-X can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0044] The system update method provided in this application embodiment is applicable to the above-mentioned... Figure 1The system architecture shown illustrates how virtual machines deployed on servers 103-1, 103-2, ..., 103-X can provide services such as CPU, GPU, FPGA, memory, hard disk, and gateway. The following explanation uses the example of virtual machines on each server providing gateway services as an example.
[0045] based on Figure 1 The system architecture diagram shown illustrates the process of a system update method provided in this application embodiment. This method can be applied to... Figure 1 The system architecture shown includes terminal device 101, system update device 102, servers 103-1, servers 103-2, ..., servers 103-X, wherein each server includes at least one virtual machine, such as... Figure 2 As shown, the method may include the following steps:
[0046] Step 201: The terminal device sends a first message to the system update device.
[0047] In the embodiments of this application, the first message includes the following two possible implementations.
[0048] In one implementation, the first message includes at least one first identifier, at least one first system version identifier corresponding to the at least one first identifier, and at least one second system version identifier of the server to be updated.
[0049] For example, in servers 103-1, 103-2, ..., 103-X, each server deploys at least one virtual machine. The identifier of each virtual machine can be determined based on the services it provides. For example, if a virtual machine provides a NAT gateway service, its identifier can be NAT-gateway; if it provides a route gateway service, its identifier can be route-gateway. If any two virtual machines provide the same service, their identifiers are the same; if any two virtual machines provide different services, their identifiers are different. In this embodiment, for example, if a user updates a virtual machine on a terminal device, the terminal device sends the identifier of the virtual machine to be updated to the system update device. In this embodiment, the virtual machine to be updated can also be called the virtual machine to be updated. For example, the identifiers of these virtual machines to be updated can be carried in a first message, and in this embodiment, the identifier of the virtual machine to be updated can also be called the first identifier.
[0050] For example, in a service cluster comprising 100 servers, each server includes at least one virtual machine (VM). Ten of these servers have VMs that need updating. The total number of VMs requiring updates on these ten servers is 15, for example, VMs 1 through 15. Each of these 15 VMs can be called a VM to be updated. If multiple VMs among VMs 1 through 15 provide the same service to the outside world, these multiple VMs providing the same service correspond to the same first identifier. Multiple VMs providing different services correspond to different first identifiers. For example, if VMs 1 through 4 and VM 10 all provide NAT gateway services, then the first identifier for VMs 1 through 4 and VM 10 can be NAT-gateway; if VMs 5 through 6, VM 9, VM 11, and VMs 13 through 15 all provide route gateway services, then the first identifier for VMs 5 through 6, VM 9, VM 11, and VMs 13 through 15 can be route-gateway; if VMs 7 through 8 and VM 12 all provide LB gateway services, then the first identifier for VMs 7 through 8 and VM 12 can be LB-gateway. As can be seen, virtual machines 1 through 15 correspond to three first identifiers: NAT-gateway, route-gateway, and LB-gateway. These three first identifiers—NAT-gateway, route-gateway, and LB-gateway—can be carried in the first message.
[0051] Each server has an operating system installed, and each virtual machine on the server also has an operating system installed. For ease of description, in this embodiment, the operating system installed on the virtual machine is referred to as the first operating system, and the operating system installed on the server is referred to as the second operating system. For different virtual machines to be updated, multiple virtual machines providing the same service to the outside world have the same type of first operating system installed, while multiple virtual machines providing different services to the outside world have different types of first operating systems installed. For example, the first operating system installed on multiple virtual machines providing NAT gateway services to the outside world can be a NAT operating system; as another example, the first operating system installed on multiple virtual machines providing route gateway services to the outside world can be a route operating system.
[0052] The first operating system installed on the virtual machine to be updated can be upgraded. Each upgrade corresponds to a new version number. For example, the current version number of the NAT operating system on virtual machine 1 is NAT-1.1, and the upgraded version number is NAT-1.2. Similarly, the current version number of the route operating system on virtual machine 2 is route-1.2, and the upgraded version number is route-1.3. In this embodiment, the version of the first operating system installed on each virtual machine to be updated is represented by a first system version identifier. Multiple virtual machines to be updated identified by the same first identifier have the same first system version identifier, while two different first identifiers identify two virtual machines to be updated with different first system version identifiers. Since each of the at least one first identifiers in step 201 is different, the corresponding at least one first system version identifier is also different. For example, the first identifier NAT-gateway corresponds to first system version identifier 1, the first identifier route-gateway corresponds to first system version identifier 2, and the first identifier LB-gateway corresponds to first system version identifier 3.
[0053] Each of the first identifiers in at least one of the first identifiers in step 201 can correspond to a first system version identifier. Taking NAT-gateway as an example, the first operating system installed on the virtual machine identified by NAT-gateway is the NAT operating system. The current version number of the NAT operating system is NAT-1.1. The virtual machine 1 identified by the first identifier (NAT-gateway) needs to be upgraded and updated. The version of the updated first operating system (i.e., the NAT operating system) can be represented by the first system version identifier. For example, if it needs to be upgraded to version number NAT-1.2, then the first system version identifier corresponding to NAT-gateway, NAT-1.2, can be carried in the first message.
[0054] For example, taking the first identifier as route-gateway, the first operating system installed on the virtual machine identified by route-gateway is the route operating system. The current version number of the route operating system is route-1.1. It is necessary to upgrade and update the virtual machine 2 identified by the first identifier (route-gateway). The version of the updated first operating system (i.e., the route operating system) can be represented by another first system version identifier. For example, if it needs to be upgraded to version number route-1.2, then the first system version identifier corresponding to route-gateway, route-1.2, can be carried in the first message.
[0055] As can be seen from the embodiments of this application, for each first identifier in the first message, there is a first system version identifier corresponding to the first identifier in the first message.
[0056] For any given server, the virtual machines to be updated on that server can have the same type of first operating system installed, or they can have different types of first operating systems installed. Taking the example of virtual machines to be updated on a server having different types of first operating systems installed, server 103-1 has deployed virtual machine 1 and virtual machine 2 to be updated. Virtual machine 1 has a NAT operating system installed as its first operating system, while virtual machine 2 has a route operating system installed as its first operating system.
[0057] For the same type of first operating system, the version number of the first operating system is generally the same. For example, on server 103~1, there are two virtual machines to be updated, namely virtual machine 1 and virtual machine 2. The first operating system installed on virtual machine 1 is a NAT operating system, and its corresponding version number is NAT-1.1; the first operating system installed on virtual machine 2 is also a NAT operating system, and its corresponding version number is also NAT-1.1.
[0058] Each server to be updated has a second operating system installed. This second operating system can be upgraded and updated, and each upgrade corresponds to a new version number. Generally, the second operating system of the server to be updated can be upgraded and updated based on its version identifier, that is, the second operating system is upgraded to the version corresponding to the second system version identifier, and the version number of the upgraded second operating system is the second system version identifier. The second operating system can be, but is not limited to, any of the following: Windows operating system, Linux operating system, macOS operating system, OS operating system, and Unix operating system. For example, taking Windows operating system as the second operating system, if the current version number of Windows operating system is Win7, and the second system version identifier is Win10, upgrading the Windows operating system to the version corresponding to Win10 will result in the version number of the upgraded Windows operating system being Win10. In Implementation Method 1, the identifier of the server to be updated can be used to identify the server to be updated. Since the first message does not include the identifier of the server to be updated, other methods are needed to identify the server to be updated.
[0059] In the embodiments of this application, the first operating system corresponding to each first system version identifier and the second operating system corresponding to the second system version identifier are compatible, that is, the first operating system corresponding to each first system version identifier can run stably in the second operating system corresponding to the second system version identifier.
[0060] For example, the first message may include NAT-gateway, route-gateway, NAT-1.1, route-1.1, and win10. The first message includes two first identifiers: NAT-gateway and route-gateway; it also includes two first system version identifiers: NAT-1.1 and route-1.1; and it further includes a second system version identifier for the server to be updated, which is win10.
[0061] In the second embodiment, the first message includes at least one first identifier, at least one first system version identifier corresponding to the at least one first identifier, and at least one second system version identifier of the server to be updated and at least one identifier of the server to be updated.
[0062] It should be understood that the identifier of the server to be updated is the identifier corresponding to the pre-defined server to be updated. For each identifier of the server to be updated in the first message, there is also a second system version identifier corresponding to the identifier of the server to be updated in the first message.
[0063] For example, the first message may include NAT-gateway, route-gateway, NAT-1.1, route-1.1, win10, and server103~1. The first message includes two first identifiers, namely NAT-gateway and route-gateway. The first message also includes two first system version identifiers, namely NAT-1.1 and route-1.1. The first message also includes a second system version identifier, which is win10. The first message also includes an identifier for the server to be updated, which is server103~1.
[0064] Regarding the first message in Implementation Method 1, in step 201 above, before the terminal device sends the first message to the system update device, the terminal device needs to generate the first message. The generation of the first message by the terminal device can include the following two possible message generation methods:
[0065] In the first possible message generation method, the terminal device receives at least one first identifier, at least one first system version identifier corresponding to the at least one first identifier, and at least one second system version identifier of the server to be updated, and generates a first message based on the at least one first identifier, the at least one first system version identifier corresponding to the at least one first identifier, and at least one second system version identifier of the server to be updated.
[0066] The second possible message generation method involves the terminal device scanning and detecting various servers and their virtual machines to identify the server to be updated and the virtual machines on that server. For the virtual machines on the server to be updated, those providing the same service are represented by the same first identifier, while those providing different services are represented by different first identifiers. Based on this, at least one first identifier can be determined for each virtual machine. Any two of these first identifiers are different, and each first identifier corresponds to a first system version identifier; at least one first identifier corresponds to at least one first system version identifier. For the server to be updated, at least one second system version identifier is determined. Finally, a first message is generated based on the at least one first identifier, the at least one first system version identifier corresponding to the at least one first identifier, and the at least one second system version identifier of the server to be updated.
[0067] Regarding the first message in Implementation Method Two, in step 201 above, before the terminal device sends the first message to the system update device, the terminal device needs to generate the first message. The generation of the first message by the terminal device can include the following two possible message generation methods:
[0068] In the first possible message generation method, the terminal device receives at least one first identifier, at least one first system version identifier corresponding to the at least one first identifier, and at least one second system version identifier and at least one identifier of the server to be updated, and generates a first message based on the at least one first identifier, the at least one first system version identifier corresponding to the at least one first identifier, and at least one second system version identifier and at least one identifier of the server to be updated.
[0069] The second possible message generation method involves the terminal device scanning and detecting various servers and their virtual machines to identify the server to be updated and the virtual machines on that server. For the virtual machines on the server to be updated, those providing the same service are represented by the same first identifier, while those providing different services are represented by different first identifiers. Based on this, at least one first identifier can be determined for each virtual machine. Any two first identifiers are different, and each first identifier corresponds to a first system version identifier; at least one first identifier corresponds to at least one first system version identifier. For the server to be updated, at least one second system version identifier and at least one identifier for the server to be updated are determined. Finally, a first message is generated based on the at least one first identifier, the at least one first system version identifier corresponding to the at least one first identifier, the at least one second system version identifier of the at least one server to be updated, and the at least one identifier for the server to be updated.
[0070] Step 202: The system update device determines the identifier of each server to be updated and the identifier of the virtual machine to be updated on each server to be updated based on the first message and the first correspondence.
[0071] The first correspondence relationship includes multiple sets of correspondence relationships. Each set of correspondence relationships includes a correspondence between the identifier of a preset server and the identifier of at least one preset virtual machine. Different sets of correspondence relationships include different identifiers of preset servers. For each set of correspondence relationships, the preset server can be any server among servers 103~1, servers 103~2, ..., servers 103~X, and the preset virtual machine is a virtual machine deployed on the preset server.
[0072] Taking server 103-1 as a preset server as an example, virtual machine 1 to be updated and virtual machine 2 to be updated are deployed on server 103-1. Both virtual machine 1 to be updated and virtual machine 2 to be updated are preset virtual machines. The identifier of server 103-1 is server103-1, the identifier of virtual machine 1 to be updated is NAT-gateway, and the identifier of virtual machine 2 to be updated is route-gateway. Based on the identifier of server 103-1 (server103-1), the identifier of virtual machine 1 (NAT-gateway), and the identifier of virtual machine 2 (route-gateway), a correspondence can be determined.
[0073] In this embodiment of the application, the system update device determines the identifier of each server to be updated and the identifier of the virtual machine to be updated on each server to be updated based on the first message and the first correspondence, which may include the following two possible implementation methods.
[0074] In a first possible implementation, when the first message includes at least one first identifier, at least one first system version identifier corresponding to the at least one first identifier, and at least one second system version identifier of the server to be updated, the system update device performs the following steps:
[0075] For the first set of correspondences in the first correspondence relationship, if the identifier of at least one preset virtual machine in the first set of correspondences has the same identifier as at least one first identifier, the system update device will use the identifier of the preset server in the first set of correspondences as the identifier of the server to be updated, and use the same identifier as the identifier of the virtual machine to be updated on the server to be updated. Here, the first set of correspondences can be any set of correspondences in the first correspondence relationship.
[0076] Before performing step 202 above, the system update device also needs to determine the first correspondence relationship and set the first correspondence relationship to include multiple sets of correspondence relationships. Each set of correspondence relationships is a correspondence relationship between the identifier of a preset server and the identifier of at least one preset virtual machine. The identifiers of the preset servers corresponding to any two sets of correspondence relationships are different, and the identifiers of the preset virtual machines corresponding to any two sets of relationships can be the same or different.
[0077] based on Figure 1 The system architecture shown has the following default servers: Server 103~1, Server 103~2, ..., Server 103~X, and the default virtual machines are virtual machines deployed on each server.
[0078] This application provides a method for a system update device to determine a first correspondence, which may include the following steps:
[0079] For any given server, the system update device uses that server as a preset server and the virtual machines deployed on that server as preset virtual machines. The system update device first scans and detects the server and the virtual machines deployed on it to determine the server's identifier and the identifiers of the virtual machines deployed on it. It then associates the server's identifier and the identifiers of the virtual machines deployed on it with each other as a set of correspondences. Finally, the multiple sets of correspondences obtained are used as the first correspondence.
[0080] It should be understood that, in the embodiments of this application, the system update device can establish a correspondence between the server identifier and the identifier of the virtual machine deployed on the server in a key-value pair manner. The server identifier serves as the key, and the identifiers of the virtual machines deployed on the server serve as the values, forming a correspondence of <server identifier: identifier of the virtual machine deployed on the server>.
[0081] For example, such as Figure 3 The system architecture shown includes three servers: server 103-1, server 103-2, and server 103-3. Server 103-1 has a NAT gateway deployed, server 103-2 has both a NAT gateway and a route gateway deployed, and server 103-3 has both a route gateway and a load balancer gateway deployed. The system update device can scan and detect these three servers and the gateways deployed on them.
[0082] For server 103-1, the system update device scans server 103-1 and the NAT gateway deployed on server 103-1, determining that server 103-1 is identified as server103-1 and the NAT gateway is identified as NAT-gateway. The determined mapping relationship is as follows:<server103~1:NAT-gateway> .
[0083] For servers 103-2, the system update device scans servers 103-2 and the NAT gateway and route gateway deployed on servers 103-2, determining that server 103-2 is identified as server103-2, the NAT gateway as NAT-gateway, and the route gateway as route-gateway. The determined mapping relationship is as follows:<server103~2:NAT-gateway,route-gateway> .
[0084] For servers 103-3, the system update device scans servers 103-3 and the route gateway and LB gateway deployed on servers 103-3, determining that the identifier for server 103-3 is server103-3, the identifier for the route gateway is route-gateway, and the identifier for the LB gateway is LB-gateway. The determined correspondence is as follows:<server103~3:route-gateway,LB-gateway> .
[0085] Finally, the first correspondence determined based on the above three sets of correspondences is:
[0086] <server103~1:NAT-gateway>
[0087] <server103~2:NAT-gateway,route-gateway>
[0088] <server103~3:route-gateway,LB-gateway>
[0089] After determining the first correspondence, the first correspondence is defined as including 3 sets of correspondences, namely:<server103~1:NAT-gateway> ,<server103~2:NAT-gateway,route-gateway> as well as<server103~3:route-gateway,LB-gateway> The system update device can determine the identifier of each server to be updated and the identifier of the virtual machine to be updated on each server based on the first message and the three sets of correspondences.
[0090] For example, at least one first identifier is set, including NAT-gateway and route-gateway.
[0091] Taking the first set of correspondences as<server103~1:NAT-gateway> To explain, the default server is identified as server103~1, and the default virtual machine is identified as NAT-gateway. Since the default virtual machine identifier NAT-gateway in the first set of correspondences has the same identifier as at least one first identifier (including nat-gateway and route-gateway), i.e., NAT-gateway, the system update device uses server103~1 as the identifier of the server to be updated and uses NAT-gateway as the identifier of the virtual machine to be updated on the server to be updated.
[0092] Taking the first set of correspondences as<server103~2:NAT-gateway,route-gateway> To explain, the default server identifier is server103~2, and the default virtual machine identifier is NAT-gateway and route-gateway. Since the default virtual machine identifier (including NAT-gateway and route-gateway) has the same identifier as at least one first identifier (including NAT-gateway and route-gateway), namely NAT-gateway and route-gateway, the system update device uses server103~2 as the identifier of the server to be updated, and uses NAT-gateway and route-gateway as the identifier of the virtual machine to be updated on the server to be updated.
[0093] Taking the first set of correspondences as<server103~3:route-gateway,LB-gateway> To explain, the default server identifiers are server103 to 3, and the default virtual machine identifiers are route-gateway and LB-gateway. Since the default virtual machine identifiers (including route-gateway and LB-gateway) share the same identifier as at least one first identifier (including NAT-gateway and route-gateway), namely route-gateway, the system update device uses server103 to 2 as the identifier of the server to be updated, and uses route-gateway as the identifier of the virtual machine to be updated on the server to be updated.
[0094] In this embodiment, when the first message includes at least one first identifier, at least one first system version identifier corresponding to the at least one first identifier, and at least one second system version identifier of the server to be updated, the identifier of the server to be updated and the identifier of the virtual machine to be updated on the server to be updated can be determined directly based on the at least one first identifier and the first correspondence. In the above method, since the first message has no redundant data, the time for the system update device to receive the first message and the space for storing the first message can be saved.
[0095] In a second possible implementation, if the first message includes at least one first identifier, at least one first system version identifier corresponding to the at least one first identifier, and at least one second system version identifier and at least one identifier of the server to be updated, the system update device first determines the identifier of each server to be updated from the first message, and then determines the identifier of the virtual machine to be updated on each server to be updated based on the at least one first identifier and the first correspondence.
[0096] Specifically, the system update device determines the identifier of each virtual machine to be updated on the server to be updated based on at least one first identifier and a first correspondence, which may include, for example: Figure 4 The following steps are shown:
[0097] Step 401: The system update device selects at least one set of correspondences containing the identifier of any server to be updated from the multiple sets of correspondences included in the first correspondence, and obtains at least one set of candidate correspondences.
[0098] Specifically, for any set of correspondences, if the identifier of the preset server in the set of correspondences is the same as the identifier of any server to be updated, then the set of correspondences is regarded as a candidate correspondence.
[0099] Step 402: For any candidate correspondence, if the identifier of at least one preset virtual machine in the candidate correspondence has the same identifier as at least one first identifier, the system update device will use the same identifier as the identifier of the virtual machine to be updated on the server to be updated.
[0100] Before performing step 401 above, the system update device also needs to determine the first correspondence relationship, and set the first correspondence relationship to include multiple sets of correspondence relationships. Each set of correspondence relationships is a correspondence between the identifier of a preset server and the identifier of at least one preset virtual machine. The identifiers of the preset servers corresponding to any two sets of correspondence relationships are different, and the identifiers of the preset virtual machines corresponding to any two sets of relationships can be the same or different.
[0101] based on Figure 1 The system architecture shown has the following default servers: Server 103~1, Server 103~2, ..., Server 103~X, and the default virtual machines are virtual machines deployed on each server.
[0102] This application provides a method for a system update device to determine a first correspondence, which may include the following steps:
[0103] For any given server, the system update device uses that server as a preset server and the virtual machines deployed on that server as preset virtual machines. The system update device first scans and detects the server and the virtual machines deployed on it to determine the server's identifier and the identifiers of the virtual machines deployed on it. It then associates the server's identifier and the identifiers of the virtual machines deployed on it with each other as a set of correspondences. Finally, the multiple sets of correspondences obtained are used as the first correspondence.
[0104] It should be understood that, in the embodiments of this application, the system update device can establish a correspondence between the server identifier and the identifier of the virtual machine deployed on the server in a key-value pair manner. The server identifier serves as the key, and the identifiers of the virtual machines deployed on the server serve as the values, forming a correspondence of <server identifier: identifier of the virtual machine deployed on the server>.
[0105] For example, based on Figure 3 The system architecture shown has three sets of corresponding relationships.<server103~1:NAT-gateway> ,<server103~2:NAT-gateway,route-gateway> and<server103~3:route-gateway,LB-gateway> .
[0106] The first correspondence determined based on the above three sets of correspondences is:
[0107] <server103~1:NAT-gateway>
[0108] <server103~2:NAT-gateway,route-gateway>
[0109] <server103~3:route-gateway,LB-gateway>
[0110] After determining the first correspondence, the first correspondence is defined as including 3 sets of correspondences, namely:<server103~1:NAT-gateway> ,<server103~2:NAT-gateway,route-gateway> as well as<server103~3:route-gateway,LB-gateway> The system update device can first determine the identifier of each server to be updated from the first message, and then determine the identifier of the virtual machine to be updated on each server based on at least one first identifier and a first correspondence.
[0111] For example, set at least one primary identifier as NAT-gateway, and the identifiers of the servers to be updated are server103~2.
[0112] In the above three sets of correspondences, since only<server103~2:NAT-gateway,route-gateway> It contains the identifiers of the servers to be updated (server103~2), therefore,<server103~2:NAT-gateway,route-gateway> As a set of candidate correspondences.
[0113] Since the identifiers of the preset virtual machines in the above candidate correspondence are NAT-gateway and route-gateway, and the first identifier is NAT-gateway, and the two have the same identifier NAT-gateway, NAT-gateway will be used as the identifier of the virtual machine to be updated on the server to be updated.
[0114] Ultimately, the identifiers of the servers to be updated were determined to be server103~2, and the identifiers of the virtual machines to be updated on the servers were determined to be NAT-gateway.
[0115] In the embodiments of this application, when the first message includes at least one first identifier, at least one first system version identifier corresponding to at least one first identifier, and at least one second system version identifier of the server to be updated and at least one identifier of the server to be updated, at least one set of candidate correspondences is determined from multiple sets of correspondences based on the identifier of the server to be updated. This can reduce the number of correspondences that need to be investigated and is beneficial to improving the efficiency of determining the identifier of the server to be updated and the identifier of the virtual machine to be updated on the server to be updated.
[0116] Step 203: The system update device sends a second system version identifier to the first server to be updated based on the identifier of the first server to be updated.
[0117] In this embodiment, the first server to be updated is any one of at least one servers to be updated. Optionally, the first server to be updated may further include a client, and the system update device sends a second system version identifier to the client in the first server to be updated based on the identifier of the first server to be updated.
[0118] The first server to be updated can be determined through the following two possible implementation methods.
[0119] In a first possible implementation, the system update device randomly selects any one of the at least one servers to be updated as the first server to be updated, and then sends a second system version identifier to the first server to be updated.
[0120] In this embodiment of the application, the system update device selects the server to be updated as the first server to be updated in a random manner, which can effectively improve the diversity of system updates.
[0121] In a second possible implementation, the system update device first determines the update order of at least one server to be updated, then sequentially designates the at least one server to be updated as the first server to be updated according to the update order, and then sends a second system version identifier to the first server to be updated.
[0122] Specifically, the update order of at least one server to be updated can be determined based on at least one preset factor, wherein the at least one preset factor includes at least one of the following: the identifier of at least one server to be updated, the IP address of at least one server to be updated, and the number of virtual machines deployed on at least one server to be updated.
[0123] In the embodiments of this application, for example, at least one preset factor is the identifier of at least one server to be updated, and the servers can be sorted from largest to smallest (or smallest to largest) according to the size of the identifier of at least one server to be updated, thereby determining the update order of at least one server to be updated.
[0124] For example, at least one preset factor is the IP address of at least one server to be updated. The servers can be sorted from largest to smallest (or smallest to largest) according to the size of the IP address of the at least one server to be updated, thereby determining the update order of the at least one server to be updated.
[0125] For example, if at least one preset factor is the number of virtual machines deployed on at least one server to be updated, the virtual machines can be sorted from largest to smallest (or smallest to largest) according to the number of virtual machines deployed on at least one server to be updated, thereby determining the update order of at least one server to be updated.
[0126] Taking the number of virtual machines deployed on at least one server to be updated as a preset factor to determine the update order of at least one server to be updated, let's illustrate with an example. The two servers to be updated are server 103-1 and server 103-2. Server 103-1 has a NAT gateway deployed, therefore, the number of virtual machines deployed is 1. Server 103-2 has both a NAT gateway and a route gateway deployed, therefore, the number of virtual machines deployed is 2. Based on the number of virtual machines deployed in server 103-1 (1) and the number of virtual machines deployed in server 103-2 (2), sorted from largest to smallest, the update order of the two servers can be determined as server 103-2, then server 103-1.
[0127] In this embodiment of the application, the system update device can determine the update order of the server to be updated based on the identifier of the server to be updated, the IP address of the server to be updated, and the number of virtual machines deployed on the server to be updated, which can effectively improve the diversity of system updates.
[0128] If the first server to be updated successfully receives the second system version identifier sent by the system update device, and updates the second operating system of the first server to be updated according to the second system version identifier and the update is successful, then step 205 is executed.
[0129] If the first server to be updated successfully receives the second system version identifier sent by the system update device, but fails to update the second operating system of the first server to be updated according to the second system version identifier, the first server to be updated sends a fault message to the system update device, and the system update device sends a fault message to the terminal device to notify the user to perform fault repair.
[0130] If the first server to be updated cannot receive the second system version identifier sent by the system update device, the first server to be updated sends a fault message to the system update device, and the system update device sends a fault message to the terminal device to notify the user to perform fault repair.
[0131] Step 204: The system update device sends the corresponding first system version identifier to the virtual machine to be updated on the first server to be updated, based on the identifier of the virtual machine to be updated corresponding to the identifier of the first server to be updated.
[0132] Specifically, for any virtual machine to be updated on the first server to be updated, the system update device sends the corresponding first system version identifier to the client in the virtual machine to be updated.
[0133] For example, the first message may include NAT-gateway, route-gateway, NAT-1.1, route-1.1, and win10. The first message includes two first identifiers: NAT-gateway and route-gateway. It also includes two first system version identifiers: NAT-1.1 and route-1.1. Furthermore, it includes a second system version identifier for the server to be updated, which is win10. The identifier of the first server to be updated is set as server103~1, and the identifier of the virtual machine to be updated on the first server to be updated is NAT-gateway. The system update device sends the second system version identifier (win10) to the clients on the first server to be updated (i.e., servers 103~1), and sends the first system version identifier (NAT-1.1) to the clients in the virtual machine (NAT gateway) to be updated on the first server to be updated.
[0134] If the virtual machine to be updated on the first server to be updated successfully receives the first system version identifier sent by the system update device, and updates the first operating system of the virtual machine to be updated according to the first system version identifier and the update is successful, then step 206 is executed.
[0135] If the virtual machine to be updated on the first server to be updated successfully receives the first system version identifier sent by the system update device, but fails to update the first operating system of the virtual machine to be updated according to the first system version identifier, the virtual machine to be updated on the first server to be updated sends a fault message to the system update device, and the system update device sends a fault message to the terminal device to notify the user to perform fault repair.
[0136] If the virtual machine to be updated on the first server to be updated cannot receive the first system version identifier sent by the system update device, the virtual machine to be updated on the first server to be updated sends a fault message to the system update device, and the system update device sends a fault message to the terminal device so as to notify the user to perform fault repair.
[0137] The execution order of steps 203 and 204 above is not important.
[0138] Step 205: The first server to be updated sends an update success message to the system update device.
[0139] Specifically, the client in the first server to be updated receives the second system version identifier and sends the second system version identifier to the system version storage. The system version storage sends the system patch corresponding to the second system version identifier to the client in the first server to be updated. The client in the first server to be updated updates the system of the first server to be updated based on the system patch.
[0140] Step 206: The virtual machine to be updated on the first server to be updated sends an update success message to the system update device.
[0141] For any virtual machine on the first server to be updated, perform the following steps:
[0142] The client in the virtual machine to be updated receives the first system version identifier and sends it to the system version storage. The system version storage sends the system patch corresponding to the first system version identifier to the client in the virtual machine to be updated. The client in the virtual machine to be updated updates the system of the virtual machine to be updated based on the system patch.
[0143] The execution order of steps 205 and 206 above is not important.
[0144] If the system update device successfully receives the update success message from the first server to be updated, it waits to receive the update success message from the virtual machine to be updated on the first server to be updated.
[0145] If the system update device successfully receives the update success message from the virtual machine to be updated on the first server to be updated, it waits to receive the update success message from the first server to be updated.
[0146] If the system update device successfully receives the update success message sent by the first server to be updated, and the update success message sent by the virtual machine to be updated on the first server to be updated, then step 207 is executed.
[0147] If the system update device does not receive an update success message from the first server to be updated, or does not receive an update success message from the virtual machine to be updated on the first server to be updated, the system update device sends a fault message to the terminal device to notify the user to perform fault repair.
[0148] If the system update device receives an update failure message from the first server to be updated, or receives an update failure message from any virtual machine to be updated on the first server to be updated, the system update device sends a fault message to the terminal device to notify the user to perform fault repair.
[0149] Step 207: The system update device sends a restart message to the first server to be updated.
[0150] In this embodiment, the restart message is used to instruct the first server to be updated to restart its system according to the second system version identifier. After receiving the restart message, the first server to be updated restarts its system. When the first server to be updated completes its system restart, each virtual machine deployed on the first server to be updated will also automatically restart its system.
[0151] If the first server to be updated successfully restarts and sends a restart success message to the system update device, and the system update device successfully receives the restart success message, the system update device selects at least one other server to be updated (excluding the first server to be updated) as the first server to be updated, and repeats steps 203 to 207 above until all servers to be updated in at least one server to be updated have completed the system update. Since the virtual machines on the servers to be updated cannot provide stable services when the servers are undergoing system updates, in this embodiment, the system update device selects one server to be updated as the first server to be updated each time and performs a system update on that first server. The virtual machines on the other servers to be updated can still provide services, ensuring service stability.
[0152] If the first server to be updated restarts successfully and sends a restart success message to the system update device, but the system update device cannot receive the restart success message, the system update device will send a fault message to the terminal device to notify the user to perform fault repair.
[0153] If the first server to be updated fails to restart and sends a restart failure message to the system update device, and the system update device successfully receives the restart failure message, the system update device will send a fault message to the terminal device to notify the user to perform fault repair.
[0154] If the first server to be updated fails to restart and sends a restart failure message to the system update device, but the system update device cannot receive the restart failure message, the system update device will send a fault message to the terminal device to notify the user to troubleshoot the fault.
[0155] In this embodiment, after receiving update success messages from the first server to be updated and the virtual machines on it, the system update device sends a restart message to the first server to be updated, so that the server can restart its system upon receiving the restart message. When the first server restarts, each virtual machine on it will also automatically restart. Compared to the prior art where the first server restarts first after updating, causing all virtual machines on it to restart as well, and the virtual machines to be updated later needing to restart again, this application, by sending a restart message to the first server after updating, achieves a system restart for both the server and its virtual machines, reducing the number of restarts and improving the stability of the services provided by the virtual machines.
[0156] Furthermore, since the system update device sends a restart message to the first server to be updated only after both the first server to be updated and the virtual machines on the first server to be updated have completed the system update, the first server to be updated and the virtual machines on the first server to be updated can use their respective updated operating systems. Moreover, the updated operating system of the first server to be updated is compatible with the updated operating system of the virtual machines on the first server to be updated. Therefore, the system incompatibility problem caused by one of the first server to be updated and the virtual machines on the first server to be updated restarting first can be avoided. This can also avoid the problem of virtual machine restart failure due to system incompatibility, and the problem of virtual machine restarting successfully but being unable to reliably provide network connection services can also be avoided.
[0157] For example, such as Figure 5As shown, three servers to be updated are designated as Server 103-1, Server 103-2, and Server 103-3, with corresponding identifiers of server103-1, server103-2, and server103-3, respectively. Among all the virtual machines to be updated on these servers, those providing the same service share the same first identifier, while those providing different services have different first identifiers. These virtual machines have two distinct first identifiers: NAT-gateway and route-gateway. These two first identifiers correspond to two first system version identifiers: NAT-1.1 and route-1.1. The second system version identifier that the servers to be updated need to be upgraded to is win10. Therefore, the first message can be set to include NAT-gateway, route-gateway, NAT-1.1, route-1.1, and win10.
[0158] For servers 103-1, the identified virtual machine to be updated is the NAT gateway deployed on server 103-1, and its identifier is NAT-gateway. For servers 103-2, the identified virtual machines to be updated are the NAT gateway and route gateway deployed on server 103-2, and their identifiers are NAT-gateway and route-gateway. For servers 103-3, the identified virtual machine to be updated is the route gateway deployed on server 103-3, and its identifier is route-gateway.
[0159] Assuming the update order of the three servers to be updated is server 103-1, server 103-2, and server 103-3, servers 103-1, 103-2, and 103-3 are designated as the first servers to be updated, according to this order. During the system update process, the system update device can send the following messages to the first servers to be updated and the virtual machines on those servers:
[0160] Step 501: The system update device sends the second system version identifier win10 to the server 103-1.
[0161] Step 502: The system update device sends the first system version identifier NAT-1.1 to the NAT gateway on server 103-1.
[0162] Step 503: The system update device sends a restart message to server 103-1.
[0163] Combining steps 501 to 503 above, the system update device can achieve parallel updates of server 103-1 and its NAT gateway by sending the second system version identifier win10 to server 103-1 and the first system version identifier NAT-1.1 to the NAT gateway on server 103-1. This allows server 103-1 and its NAT gateway to restart only once, reducing the number of NAT gateway restarts and thus improving the stability of the NAT gateway in providing gateway services.
[0164] Step 504: The system update device sends the second system version identifier win10 to servers 103-2.
[0165] Step 505: The system update device sends the first system version identifier NAT-1.1 to the NAT gateway on servers 103-2.
[0166] Step 506: The system update device sends the first system version identifier route-1.1 to the route gateway on servers 103-2.
[0167] Step 507: The system update device sends a restart message to servers 103-2.
[0168] Combining steps 501 to 503 and steps 504 to 507 above, it can be seen that after the system update device sends a restart message to server 103-1, the system update device then sends the second system version identifier win10 to server 103-2. When server 103-1 is performing system updates and restarts, the NAT gateway on server 103-1 cannot provide services to the outside world, while the NAT gateway and route gateway on server 103-2 can still stably provide services to the outside world, thereby avoiding NAT gateway service interruption.
[0169] The system update device sends a second system version identifier (win10) to server 103-2, and a first system version identifier (NAT-1.1) to the NAT gateway on server 103-2, and a first system version identifier (route-1.1) to the route gateway on server 103-2. This enables parallel updates of server 103-2, its NAT gateway, and its route gateway. This results in each of these gateways restarting only once, reducing the number of restarts for both the NAT and route gateways. This improves the stability of the gateway services provided by both the NAT and route gateways.
[0170] Step 508: The system update device sends the second system version identifier win10 to servers 103-3.
[0171] Step 509: The system update device sends the first system version identifier route-1.1 to the route gateway on servers 103-3.
[0172] Step 510: The system update device sends a restart message to servers 103-3.
[0173] Combining steps 504 to 507 and steps 508 to 510 above, it can be seen that after the system update device sends a restart message to servers 103-2, the system update device then sends the second system version identifier win10 to servers 103-3. When servers 103-3 are performing system updates and restarts, the route gateway on servers 103-3 cannot provide services to the outside world, while the NAT gateway on servers 103-1 can stably provide services to the outside world. Furthermore, the NAT gateway and route gateway on servers 103-2 can also stably provide services to the outside world, thereby avoiding service interruption of the route gateway.
[0174] To better explain the embodiments of this application, the following is in conjunction with... Figure 5 The schematic diagram shown illustrates a system update method provided by an embodiment of this application, tailored to a specific implementation scenario. This system update method may include, for example: Figure 6 The following steps are shown:
[0175] Step 601: The user enters two first identifiers, NAT-gateway and route-gateway, two first system version identifiers, NAT-1.1 and route-1.1, corresponding to the two first identifiers, and a second system version identifier, win10, to a server to be updated on the terminal device.
[0176] Step 602: The terminal device generates a first message based on two first identifiers, NAT-gateway and route-gateway, two first system version identifiers, NAT-1.1 and route-1.1, corresponding to the two first identifiers, and a second system version identifier, win10, to a server to be updated, and sends the first message to the system update device. The first message includes NAT-gateway, route-gateway, NAT-1.1, route-1.1, and win10.
[0177] After receiving the first message, the system update device, based on the first message and the first correspondence, determines that the three servers to be updated are server 103-1, server 103-2, and server 103-3, respectively, and their identifiers are server103-1, server103-2, and server103-3. It also determines the identifier of the virtual machine to be updated on each server: the identifier of the virtual machine to be updated on server 103-1 is NAT-gateway; the identifiers of the virtual machines to be updated on server 103-2 are NAT-gateway and route-gateway; and the identifier of the virtual machine to be updated on server 103-3 is route-gateway. After the system update device determines the identifiers of the three servers to be updated and the identifiers of the virtual machines to be updated on each server, it executes step 603.
[0178] Step 603: The system update device sends the first system version identifier NAT-1.1 to the NAT gateway on server 103-1.
[0179] After receiving the first system version identifier NAT-1.1, the client in the NAT gateway on server 103-1 retrieves the system patch corresponding to the first system version identifier NAT-1.1 from the system version storage, and updates the first operating system of the NAT gateway on server 103-1 based on the system patch. If the update is successful, step 604 is executed; if the update fails, the NAT gateway on server 103-1 sends a fault message to the system update device.
[0180] Step 604: The NAT gateway on server 103-1 sends an update success message to the system update device.
[0181] Step 605: The system update device sends the second system version identifier win10 to server 103-1.
[0182] After receiving the second system version identifier win10, the client in server 103-1 retrieves the system patch corresponding to the second system version identifier win10 from the system version storage, and updates the second operating system of server 103-1 based on the system patch. If the update is successful, step 606 is executed; if the update fails, server 103-1 sends a fault message to the system update device.
[0183] Step 606: Server 103-1 sends an update success message to the system update device.
[0184] After successfully receiving the update success message sent by server 103-1 and the update success message sent by the NAT gateway on server 103-1, the system update device executes step 607.
[0185] The execution order of steps 603-604 and steps 605-606 is not important.
[0186] Step 607: The system update device sends a restart message to servers 103-1.
[0187] After receiving the restart message, server 103-1 restarts the system. When server 103-1 completes the system restart, the NAT gateway deployed on server 103-1 will also automatically restart the system.
[0188] If server 103~1 restarts successfully, proceed to step 608.
[0189] Step 608: Server 103-1 sends a restart success message to the system update device.
[0190] After the system update device successfully receives the restart success message sent by server 103-1, it executes step 609.
[0191] Step 609: The system update device sends the first system version identifier NAT-1.1 to the NAT gateway on servers 103-2.
[0192] After receiving the first system version identifier NAT-1.1, the client in the NAT gateway on server 103-2 retrieves the system patch corresponding to the first system version identifier NAT-1.1 from the system version storage, and updates the first operating system of the NAT gateway on server 103-2 based on the system patch. If the update is successful, step 610 is executed; if the update fails, the NAT gateway on server 103-2 sends a fault message to the system update device.
[0193] Step 610: The NAT gateway on servers 103-2 sends an update success message to the system update device.
[0194] Step 611: The system update device sends the first system version identifier route-1.1 to the route gateway on servers 103-2.
[0195] After receiving the first system version identifier route-1.1, the client in the route gateway on servers 103-2 retrieves the system patch corresponding to the first system version identifier route-1.1 from the system version storage, and updates the first operating system of the route gateway on servers 103-2 based on the system patch. If the update is successful, step 612 is executed; if the update fails, the route gateway on servers 103-2 sends a fault message to the system update device.
[0196] Step 612: The route gateway on servers 103-2 sends an update success message to the system update device.
[0197] Step 613: The system update device sends the second system version identifier win10 to servers 103-2.
[0198] After receiving the second system version identifier win10, the client in server 103-2 retrieves the system patch corresponding to the second system version identifier win10 from the system version storage, and updates the second operating system of server 103-2 based on the system patch. If the update is successful, step 614 is executed; if the update fails, server 103-2 sends a fault message to the system update device.
[0199] Step 614: Servers 103-2 send an update success message to the system update device.
[0200] After successfully receiving the update success message sent by server 103-2, the update success message sent by the NAT gateway on server 103-2, and the update success message sent by the route gateway on server 103-2, the system update device executes step 615.
[0201] The execution order of steps 609-610, 611-612, and 613-614 is not important.
[0202] Step 615: The system update device sends a restart message to servers 103-2.
[0203] After receiving the restart message, servers 103-2 will restart their systems. When servers 103-2 complete the system restart, the NAT gateway and route gateway deployed on servers 103-2 will also automatically restart their systems.
[0204] If servers 103-2 restart successfully, proceed to step 616.
[0205] Step 616: Servers 103-2 send a restart success message to the system update device.
[0206] After the system update device successfully receives the restart success message sent by server 103-2, it executes step 617.
[0207] Step 617: The system update device sends the first system version identifier route-1.1 to the route gateway on servers 103-3.
[0208] After receiving the first system version identifier route-1.1, the client in the route gateway on servers 103-3 retrieves the system patch corresponding to the first system version identifier route-1.1 from the system version storage, and updates the first operating system of the route gateway on servers 103-3 based on the system patch. If the update is successful, step 618 is executed; if the update fails, the route gateway on servers 103-3 sends a fault message to the system update device.
[0209] Step 618: The route gateway on servers 103-3 sends an update success message to the system update device.
[0210] Step 619: The system update device sends the second system version identifier win10 to servers 103-3.
[0211] After receiving the second system version identifier win10, the client in servers 103-3 retrieves the system patch corresponding to the second system version identifier win10 from the system version storage, and updates the second operating system of servers 103-3 based on the system patch. If the update is successful, step 620 is executed; if the update fails, servers 103-3 send a fault message to the system update device.
[0212] Step 620: Servers 103-3 send an update success message to the system update device.
[0213] After successfully receiving the update success message sent by server 103-3 and the update success message sent by the route gateway on server 103-3, the system update device executes step 621.
[0214] The execution order of steps 617-618 and steps 619-620 is not important.
[0215] Step 621: The system update device sends a restart message to servers 103-3.
[0216] After receiving the restart message, servers 103-3 will restart their systems. When servers 103-3 complete their system restart, the route gateways deployed on servers 103-3 will also automatically restart their systems.
[0217] If server 103~3 restarts successfully, proceed to step 622.
[0218] Step 622: Servers 103-3 send a restart success message to the system update device. The system update ends after the system update device successfully receives the restart success message from servers 103-3.
[0219] The above examples can reduce the number of restarts required for each virtual machine to be updated, thereby improving the reliability of the virtual gateway cluster.
[0220] Based on the same technical concept, embodiments of this application provide a system update device 700, such as... Figure 7 As shown, the system update device 700 includes: a receiving module 701, configured to receive a first message, the first message including at least one first identifier, at least one first system version identifier corresponding to the at least one first identifier, and at least one second system version identifier of the server to be updated; wherein, each of the at least one first identifier is used to identify at least one virtual machine of the same type to be updated;
[0221] The determining module 702 is configured to determine, based on the first message and the first correspondence, the identifier of each server to be updated and the identifier of the virtual machine to be updated on each server to be updated; the first correspondence includes the correspondence between the identifier of a preset server and the identifier of a preset virtual machine; the identifier of the virtual machine to be updated on each server to be updated is at least one of at least one first identifier.
[0222] The update module 703 is configured to, for a first server to be updated (which may be any one of at least one server to be updated), perform the following actions: sending a second system version identifier to the first server to be updated based on the identifier of the first server to be updated; sending a corresponding first system version identifier to the virtual machine to be updated on the first server to be updated based on the identifier of the virtual machine to be updated corresponding to the identifier of the first server to be updated; and after receiving update success messages from the first server to be updated and the virtual machine to be updated on the first server to be updated, sending a restart message to the first server to be updated, the restart message being used to instruct the first server to be updated to restart the system based on the second system version identifier.
[0223] In one possible design, the first correspondence includes multiple sets of correspondences, each set being a correspondence between the identifier of a preset server and the identifier of at least one preset virtual machine; the determining module 702 is specifically used to: for the first set of correspondences in the first correspondence, execute: if the identifier of at least one preset virtual machine in the first set of correspondences has the same identifier as at least one first identifier, then the identifier of the preset server in the first set of correspondences is used as the identifier of the server to be updated, and the same identifier is used as the identifier of the virtual machine to be updated on the server to be updated, wherein the first set of correspondences is any set of correspondences in the first correspondence.
[0224] In one possible design, the first message also includes an identifier of at least one server to be updated; the determining module 702 is specifically used to: first determine the identifier of each server to be updated from the first message, and then determine the identifier of the virtual machine to be updated on each server to be updated based on at least one first identifier and a first correspondence.
[0225] In one possible design, the device further includes a sorting module 704, specifically used to: first determine the update order of at least one server to be updated, and then, in order of update order, designate the at least one server to be updated as the first server to be updated.
[0226] In one possible design, the sorting module 704 is specifically used to: determine the update order of at least one server to be updated based on at least one preset factor, wherein the at least one preset factor includes at least one of the following: the identifier of at least one server to be updated, the IP address of at least one server to be updated, and the number of virtual machines deployed on at least one server to be updated.
[0227] The methods provided in the embodiments of this application above are described from the perspective of a system update device as the executing entity. To implement the functions of the methods provided in the embodiments of this application above, the system update device may include hardware structures and / or software modules, implementing the above functions in the form of hardware structures, software modules, or a combination of hardware structures and software modules. Whether a particular function is executed in the form of hardware structures, software modules, or a combination of hardware structures and software modules depends on the specific application and design constraints of the technical solution.
[0228] For example, when implemented in hardware, the hardware implementation of the system update device can be referred to Figure 8 And its related descriptions.
[0229] See Figure 8The system update apparatus may include: one or more processors 802; a memory 803; one or more application programs (not shown); and one or more computer programs 804. These components can be connected via one or more communication buses 801. The one or more computer programs 804 are stored in the memory 803 and configured to be executed by the one or more processors 802. The one or more computer programs 804 include instructions that can be used to perform the methods in any of the above embodiments. The one or more processors 802 can perform the functions of the receiving module 701, the determining module 702, the updating module 703, and the sorting module 704.
[0230] This application also provides a computer storage medium storing computer instructions. When the computer instructions are executed on a system update device, the system update device implements the system update method described in the above embodiments.
[0231] This application also provides a computer program product that, when run on a computer, causes the computer to execute the system update method described in the above embodiments.
[0232] In this application, the system update device, computer storage medium, computer program product or chip provided in the embodiments are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0233] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0234] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0235] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0236] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0237] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0238] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A system update method applied to a system update device, characterized by, The method includes: A first message is received, the first message including at least one first identifier, at least one first system version identifier corresponding to the at least one first identifier, and at least one second system version identifier of the server to be updated; wherein, each of the at least one first identifier is used to identify at least one virtual machine of the same type to be updated; Based on the first message and the first correspondence, the identifier of each server to be updated and the identifier of the virtual machine to be updated on each of the at least one servers to be updated are determined; the first correspondence includes the correspondence between the identifier of a preset server and the identifier of a preset virtual machine; the identifier of the virtual machine to be updated on each of the at least one servers to be updated is at least one of the at least one first identifier; For the first server to be updated, which is any one of the at least one servers to be updated, execute: Based on the identifier of the first server to be updated, send the second system version identifier to the first server to be updated; Based on the identifier of the virtual machine to be updated corresponding to the identifier of the first server to be updated, send the corresponding first system version identifier to the virtual machine to be updated on the first server to be updated. After receiving update success messages from the first server to be updated and the virtual machine to be updated on the first server to be updated, a restart message is sent to the first server to be updated. The restart message is used to instruct the first server to be updated to restart the system according to the second system version identifier.
2. The method as described in claim 1, characterized in that, The first correspondence includes multiple sets of correspondences, each set of correspondences being a correspondence between the identifier of a preset server and the identifier of at least one preset virtual machine; The step of determining the identifier of each server to be updated and the identifier of the virtual machine to be updated on each server to be updated based on the first message and the first correspondence includes: For the first set of correspondences in the first correspondence relationship, where the first set of correspondences is any set of correspondences in the first correspondence relationship, execute: If the identifier of at least one preset virtual machine in the first set of correspondences is the same as the identifier of at least one first identifier, then the identifier of the preset server in the first set of correspondences is used as the identifier of the server to be updated, and the same identifier is used as the identifier of the virtual machine to be updated on the server to be updated.
3. The method as described in claim 1, characterized in that, The first message also includes the identifier of at least one server to be updated; The step of determining the identifier of each server to be updated and the identifier of the virtual machine to be updated on each server to be updated based on the first message and the first correspondence includes: The identifier of each server to be updated is determined from the first message; Based on the at least one first identifier and the first correspondence, the identifier of the virtual machine to be updated on each server to be updated is determined.
4. The method according to any one of claims 1-3, characterized in that, Before sending the second system version identifier to the first server to be updated based on the identifier of the first server to be updated, the method further includes: Determine the update order of the at least one server to be updated; The at least one server to be updated is designated as the first server to be updated in the order of the update.
5. The method as described in claim 4, characterized in that, Determining the update order of the at least one server to be updated includes: The update order of the at least one server to be updated is determined based on at least one preset factor; the at least one preset factor includes at least one of the following: the identifier of the at least one server to be updated, the IP address of the at least one server to be updated, and the number of virtual machines deployed on the at least one server to be updated.
6. A system update device, characterized in that, include: A receiving module is configured to receive a first message, the first message including at least one first identifier, at least one first system version identifier corresponding to the at least one first identifier, and at least one second system version identifier of the server to be updated; wherein, each of the at least one first identifier is used to identify at least one virtual machine of the same type to be updated; The determining module is configured to determine, based on the first message and the first correspondence, the identifier of each server to be updated and the identifier of the virtual machine to be updated on each of the at least one servers to be updated; the first correspondence includes the correspondence between the identifiers of preset servers and the identifiers of preset virtual machines; the identifier of the virtual machine to be updated on each of the servers to be updated is at least one of the at least one first identifier. The update module is configured to, for a first server to be updated (which is any one of the at least one servers to be updated), perform the following actions: sending a second system version identifier to the first server to be updated based on the identifier of the first server to be updated; sending a corresponding first system version identifier to the virtual machine to be updated on the first server to be updated based on the identifier of the virtual machine to be updated corresponding to the identifier of the first server to be updated; and, upon receiving update success messages from the first server to be updated and the virtual machine to be updated on the first server to be updated, sending a restart message to the first server to be updated, wherein the restart message instructs the first server to be updated to restart the system based on the second system version identifier.
7. The apparatus as claimed in claim 6, characterized in that, The first correspondence includes multiple sets of correspondences, each set of correspondences being a correspondence between the identifier of a preset server and the identifier of at least one preset virtual machine; The determining module is specifically used for: For the first set of correspondences in the first correspondence relationship, where the first set of correspondences is any set of correspondences in the first correspondence relationship, execute: If the identifier of at least one preset virtual machine in the first set of correspondences is the same as the identifier of at least one first identifier, then the identifier of the preset server in the first set of correspondences is used as the identifier of the server to be updated, and the same identifier is used as the identifier of the virtual machine to be updated on the server to be updated.
8. The apparatus as claimed in claim 6, characterized in that, The first message also includes the identifier of at least one server to be updated; The determining module is specifically used for: The identifier of each server to be updated is determined from the first message; Based on the at least one first identifier and the first correspondence, the identifier of the virtual machine to be updated on each server to be updated is determined.
9. The apparatus according to any one of claims 6-8, characterized in that, The device further includes a sorting module, specifically used for: Determine the update order of the at least one server to be updated; The at least one server to be updated is designated as the first server to be updated in the order of the update.
10. The apparatus as claimed in claim 9, characterized in that, The sorting module is specifically used for: The update order of the at least one server to be updated is determined based on at least one preset factor; the at least one preset factor includes at least one of the following: the identifier of the at least one server to be updated, the IP address of the at least one server to be updated, and the number of virtual machines deployed on the at least one server to be updated.
11. A system update device, characterized in that, Including memory and processor; The memory is used to store one or more computer programs, which, when executed by the processor, cause the system update device to perform the method as described in any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program that, when run on a system update device, causes the system update device to perform the method as described in any one of claims 1 to 5.