Virtual machine state synchronization method, electronic device and computer program product
By implementing a virtual machine state subscription and notification mechanism between the cloud platform base and upper-layer cloud services in cloud computing, the problem of low efficiency in virtual machine state synchronization is solved, the accuracy and efficiency of synchronization are improved, and the needs of public cloud services are met.
Patent Information
- Application Number
- CN202411087063.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2026-02-10
AI Technical Summary
In cloud computing, virtual machine state synchronization suffers from inefficiency and low accuracy. This is especially true in decoupled architectures, where virtual machine state queries or notifications are inefficient, thus limiting the development of public cloud services.
The cloud platform base receives virtual machine status subscription requests from upper-layer cloud services and sends notifications to upper-layer cloud services when the status changes, or the upper-layer cloud services send subscription requests to the cloud platform base and receive status change notifications, thus achieving accurate and efficient status synchronization.
It improves the efficiency and accuracy of virtual machine state synchronization, solves the problem of low efficiency in virtual machine state synchronization, and meets the needs of public cloud services.
Smart Images

Figure CN121501408A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of communications, and in particular, to a virtual machine state synchronization method, an electronic device and a computer program product. BACKGROUND
[0002] After years of rapid development, the cloud computing market has evolved into a solution of decoupling architecture of upper cloud business and underlying virtualization resource platform. Under this decoupling architecture, the virtual machine state synchronization between the upper cloud business and the underlying virtualization platform faces new problems, such as inconsistency of virtual machine state, low efficiency of state query or notification, excessive amount of query and notification messages, and the like, which restricts the development and experience of public cloud business, especially in the scenario where the public cloud business pedestal carries multiple virtualization businesses.
[0003] In summary, in the related art, the virtual machine state synchronization has the problems of low efficiency and low accuracy. SUMMARY
[0004] Embodiments of the present application provide a virtual machine state synchronization method, an electronic device and a computer program product to at least solve the problem of low efficiency and low accuracy of virtual machine state synchronization in the related art.
[0005] According to an embodiment of the present application, a virtual machine state synchronization method is provided, comprising: receiving, by a cloud platform pedestal, a virtual machine state subscription request from an upper cloud business; and sending, by the cloud platform pedestal, a virtual machine state change notification to the upper cloud business in the case of a change in virtual machine state.
[0006] According to another embodiment of the present application, a virtual machine state synchronization method is provided, comprising: sending, by an upper cloud business, a virtual machine state subscription request to a cloud platform pedestal; and receiving, by the upper cloud business, a virtual machine state change notification from the cloud platform pedestal in the case of a change in virtual machine state.
[0007] According to still another embodiment of the present application, an electronic device is further provided, comprising a memory and a processor, the memory having stored therein a computer program, and the processor being configured to execute the computer program to perform the steps in any of the method embodiments described above.
[0008] According to still another embodiment of the present application, a computer program product is further provided, comprising a computer program, which, when executed by a processor, implements the steps in any of the method embodiments described above.
[0009] This invention provides a virtual machine state synchronization method, comprising: a cloud platform receiving a virtual machine state subscription request from an upper-layer cloud service; and, in the event of a change in the virtual machine state, the cloud platform sending a virtual machine state change notification to the upper-layer cloud service. This solves the problems of low efficiency and low accuracy in virtual machine state synchronization in related technologies, achieving the effect of improving the efficiency and accuracy of virtual machine state synchronization. Attached Figure Description
[0010] Figure 1 This is a hardware structure block diagram of a computer terminal for a virtual machine state synchronization method according to an embodiment of the present invention.
[0011] Figure 2 This is a flowchart of a virtual machine state synchronization method according to an embodiment of the present invention;
[0012] Figure 3 This is another flowchart of the virtual machine state synchronization method according to an embodiment of the present invention;
[0013] Figure 4 This is a structural block diagram of the virtual machine state synchronization device according to an embodiment of the present invention;
[0014] Figure 5 This is a schematic diagram illustrating the flow principle of the virtual machine state synchronization method according to an embodiment of the present invention. Detailed Implementation
[0015] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and examples.
[0016] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0017] In related technologies, with the development of cloud computing, Software as a Service (SaaS) has become an important trend in enterprise digitalization. More and more enterprises are migrating their businesses to the cloud to reduce costs, improve efficiency, and enhance competitiveness. Currently, public cloud services from operators, such as cloud servers, cloud PCs, cloud storage, and cloud gateways, are developing rapidly, serving various industries. After operators or large enterprises uniformly deploy public cloud virtualization platforms, they further decouple the deployment of cloud servers, cloud PCs, cloud storage, and other services according to business needs. This means that there is no longer a dependency between the underlying virtual platform and the upper-layer cloud service virtual machines. This introduces a new problem: how to synchronize the status of the underlying virtual machines (e.g., powered on, powered off, unavailable, etc.) to the upper-layer services.
[0018] In related technologies, under a decoupled deployment architecture of cloud infrastructure and cloud services (e.g., cloud PCs), common industry practices for synchronizing virtual machine (VM) status include: A) Mechanisms where upper-layer services periodically query the cloud infrastructure for VM status; this method has significant drawbacks: low VM status query efficiency, blind queries leading to excessive message volume, inconsistent with green energy-saving principles, and inability to query only changing VM statuses; B) Or, the underlying cloud platform proactively notifies upper-layer services of VM status changes; this method also has significant drawbacks: the cloud infrastructure cannot accurately distinguish between different upper-layer services when notifying VM status, resulting in notifications to all services. These VM status synchronization issues hinder business development and user experience, especially when the cloud infrastructure handles a certain scale of services (e.g., tens of thousands of cloud hosts or cloud PCs), where these problems become particularly prominent.
[0019] The methods and embodiments provided in this application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a computer terminal as an example, Figure 1 This is a hardware structure block diagram of a computer terminal for a virtual machine state synchronization method according to an embodiment of the present invention. Figure 1 As shown, a computer terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0020] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the virtual machine state synchronization method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0021] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0022] This invention provides a virtual machine state synchronization method. Figure 2 This is a flowchart of a virtual machine state synchronization method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0023] In step S202, the cloud platform base receives a virtual machine status subscription request from the upper-layer cloud services.
[0024] In this embodiment of the invention, before transmitting virtual machine status information between the cloud platform base and the upper-layer cloud services, it is first necessary to subscribe to and associate the cloud platform base with the upper-layer cloud services.
[0025] In this embodiment of the invention, upper-layer cloud services order or request virtual machine resources from the cloud platform base. In one embodiment, the virtual machine resource request may include one of the following: resource availability zone ID, virtual machine specifications, operating system version number, quantity, etc.
[0026] In one exemplary embodiment, the virtual machine state subscription request includes at least: a virtual machine resource availability zone identifier (i.e., resource availability zone ID); and a virtual machine identifier.
[0027] In one exemplary embodiment, after the cloud platform base receives a virtual machine state subscription request from an upper-layer cloud service, the method further includes: the cloud platform base sending a virtual machine state subscription response to the upper-layer cloud service, wherein the virtual machine state subscription response is used to confirm successful receipt of the virtual machine state subscription request.
[0028] In step S204, when the virtual machine status changes, the cloud platform base sends a notification of the virtual machine status change to the upper-layer cloud services.
[0029] In this embodiment of the invention, the cloud platform base accepts virtual machine status subscription requests from upper-layer cloud services, and notifies subscribers in real time when the virtual machine status changes. It also supports processing subscription requests and status notifications separately for multiple upper-layer cloud services.
[0030] In one exemplary embodiment, the virtual machine state change notification includes at least: a virtual machine resource availability zone identifier; a virtual machine identifier; and virtual machine state information.
[0031] In one exemplary embodiment, after the cloud platform base sends a virtual machine status change notification to the upper-layer cloud service, the method further includes: the cloud platform base receiving a virtual machine status notification response from the upper-layer cloud service, wherein the virtual machine status notification response is used to confirm that the virtual machine status change notification was successfully sent.
[0032] This invention provides a virtual machine state synchronization method. Figure 3 This is another flowchart of the virtual machine state synchronization method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps:
[0033] In step S302, the upper-layer cloud service sends a virtual machine status subscription request to the cloud platform base.
[0034] In this embodiment of the invention, before transmitting virtual machine status information between the cloud platform base and the upper-layer cloud services, it is first necessary to subscribe to and associate the cloud platform base with the upper-layer cloud services.
[0035] In this embodiment of the invention, upper-layer cloud services order or request virtual machine resources from the cloud platform base. In one embodiment, the virtual machine resource request may include one of the following: resource availability zone ID, virtual machine specifications, operating system version number, quantity, etc.
[0036] In one exemplary embodiment, the virtual machine state subscription request includes at least: a virtual machine resource availability zone identifier (i.e., resource availability zone ID); and a virtual machine identifier.
[0037] In one exemplary embodiment, the virtual machine state change notification includes at least: a virtual machine resource availability zone identifier; a virtual machine identifier; and virtual machine state information.
[0038] In one exemplary embodiment, after the upper-layer cloud service sends a virtual machine state subscription request to the cloud platform base, the method further includes: the upper-layer cloud service receiving a virtual machine state subscription response from the cloud platform base, wherein the virtual machine state subscription response is used to confirm that the virtual machine state subscription request has been successfully received.
[0039] In step S304, when the virtual machine state changes, the upper-layer cloud service receives a notification of the virtual machine state change from the cloud platform base.
[0040] In this embodiment of the invention, the upper-layer cloud service actively initiates a status subscription for the virtual machine belonging to its own cloud service to the cloud platform base, and can receive and process virtual machine status notifications from the cloud base for the subscription.
[0041] In one exemplary embodiment, after the upper-layer cloud service receives the virtual machine status change notification from the cloud platform base, the method further includes: the upper-layer cloud service sending a virtual machine status notification response to the cloud platform base, the virtual machine status notification response being used to confirm the successful sending of the virtual machine status change notification.
[0042] This invention provides a virtual machine state synchronization method, comprising: a cloud platform receiving a virtual machine state subscription request from an upper-layer cloud service; and, in the event of a change in the virtual machine state, the cloud platform sending a virtual machine state change notification to the upper-layer cloud service. This solves the problems of low efficiency and low accuracy in virtual machine state synchronization in related technologies, achieving the effect of improving the efficiency and accuracy of virtual machine state synchronization.
[0043] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0044] This embodiment also provides a virtual machine state synchronization device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0045] The virtual machine state synchronization device provided in this embodiment of the invention can be installed on a cloud platform base, including a first receiving module and a first sending module. The first receiving module is configured to receive virtual machine state subscription requests from upper-layer cloud services. The first sending module is configured to send virtual machine state change notifications to upper-layer cloud services when the virtual machine state changes.
[0046] The virtual machine state synchronization device provided in this embodiment of the invention can be installed on an upper-layer cloud service platform, including a second sending module and a second receiving module. The second sending module is configured to send a virtual machine state subscription request to the cloud platform base. The second receiving module is configured to receive a virtual machine state change notification from the cloud platform base when the virtual machine state changes.
[0047] In this embodiment of the invention, the virtual machine state synchronization device may further include different modules, and the naming and functional division of the modules may be selected in different ways according to the actual situation, without specific restrictions.
[0048] The virtual machine state synchronization device provided in this embodiment of the invention can be set on the cloud platform base or the upper-layer cloud business platform, or it can be a device, system or platform independent of the cloud platform base or the upper-layer cloud business platform.
[0049] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0050] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
[0051] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0052] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0053] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0054] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0055] In one exemplary embodiment, the computer program product described above includes a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the methods described in various embodiments of this application.
[0056] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0057] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0058] To enable those skilled in the art to better understand the technical solutions of the present invention, the following description is provided in conjunction with different embodiments.
[0059] Example 1
[0060] Figure 4 This is a structural block diagram of the virtual machine state synchronization device according to an embodiment of the present invention, as shown below. Figure 4 As shown, the virtual machine state synchronization device 40 includes a cloud platform management module 410 and a cloud service management module 420.
[0061] Cloud Platform Management Module 410: Responsible for server maintenance, resource pool management, virtual machine lifecycle management (creation / startup / stopping / deletion / migration), virtual network management, device and platform performance monitoring, and virtual machine high availability management.
[0062] Cloud Business Management Module 420: Responsible for managing the lifecycle of ordered virtual machines, virtual machine policies, resource allocation and management, etc.
[0063] like Figure 4 As shown, the cloud platform management module 410 includes a first resource management unit 4101, a first lifecycle unit 4102, and a status service unit 4103. The status service unit 4103 is configured to manage the virtual machine status (startup / shutdown / hibernation / suspended, etc.), including receiving virtual machine status subscription requests and actively sending virtual machine status notifications to upper-layer cloud services. The first resource management unit 4101 and the first lifecycle unit 4102 are standard functional modules of the cloud platform and will not be described in detail here.
[0064] like Figure 4As shown, the cloud service management module 420 includes a second resource management unit 4201, a second lifecycle unit 4202, a policy management unit 4203, and a status management unit 4204. The status management unit 4204 is configured to manage the status of cloud service virtual machines, including actively initiating virtual machine status subscriptions and receiving and processing virtual machine status notification messages. The second resource management unit 4201, the second lifecycle unit 4202, and the policy management unit 4203 are standard functional modules of the cloud service system and will not be described in detail here.
[0065] In this embodiment of the invention, the cloud service management module can be a cloud computer service platform.
[0066] This invention adds a virtual machine status service function to the cloud platform foundation to manage the state of virtual machines throughout their lifecycle. When the virtual machine state changes, subscribers are notified of the virtual machine status in real time.
[0067] In this embodiment of the invention, the virtual machine state service unit of the cloud platform base, namely the aforementioned state service unit 4103, also needs to have the following capabilities: providing virtual machine state subscription functionality for upper-layer cloud services, providing upper-layer cloud services with an application programming interface (API) for subscribing to certain virtual machine states, and virtual machine state notification functionality, providing upper-layer cloud services with a virtual machine state notification API based on the established virtual machine state subscription relationship.
[0068] In one embodiment, the cloud platform base accepts virtual machine status subscription requests from upper-layer cloud services and notifies subscribers in real time when the virtual machine status changes. It also supports processing subscription requests and status notifications separately for multiple upper-layer cloud services.
[0069] In this embodiment of the invention, the cloud service platform adds a state management unit, namely the aforementioned state management unit 4204. This module unit provides the ability to actively initiate state subscriptions to virtual machines belonging to its own cloud services from the cloud platform base, and can receive and process virtual machine state notifications from the cloud base for the subscription.
[0070] In one embodiment, the state management unit 4204 can also present the state in response to notification messages of virtual machine state changes.
[0071] In this embodiment of the invention, the cloud platform base has cloud platform flow control capability: the cloud platform base must have flow control capability (control of the number of message entries processed per second) for receiving virtual machine status subscription request messages and sending virtual machine status notification messages to upper-layer cloud services.
[0072] In this embodiment of the invention, the cloud service platform has cloud service flow control capabilities: the cloud service must have flow control capabilities (control over the number of message entries processed per second) for both the virtual machine status subscription request messages sent to the cloud platform and the virtual machine status notification messages received from the cloud platform.
[0073] This invention addresses the challenge of efficiently and accurately synchronizing virtual machine states between the cloud service platform and upper-layer cloud services in a decoupled architecture through a virtual machine state subscription notification mechanism. Each cloud service subscribes to the virtual machine states it is interested in or belongs to, and the cloud service platform immediately notifies subscribers when virtual machine states change, with multiple subscribers isolated from each other. In contrast, traditional virtual machine state synchronization mechanisms require the cloud service platform to periodically notify all cloud services of the full virtual machine state, or for cloud services to periodically query the virtual machine state. The drawbacks of these mechanisms are obvious: notifying all cloud services of the virtual machine state results in untimely and precise notifications; and cloud services can only actively query the virtual machine state periodically, leading to excessive query volume due to indiscriminate periodic queries.
[0074] Example 2
[0075] Based on the framework structure of the virtual machine state synchronization device in Embodiment 1, the process principle of the virtual machine state synchronization method is introduced in this embodiment.
[0076] In this embodiment of the invention, the cloud platform carries cloud services and can simultaneously support multiple cloud services. In this embodiment, cloud service 1 and cloud service N are used to represent multiple cloud services as an example. The cloud platform refers to the cloud platform base in the above embodiments, and the cloud services refer to the upper-layer cloud services in the above embodiments.
[0077] Figure 5 This is a schematic diagram illustrating the flow principle of the virtual machine state synchronization method according to an embodiment of the present invention, as follows: Figure 5 As shown, it includes the following steps:
[0078] Step S501: After deploying the virtualization system on the cloud platform, create virtual machine resources.
[0079] In step S502, the cloud platform manages virtual machine resources, performs lifecycle management (startup / shutdown / hibernation / suspend, etc.), and provides virtual machine status service capabilities.
[0080] In this embodiment of the invention, step S502 can be implemented by the first resource management unit 4101, the first lifecycle unit 4102 and the status service unit 4103 described above.
[0081] Step S503: Cloud Service 1 orders or applies for virtual machine resources from the cloud platform.
[0082] In this embodiment of the invention, virtual machine resource requests may include one of the following: resource availability zone ID, virtual machine specifications, operating system version number, quantity, etc.
[0083] Step S504: The cloud platform reports the results of ordering or applying for virtual machine resources for cloud service 1.
[0084] In this embodiment of the invention, the reported content may include one of the following: resource availability zone ID, virtual machine ID, etc.
[0085] Step S505: Cloud Service 1 performs resource management / lifecycle management / policy management / status management on the ordered or requested virtual machines.
[0086] In this embodiment of the invention, step S505 can be implemented by the second resource management unit 4201, the second lifecycle unit 4202, the strategy management unit 4203, and the status management unit 4204.
[0087] In step S506, cloud service 1 initiates a virtual machine status subscription request to the cloud platform for the virtual machine that was ordered or requested.
[0088] In this embodiment of the invention, cloud service 1 sends a virtual machine status subscription request to the cloud platform. The virtual machine status subscription request may include one of the following: virtual machine resource availability zone identifier (i.e., resource availability zone ID); virtual machine identifier.
[0089] In step S507, the cloud platform sends a virtual machine status subscription response to cloud service 1.
[0090] In this embodiment of the invention, the virtual machine state subscription response is used to confirm that the cloud platform base successfully received the virtual machine state subscription request.
[0091] In step S508, when the virtual machine status changes, the cloud platform sends a virtual machine status change notification to cloud service 1.
[0092] In this embodiment of the invention, the virtual machine status change notification includes at least: virtual machine resource availability zone identifier; virtual machine identifier; and virtual machine status information.
[0093] Step S509: Cloud Service 1 sends a virtual machine status notification response to the cloud platform.
[0094] In this embodiment of the invention, the virtual machine status notification response is used to confirm that the cloud platform (cloud platform base) successfully sent the virtual machine status change notification, and that cloud service 1 successfully received the virtual machine status change notification.
[0095] In step S5010, cloud service 1 presents the results of the status changes of the subscribed virtual machines.
[0096] Step S5011: Cloud service N orders or applies for virtual machine resources from the cloud platform.
[0097] In this embodiment of the invention, virtual machine resource requests may include one of the following: resource availability zone ID, virtual machine specifications, operating system version number, quantity, etc.
[0098] Step S5012: The cloud platform reports the results of ordering or applying for virtual machine resources for cloud service N.
[0099] In this embodiment of the invention, the reported content may include one of the following: resource availability zone ID, virtual machine ID, etc.
[0100] Step S5013: Cloud service N performs resource management / lifecycle management / policy management / status management on the ordered or requested virtual machines.
[0101] In this embodiment of the invention, step S505 can be implemented by the second resource management unit 4201, the second lifecycle unit 4202, the strategy management unit 4203, and the status management unit 4204.
[0102] In step S5014, cloud service N initiates a virtual machine status subscription request to the cloud platform for the virtual machine that was ordered or requested.
[0103] In this embodiment of the invention, cloud service N sends a virtual machine status subscription request to the cloud platform. The virtual machine status subscription request may include one of the following: virtual machine resource availability zone identifier (i.e., resource availability zone ID); virtual machine identifier.
[0104] In step S5015, the cloud platform base sends a virtual machine status subscription response to the cloud service N.
[0105] In this embodiment of the invention, the virtual machine state subscription response is used to confirm that the cloud platform base successfully received the virtual machine state subscription request.
[0106] Step S5016: When the virtual machine status changes, the cloud platform sends a virtual machine status change notification to cloud service N.
[0107] In this embodiment of the invention, the virtual machine status change notification includes at least: a virtual machine resource availability zone identifier; a virtual machine identifier; and virtual machine status information. Furthermore, a subscription association is established between the cloud service N and the cloud platform.
[0108] In step S5017, cloud service N sends a virtual machine status notification response to the cloud platform.
[0109] In this embodiment of the invention, the virtual machine status notification response is used to confirm that the cloud platform (cloud platform base) successfully sent the virtual machine status change notification, and that cloud service N successfully received the virtual machine status change notification.
[0110] In step S5018, cloud service N presents the results of the changes in the status of the subscribed virtual machines.
[0111] This invention implements a virtual machine state subscription mechanism to achieve state synchronization between cloud service virtual machines and virtual machines on the underlying virtualization resource platform under a decoupled architecture, thus solving the problem of efficient virtual machine state synchronization between cloud service virtual machines and the underlying virtualization resource platform under a decoupled deployment architecture between cloud services and cloud platforms.
[0112] The virtual machine state synchronization method provided in this invention can be applied to scenarios in the public cloud model of cloud computing, where the virtualization cloud platform is responsible for providing virtual machine resources to upper-layer cloud services or providing computing power support, or scenarios involving how the virtual machine state on the virtualization platform is synchronized with upper-layer cloud services. It can also be applied to scenarios where multiple cloud services share the same virtualization platform.
[0113] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A virtual machine state synchronization method, characterized in that, include: The cloud platform base receives virtual machine state subscription requests from upper-layer cloud services; When the virtual machine state changes, the cloud platform base sends a virtual machine state change notification to the upper-layer cloud services.
2. The method according to claim 1, characterized in that, in, The virtual machine state subscription request includes at least: Virtual machine resource availability zone identifier; Virtual machine identifier.
3. The method according to claim 1, characterized in that, in, The virtual machine state change notification includes at least: Virtual machine resource availability zone identifier; Virtual machine identifier; Virtual machine status information.
4. The method according to claim 1, characterized in that, After the cloud platform base receives a virtual machine state subscription request from an upper-layer cloud service, the method further includes: The cloud platform base sends a virtual machine state subscription response to the upper-layer cloud service. The virtual machine state subscription response is used to confirm that the virtual machine state subscription request has been successfully received.
5. The method according to claim 1, characterized in that, After the cloud platform base sends a virtual machine status change notification to the upper-layer cloud service, the method further includes: The cloud platform base receives a virtual machine status notification response from the upper-layer cloud service. The virtual machine status notification response is used to confirm the successful transmission of the virtual machine status change notification.
6. A virtual machine state synchronization method, characterized in that, include: Upper-layer cloud services send virtual machine status subscription requests to the cloud platform base; When the virtual machine state changes, the upper-layer cloud service receives a notification of the virtual machine state change from the cloud platform base.
7. The method according to claim 6, characterized in that, in, The virtual machine state subscription request includes at least: Virtual machine resource availability zone identifier; Virtual machine identifier.
8. The method according to claim 6, characterized in that, in, The virtual machine state change notification includes at least: Virtual machine resource availability zone identifier; Virtual machine identifier; Virtual machine status information.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method described in any one of claims 1 to 8.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 8.