An application update method, a computing device, and a computing system for a virtual machine

By using a virtual serial port to communicate between the host machine and virtual machine, the method ensures successful application updates on VMs even in network-limited environments, addressing the issue of failed updates in existing methods.

CN117453242BActive Publication Date: 2025-07-15XFUSION DIGITAL TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311282395.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-28
Publication Date
2025-07-15
Estimated Expiration
2043-09-28

AI Technical Summary

Technical Problem

In scenarios with no network or unstable network connectivity, existing methods for updating applications on virtual machines (VMs) result in failed updates, lowering the success rate of application updates.

Method used

A method where the host machine communicates with the target virtual machine using a virtual serial port (virtual serial port) to send the application identifier and update package, allowing the VM to add the update to its file system without relying on network connectivity, thereby avoiding update failures due to network issues.

Benefits of technology

This approach enhances the success rate of application updates on virtual machines by bypassing network-dependent update processes, ensuring successful package delivery and installation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117453242B_ABST
    Figure CN117453242B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a method for updating an application of a virtual machine, a computing device, and a computing system, which relate to the technical field of servers and can improve the success rate of updating an application in a virtual machine. The method includes: in response to an application update request, a host machine sends an application identifier of an application to be updated to a target virtual machine through a virtual serial port, where the target virtual machine is a virtual machine that runs on the host machine and needs to update the application; the target virtual machine adds an update package of the application to be updated in the host machine to the file system of the target virtual machine; and the target virtual machine updates the application to be updated based on the update package.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of servers, and particularly to an application update method for virtual machines, a computing device, and a computing system. Background Art

[0002] As is well known, a virtual machine (VM) is a virtual computer with an independent operating system (OS) running on a host machine; in practical applications, it is necessary to update and upgrade the version of the application software deployed on the virtual machine.

[0003] A common method for updating applications on a virtual machine is that the virtual machine updates the applications thereon based on the network connection with the host machine; however, in scenarios where there is no network or the network is unstable, when updating the applications on the virtual machine, the update of the application may fail, thereby reducing the success rate of the application update. Summary of the Invention

[0004] Embodiments of this application provide an application update method for virtual machines, a computing device, and a computing system, which are used to improve the success rate of application updates on virtual machines.

[0005] To achieve the above object, the embodiments of this application adopt the following technical solutions:

[0006] In a first aspect, embodiments of this application provide an application update method for virtual machines. The method includes: in response to an application update request, the host machine sends an application identifier of the application to be updated to a target virtual machine through a virtual serial port, where the target virtual machine is a virtual machine running on the host machine and requires application update; the target virtual machine adds an update package of the application to be updated in the host machine to the file system of the target virtual machine; the target virtual machine updates the application to be updated based on the update package.

[0007] This application provides an application update method for virtual machines. In this method, the host machine sends an application identifier of the application to be updated to a target virtual machine that requires application update on the host machine through a virtual serial port; then, the target virtual machine adds the update package of the application to be updated in the host machine to the file system of the target virtual machine, and finally, the target virtual machine updates the application to be updated thereon based on the update package. Since in this update process, the host machine and the target virtual machine running thereon communicate based on a virtual serial port, the problem that the application to be updated fails to be updated due to network problems during the update process of the application to be updated is avoided. Therefore, the success rate of updating the application to be updated on the virtual machine is improved.

[0008] In a possible implementation, the above-mentioned target virtual machine adds the update package of the application to be updated in the host machine to the file system of the target virtual machine, including: the target virtual machine sends a mounting notification to the host machine through the virtual serial port; in response to the mounting notification, the host machine mounts the update package to the optical drive of the target virtual machine and sends a mounting success message to the target virtual machine through the virtual serial port; in response to the mounting success message, the target virtual machine adds the update package from the optical drive to the file system of the target virtual machine.

[0009] In the above-mentioned embodiment, the host machine mounts the update package of the application to be updated to the optical drive of the target virtual machine, and then the target virtual machine adds the update package of the application to be updated from the optical drive to the file system of the target virtual machine. Since it is based on the optical drive of the target virtual machine, the process of adding the update package to the file system of the target virtual machine does not require a network, thus avoiding the problem that the target virtual machine cannot obtain the update package due to network problems. Therefore, the success rate of the virtual machine obtaining the update package is improved. Further, the success rate of updating the application to be updated on the virtual machine is improved.

[0010] In a possible implementation, the above-mentioned target virtual machine updates the application to be updated based on the update package, including:

[0011] The target virtual machine updates the application to be updated in a preset update manner based on the update package; wherein, the preset update manner includes: incremental update or full update.

[0012] In a possible implementation, before the host machine sends the application identifier of the application to be updated to the target virtual machine through the virtual serial port in response to the application update request, the method further includes: the host machine receives an application update request sent by the management device, and the application update request includes: the identifier of the target virtual machine and the application identifier of the application to be updated, and the application update request is a request generated by the management device in response to the target operation input by the user.

[0013] In the above-mentioned embodiment, the user can update the application on the virtual machine in the host machine managed by the management device. Compared with the way that the user triggers the update process of the application to be updated on the target virtual machine on each host machine, the update process of the application to be updated is simplified, so the update efficiency of the application to be updated is improved. In addition, in the above-mentioned embodiment, the host machine will send the update result of the application to be updated in the target virtual machine on it to the management device, so that the user can timely learn the update result of the application on the virtual machine in the host machine managed by the management device through the management device. Therefore, the user experience is improved.

[0014] In a possible implementation, the above-mentioned target virtual machine updates the application to be updated based on the above-mentioned update package, including:

[0015] The target virtual machine obtains a preset update policy from the host through a virtual serial port. The preset update policy includes any one of a real-time update policy, a scheduled update policy, a polling update policy, and a parallel update policy. The target virtual machine updates the application to be updated based on the update package and the preset update policy.

[0016] In a possible implementation, before the target virtual machine adds the update package of the application to be updated in the host to the file system of the target virtual machine, the method further includes: the target virtual machine determines whether the target virtual machine meets a preset condition. Wherein, the preset condition includes: the unused rate of the processor in the target virtual machine is greater than or equal to a first threshold; and / or, the unused rate of the memory in the target virtual machine is greater than or equal to a second threshold; and / or, the unused rate of the hard disk in the target virtual machine is greater than or equal to a third threshold. The target virtual machine adding the update package of the application to be updated in the host to the file system of the target virtual machine includes: when the target virtual machine meets the target preset condition, the target virtual machine adds the update package of the application to be updated in the host to the file system of the target virtual machine.

[0017] Before updating the application to be updated on the target virtual machine in the above embodiment, it is determined whether to update the application to be updated on the target virtual machine by determining whether the target virtual machine meets a preset condition. Wherein, when the target virtual machine meets the preset condition (that is, the target virtual machine is in a healthy state), the application to be updated on the target virtual machine is updated; when the target virtual machine does not meet the preset condition (that is, the target virtual machine is in an unhealthy state), the application to be updated on the target virtual machine is not updated, thereby avoiding the problem that the update of the application to be updated on the target virtual machine fails due to the health state of the target virtual machine. Therefore, the success rate of updating the application to be updated on the virtual machine is improved.

[0018] In a possible implementation, in the case where the update of the application to be updated fails, the method further includes: the target virtual machine obtains the number of times the update of the application to be updated fails. When the number of update failures is less than a preset number of failure times, the target virtual machine updates the application to be updated that has failed again based on the update package. When the number of update failures is equal to the preset number of failure times, the target virtual machine determines that the update of the application to be updated fails and rolls back the application to be updated to the version before the update.

[0019] In the above embodiment, in the case where the update of the application to be updated fails, when the number of times the update of the application to be updated fails is less than the preset number of failure times, the application to be updated is updated again until the update of the application to be updated is successful, or until the number of times the update of the application to be updated fails is greater than or equal to the preset number of failure times, thereby improving the fault tolerance rate of upgrading the application to be updated.

[0020] In a possible implementation, the method further includes: the target virtual machine sends the update result of the application to be updated to the host through the virtual serial port.

[0021] In the above embodiment, by sending the update result to the host, the user can timely learn the update result of the application to be updated in the target virtual machine through the host, and process the application to be updated that fails to be updated in time, thereby improving the user experience.

[0022] In a possible implementation, the above host sends the application identifier of the application to be updated to the target virtual machine through the virtual serial port, including: the application update service running in the host sends the application identifier of the application to be updated to the daemon service running in the target virtual machine through the above virtual serial port.

[0023] In a second aspect, an embodiment of the present application provides an application update device, which includes a transceiver unit and a processing unit; the transceiver unit is configured to send the application identifier of the application to be updated to the target virtual machine through the virtual serial port in response to an application update request, and the target virtual machine is a virtual machine running on the host and needs to perform application update; the processing unit is configured to add the update package of the application to be updated in the host to the file system of the target virtual machine; the processing unit is further configured to update the application to be updated in the target virtual machine based on the above update package.

[0024] In a possible implementation, the transceiver unit is configured to send a mount notification to the host through the virtual serial port; the processing unit is configured to mount the update package to the optical drive of the target virtual machine in response to the mount notification, and send a mount success message to the target virtual machine through the virtual serial port; the processing unit is further configured to add the update package to the file system of the target virtual machine from the optical drive in response to the mount success message.

[0025] In a possible implementation, the transceiver unit is configured to receive an application update request sent by a management device, and the application update request includes: the identifier of the target virtual machine and the application identifier of the application to be updated, and the application update request is a request generated by the management device in response to a target operation input by the user.

[0026] In a possible implementation, the transceiver unit is configured to obtain a preset update policy from the host through the virtual serial port, and the preset update policy includes any one of a real-time update policy, a scheduled update policy, a polling update policy, and a parallel update policy; the processing unit is configured to update the application to be updated based on the update package and the preset update policy.

[0027] In a possible implementation, the processing unit is used to determine whether the target virtual machine meets a preset condition; wherein, the preset condition includes: the unused rate of the processor in the target virtual machine is greater than or equal to a first threshold; and / or, the unused rate of the memory in the target virtual machine is greater than or equal to a second threshold; and / or, the unused rate of the hard disk in the target virtual machine is greater than or equal to a third threshold; the processing unit is further used to add the update package of the application to be updated in the host machine to the file system of the target virtual machine when the target virtual machine meets the target preset condition.

[0028] In a possible implementation, the transceiver unit is used to obtain the number of times the update of the application to be updated fails; the processing unit is used to perform a second update on the application to be updated that fails to update based on the update package when the number of times of update failure is less than a preset number of failure times; when the number of times of update failure is equal to the preset number of failure times, it is determined that the update of the application to be updated fails, and the application to be updated is rolled back to the version before the update.

[0029] In a possible implementation, the transceiver unit is used to send the update result of the application to be updated to the host machine through a virtual serial port.

[0030] In a possible implementation, the transceiver unit is used to send the application identifier of the application to be updated to the daemon service running in the target virtual machine through the above virtual serial port.

[0031] In a third aspect, a computing device is provided. The computing device includes a processor and a memory, and the memory is electrically connected to the processor; the memory is used to store program instructions, and the processor executes the program instructions to implement the method of the first aspect and its possible implementations.

[0032] In a fourth aspect, a computing system is provided. The computing system includes: a management device and the computing device described in the third aspect; the management device is connected to the computing device through a network; the management device is used to send an application update request to the host machine, and the application update request includes: the identifier of the target virtual machine and the application identifier of the application to be updated in the target virtual machine.

[0033] In a fifth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores computer instructions, and when the computer instructions in the computer-readable storage medium are executed by a computing device, the computing device is enabled to execute the functions of the device of the first aspect and its possible implementations.

[0034] In a sixth aspect, a computer program product including instructions is provided. When it runs on a computing device, the computing device is enabled to execute the functions of the device of the above first aspect and its possible implementations.

[0035] It should be understood that for the technical solutions of the second to sixth aspects of the embodiments of the present application and the corresponding possible implementation manners, the beneficial effects achieved can refer to the technical effects of the first aspect and its corresponding possible implementation manners described above, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A schematic diagram of a management system provided by an embodiment of the present application;

[0037] Figure 2 A schematic diagram of the hardware structure of a computing device provided by an embodiment of the present application;

[0038] Figure 3 A schematic diagram of the system architecture of a virtual machine and a CPU provided by an embodiment of the present application;

[0039] Figure 4 A schematic flowchart of a method for updating an application of a virtual machine provided by an embodiment of the present application Figure 1 ;

[0040] Figure 5 A schematic diagram of a virtual machine management interface provided by an embodiment of the present application;

[0041] Figure 6 A schematic flowchart of a method for updating an application of a virtual machine provided by an embodiment of the present application Figure 2 ;

[0042] Figure 7 A schematic flowchart of a method for updating an application of a virtual machine provided by an embodiment of the present application Figure 3 ;

[0043] Figure 8 A schematic flowchart of a method for updating an application of a virtual machine provided by an embodiment of the present application Figure 4 ;

[0044] Figure 9 A schematic flowchart of a method for updating an application of a virtual machine provided by an embodiment of the present application Figure 5 ;

[0045] Figure 10 A schematic diagram of a host management interface provided by an embodiment of the present application;

[0046] Figure 11 A schematic diagram of an update result interface provided by an embodiment of the present application;

[0047] Figure 12 A schematic diagram of the structure of an application update device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0048] As used herein, the term "and / or" is merely a description of the relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone.

[0049] In the description of the embodiments of the present application, terms such as "first" and "second" in the specification and claims are used to distinguish different objects, rather than to describe a specific order of the objects. For example, the first threshold and the second threshold are used to distinguish different thresholds, rather than to describe a specific order of the thresholds.

[0050] In the embodiments of the present application, words such as "exemplary" or "for example" are used to provide examples, illustrations, or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0051] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality of" refers to two or more. For example, a plurality of host machines refers to two or more host machines.

[0052] First, some concepts involved in an application update method, a computing device, and a computing system of a virtual machine provided by the embodiments of the present application will be explained:

[0053] Virtual machine: Refers to a complete computer system with the functions of a complete hardware system simulated by software and running in a completely isolated environment. What can be done on a physical computer can be achieved in a virtual machine. When creating a virtual machine in a computer, a part of the hard disk and memory capacity of the physical machine needs to be used as the hard disk and memory capacity of the virtual machine. Each virtual machine has an independent hard disk and operating system, and the virtual machine can be operated just like a physical machine.

[0054] As described in the background art, when updating an application on a virtual machine in a scenario without a network or with an unstable network, the update of the application may fail, thereby reducing the success rate of the application update. To solve this problem, an embodiment of the present application provides a method for updating an application of a virtual machine. In this method, a host sends an application identifier of an application to be updated to a target virtual machine that needs to update the application on the host through a virtual serial port. Then, the target virtual machine adds the update of the application to be updated in the host to the file system of the target virtual machine. Finally, the target virtual machine updates the application to be updated on it based on the update package. Since the host and the target virtual machine running on it communicate based on a virtual serial port during the update process, the problem that the application to be updated fails to be updated due to network problems is avoided during the update process of the application to be updated. Therefore, the success rate of updating the application to be updated on the virtual machine is improved.

[0055] The application update method provided by the embodiment of the present application is applied in a management system as shown in Figure 1 The management system includes: a host 101, a host 102, a host 103, and a management device 104.

[0056] The management device 104 is used to send the identifier of the target virtual machine running on each of the hosts 101 - 103 and the application identifier of the application to be updated to each host. Among them, taking the host 101 as an example, the target virtual machine in the host 101 is the virtual machine that needs to update the application among the multiple virtual machines running on the host 101. Among them, the management device 104 is connected to the hosts 101 - 103 through the network respectively. Specifically, the management device 104 can be a computing device with processing capabilities such as a server or a computer.

[0057] The host 101 is used to receive the application update request sent by the management device 104. The application update request includes: the identifier of the target virtual machine in the host 101 and the application identifier of the application to be updated. Then, the host 101 sends the application identifier of the application to be updated to the target virtual machine through the virtual serial port between the host 101 and the target virtual machine, so that the target virtual machine updates the application to be updated.

[0058] It should be noted that the virtual machines on the host 101 (such as the virtual machine 1012) all run on the operating system of the host 101, and the virtual machine 1012 communicates with the host 101 based on a virtual serial port.

[0059] Among them, multiple virtual machines such as virtual machine 1011, virtual machine 1012, virtual machine... and virtual machine 101x are running on the host 101. These multiple virtual machines can be virtual machines with the Windows operating system or virtual machines with the Linux operating system. There are multiple applications on any one of these multiple virtual machines. Taking virtual machine 1012 as an example, there are a video application, a reading application, and a music application on the virtual machine 1012. Specifically, the host 101 can be a computing device with computing and storage capabilities such as a desktop computer, a laptop, or a server.

[0060] It should be understood that the relevant descriptions of host 102 and host 103 are similar to the relevant descriptions of the above host 101. For the specific descriptions of host 102 and host 103, refer to the relevant descriptions of the above host 101, which will not be elaborated here.

[0061] It should be noted that the application update method provided in the embodiments of the present application is applied to the scenario of updating and upgrading the applications of the virtual machines in the above management system; the above management system is described by taking the host including hosts 101-103 as an example, and in actual applications, the management system may include at least one host; similarly, the management system is described by taking the host running multiple virtual machines as an example, and in actual applications, at least one virtual machine may be running on the host.

[0062] Exemplarily, Figure 2 is a schematic diagram of the hardware structure of a computing device of host 101, host 102 or host 103. The computing device can specifically be a high-density server, a rack server, a high-performance server, or a GPU (graphics processing unit) server, etc.

[0063] Among them, the hardware part of the computing device includes a processor (central processing unit, CPU), an out-of-band controller, and memory. The software part mainly includes an out-of-band management module and an operating system (operating system, OS).

[0064] Among them, the out-of-band management module runs in the out-of-band controller, and the OS and BIOS run in the processor (as Figure 2 shown). Among them, the out-of-band management module can be a management unit of non-business modules. For example, the out-of-band management module can remotely maintain and manage the computing device through a dedicated data channel. The out-of-band management module is completely independent of the operating system of the computing device and can communicate with the OS through the out-of-band management interface of the computing device. Among them, at least one virtual machine is running in the OS, specifically including: virtual machine_1 to virtual machine_N.

[0065] Exemplarily, the system architecture between the virtual machine_1 and the CPU in the host computer used to run the OS is as follows Figure 3 shown. The virtual machine_1 includes Application A, Application B, and a daemon service. The daemon service is used to create a virtual serial port with the CPU during the initialization of the virtual machine_1, and receive update instructions for Application A and Application B from the CPU through this virtual serial port; the daemon service is also used to update Application A and Application B in response to the update instructions.

[0066] An application update service runs in the above CPU. The application update service is used to send the above update instructions to the daemon service in the virtual machine_1 through the virtual serial port; among them, the virtual serial port is used to provide a virtual serial port channel for interaction between the virtual machine and the host computer.

[0067] Exemplarily, the out-of-band management module may include a management unit for the operating status of the computing device, a management system in a management chip outside the in-band controller, a system management module (system management mode, SMM), etc. It should be noted that the specific form of the out-of-band management module in the embodiments of the present application is not limited, and the above is only an exemplary description.

[0068] Among them, the memory, also known as the internal memory or main memory, is installed in the memory slot on the motherboard of the computing device. The memory communicates with the memory controller through a memory channel.

[0069] It should be noted that the system architecture and application scenarios described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation to the technical solutions provided in the embodiments of the present application. Those of ordinary skill in the art know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.

[0070] The embodiments of the present application provide a method for updating an application of a virtual machine, as follows Figure 4 shown. The method includes: S110-S130.

[0071] S110. In response to an application update request, the host computer sends the application identifier of the application to be updated to the target virtual machine through the virtual serial port.

[0072] At least one virtual machine runs on the above host computer. The at least one virtual machine communicates with the host through a virtual serial port; among them, there is at least one application in the at least one virtual machine.

[0073] The above virtual serial port is a virtual serial port channel created by the virtual machine during initialization for providing interaction between the virtual machine and the host computer.

[0074] The above target virtual machine is the virtual machine among all the virtual machines running on the host machine for which the application thereon needs to be updated. For example, assume that there are virtual machine_1 and virtual machine_2 running on the host machine. When the host machine needs to update the application on virtual machine_1, virtual machine_1 is the above target virtual machine.

[0075] When there are multiple target virtual machines in the above host machine and the applications to be updated of these multiple target virtual machines are the same, the host machine sends the application identifier of the application to be updated to each of these multiple target virtual machines respectively, so that these multiple target virtual machines execute the following S120 - S130.

[0076] When there are multiple target virtual machines in the above host machine and the applications to be updated corresponding to each of these multiple target virtual machines are different; the host machine sends the application identifiers of the applications to be updated corresponding to each of these multiple target virtual machines respectively, so that these multiple target virtual machines execute the following S120 - S130 based on the application identifiers of the applications to be updated corresponding to each of them.

[0077] Exemplarily, assume that there are virtual machine_1 and virtual machine_2 running on the host machine. When the host machine needs to update application A in virtual machine_1 and application B in virtual machine_2, both virtual machine_1 and virtual machine_2 are target virtual machines. At this time, the host machine sends the application identifier of application A to virtual machine_1 and the application identifier of application B to virtual machine_2.

[0078] It should be noted that the above application update request is a request triggered after the user specifies the target virtual machine on the above host machine and the application to be updated on this target virtual machine, and is used to indicate the update of the application to be updated on the target virtual machine.

[0079] In one implementation, the application update request is a request triggered after the user specifies the target virtual machine and the application to be updated on this target virtual machine on the host machine; specifically, it includes: after the user accesses the virtual machine management interface on the host machine and selects the target virtual machine and the application to be updated on the target virtual machine in the virtual machine management interface, the application update request is triggered; where the virtual machine management interface includes all the virtual machines running on the host machine and all the applications on each of these virtual machines.

[0080] Exemplarily, assume that the virtual machine management interface is as Figure 5As shown in the figure, the interface includes virtual machines _1 to _4 running on the host machine. Among them, virtual machines _1 to _3 all include Application A and Application B, and virtual machine _4 includes Application B and Application C. When the user selects Application A in virtual machine _1, Application B in virtual machine _3, and Application B and Application C in virtual machine _4 on this interface, and then clicks the update button to trigger the above application update request, the request includes the identifier of the target virtual machine and the application identifier of the application to be updated. The host machine obtains the identifier of the target virtual machine specified by the user (i.e., virtual machines _1, _3, and _4) and the application identifier of the application to be updated corresponding to each target virtual machine. That is, the application to be updated in virtual machine _1 is Application A, the application to be updated in virtual machine _3 is Application B, and the applications to be updated in virtual machine _4 are Application B and Application C. Then, the host machine sends the application identifier of Application A to virtual machine _1, the application identifier of Application B to virtual machine _3, and the application identifiers of Application B and Application C to virtual machine _4.

[0081] In another implementation manner, the above application update request is a request sent by the management device to the host machine after the user specifies the target virtual machine and the application to be updated on the management device. The management device is a device for managing the host machine, and the specific implementation process is shown in S310 - S330 below, which will not be elaborated here.

[0082] Optionally, an application update service runs on the above host machine, and a daemon service runs in each of the at least one virtual machine. When the daemon service in the virtual machine starts, it creates the above virtual serial port. The daemon service in each virtual machine interacts with the application update service in the host machine based on the virtual serial port. Based on this, the implementation manner of S110 includes: The application update service running in the host machine sends the application identifier of the application to be updated to the daemon service running in the target virtual machine through the virtual serial port.

[0083] It should be noted that the above application update service can be an independent application in the host machine or a functional module in an application (such as VMtools) in the host machine. Similarly, the daemon service in the virtual machine can be an independent application or process, or a functional module in an application or process (such as the internal daemon process qemu - guest - agent, qga) in the virtual machine.

[0084] S120: The target virtual machine adds the update package of the application to be updated in the host machine to the file system of the target virtual machine.

[0085] It should be noted that the above update package can be stored in the host machine by the user in advance, or sent by the management device to the host machine. Specifically, the embodiment of the present application does not limit the acquisition method of the update package.

[0086] In one implementation, the implementation of S120 is based on the optical drive of the target virtual machine, and the update package is added to the file system of the target virtual machine, combined with Figure 4 , as Figure 6 shown, the specific implementation process includes: S120a - S120d.

[0087] S120a. The target virtual machine sends a mount notification to the host through the virtual serial port.

[0088] The above - mentioned mount notification is used to instruct the host to mount the update package of the application to be updated in the target virtual machine to the optical drive of the target virtual machine.

[0089] S120b. In response to the mount notification, the host mounts the update package of the application to be updated to the optical drive of the target virtual machine.

[0090] The specific implementation of S120b includes: the host converts the update package of the application to be updated into an image file (abbreviation: the image file of the update package), and then executes the mount command to mount the above - mentioned image file of the update package to the directory corresponding to the optical drive of the target virtual machine (such as: dev / sr0).

[0091] S120c. The host sends a mount success message to the target virtual machine through the virtual serial port.

[0092] The above - mentioned mount success message is used to indicate that the host has mounted the above - mentioned update package to the file directory corresponding to the optical drive of the target virtual machine.

[0093] S120d. In response to the mount success message, the target virtual machine adds the update package of the application to be updated from the optical drive of the target virtual machine to the file system of the target virtual machine.

[0094] The specific implementation of S120d can be that the target virtual machine copies the update package in the optical drive to the file system of the target virtual machine (such as: the home file directory in the file system) based on the copy command; it can also be that the target virtual machine mounts the update package in the optical drive to the file system of the target virtual machine based on the mount command. Specifically, the embodiments of the present application do not limit the implementation of S120d.

[0095] In the above embodiments, the host mounts the update package of the application to be updated to the optical drive of the target virtual machine, and then the target virtual machine adds the update package of the application to be updated from the optical drive to the file system of the target virtual machine. Since it is based on the optical drive of the target virtual machine, the process of adding the update package to the file system of the target virtual machine does not require a network, thus avoiding the problem that the target virtual machine cannot obtain the update package due to network problems. Therefore, the success rate of the virtual machine obtaining the update package is improved. Further, the success rate of updating the application to be updated on the virtual machine is improved.

[0096] In another implementation, the implementation of S120 is based on a shared folder between the target virtual machine and the host, and the update package is added to the file system of the target virtual machine. Combining Figure 4 , as Figure 7 shown, its specific implementation process includes: S120A - S120D.

[0097] S120A. The target virtual machine sends an addition notification to the host through the virtual serial port.

[0098] The above addition notification is used to instruct the host to add the above update package to the shared folder, which is a folder visible to both the host and the target virtual machine and can be read and written to.

[0099] S120B. In response to the addition notification, the host adds the update package of the application to be updated to the shared folder.

[0100] The specific implementation of S120B above can be that the host executes the mount command to mount the above update package to the above shared folder; or the host executes the copy command to copy the above update package to the above shared folder.

[0101] S120C. The host sends an addition success message to the target virtual machine through the virtual serial port.

[0102] S120D. In response to the addition success message, the target virtual machine adds the update package of the application to be updated from the shared file to the file system of the target virtual machine.

[0103] It should be noted that the implementation of S120C - S120D is similar to that of S120c - S120d. For the specific description of S120C - S120D, reference can be made to the relevant description of S120C - S120D above, and details will not be repeated here.

[0104] S130. The target virtual machine updates the application to be updated based on the update package of the application to be updated.

[0105] In one implementation, the specific implementation of S130 includes: The target virtual machine updates the application to be updated based on the update package of the application to be updated in a preset update manner; the preset update manner includes: incremental update or full update.

[0106] Among them, incremental update is to update the application to be updated based on the difference between the update package and the application to be updated; full update is that the target virtual machine first uninstalls the application to be updated in the target virtual machine, and then installs the application in the update package of the application to be updated.

[0107] It should be noted that the above preset update manner can be configured by the user in the target virtual machine through the host, or sent by the management device to the target virtual machine through the host. Specifically, the present application embodiment does not limit the acquisition manner of the above preset update manner.

[0108] In another implementation, the specific implementation of S130 includes: The target virtual machine updates the application to be updated based on the update package of the application to be updated and a preset update policy. The preset update policy includes: real-time update policy, scheduled update policy, polling update policy or parallel update policy.

[0109] It should be noted that the above preset update policy can be configured by the user in the target virtual machine through the host, or sent by the management device to the target virtual machine through the host. Specifically, the present application embodiment does not limit the acquisition manner of the above preset update policy.

[0110] The above real-time update policy is used to represent the policy that when the update package of the application to be updated is added to the file system of the target virtual machine, the target virtual machine immediately updates the application to be updated based on the update package.

[0111] The above scheduled update policy is used to represent the policy that after the update package of the application to be updated is added to the file system of the target virtual machine, the target virtual machine will only update the application to be updated based on the update package at a preset time point. For example: Assume that the preset time point is 0:00; then, when the target virtual machine obtains the update package at 18:00, it will not update the application to be updated; only at 0:00 will the target virtual machine update the application to be updated based on the update package.

[0112] The polling update policy is used to represent the policy that in the case where there are multiple applications to be updated in the target virtual machine, the target virtual machine updates each application to be updated in sequence according to the arrangement order of the multiple applications to be updated. For example: Assume that the applications to be updated existing in the target virtual machine include: Application 1 to Application 3; at this time, the target virtual machine first updates Application 1, and after Application 1 is updated, it updates Application 2, and after Application 2 is updated, it updates Application 3.

[0113] The parallel update strategy is used to represent a strategy in which, when there are multiple applications to be updated in a target virtual machine, the target virtual machine simultaneously updates at least two of the multiple applications to be updated.

[0114] Exemplarily, assume that there are 8 applications to be updated in target virtual machine A, and the preset update strategy of target virtual machine A is the parallel update strategy; at this time, the target virtual machine creates a thread pool, and the available threads in this thread pool are 4; then, target virtual machine A assigns an application to be updated to each available thread in the thread pool, so that the assigned application to be updated is updated. When there is an idle thread among the 4 threads (i.e., the thread has completed the update of the assigned application to be updated), the target virtual machine assigns the 5th application to be updated (i.e., any one of the applications to be updated that has not been updated) to the idle thread, and so on, until all 8 applications to be updated are completed.

[0115] The present application provides a method for updating an application of a virtual machine. In this method, a host sends an application identifier of an application to be updated to a target virtual machine that needs to update the application on the host through a virtual serial port; then, the target virtual machine adds the update of the application to be updated in the host to the file system of the target virtual machine. Finally, the target virtual machine updates the application to be updated on it based on the update package. Since in this update process, the host and the target virtual machine running on it communicate based on the virtual serial port, the problem that the application to be updated fails to be updated due to network problems during the update process of the application to be updated is avoided. Therefore, the success rate of updating the application to be updated on the virtual machine is improved.

[0116] Based on Figure 4 the application update method shown above, an embodiment of the present application provides another method for updating an application of a virtual machine, as Figure 8 shown, this method includes: S210 - S270.

[0117] S210. In response to an application update request, the host sends an application identifier of an application to be updated to the target virtual machine through a virtual serial port.

[0118] It should be noted that the implementation manner of S210 above is similar to that of S110. For the specific description of S210, reference can be made to the relevant description of S110 above, and details are not described here again.

[0119] S220. The target virtual machine determines whether the target virtual machine meets a preset condition.

[0120] The above preset conditions are used to determine the health status of the target virtual machine. When the target virtual machine meets the preset conditions, it indicates that the target virtual machine is in a healthy state; when the target virtual machine does not meet the preset conditions, it indicates that the target virtual machine is in an unhealthy state. The preset conditions include, but are not limited to: the unused rate of the processor in the target virtual machine is greater than or equal to the first threshold; and / or, the unused rate of the memory in the target virtual machine is greater than or equal to the second threshold; and / or, the unused rate of the hard disk in the target virtual machine is greater than or equal to the third threshold.

[0121] Among them, the above first threshold is greater than or equal to the computing power resources required for the target virtual machine to run the application to be updated after the update; the above second threshold is greater than or equal to the memory space required for the target virtual machine to run the application to be updated after the update; the above third threshold is greater than or equal to the storage capacity required for the target virtual machine to store the application to be updated after the update.

[0122] It should be noted that in the embodiments of the present application, the preset conditions include: the unused rate of the processor in the target virtual machine is greater than or equal to the first threshold; the unused rate of the memory in the target virtual machine is greater than or equal to the second threshold, and the unused rate of the hard disk in the target virtual machine is greater than or equal to the third threshold as an example for description, and will not be elaborated hereinafter.

[0123] Exemplarily, assume that the first threshold is 10%, the second threshold is 20%, and the third threshold is 5%; then the preset conditions include: the unused rate of the processor in the target virtual machine is greater than or equal to 10%; the unused rate of the memory in the target virtual machine is greater than or equal to 20%, and the unused rate of the hard disk in the target virtual machine is greater than or equal to 5%. When the unused rate of the processor in the target virtual machine is 40%, the unused rate of the memory in the target virtual machine is 50%, and the unused rate of the hard disk in the target virtual machine is 45%, the target virtual machine meets the preset conditions.

[0124] When the target virtual machine does not meet the preset conditions, the target virtual machine determines the update result of the application to be updated on it as an update failure, and executes the following S270.

[0125] When the target virtual machine meets the preset conditions, the target virtual machine executes the following S230.

[0126] Before updating the application to be updated on the target virtual machine, by determining whether the target virtual machine meets the preset conditions, it is determined whether to update the application to be updated on the target virtual machine; wherein, when the target virtual machine meets the preset conditions (that is, the target virtual machine is in a healthy state), the application to be updated on the target virtual machine is updated; when the target virtual machine does not meet the preset conditions (that is, the target virtual machine is in an unhealthy state), the application to be updated on the target virtual machine is not updated, thus avoiding the problem that the update of the application to be updated on the target virtual machine fails due to the health state of the target virtual machine. Therefore, the success rate of updating the application to be updated on the virtual machine is improved.

[0127] S230. The target virtual machine adds the update package of the application to be updated in the host to the file system of the target virtual machine.

[0128] S240. The target virtual machine updates the application to be updated based on the update package of the application to be updated.

[0129] It should be noted that the implementation manners of S230 - S240 are similar to those of S120 - S130. For the specific descriptions of S230 - S240, reference can be made to the relevant descriptions of S120 - S130 above, and details will not be elaborated here.

[0130] When the above application to be updated fails to be updated, S250 - S270 below are executed.

[0131] When the above application to be updated is successfully updated, S270 below is executed.

[0132] S250. The target virtual machine obtains the number of times the application to be updated fails to be updated.

[0133] It should be noted that in a process, when the application to be updated fails to be updated, the target virtual machine records the number of times the application to be updated fails to be updated; when the process ends, the target virtual machine clears the number of times of update failure. That is to say, when the application to be updated fails to be updated, the target virtual machine records the number of times the application to be updated fails to be updated in the current process, and this number of times of update failure is cleared by the target virtual machine when the current process ends. Based on this, the implementation manner of S250 includes: the target virtual machine obtains the number of times the application to be updated fails to be updated from the local.

[0134] When the number of times the application to be updated fails to be updated is less than the preset number of failure times, the target virtual machine executes S240 again.

[0135] When the number of times the application to be updated fails to be updated is greater than or equal to the preset number of failure times, the target virtual machine executes S260.

[0136] S260. The target virtual machine determines that the update of the application to be updated fails and rolls back the application to be updated to the version before the update.

[0137] It should be noted that the implementation method of rolling back the application to be updated to the version before the update is referred to the existing related technologies and will not be elaborated here.

[0138] In the above embodiments, when the update of the application to be updated fails and the number of failures of the update of the application to be updated is less than the preset number of failures, the application to be updated is updated again until the update of the application to be updated is successful or until the number of failures of the update of the application to be updated is greater than or equal to the preset number of failures, thereby improving the fault tolerance rate of upgrading the application to be updated.

[0139] S270. The target virtual machine sends the update result of the application to be updated to the host through the virtual serial port.

[0140] In the above embodiments, by sending the update result to the host, the user can timely learn the update result of the application to be updated in the target virtual machine through the host and process the application to be updated with failed updates in a timely manner, thereby improving the user experience.

[0141] In the scenario where the user designates the above target virtual machine and the application to be updated in the target virtual machine through the management device, the embodiments of the present application provide a method for updating an application of a virtual machine, as Figure 9 shown, the method includes: S310 - S380.

[0142] S310. The management device receives the target operation of the user on the host management interface.

[0143] The above management device is a device for managing the host, and the management device interacts with the host through the network.

[0144] The above host management interface is an interface output (i.e., displayed) by the management device, and the interface includes: all hosts managed by the management device, all virtual machines running on each host managed by the management device, and all applications on each virtual machine among all the virtual machines.

[0145] The above target operation is an operation in which the user selects the application to be updated (i.e., the application to be updated) on the host management interface.

[0146] Exemplarily, assume that the host management interface output by the management device is as Figure 10As shown in the figure, the management interface includes: managing the host machine A and host machine B managed by the management device. Virtual machine_1 and virtual machine_2 are running on the host machine A; among them, application A and application B exist in the virtual machine_1, and application C and application D exist in the virtual machine_2. Virtual machine_3 and virtual machine_4 are running on the host machine B; among them, application C and application D exist in both virtual machine_3 and virtual machine_4. When the target operations input by the user on the host machine management interface include: selecting application C and application D in the virtual machine_3; the target operation is used to indicate to update application C and application D on the virtual machine_3 running on the host machine B. That is to say, the user designates the target virtual machine in the host machine B as the virtual machine_3 through the management device, and designates the applications to be updated in the virtual machine_3 as application C and application D.

[0147] S320. The management device obtains the selected information.

[0148] The above-mentioned selected information includes: the identifier of the target host machine, the identifier of the target virtual machine in the target host machine, and the application identifier of the application to be updated in the target virtual machine.

[0149] Among them, the target host machine is the host machine among the multiple host machines managed by the management device that needs to update the applications on the virtual machines running on it; the target virtual machine is the virtual machine among the multiple virtual machines running on the target host machine that needs to update the applications on it.

[0150] Exemplarily, based on the example in the above S310, the target host machine in the selected information obtained by the management device includes: host machine B, the target virtual machine includes: virtual machine_3; the applications to be updated in the target virtual machine include: application C and application D.

[0151] S330. The management device sends an application update request to the target host machine.

[0152] The above-mentioned application update request is used to indicate to update the application to be updated on the target virtual machine running on the target host machine. The application update request includes: the identifier of the target virtual machine and the application identifier of the application to be updated in the target virtual machine.

[0153] Exemplarily, based on the example in the above S320, the above-mentioned application update request includes: the identifier of the virtual machine_3, the identifier of the application C, and the identifier of the application 3.

[0154] It should be noted that the number of the above-mentioned target host machines can be one or multiple; when the number of the target host machines is multiple, the management device sends an application update request to each target host machine so that each target host machine updates the application to be updated on the target virtual machine running on it. In this embodiment of the application, an example where the target host machine is one is used for illustration, and details will not be described later.

[0155] Optionally, the above application update request further includes: a preset update method, and / or a preset update policy.

[0156] Among them, the preset update method is used to instruct the target virtual machine to update the application to be updated in an incremental update manner or in a full update manner. The preset update policy is used to instruct the target virtual machine's policy for updating the application to be updated; the preset update policy includes: a real-time update policy, a scheduled update policy, a polling update policy, or a parallel update policy.

[0157] It should be noted that the above preset update method and preset update policy are the same as those in S130. For the specific descriptions of the above preset update method and preset update policy, reference can be made to the relevant descriptions of S130 above, and details will not be elaborated here.

[0158] S340. The target host sends the application identifier of the application to be updated to the target virtual machine through a virtual serial port.

[0159] It should be noted that the implementation method of the above S340 is similar to that of S110. For the specific description of S340, reference can be made to the relevant description of S110 above, and details will not be elaborated here.

[0160] S350. The target virtual machine adds the update package of the application to be updated in the target host to the file system of the target virtual machine.

[0161] S360. The target virtual machine updates the application to be updated based on the update package of the application to be updated.

[0162] It should be noted that the implementation methods of the above S350 - S360 are similar to those of S120 - S130. For the specific descriptions of S350 - S360, reference can be made to the relevant descriptions of S120 - S130 above, and details will not be elaborated here.

[0163] S370. The target virtual machine sends the update result of the application to be updated to the target host through a virtual serial port.

[0164] It should be noted that the implementation method of the above S370 is similar to that of S270. For the specific description of S370, reference can be made to the relevant description of S270 above, and details will not be elaborated here.

[0165] S380. The target host sends the update result of the application to be updated to the management device.

[0166] The above management device is used to output the update result, so that the user can learn about the update result of the application to be updated through the management device.

[0167] Exemplarily, based on the example in the above S330, the target host is Host B, the target virtual machine is Virtual Machine_3, and the applications to be updated are Application C and Application D on Virtual Machine_3. Update Application C and Application D based on the above S340 - S360. Assume that the update of Application C fails and the update of Application D is successful; Host B sends the update results of Application C and Application D on Virtual Machine_3 to the management device; so that the management device outputs the update results of Application C and Application D in the update result interface as shown in Figure 11 the following. The update result interface includes: the update result of Host B (the target host), Virtual Machine_3 in Host B (the target virtual machine), Application C in Virtual Machine_3 (the application to be updated) which fails to be updated, and the update result of Application D in Virtual Machine_3 which is successfully updated.

[0168] In the above embodiments, the user can update the applications on the virtual machines in the hosts managed by the management device. Compared with the way that the user triggers the update process of the application to be updated on the target virtual machine on each host, the update process of the application to be updated is simplified, so the update efficiency of the application to be updated is improved. In addition, in the above embodiments, the host will send the update results of the application to be updated in the target virtual machine on it to the management device, so that the user can timely learn the update results of the applications on the virtual machines in the hosts managed by the management device through the management device. Therefore, the user experience is improved.

[0169] The above mainly introduces the solution provided by the embodiments of the present application from the perspective of the method. To implement the above functions, it includes the corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving the hardware depends on the specific application and design constraint conditions of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0170] The embodiments of the present application can divide the function modules of the application update device according to the above method examples. For example, each function module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of a software function module. It should be noted that the division of modules in the embodiments of the present application is illustrative, only a logical function division, and there can be other division methods in actual implementation.

[0171] In the case of dividing each functional module corresponding to each function, Figure 12 A possible structural schematic diagram of the application update device involved in the above embodiment is shown. As Figure 12 shown, the application update device includes: a transceiver unit 1201 and a processing unit 1202.

[0172] The transceiver unit 1201 is configured to send the application identifier of the application to be updated to the target virtual machine through a virtual serial port in response to an application update request; for example, execute step S110 in the above method embodiment.

[0173] The processing unit 1202 is configured to add the update package of the application to be updated in the host to the file system of the target virtual machine; for example, execute step S120 in the above method embodiment.

[0174] The processing unit 1202 is further configured to update the application to be updated based on the update package; for example, execute step S130 in the above method embodiment.

[0175] Optionally, the transceiver unit 1201 is configured to send a mounting notification to the host through a virtual serial port; for example, execute step S120a in the above method embodiment.

[0176] The processing unit 1202 is configured to mount the update package to the optical drive of the target virtual machine in response to the mounting notification; for example, execute step S120b in the above method embodiment.

[0177] The transceiver unit 1201 is configured to send a mounting success message to the target virtual machine through a virtual serial port; for example, execute step S120c in the above method embodiment.

[0178] The processing unit 1202 is further configured to add the update package from the optical drive to the file system of the target virtual machine in response to the mounting success message; for example, execute step S120d in the above method embodiment.

[0179] Optionally, the transceiver unit 1201 is configured to receive an application update request sent by a management device; for example, execute step S330 in the above method embodiment.

[0180] Optionally, the transceiver unit 1201 is configured to obtain a preset update policy from the host through a virtual serial port.

[0181] Optionally, the processing unit 1202 is configured to determine whether the target virtual machine meets a preset condition; for example, execute step S220 in the above method embodiment.

[0182] The processing unit 1202 is further configured to add the update package of the application to be updated in the host machine to the file system of the target virtual machine when the target virtual machine meets the target preset condition; for example, execute step S230 in the above method embodiment.

[0183] Optionally, the transceiver unit 1201 is configured to obtain the number of times the update of the application to be updated fails; for example, execute step S250 in the above method embodiment.

[0184] The processing unit 1202 is configured to perform a second update on the application to be updated that has failed to update based on the update package when the number of times of update failure is less than the preset number of failure times.

[0185] The processing unit 1202 is configured to determine that the update of the application to be updated fails and roll back the application to be updated to the version before the update when the number of times of update failure is equal to the preset number of failure times; for example, execute step S260 in the above method embodiment.

[0186] Optionally, the transceiver unit 1201 is configured to send the update result of the application to be updated to the host machine through a virtual serial port; for example, execute step S270 in the above method embodiment.

[0187] Optionally, the transceiver unit 1201 sends the application identifier of the application to be updated to the daemon service running in the target virtual machine through a virtual serial port.

[0188] Each unit of the above application update device may also be used to perform other actions in the above method embodiment. All relevant contents of the steps involved in the above method embodiment can be cited in the function description of the corresponding functional module, and will not be elaborated here.

[0189] An embodiment of the present application further provides a computing device, including a memory and a processor, the memory is electrically connected to the processor; the memory is used to store program instructions, and the processor executes the program instructions to implement any one of the methods executed by the above host machine and virtual machine.

[0190] An embodiment of the present application further provides a computing system, the computing system includes: a management device and a computing device; the management device is connected to the computing device through a network; the computing device is used to execute any one of the methods executed by the above host machine and virtual machine; the management device is used to send an application update request to the host machine, and the application update request includes: the identifier of the target virtual machine and the application identifier of the application to be updated in the target virtual machine.

[0191] An embodiment of the present application further provides a computer-readable storage medium, on which computer instructions are stored. When the computer instructions run on a computing device, the computing device is caused to execute any one of the methods executed by the above host machine and virtual machine.

[0192] For the explanations and beneficial effects of the relevant content in any of the computer-readable storage media provided above, reference may be made to the corresponding embodiments above, and details are not repeated here.

[0193] An embodiment of the present application provides a computer program product, which when running on a computer, causes the computer to execute any of the methods executed by the above host computer and virtual machine.

[0194] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the computer, the processes or functions in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access, or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (such as a floppy disk, magnetic disk, magnetic tape), an optical medium (such as a digital video disc (DVD)), or a semiconductor medium (such as a solid state drive (SSD)), etc.

[0195] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and details are not repeated here.

[0196] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.

[0197] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0198] In addition, each functional unit in various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0199] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: various media that can store program codes such as flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk, or optical disc.

[0200] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for updating an application of a virtual machine, characterized in that, The method includes: The host receives an application update request sent by the management device. The application update request includes: the identifier of the target virtual machine and the application identifier of the application to be updated. The application update request is a request generated by the management device in response to a target operation input by the user. The management device is used to manage multiple hosts, and multiple virtual machines are running on each host. The target virtual machine is a virtual machine running on the host and requiring application update. In response to the application update request, the host sends the application identifier of the application to be updated to the target virtual machine through the virtual serial port. The target virtual machine determines whether the target virtual machine meets a preset condition. The preset condition includes: the unused rate of the processor in the target virtual machine is greater than or equal to a first threshold; and / or, the unused rate of the memory in the target virtual machine is greater than or equal to a second threshold; and / or, the unused rate of the hard disk in the target virtual machine is greater than or equal to a third threshold. When the target virtual machine meets the preset condition, the target virtual machine sends an addition notification to the host through the virtual serial port. In response to the addition notification, the host adds the update package of the application to be updated to the shared folder and sends an addition success message to the target virtual machine through the virtual serial port. The shared folder is a folder that can be read and written by both the host and the target virtual machine. The update package is sent by the management device to the host. In response to the addition success message, the target virtual machine adds the update package from the shared folder to the file system of the target virtual machine. The target virtual machine updates the application to be updated based on the update package.

2. The method according to claim 1, characterized in that, The target virtual machine updates the application to be updated based on the update package, including: The target virtual machine obtains a preset update policy from the host through the virtual serial port. The preset update policy includes any one of a real-time update policy, a scheduled update policy, a polling update policy, and a parallel update policy. The target virtual machine updates the application to be updated based on the update package and the preset update policy.

3. The method according to claim 1 or 2, characterized in that, When the update of the application to be updated fails, the method further includes: The target virtual machine obtains the number of times the update of the application to be updated fails. When the number of update failures is less than a preset number of failure times, the target virtual machine updates the application to be updated that has failed based on the update package again. When the number of update failures is equal to the preset number of failure times, the target virtual machine determines that the update of the application to be updated fails and rolls back the application to be updated to the version before the update.

4. The method according to claim 1 or 2, characterized in that, The method further includes: The target virtual machine sends the update result of the application to be updated to the host through the virtual serial port.

5. The method according to claim 1 or 2, characterized in that, The host sends the application identifier of the application to be updated to the target virtual machine through the virtual serial port, including: The application update service running in the host machine sends the application identifier of the application to be updated to the daemon service running in the target virtual machine through the virtual serial port.

6. The method according to claim 5, wherein: The application update service is VMtools; the daemon service is the internal daemon process qga.

7. A computing device, characterized in that, The computing device includes a memory and a processor; the memory and the processor are electrically connected; the memory is used to store program instructions, and the processor is used to execute the program instructions so that the computing device implements the method according to any one of claims 1-6.

8. A computing system, characterized in that, The computing system includes: a management device and the computing device according to claim 7; the management device is connected to the computing device through a network; The management device is used to send an application update request to the host machine, and the application update request includes: the identifier of the target virtual machine and the application identifier of the application to be updated in the target virtual machine.

Citation Information

Patent Citations

  • Method for updating software of virtual machine

    CN104102527A

  • Control method and electronic equipment

    CN115543526A

  • Management method of application programs in virtual machine and server cluster

    CN116089006A