A method, device, equipment and storage medium for synchronizing virtual machine information

By configuring cycle tasks in the OpenStack cloud management platform, and timely detecting and synchronizing virtual machine resource information in the Nova component and Placement component, the problem of data inconsistency between the two is solved and the stability of the cloud platform is improved.

CN119066130BActive Publication Date: 2025-05-06SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411548431.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-05-06
Estimated Expiration
2044-11-01

AI Technical Summary

Technical Problem

In the cloud management platform with OpenStack as the infrastructure architecture, the virtual machine resource information recorded by the Nova component and the Placement component may be inconsistent, resulting in errors in node resource scheduling and physical machine resource monitoring.

Method used

By configuring cycle tasks, the virtual machine resource information recorded in the Nova component is detected and synchronized to the Placement component regularly to ensure data consistency between the two.

Benefits of technology

The synchronization of virtual machine resource information in the cloud platform is realized, ensuring the data consistency between the Nova component and the Placement component, thereby improving the stability of the scheduling, monitoring and other functions of the cloud platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119066130B_ABST
    Figure CN119066130B_ABST
Patent Text Reader

Abstract

The present application discloses a virtual machine information synchronization method, device, equipment and storage medium, which relates to the field of cloud computing technology and is applied to a preset cloud computing management platform, including: starting a virtual machine information synchronization task according to a preset resource information synchronization cycle; monitoring computing node change information, and detecting the Nova component and Placement component of the preset cloud computing management platform to determine whether the computing node change information is consistent; if consistent, running the virtual machine on the computing node of the cloud computing management platform and monitoring the virtual machine information, recording the virtual machine information to the Nova component and the Placement component; determining whether the virtual machine information is consistent, and synchronizing the virtual machine information in the Nova component to the Placement component according to the determination result. By configuring periodic tasks, regularly detecting and synchronizing virtual machine resource information, and updating Placement data, the data consistency of the cloud computing management platform is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing technology, and in particular to a virtual machine information synchronization method, device, equipment and storage medium. Background Art

[0002] With the rapid development of information technology, cloud computing has become one of the hot topics in today's science and technology field. As an emerging computing model, cloud computing realizes on-demand allocation and elastic expansion of computing power by providing computing resources to users. As the current cloud computing market continues to expand, more and more enterprises and organizations choose to migrate their businesses to the cloud, and the application and market size of cloud computing in China are showing strong growth. Among them, OpenStack, as a leading open source cloud computing platform, is widely used to build and manage public and private clouds. Through its rich set of components and services, it provides flexible and scalable Infrastructure as a Service (IaaS) solutions.

[0003] OpenStack is a combination of a series of open source components, which mainly use pooled virtual resources to build and manage private and public clouds. Among them, Keystone, Glance, Cinder, Neutron, Nova, and Placement are the main components, which are responsible for authentication and authorization, image management, block device management, network management, virtual machine management, and resource scheduling functions in the cloud management platform. Among them, the OpenStack Nova component is the core computing service component in the OpenStack project, responsible for managing and maintaining the computing resources of the cloud environment, including instance lifecycle management, scheduling and allocation of computing resources, etc. Nova achieves these functions through the collaborative work of multiple sub-components. Specifically, the Nova Scheduler module is mainly responsible for virtual machine resource scheduling. By defining different schedulers and algorithms, it determines which computing server the virtual machine is scheduled to. The OpenStack Placement component is the key component responsible for resource tracking and management in the OpenStack project. It was split from the Nova service in the Newton version and is specifically used to collect and manage the resource status and usage in the entire cloud computing environment. Through its API (Application Programming Interface) interface module, resource tracking function, working principle, project implementation and configuration, and deployment optimization, it realizes efficient management and scheduling of OpenStack cloud platform resources. However, Nova is the core computing component in the cloud management platform based on OpenStack. When Nova-Scheduler module is used to implement virtual machine scheduling, it records virtual machine-related resource information. At the same time, the Placement component responsible for resource tracking and management in the OpenStack project will also record more detailed virtual machine resource information. At this time, due to the frequent virtual machine operations and physical machine evacuation on the cloud platform, there may be inconsistencies between the virtual machine resource information recorded in Nova and the information recorded in Placement, resulting in errors in node resource scheduling and physical machine resource monitoring. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a virtual machine information synchronization method, device, equipment and storage medium, which can configure periodic tasks, regularly detect and synchronize virtual machine resource information, update placement data, and achieve data consistency of cloud computing management platform. The specific scheme is as follows:

[0005] In a first aspect, the present application provides a virtual machine information synchronization method, which is applied to a preset cloud computing management platform, comprising:

[0006] Creating a virtual machine information synchronization task for the preset cloud computing management platform, and starting the virtual machine information synchronization task according to a preset resource information synchronization cycle;

[0007] Monitor the computing node change information of the preset cloud computing management platform, and execute the virtual machine information synchronization task to detect the Nova component and the Placement component of the preset cloud computing management platform according to the computing node change information, and determine whether the corresponding computing node change information in the Nova component and the Placement component is consistent;

[0008] If the computing node change information in the Nova component and the Placement component is consistent, the virtual machine on the computing node of the preset cloud computing management platform is run, and the virtual machine information of the virtual machine is monitored, and the virtual machine information is recorded in the Nova component and the Placement component;

[0009] It is determined whether the virtual machine information in the Nova component is consistent with that in the Placement component, and the virtual machine information in the Nova component is synchronized to the Placement component according to the determination result.

[0010] Optionally, before starting the virtual machine information synchronization task according to a preset resource information synchronization period, the method further includes:

[0011] A task cycle control configuration is added to the configuration group of the configuration file of the Nova component, and the preset resource information synchronization cycle of the virtual machine information synchronization task is determined according to the task cycle control configuration.

[0012] Optionally, before monitoring the computing node change information of the preset cloud computing management platform, the method further includes:

[0013] Determine whether the current preset resource information synchronization period is greater than a preset synchronization period threshold;

[0014] If the preset resource information synchronization period is greater than the preset synchronization period threshold, the step of monitoring the computing node change information of the preset cloud computing management platform is performed.

[0015] Optionally, the detecting a Nova component and a Placement component of the preset cloud computing management platform to determine whether corresponding computing node change information in the Nova component and the Placement component is consistent includes:

[0016] Detecting first data change information of a first data table of the Nova component of the preset cloud computing management platform, and detecting second data change information of a second data table of the Placement component of the preset cloud computing management platform;

[0017] A first universal unique identifier of a computing node corresponding to the first data change information and a second universal unique identifier of a computing node corresponding to the second data change information are respectively determined, and it is determined whether the first universal unique identifier is consistent with the second universal unique identifier.

[0018] Optionally, after determining whether the corresponding computing node change information in the Nova component and the Placement component is consistent, the method further includes:

[0019] If the computing node change information in the Nova component and the Placement component are inconsistent, a preset interface of the Placement component is called to create a new computing node resource according to the first universal unique identifier in the Nova component.

[0020] Optionally, determining whether the virtual machine information in the Nova component is consistent with the virtual machine information in the Placement component includes:

[0021] The first virtual machine information of the target virtual machine in the third data table of the Nova component is called, and the information acquisition interface of the Placement component is called to obtain the second virtual machine information in the Placement component to determine whether the first virtual machine information and the second virtual machine information are consistent; the target virtual machine is a virtual machine whose current state is the running state.

[0022] Optionally, synchronizing the virtual machine information in the Nova component to the Placement component according to the determination result includes:

[0023] If the first virtual machine information that does not correspond to the second virtual machine information of the Placement component exists in the Nova component, creating new virtual machine information in the Placement component according to the first virtual machine information;

[0024] If the first virtual machine information and the second virtual machine information corresponding to the same virtual machine in the Nova component and the Placement component are inconsistent, updating the corresponding second virtual machine information in the Placement component according to the first virtual machine information;

[0025] If the same virtual machine corresponds to one piece of the first virtual machine information and multiple pieces of the second virtual machine information in the Nova component and the Placement component respectively, the target virtual machine information is filtered out from the multiple pieces of the second virtual machine information, and the other second virtual machine information is deleted.

[0026] In a second aspect, the present application provides a virtual machine information synchronization device, which is applied to a preset cloud computing management platform, including:

[0027] A task creation module, used to create a virtual machine information synchronization task for the preset cloud computing management platform, and start the virtual machine information synchronization task according to a preset resource information synchronization cycle;

[0028] A component detection module, used to monitor the computing node change information of the preset cloud computing management platform, and execute the virtual machine information synchronization task to detect the Nova component and the Placement component of the preset cloud computing management platform according to the computing node change information, and determine whether the corresponding computing node change information in the Nova component and the Placement component is consistent;

[0029] A data monitoring module, for running a virtual machine on a computing node of the preset cloud computing management platform, monitoring virtual machine information of the virtual machine, and recording the virtual machine information to the Nova component and the Placement component if the computing node change information in the Nova component and the Placement component is consistent;

[0030] A data synchronization module is used to determine whether the virtual machine information in the Nova component and the Placement component is consistent, and synchronize the virtual machine information in the Nova component to the Placement component according to the determination result.

[0031] In a third aspect, the present application provides an electronic device, comprising a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the aforementioned virtual machine information synchronization method.

[0032] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned virtual machine information synchronization method when executed by a processor.

[0033] In this application, a virtual machine information synchronization task of a preset cloud computing management platform is first created, and the virtual machine information synchronization task is started according to a preset resource information synchronization period. By monitoring the computing node change information of the preset cloud computing management platform, the virtual machine information synchronization task is executed. According to the computing node change information, the Nova component and the Placement component of the preset cloud computing management platform are detected, and it is determined whether the corresponding computing node change information in the Nova component and the Placement component is consistent; if the computing node change information in the Nova component and the Placement component is consistent, the virtual machine on the computing node of the preset cloud computing management platform is run, and the virtual machine information of the virtual machine is monitored, and the virtual machine information is recorded to the Nova component and the Placement component; and whether the virtual machine information in the Nova component and the Placement component is consistent, the virtual machine information in the Nova component is synchronized to the Placement component according to the judgment result. In this way, the Nova component and Placement component in the cloud management platform based on OpenStack will record the virtual machine resource information, which leads to the risk of inconsistent information recorded in the Nova component and the Placement component. By configuring periodic tasks, regular detection and synchronization of resource information recorded in Nova to the Placement component are performed, and the existing functions of the OpenStack Nova component are expanded to achieve synchronization of virtual machine resource information, ensuring that the virtual machine resource-related information in the cloud platform Nova component corresponds to the corresponding data in the Placement component, thereby ensuring the consistency of the underlying data and improving the stability of the cloud platform scheduling, monitoring and other functions. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0035] Figure 1 A flow chart of a virtual machine information synchronization method provided in this application;

[0036] Figure 2 An automatic synchronization virtual machine resource information structure diagram provided for this application;

[0037] Figure 3 A flowchart of a specific virtual machine information synchronization method provided in this application;

[0038] Figure 4A virtual machine information consistency detection flow chart provided for this application;

[0039] Figure 5 A schematic diagram of the structure of a virtual machine information synchronization device provided in this application;

[0040] Figure 6 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] In the cloud management platform based on OpenStack, Nova implements virtual machine scheduling and records virtual machine related resource information. At the same time, the Placement component will also record more detailed virtual machine resource information. At this time, due to the frequent virtual machine operations and physical machine evacuation operations on the cloud platform, the virtual machine resource information recorded in Nova and the information recorded in Placement may be inconsistent. This application can configure periodic tasks, regularly detect and synchronize the resource information recorded in Nova to the Placement component, expand the basic management functions of the cloud platform, and ensure that the virtual machine resource related information in the Nova component of the cloud platform corresponds to the corresponding data in the Placement component, thereby ensuring data consistency.

[0043] See also Figure 1 As shown, an embodiment of the present invention discloses a virtual machine information synchronization method, which is applied to a preset cloud computing management platform, including:

[0044] Step S11: creating a virtual machine information synchronization task for the preset cloud computing management platform, and starting the virtual machine information synchronization task according to a preset resource information synchronization cycle.

[0045] In this embodiment, first, a task cycle control configuration is added to the configuration group of the configuration file of the Nova component, and the preset resource information synchronization period of the virtual machine information synchronization task is determined according to the task cycle control configuration, and then a virtual machine information synchronization task of the preset cloud computing management platform is created to start the virtual machine information synchronization task according to the above resource information synchronization period. Specifically, in this embodiment, relying on Nova's own configuration management system, the task_heal_Placement_interval configuration is added to the workarounds configuration group of the Nova.conf (configuration file) file to configure the time interval for repairing Placement resource data, that is, synchronizing Nova virtual machine resource information to the Placement component, in minutes, to trigger automated virtual machine resource information consistency detection and synchronization periodic tasks. At the same time, a function with the @periodic_task.periodic_task identifier can also be defined in the schedulermanager, indicating the definition of a periodic task to write code logic for processing the synchronization of Nova virtual machine resource information to the Placement component.

[0046] Step S12, monitor the computing node change information of the preset cloud computing management platform, and execute the virtual machine information synchronization task. Detect the Nova component and Placement component of the preset cloud computing management platform according to the computing node change information, and determine whether the corresponding computing node change information in the Nova component and the Placement component is consistent.

[0047] In this embodiment, Figure 2 As shown, before monitoring the computing node change information of the preset cloud computing management platform, it can be determined whether the current preset resource information synchronization period is greater than the preset synchronization period threshold; if the preset resource information synchronization period is greater than the preset synchronization period threshold, the step of monitoring the computing node change information of the preset cloud computing management platform is performed. According to the previous step, the default configuration of the time interval for synchronizing the Nova virtual machine resource information to the Placement component can be configured, that is, the preset synchronization period threshold is set to -1, indicating that no repair is performed, and supports configuration of integers greater than 0. Correspondingly, if the above configuration is -1, no detection is performed; if the above configuration is an integer greater than 0, the next step of the detection process is performed.

[0048] When performing consistency detection, first monitor the computing node change information of the preset cloud computing management platform, and execute the virtual machine information synchronization task to detect the Nova component and Placement component of the preset cloud computing management platform according to the computing node change information, and determine whether the corresponding computing node change information in the Nova component and the Placement component is consistent.

[0049] Step S13: If the computing node change information in the Nova component and the Placement component is consistent, run the virtual machine on the computing node of the preset cloud computing management platform, monitor the virtual machine information of the virtual machine, and record the virtual machine information to the Nova component and the Placement component.

[0050] In this embodiment, if the computing node change information in the Nova component and the Placement component is consistent, that is, Figure 2 If the consistency check of Reosurce prividers in the system passes, the virtual machine on the computing node of the preset cloud computing management platform will be run, and the virtual machine information of the virtual machine will be monitored, and the virtual machine information will be recorded in the Nova component and the Placement component. In this way, combined with the above steps, relying on the OpenStack basic architecture, based on the existing scheduled task mechanism of the Nova component, the time interval for synchronizing the Placement virtual machine resource information is configured through the Nova configuration file, and the periodic task of automatically synchronizing the virtual machine resource information is triggered to detect the consistency of the virtual machine resource information in Nova and Placement, so as to synchronize the virtual machine resource information recorded in the Nova database to the Placement.

[0051] Step S14: determine whether the virtual machine information in the Nova component is consistent with that in the Placement component, and synchronize the virtual machine information in the Nova component to the Placement component according to the determination result.

[0052] In this embodiment, Figure 2 As shown, Allocations detection is performed to determine whether the virtual machine information in the Nova component and the Placement component is consistent, and different virtual machine information in the Nova component and the Placement component is synchronized to the Placement component according to the determination result.

[0053] This embodiment can create a virtual machine information synchronization task for a preset cloud computing management platform, and add a task_heal_Placement_interval configuration in the configuration group of the configuration file to configure the time interval for synchronizing Nova virtual machine resource information to the Placement component to start the virtual machine information synchronization task, and execute the virtual machine information synchronization task by monitoring the computing node change information of the preset cloud computing management platform. According to the computing node change information, the Nova component and the Placement component of the preset cloud computing management platform are detected to determine whether the corresponding computing node change information in the Nova component and the Placement component is consistent; if the computing node change information in the Nova component and the Placement component is consistent, the virtual machine on the computing node of the preset cloud computing management platform is run, and the virtual machine information of the virtual machine is monitored, and the virtual machine information is recorded in the Nova component and the Placement component; and it is determined whether the virtual machine information in the Nova component and the Placement component is consistent, and the virtual machine information in the Nova component is synchronized to the Placement component according to the determination result. Through the above technical solution, in the cloud management platform based on OpenStack, both the Nova component and the Placement component will record the virtual machine resource information, which leads to the risk of inconsistency in the recorded information in the Nova component and the Placement component. Based on the existing periodic task mechanism of the Nova component, the periodic task is extended to realize the automatic synchronization of virtual machine resource information, and the Nova configuration file workaround group is used to increase the configuration of the automatic synchronization of virtual machine resource cycle to trigger the periodic task. In this way, by configuring the periodic task, the resource information recorded in Nova is regularly detected and synchronized to the Placement component, the existing function of the OpenStack Nova component is extended to realize the synchronization of virtual machine resource information, and the virtual machine resource related information in the cloud platform Nova component is ensured to correspond to the corresponding data in the Placement component one by one, thereby ensuring the consistency of the underlying data and improving the stability of the cloud platform scheduling, monitoring and other functions.

[0054] Based on the previous embodiment, it can be known that the present application can periodically detect the resource information in the Nova component and the Placement component by configuring a periodic task, and synchronize the resource information recorded in the Nova component to the Placement component. Next, the process of synchronizing resource information will be described in detail in this embodiment. Figure 3 As shown, the embodiment of the present application discloses a specific virtual machine information synchronization method, which is applied to a preset cloud computing management platform, including:

[0055] Step S21, monitor the computing node change information of the preset cloud computing management platform, and execute the virtual machine information synchronization task. According to the computing node change information, detect the Nova component and the Placement component of the preset cloud computing management platform, and determine whether the corresponding computing node change information in the Nova component and the Placement component is consistent.

[0056] In this embodiment, the resource information synchronization process is mainly implemented by the consistency detection module, such as Figure 4 As shown, the consistency detection module for synchronizing Nova virtual machine resource information to the Placement component mainly includes the Reosurce prividers detection module and the Allocations detection module. The Reosurce prividers detection module is used to obtain the computing node information reported in Nova, and perform consistency detection and data synchronization with the computing node information recorded in Placement; the Allocations detection module is mainly used to obtain the virtual machine information reported in Nova, including but not limited to the virtual machine uuid (Universally Unique Identifier), virtual machine specification information, virtual machine PCI (Peripheral Component Interconnect) device information, etc., and perform consistency detection and data synchronization with the allocations information recorded in Placement.

[0057] Specifically, Figure 4 As shown, firstly, a Reosurce prividers detection is performed, which can detect the first data change information of the first data table of the Nova component of the preset cloud computing management platform, and detect the second data change information of the second data table of the Placement component of the preset cloud computing management platform, and then respectively determine the first universal unique identifier of the computing node corresponding to the first data change information and the second universal unique identifier of the computing node corresponding to the second data change information, and determine whether the first universal unique identifier and the second universal unique identifier are consistent.

[0058] It is understandable that the OpenStack-based cloud management platform mainly records the information of the computing nodes that have joined the cluster through the compute_nodes data table of the Nova component. When the computing node is expanded and added to the cluster, the Nova-compute service on the corresponding node is successfully started. The first data table of the Nova database, namely the compute_node data table, records the detailed information of the computing node, including the basic information of the computing node and the CPU (Central Processing Unit), memory, disk over-provisioning ratio, CPU, memory, disk usage, CPU, memory, disk remaining, the number of virtual machines running on the computing node, and other virtual machine-related resource data. On the other hand, Placement is a key component responsible for resource tracking and management in the OpenStack project. When the computing node is expanded and added to the cluster, and the Nova-compute service on the corresponding node is successfully started, the Placement database will also record the corresponding computing node resource-related information, including initializing resource types in the resource_class data table, such as CPU, memory, disk, GPU (graphics processing unit) card, etc., and recording the corresponding data of the computing node in the second data table, namely the resource_providers data table, and keep it consistent with the uuid of the compute_nodes data table in the Nova library through the uuid attribute to achieve a one-to-one correspondence, so as to ensure the consistency of Nova components and Placement components in the computing node, namely the resource_provider resources.

[0059] It should also be pointed out that if the computing node change information in the Nova component and the Placement component is inconsistent, the preset interface of the Placement component is called to create a new computing node resource according to the first universal unique identifier in the Nova component. In other words, since operations such as node name modification and abnormal node delisting and listing may occur in the business environment, the Nova component and the Placement component may be inconsistent. At this time, it is necessary to detect and check the consistency of the above situation. If the computing node information corresponding to the Nova library is not found in the Placement library, it is necessary to call the Placement API to create a new reosurce provider and keep it consistent with the uuid recorded in the compute_nodes database table in the current Nova library. At the same time, the virtual machine data of the computing node inventory before the modification, because it is recorded in the previous resource_provders data, also needs to be updated through the allocations detection system.

[0060] Step S22: If the computing node change information in the Nova component and the Placement component is consistent, run the virtual machine on the computing node of the preset cloud computing management platform, monitor the virtual machine information of the virtual machine, and record the virtual machine information to the Nova component and the Placement component.

[0061] Step S23: determine whether the virtual machine information in the Nova component is consistent with that in the Placement component, and synchronize the virtual machine information in the Nova component to the Placement component according to the determination result.

[0062] In this embodiment, Figure 4 As shown, the first virtual machine information of the target virtual machine in the third data table of the Nova component can be called, and the information acquisition interface of the Placement component can be called to obtain the second virtual machine information in the Placement component to determine whether the first virtual machine information and the second virtual machine information are consistent; wherein the above-mentioned target virtual machine is a virtual machine whose current state is the running state. It can be understood that when the virtual machine is successfully started on the computing node, the instances data table of the Nova library will record the node information where the virtual machine is located, and the compute_nodes data table will update the cpu, memory, disk usage, cpu, memory, disk remaining, the number of virtual machines running on the computing node and other resource-related data. On the other hand, the Placement database will record the resource usage related to the virtual machine through the allocations data table, including consumer_uuid, i.e. virtual machine uuid, resource_class, i.e. resource type (mainly including CPU, memory, disk, GPU card, etc.), resource_provider_id, i.e. node information where the virtual machine is located, and the usage of each resource_class, and it can be understood that in theory, the virtual machine node information and resource usage recorded by the Nova database should be consistent with the Placement database. By calling the Nova database to obtain the Instance (virtual machine basic information uuid, project, user, etc.), Flaver (virtual machine specification information), and PCIdevice (PCI device information) of all active virtual machines in the cluster, a standard data source can be obtained, and the virtual machine uuid, node uuid, virtual machine specifications (CPU, memory, disk allocation), and mounted PCI device status (GPU card) can be extracted from the above data. At the same time, the Placement interface is called to obtain the allocations information of each virtual machine, and a comparative test can be performed to analyze which of the above data has anomalies.

[0063] Accordingly, when synchronizing the virtual machine information in the Nova component to the Placement component according to the judgment result, if there is first virtual machine information in the Nova component that does not correspond to the second virtual machine information in the Placement component, new virtual machine information is created in the Placement component according to the first virtual machine information; if the first virtual machine information and the second virtual machine information corresponding to the same virtual machine in the Nova component and the Placement component are inconsistent, the corresponding second virtual machine information in the Placement component is updated according to the first virtual machine information; if the same virtual machine corresponds to one first virtual machine information and multiple second virtual machine information in the Nova component and the Placement component respectively, the target virtual machine information is filtered out from the multiple second virtual machine information, and the other second virtual machine information is deleted. In other words, if Figure 4 As shown, for a virtual machine that exists in the Nova database but the allocation is not obtained in Placement, it is necessary to call the Placement create allocation API to pass in the standard virtual machine specifications, node information, project, user information, and PCI device information in Nova to create a new allocation; for a virtual machine that exists in the Nova database but the allocation obtained in Placement is incorrect, it is necessary to call the Placement update allocation API to update the incorrect data; for a virtual machine that exists in the Nova database but there may be multiple allocations in Placement, it is necessary to extend the PlacementAPI and delete the redundant allocation data. After the above repairs, the data synchronization of virtual machine resource information in the Nova and Placement databases is finally achieved.

[0064] For a more specific processing procedure of the above step S22, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be described in detail here.

[0065] Through the above technical solution, this embodiment can check the consistency of the resource_provders related data of the computing nodes in the Nova and Placement databases through the resource_provders detection module, and synchronize the computing node related information in the Nova database to the resource_provders data table of the Placement database, and then check the consistency of the virtual machine allocation related data in the Nova and Placement databases through the allocations detection module, and synchronize the virtual machine resource data in the Nova database to the Placement database. In this way, the computing node information recorded in the compute_nodes data table in the Nova database is compared with the information in the resource_providers data table in the Placement database to detect the consistency of the node information, and the missing, redundancy, and error of the resource_providers data in the Placement database are repaired. In addition, the basic information of the virtual machine, the specification data of the virtual machine, and the PCI device information of the virtual machine recorded in the instances, flavors, and pci_devices data in the Nova database are compared with the information in the allocations data table in the Placement database to detect whether the above data are consistent. The missing, redundancy, and error of the resource usage data of the virtual machine project, user, node, CPU, memory, disk, etc. in the allocations data in the Placement database can be repaired, thereby avoiding the abnormality of the virtual machine scheduling function due to the inconsistency of the Nova and Placement virtual machine resource data, and the use of wrong data for analysis and scheduling, and avoiding the abnormality of the node resource monitoring data due to the inconsistency of the Nova and Placement virtual machine resource data, and reporting of the wrong node CPU, memory, disk, PCI device usage and remaining amount.

[0066] See also Figure 5 As shown, the embodiment of the present application also discloses a virtual machine information synchronization device, which is applied to a preset cloud computing management platform, including:

[0067] The task creation module 11 is used to create a virtual machine information synchronization task of the preset cloud computing management platform, and start the virtual machine information synchronization task according to a preset resource information synchronization cycle;

[0068] A component detection module 12 is used to monitor the computing node change information of the preset cloud computing management platform, and execute the virtual machine information synchronization task to detect the Nova component and the Placement component of the preset cloud computing management platform according to the computing node change information, and determine whether the corresponding computing node change information in the Nova component and the Placement component is consistent;

[0069] A data monitoring module 13 is used to run the virtual machine on the computing node of the preset cloud computing management platform if the computing node change information in the Nova component and the Placement component is consistent, monitor the virtual machine information of the virtual machine, and record the virtual machine information to the Nova component and the Placement component;

[0070] The data synchronization module 14 is used to determine whether the virtual machine information in the Nova component is consistent with that in the Placement component, and synchronize the virtual machine information in the Nova component to the Placement component according to the determination result.

[0071] This embodiment can create a virtual machine information synchronization task for a preset cloud computing management platform, and start the virtual machine information synchronization task according to a preset resource information synchronization period, and execute the virtual machine information synchronization task by monitoring the computing node change information of the preset cloud computing management platform. According to the computing node change information, the Nova component and the Placement component of the preset cloud computing management platform are detected, and it is determined whether the corresponding computing node change information in the Nova component and the Placement component are consistent; if the computing node change information in the Nova component and the Placement component are consistent, the virtual machine on the computing node of the preset cloud computing management platform is run, and the virtual machine information of the virtual machine is monitored, and the virtual machine information is recorded in the Nova component and the Placement component; and it is determined whether the virtual machine information in the Nova component and the Placement component is consistent, and according to the determination result, the virtual machine information in the Nova component is synchronized to the Placement component. Through the above technical solution, this embodiment aims at the problem that both the Nova component and the Placement component in the cloud management platform based on OpenStack record the virtual machine resource information, which leads to the risk of inconsistency in the recorded information in the Nova component and the Placement component. By configuring periodic tasks, regular detection and synchronization of the resource information recorded in Nova to the Placement component are performed, the existing function of the OpenStack Nova component is expanded to realize the synchronization of virtual machine resource information, and the virtual machine resource related information in the Nova component of the cloud platform is ensured to correspond one-to-one with the corresponding data in the Placement component, thereby ensuring the consistency of the underlying data and improving the stability of the cloud platform scheduling, monitoring and other functions.

[0072] In some specific embodiments, the virtual machine information synchronization device further includes:

[0073] The cycle determination module is used to add a task cycle control configuration to the configuration group of the configuration file of the Nova component, and determine the preset resource information synchronization cycle of the virtual machine information synchronization task according to the task cycle control configuration.

[0074] In some specific embodiments, the virtual machine information synchronization device further includes:

[0075] A cycle determination module, used to determine whether the current preset resource information synchronization cycle is greater than a preset synchronization cycle threshold;

[0076] The information monitoring module is used to execute the step of monitoring the computing node change information of the preset cloud computing management platform if the preset resource information synchronization period is greater than the preset synchronization period threshold.

[0077] In some specific embodiments, the component detection module 12 specifically includes:

[0078] An information detection unit, configured to detect first data change information of a first data table of the Nova component of the preset cloud computing management platform, and detect second data change information of a second data table of the Placement component of the preset cloud computing management platform;

[0079] The identification code judgment unit is used to respectively determine the first universal unique identification code of the computing node corresponding to the first data change information and the second universal unique identification code of the computing node corresponding to the second data change information, and judge whether the first universal unique identification code is consistent with the second universal unique identification code.

[0080] In some specific embodiments, the virtual machine information synchronization device further includes:

[0081] The node creation module is used to call the preset interface of the Placement component to create a new computing node resource according to the first universal unique identifier in the Nova component if the computing node change information in the Nova component and the Placement component is inconsistent.

[0082] In some specific embodiments, the data synchronization module 14 specifically includes:

[0083] An information calling unit is used to call the first virtual machine information of the target virtual machine in the third data table of the Nova component, and call the information acquisition interface of the Placement component to obtain the second virtual machine information in the Placement component to determine whether the first virtual machine information and the second virtual machine information are consistent; the target virtual machine is a virtual machine whose current state is a running state.

[0084] In some specific embodiments, the data synchronization module 14 specifically includes:

[0085] an information creation unit, configured to create new virtual machine information in the Placement component according to the first virtual machine information if the first virtual machine information that does not correspond to the second virtual machine information of the Placement component exists in the Nova component;

[0086] an information updating unit, configured to update the corresponding second virtual machine information in the Placement component according to the first virtual machine information if the first virtual machine information and the second virtual machine information corresponding to the same virtual machine in the Nova component and the Placement component are inconsistent;

[0087] An information deleting unit is used to filter out target virtual machine information from the multiple pieces of second virtual machine information and delete other pieces of second virtual machine information if the same virtual machine corresponds to one piece of the first virtual machine information and multiple pieces of the second virtual machine information in the Nova component and the Placement component respectively.

[0088] Furthermore, the present application also discloses an electronic device. Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0089] Figure 6 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the virtual machine information synchronization method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0090] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0091] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0092] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the virtual machine information synchronization method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0093] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed virtual machine information synchronization method. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.

[0094] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0095] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0096] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0097] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0098] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for synchronizing virtual machine information, characterized in that: Applied to the pre-set cloud computing management platform, including: Creating a virtual machine information synchronization task for the preset cloud computing management platform, and starting the virtual machine information synchronization task according to a preset resource information synchronization cycle; Monitor the computing node change information of the preset cloud computing management platform, and execute the virtual machine information synchronization task to detect the Nova component and the Placement component of the preset cloud computing management platform according to the computing node change information, and determine whether the corresponding computing node change information in the Nova component and the Placement component is consistent; If the computing node change information in the Nova component and the Placement component is consistent, the virtual machine on the computing node of the preset cloud computing management platform is run, and the virtual machine information of the virtual machine is monitored, and the virtual machine information is recorded in the Nova component and the Placement component; Determine whether the virtual machine information in the Nova component is consistent with that in the Placement component, and synchronize the virtual machine information in the Nova component to the Placement component according to the determination result; The detecting of the Nova component and the Placement component of the preset cloud computing management platform and determining whether the corresponding computing node change information in the Nova component and the Placement component is consistent includes: Detecting first data change information of a first data table of the Nova component of the preset cloud computing management platform, and detecting second data change information of a second data table of the Placement component of the preset cloud computing management platform; A first universal unique identifier of a computing node corresponding to the first data change information and a second universal unique identifier of a computing node corresponding to the second data change information are respectively determined, and it is determined whether the first universal unique identifier is consistent with the second universal unique identifier.

2. The method for synchronizing virtual machine information according to claim 1, characterized in that: Before starting the virtual machine information synchronization task according to the preset resource information synchronization cycle, the method further includes: A task cycle control configuration is added to the configuration group of the configuration file of the Nova component, and the preset resource information synchronization cycle of the virtual machine information synchronization task is determined according to the task cycle control configuration.

3. The method for synchronizing virtual machine information according to claim 2, characterized in that: Before monitoring the computing node change information of the preset cloud computing management platform, the method further includes: Determine whether the current preset resource information synchronization period is greater than a preset synchronization period threshold; If the preset resource information synchronization period is greater than the preset synchronization period threshold, the step of monitoring the computing node change information of the preset cloud computing management platform is performed.

4. The method for synchronizing virtual machine information according to claim 1, characterized in that: After determining whether the corresponding computing node change information in the Nova component and the Placement component is consistent, the method further includes: If the computing node change information in the Nova component and the Placement component are inconsistent, a preset interface of the Placement component is called to create a new computing node resource according to the first universal unique identifier in the Nova component.

5. The method for synchronizing virtual machine information according to any one of claims 1 to 4, characterized in that: The determining whether the virtual machine information in the Nova component is consistent with the virtual machine information in the Placement component includes: The first virtual machine information of the target virtual machine in the third data table of the Nova component is called, and the information acquisition interface of the Placement component is called to obtain the second virtual machine information in the Placement component to determine whether the first virtual machine information and the second virtual machine information are consistent; the target virtual machine is a virtual machine whose current state is the running state.

6. The method for synchronizing virtual machine information according to claim 5, characterized in that: The synchronizing the virtual machine information in the Nova component to the Placement component according to the determination result includes: If the first virtual machine information that does not correspond to the second virtual machine information of the Placement component exists in the Nova component, creating new virtual machine information in the Placement component according to the first virtual machine information; If the first virtual machine information and the second virtual machine information corresponding to the same virtual machine in the Nova component and the Placement component are inconsistent, updating the corresponding second virtual machine information in the Placement component according to the first virtual machine information; If the same virtual machine corresponds to one piece of the first virtual machine information and multiple pieces of the second virtual machine information in the Nova component and the Placement component respectively, the target virtual machine information is filtered out from the multiple pieces of the second virtual machine information, and the other second virtual machine information is deleted.

7. A virtual machine information synchronization device, characterized in that: Applied to the pre-set cloud computing management platform, including: A task creation module, used to create a virtual machine information synchronization task for the preset cloud computing management platform, and start the virtual machine information synchronization task according to a preset resource information synchronization cycle; A component detection module, used to monitor the computing node change information of the preset cloud computing management platform, and execute the virtual machine information synchronization task to detect the Nova component and the Placement component of the preset cloud computing management platform according to the computing node change information, and determine whether the corresponding computing node change information in the Nova component and the Placement component is consistent; A data monitoring module, for running a virtual machine on a computing node of the preset cloud computing management platform, monitoring virtual machine information of the virtual machine, and recording the virtual machine information to the Nova component and the Placement component if the computing node change information in the Nova component and the Placement component is consistent; A data synchronization module, used to determine whether the virtual machine information in the Nova component is consistent with that in the Placement component, and synchronize the virtual machine information in the Nova component to the Placement component according to the determination result; Wherein, the component detection module specifically includes: An information detection unit, configured to detect first data change information of a first data table of the Nova component of the preset cloud computing management platform, and detect second data change information of a second data table of the Placement component of the preset cloud computing management platform; The identification code judgment unit is used to respectively determine the first universal unique identification code of the computing node corresponding to the first data change information and the second universal unique identification code of the computing node corresponding to the second data change information, and judge whether the first universal unique identification code is consistent with the second universal unique identification code.

8. An electronic device, characterized in that: The electronic device includes a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the virtual machine information synchronization method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the virtual machine information synchronization method according to any one of claims 1 to 6.