Configuration acquisition method of VMware virtualization platform and related device
Through the automated configuration acquisition method on the VMware virtualization platform, the problems of low manual operation efficiency and incomplete data in the existing technology are solved, and efficient and complete configuration data acquisition is achieved.
Patent Information
- Application Number
- CN202411777810.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-18
AI Technical Summary
The configuration data acquisition process of the existing VMware virtualization platform requires manual operation, which is inefficient. Each Vcenter can only export the configuration of objects within its management scope, resulting in incomplete configuration data.
It provides a configuration acquisition method for VMware virtualization platform. By receiving acquisition requests, obtaining target Vcenter, building acquisition list, obtaining original configuration data, traversing and finding configuration items, and processing configuration data based on preset processing requests to obtain target configuration data.
The configuration data can be collected efficiently without manual operations, ensuring the integrity and accuracy of the collected data and improving the acquisition efficiency.
Smart Images

Figure CN119645568A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data collection, and in particular to a configuration collection method and related devices for a VMware virtualization platform. Background Art
[0002] The current mainstream VMware virtualization resource pool management method is to manage the resource pool within the management scope through Vcenter. In a large-scale virtualization environment, the number of Vcenters can reach dozens. The configuration data of the resource pool is collected by managing each Vcenter one by one. The collection method is to log in to Vcenter through the Vcenter client software, find the object that needs to be collected and configured, and view and export the configuration.
[0003] The above collection process requires manual operation, and the collection efficiency is very low. In addition, each Vcenter can only export the configuration of objects within its management scope. The exported configuration items are limited, and some configurations cannot be exported directly, resulting in incomplete collected configuration data. Summary of the invention
[0004] In view of this, the present invention provides a configuration collection method and related device for VMware virtualization platform, which is used to solve the problem that in the existing configuration data collection process, manual operation is required, the collection efficiency is very low, and each Vcenter can only export the configuration of objects within its management scope, the exported configuration items are limited, and some configurations cannot be directly exported, resulting in incomplete collected configuration data. The specific scheme is as follows:
[0005] A configuration collection method for a VMware virtualization platform is applied to the VMware virtualization platform, wherein the VMware virtualization platform includes at least one Vcenter, and the method comprises:
[0006] When receiving a collection request, obtaining a target Vcenter corresponding to the collection request, and connecting to the target Vcenter;
[0007] Constructing a collection list corresponding to the collection request, the collection list comprising: a collection object and a configuration item corresponding to the collection object, wherein the collection object is at least one;
[0008] Taking the collection list as an input parameter, obtaining original configuration data corresponding to the collection object, traversing the original configuration data, and searching for configuration data corresponding to the configuration item;
[0009] The configuration data is processed based on a preset processing request to obtain target configuration data.
[0010] The configuration collection method of the VMware virtualization platform described above may optionally include obtaining a target Vcenter corresponding to the collection request and connecting to the target Vcenter, including:
[0011] Parsing the acquisition request to obtain the acquisition object contained in the acquisition request;
[0012] Determine a target cluster based on the acquisition object;
[0013] A target Vcenter corresponding to the target cluster is determined based on a preset association relationship, and the target Vcenter is connected, wherein the preset association relationship is an association relationship between a cluster and a Vcenter.
[0014] The configuration collection method of the VMware virtualization platform described above may optionally use the collection list as an input parameter to obtain original configuration data corresponding to the collection object, including:
[0015] Traversing the VMware virtualization platform through the vSphere Web Services API;
[0016] Through the PropertyCollector interface of the vSphere Web Services API, the collection list is used as an input parameter, and based on the RetrievePropertiesEx method, the original configuration data corresponding to the collection object is traversed and obtained.
[0017] The configuration collection method of the VMware virtualization platform described above may optionally include processing the configuration data based on a preset processing request to obtain target configuration data, including:
[0018] Parsing the preset processing request to obtain key fields and processing algorithms contained in the preset processing request; traversing the configuration data to find configuration data values corresponding to the key fields in the configuration data;
[0019] The target configuration data is determined based on the configuration data value and the processing algorithm.
[0020] The configuration collection method of the VMware virtualization platform may optionally further include:
[0021] Detecting whether the target configuration data is abnormal;
[0022] When the target configuration data is abnormal, the collection of the target configuration data is stopped, and the abnormal record is stored.
[0023] A configuration collection device for a VMware virtualization platform is applied to the VMware virtualization platform, wherein the VMware virtualization platform includes at least one Vcenter, and the device includes:
[0024] An acquisition and connection module, configured to, upon receiving an acquisition request, acquire a target Vcenter corresponding to the acquisition request and connect to the target Vcenter;
[0025] A construction module, configured to construct a collection list corresponding to the collection request, wherein the collection list includes: a collection object and a configuration item corresponding to the collection object, wherein the collection object is at least one;
[0026] A collection and search module, used to take the collection list as an input parameter, obtain the original configuration data corresponding to the collection object, traverse the original configuration data, and search for the configuration data corresponding to the configuration item;
[0027] The processing module is used to process the configuration data based on a preset processing request to obtain target configuration data.
[0028] The configuration collection device for the VMware virtualization platform described above, optionally, the acquisition and connection module includes:
[0029] A first acquisition unit, configured to parse the acquisition request and acquire an acquisition object contained in the acquisition request;
[0030] A first determining unit, configured to determine a target cluster based on the acquisition object;
[0031] The determination and connection unit is used to determine the target Vcenter corresponding to the target cluster based on a preset association relationship, and connect the target Vcenter, wherein the preset association relationship is an association relationship between a cluster and a Vcenter.
[0032] The configuration collection device of the VMware virtualization platform mentioned above, optionally, the collection and search module includes:
[0033] A first traversal unit is used to traverse the VMware virtualization platform through the vSphere Web Services API;
[0034] The second acquisition unit is used to traverse and acquire the original configuration data corresponding to the collection object based on the RetrievePropertiesEx method by using the collection list as an input parameter through the PropertyCollector interface of the vSphere Web Services API.
[0035] The configuration collection device for the VMware virtualization platform described above, optionally, the processing module includes:
[0036] A third acquisition unit, used to parse the preset processing request and acquire key fields and processing algorithms included in the preset processing request;
[0037] A first search unit, configured to traverse the configuration data and search for a configuration data value corresponding to the key field in the configuration data;
[0038] A second determining unit is configured to determine the target configuration data based on the configuration data value and the processing algorithm.
[0039] The configuration collection device of the VMware virtualization platform may optionally further include:
[0040] A detection module, used to detect whether the target configuration data is abnormal;
[0041] The determination module is used to stop collecting the target configuration data and store the abnormal record when the target configuration data is abnormal.
[0042] A storage medium includes a stored program, wherein the program executes the steps of the configuration collection method of the VMware virtualization platform.
[0043] A computer program product includes a computer program, which implements the steps of the configuration collection method of the VMware virtualization platform when executed by a processor.
[0044] Compared with the prior art, the present invention has the following advantages:
[0045] The present invention discloses a configuration collection method and related device for a VMware virtualization platform, which is applied to the VMware virtualization platform, wherein the VMware virtualization platform includes at least one Vcenter, and the method includes: when receiving a collection request, obtaining a target Vcenter corresponding to the collection request, and connecting to the target Vcenter; constructing a collection list corresponding to the collection request, wherein the collection list includes: a collection object and a configuration item corresponding to the collection object, wherein the collection object is at least one; using the collection list as an input parameter, obtaining the original configuration data corresponding to the collection object, traversing the original configuration data, and searching for the configuration data corresponding to the configuration item; processing the configuration data based on a preset processing request to obtain the target configuration data. The above process can realize the collection of the collection object and the corresponding configuration item in the collection list based on the original configuration data without manual operation, and can also be performed based on the collected configuration data based on the preset processing request, thereby ensuring the integrity of the collected configuration data. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 A flow chart of a configuration collection method for a VMware virtualization platform disclosed in an embodiment of the present invention;
[0048] Figure 2 A schematic diagram of VMware virtualization platform configuration data collection disclosed in an embodiment of the present invention;
[0049] Figure 3 A structural block diagram of a configuration collection device for a VMware virtualization platform disclosed in an embodiment of the present invention;
[0050] Figure 4 The present invention is a schematic diagram of a device disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0051] 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.
[0052] The present invention discloses a configuration collection method and related devices for a VMware virtualization platform. VMware virtualization is an industry-leading solution for building a cloud computing infrastructure. It implements a complete, efficient and secure virtualization platform by providing a complete set of application and infrastructure services in terms of computing, storage, network, availability, security and automation.
[0053] In VMware virtualization environments, the configuration data of clusters, physical machines, virtual machines and other objects are of great reference value for the management of virtualized resource pools. In order to achieve more refined virtualized resource pool management, it is necessary to perform management tasks such as data statistics, compliance checks, capacity analysis, and fault location from a global perspective based on configuration data.
[0054] The VMware virtualization platform management server vCenter Server has the ability to query and export the configuration data of objects within its management scope. The method for exporting the configuration is to log in to vCenter through the vCenter client software, find the object that needs to be queried for configuration, and view and export the configuration. However, the above process requires manual operation, the collection efficiency is very low, and each Vcenter can only export the configuration of objects within its management scope. The exported configuration items are limited, and some configurations cannot be exported directly, resulting in incomplete collected configuration data. Therefore, in order to solve the above problems, the present invention provides a configuration collection method for a VMware virtualization platform, which is applied to a VMware virtualization platform, wherein the VMware virtualization platform includes: at least one cluster, at least one physical machine and at least one virtual machine, for each cluster, including at least one physical machine, for each physical machine including at least one virtual machine, the VMware virtualization platform contains at least one Vcenter, each Vcenter corresponds to a cluster, preferably, a preset association relationship is established for different clusters and Vcenters, and the execution process of the method is as follows Figure 1 As shown, the steps include:
[0055] S101. When receiving a collection request, obtain a target Vcenter corresponding to the collection request, and connect to the target Vcenter;
[0056] In an embodiment of the present invention, the acquisition request includes an acquisition object, and the acquisition object may be at least one of a cluster, a physical machine, or a virtual machine. If the acquisition object is a cluster, the target Vcenter corresponding to the acquisition object is directly determined based on the preset association relationship. If the acquisition object is a physical machine or a virtual machine, based on each cluster including at least one physical machine, for each physical machine including at least one virtual machine, the cluster to which it belongs is first determined based on the physical machine or virtual machine, and then the target Vcenter is determined based on the preset association relationship. After determining the target Vcenter, connect to the target Vcenter.
[0057] S102: construct a collection list corresponding to the collection request, wherein the collection list includes: collection objects and configuration items corresponding to the collection objects, wherein the collection object is at least one;
[0058] In an embodiment of the present invention, the acquisition request is parsed. In addition to the acquisition object, the acquisition request also includes, for each acquisition object, a configuration item corresponding to the acquisition object, wherein the configuration item is a type of configuration data that needs to be obtained for the current acquisition object. In an embodiment of the present invention, a collection list is constructed based on the acquisition object and the configuration item corresponding to the acquisition object. In an embodiment of the present invention, the collection list is a PropertyFilterSpec list, and the collection list may include, based on different acquisition objects, at least one of: a cluster and a cluster configuration item, a physical machine and a physical machine configuration item, and a virtual machine and a virtual machine configuration item.
[0059] Furthermore, with reference to the configuration items, if the collection object is a virtual machine, the configuration items of the collection object are hardware configuration, network configuration, and storage configuration; if the collection object is a physical machine, the configuration items of the collection object are hardware configuration, network configuration, and storage configuration.
[0060] S103, taking the collection list as an input parameter, obtaining original configuration data corresponding to the collection object, traversing the original configuration data, and searching for configuration data corresponding to the configuration item;
[0061] In an embodiment of the present invention, the original configuration data of the collection object is obtained by calling the RetrievePropertiesEx method of the PropertyCollector interface in the vSphere Web Services API, wherein the original configuration data includes: physical machine network configuration: (network card information, binding information, IP address, routing information, virtual switch configuration), hardware configuration (CPU, memory), storage configuration (local disk information, NAS storage information), resource allocation information (allocated CPU, allocated memory), virtual machine list. Virtual machine network configuration: (network card information, IP address), virtual hardware configuration (CPU, memory, virtual disk). Cluster configuration information: HA configuration and DRS configuration, etc. The input parameter of the RetrievePropertiesEx interface is the PropertyFilterSpec list (collection list), and PropertyFilterSpec defines the collection object for which configuration data needs to be obtained and the configuration items of the collection object. For the collection list, the collection objects are different and the parameters are different. When the cluster object is passed, the parameter is HostSystem, the parameter of the virtual machine object is VirtualMachine, and the cluster object is Cluster.
[0062] The specific processing process is as follows: through the vSphere Web Services API, traverse the VMware virtualization platform, wherein the traversal method can be based on the first keyword or the first preset identifier, and the specific existence form of the first preset identifier and the first keyword in the embodiment of the present invention is not limited. After finding the VMware virtualization platform, through the PropertyCollector interface of the vSphere Web Services API, take the collection list as an input parameter, and obtain the original configuration data corresponding to the collection object based on the RetrievePropertiesEx method.
[0063] Furthermore, with respect to the PropertyCollector interface and the RetrievePropertiesEx method, the PropertyCollector interface is used to monitor and retrieve information of managed objects, such as querying various configuration information of physical machines and virtual machines.
[0064] The interface document can be interpreted as: vSphere servers provide the PropertyCollector service for accessingdata and monitoring changes. Use the PropertyCollector to obtain references to managed objects, to obtain values of managed object properties, and to monitor and retrieve modified property values.
[0065] The RetrievePropertiesEx method can return the property information to be queried according to a defined property filter.
[0066] For example: RetrievePropertiesEx instantiates a filter, collects the specified objects and properties, and returns the data to your client application as anObjectContent data object.
[0067] The RetrievePropertiesEx method obtains configuration data. The calling example is: RetrieveResult props = methods.retrievePropertiesEx(propColl,fSpecList,ro).
[0068] Among them, fSpecList is the PropertyFilterSpec list.
[0069] S104: Process the configuration data based on a preset processing request to obtain target configuration data.
[0070] In an embodiment of the present invention, the preset processing request is set based on a specific application scenario, and the preset processing request includes a key field and a processing algorithm, wherein the key field is the configuration data that needs to be subsequently processed by the configuration data, the configuration data is traversed, the configuration data value corresponding to the key field in the configuration data is found, the target configuration data is determined based on the configuration data value and the processing algorithm, and the target configuration data is output. An example is given for the above process: for the acquisition object being a physical machine, assuming that the corresponding preset processing request is the total amount of CPU and memory that the physical machine has allocated, then the key fields are the allocated CPU and the allocated memory, and the processing algorithm is summation. The specific processing process is as follows: It is necessary to first obtain a list of virtual machines on this physical machine, and then obtain the cpu and memory configuration of each virtual machine, perform a summation calculation, and finally obtain the total amount of CPU and memory that the physical machine has allocated.
[0071] The present invention discloses a configuration collection method for a VMware virtualization platform, which is applied to the VMware virtualization platform, wherein the VMware virtualization platform includes at least one Vcenter, and the method includes: in the case of receiving a collection request, obtaining a target Vcenter corresponding to the collection request, and connecting to the target Vcenter; constructing a collection list corresponding to the collection request, wherein the collection list includes: a collection object and a configuration item corresponding to the collection object, wherein the collection object is at least one; using the collection list as an input parameter, obtaining original configuration data corresponding to the collection object, traversing the original configuration data, and searching for configuration data corresponding to the configuration item; processing the configuration data based on a preset processing request to obtain target configuration data. The above process can realize the collection of the collection object and the corresponding configuration item in the collection list based on the original configuration data without manual operation, and can also be performed based on the collected configuration data based on the preset processing request, thereby ensuring the integrity of the collected configuration data.
[0072] In the embodiment of the present invention, in order to ensure the accuracy of data collection, it is also possible to detect whether the target configuration data has anomalies, wherein the anomaly handling is completed by setting a checkpoint during the collection process. If an abnormal situation is encountered at the checkpoint, such as no data is collected, the collected data format is incorrect, etc., a log will be recorded and the collection will be stopped, and the cause will be subsequently checked through the log. In addition, if the collection process exits unexpectedly, a log will be recorded and a new collection process will be restarted. Preferably, the abnormal situation will be recorded in the log for subsequent troubleshooting of the cause of the problem.
[0073] Furthermore, the schematic diagram of configuring data collection based on VMware virtualization platform is as follows: Figure 2As shown, a collection program is constructed based on the configuration collection method. The collection program realizes the main functions of collecting data, processing data and outputting data, and records the process of collecting data, processing data and outputting data in the form of a log. At the same time, the log recording process is also used to record the exception handling process, wherein the exception handling process refers to terminating the collection when encountering an abnormal situation (yes).
[0074] In the embodiment of the present invention, a set of VMware virtualization platform configuration collection program is developed based on VMware Web Service API, and the configuration data management interface is called by connecting to Vcenter Server to collect and store the configuration data of the Vcenter Server management object. Further, the present invention solves the problem of VMware virtualization environment configuration data collection and provides a global perspective for the management of virtualization resource pools.
[0075] In the embodiment of the present invention, the configuration collection method can collect configuration data with a customized configuration item set. It can concurrently collect configuration data of resource pools managed by multiple Vcenter Servers and summarize the data. It can support personalized needs, process the original configuration data, and generate configuration data that meets the needs. It can output the configuration data collection results in a customized output format. In the embodiment of the present invention, the customized output format is not specifically limited.
[0076] Based on the above-mentioned configuration collection method of a VMware virtualization platform, an embodiment of the present invention further provides a configuration collection device for a VMware virtualization platform, wherein the collection device is applied to a VMware virtualization platform, wherein the VMware virtualization platform includes at least one Vcenter, and the structural block diagram of the device is as follows: Figure 3 As shown, including:
[0077] An acquisition and connection module 201 , a construction module 202 , a collection and search module 203 , and a processing module 204 .
[0078] The acquisition and connection module 201 is used to acquire the target Vcenter corresponding to the acquisition request and connect to the target Vcenter when receiving the acquisition request;
[0079] The construction module 202 is used to construct a collection list corresponding to the collection request, wherein the collection list includes: a collection object and a configuration item corresponding to the collection object, wherein the collection object is at least one;
[0080] The collection and search module 203 is used to use the collection list as an input parameter, obtain the original configuration data corresponding to the collection object, traverse the original configuration data, and search for the configuration data corresponding to the configuration item;
[0081] The processing module 204 is used to process the configuration data based on a preset processing request to obtain target configuration data.
[0082] The present invention discloses a configuration collection device for a VMware virtualization platform, which is applied to the VMware virtualization platform, wherein the VMware virtualization platform includes at least one Vcenter, and the method includes: when receiving a collection request, obtaining a target Vcenter corresponding to the collection request, and connecting to the target Vcenter; constructing a collection list corresponding to the collection request, wherein the collection list includes: a collection object and a configuration item corresponding to the collection object, wherein the collection object is at least one; using the collection list as an input parameter, obtaining original configuration data corresponding to the collection object, traversing the original configuration data, and searching for configuration data corresponding to the configuration item; processing the configuration data based on a preset processing request to obtain target configuration data. The above process can realize the collection of the collection object and the corresponding configuration item in the collection list based on the original configuration data without manual operation, and can also be performed based on the collected configuration data based on the preset processing request, thereby ensuring the integrity of the collected configuration data.
[0083] In the embodiment of the present invention, the acquisition and connection module 201 includes:
[0084] A first acquiring unit, a first determining unit, and a determining and connecting unit.
[0085] The first acquisition unit is used to parse the acquisition request and acquire the acquisition object contained in the acquisition request;
[0086] The first determining unit is used to determine a target cluster based on the acquisition object;
[0087] The determining and connecting unit is used to determine the target Vcenter corresponding to the target cluster based on a preset association relationship, and connect the target Vcenter. The preset association relationship is an association relationship between a cluster and a Vcenter.
[0088] In the embodiment of the present invention, the collection and search module 203 includes:
[0089] A first traversal unit and a second acquisition unit.
[0090] Wherein, the first traversal unit is used to traverse the VMware virtualization platform through the vSphere Web Services API;
[0091] The second acquisition unit is used to traverse and acquire the original configuration data corresponding to the collection object based on the RetrievePropertiesEx method by using the collection list as an input parameter through the PropertyCollector interface of the vSphere Web Services API.
[0092] In the embodiment of the present invention, the processing module 204 includes:
[0093] A third acquiring unit, a first searching unit, and a second determining unit.
[0094] The third acquisition unit is used to parse the preset processing request and acquire the key fields and processing algorithm contained in the preset processing request;
[0095] The first search unit is used to traverse the configuration data and search for the configuration data value corresponding to the key field in the configuration data;
[0096] The second determining unit is configured to determine the target configuration data based on the configuration data value and the processing algorithm.
[0097] In the embodiment of the present invention, the configuration collection device further includes:
[0098] Detection module and judgment module.
[0099] Wherein, the detection module is used to detect whether there is an abnormality in the target configuration data;
[0100] The determination module is used to stop collecting the target configuration data and store the abnormal record when the target configuration data is abnormal. The configuration collection device includes a processor and a memory, and the acquisition and connection module, the construction module, the collection and search module, and the processing module are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize the corresponding functions.
[0101] The processor contains a kernel, which calls the corresponding program unit from the memory. The kernel can be set to one or more, and the collection process can be avoided by adjusting the kernel parameters. Manual operation is required, and the collection efficiency is very low. In addition, each Vcenter can only export the configuration of objects within its management scope. The exported configuration items are limited, and some configurations cannot be directly exported, resulting in incomplete collected configuration data.
[0102] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0103] The embodiment of the present invention provides a computer storage medium on which a program is stored. When the program is executed by a processor, the steps of the configuration collection method of the VMware virtualization platform are implemented.
[0104] An embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes the steps of the configuration collection method of the VMware virtualization platform when running.
[0105] An embodiment of the present invention provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of a configuration collection method for a VMware virtualization platform provided in an embodiment of the present application.
[0106] An embodiment of the present invention provides a device, the structural block diagram of which is as follows Figure 4 As shown, the device includes: a processor 301, a storage medium 302, and a program stored in the storage medium 302 and executable on the processor 301. When the processor 301 executes the program, the following steps are implemented:
[0107] When receiving a collection request, obtaining a target Vcenter corresponding to the collection request, and connecting to the target Vcenter;
[0108] Constructing a collection list corresponding to the collection request, the collection list comprising: a collection object and a configuration item corresponding to the collection object, wherein the collection object is at least one;
[0109] Taking the collection list as an input parameter, obtaining original configuration data corresponding to the collection object, traversing the original configuration data, and searching for configuration data corresponding to the configuration item;
[0110] The configuration data is processed based on a preset processing request to obtain target configuration data.
[0111] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0112] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0113] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0114] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0115] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0116] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0117] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0118] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0119] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0120] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A configuration collection method for VMware virtualization platform, characterized in that: Applied to a VMware virtualization platform, wherein the VMware virtualization platform includes at least one Vcenter, the method comprising: When receiving a collection request, obtaining a target Vcenter corresponding to the collection request, and connecting to the target Vcenter; Constructing a collection list corresponding to the collection request, the collection list comprising: a collection object and a configuration item corresponding to the collection object, wherein the collection object is at least one; Taking the collection list as an input parameter, obtaining original configuration data corresponding to the collection object, traversing the original configuration data, and searching for configuration data corresponding to the configuration item; The configuration data is processed based on a preset processing request to obtain target configuration data.
2. The configuration collection method of VMware virtualization platform according to claim 1, characterized in that: Obtaining a target Vcenter corresponding to the acquisition request and connecting to the target Vcenter includes: Parsing the acquisition request to obtain the acquisition object contained in the acquisition request; Determine a target cluster based on the acquisition object; A target Vcenter corresponding to the target cluster is determined based on a preset association relationship, and the target Vcenter is connected, wherein the preset association relationship is an association relationship between a cluster and a Vcenter.
3. The configuration collection method of VMware virtualization platform according to claim 1, characterized in that: The acquisition list is used as an input parameter to obtain the original configuration data corresponding to the acquisition object, including: Traversing the VMware virtualization platform through the vSphere Web Services API; Through the PropertyCollector interface of the vSphere Web Services API, the collection list is used as an input parameter, and based on the RetrievePropertiesEx method, the original configuration data corresponding to the collection object is traversed and obtained.
4. The configuration collection method of VMware virtualization platform according to claim 1, characterized in that: Processing the configuration data based on a preset processing request to obtain target configuration data includes: Parsing the preset processing request to obtain key fields and processing algorithms contained in the preset processing request; traversing the configuration data to find configuration data values corresponding to the key fields in the configuration data; The target configuration data is determined based on the configuration data value and the processing algorithm.
5. The configuration collection method of VMware virtualization platform according to claim 1, characterized in that: Also includes: Detecting whether the target configuration data is abnormal; When the target configuration data is abnormal, the collection of the target configuration data is stopped, and the abnormal record is stored.
6. A configuration collection device for VMware virtualization platform, characterized in that: Applied to VMware virtualization platform, wherein the VMware virtualization platform includes at least one Vcenter, and the device includes: An acquisition and connection module, configured to, upon receiving an acquisition request, acquire a target Vcenter corresponding to the acquisition request and connect to the target Vcenter; A construction module, configured to construct a collection list corresponding to the collection request, wherein the collection list includes: a collection object and a configuration item corresponding to the collection object, wherein the collection object is at least one; A collection and search module, used to take the collection list as an input parameter, obtain the original configuration data corresponding to the collection object, traverse the original configuration data, and search for the configuration data corresponding to the configuration item; The processing module is used to process the configuration data based on a preset processing request to obtain target configuration data.
7. The configuration collection device for VMware virtualization platform according to claim 6, characterized in that: The acquisition and connection module includes: A first acquisition unit, configured to parse the acquisition request and acquire an acquisition object contained in the acquisition request; A first determining unit, configured to determine a target cluster based on the acquisition object; The determination and connection unit is used to determine the target Vcenter corresponding to the target cluster based on a preset association relationship, and connect the target Vcenter, wherein the preset association relationship is an association relationship between a cluster and a Vcenter.
8. The configuration collection device for VMware virtualization platform according to claim 6, characterized in that: The collection and search module includes: A first traversal unit is used to traverse the VMware virtualization platform through the vSphere Web Services API; The second acquisition unit is used to traverse and acquire the original configuration data corresponding to the collection object based on the RetrievePropertiesEx method by using the collection list as an input parameter through the PropertyCollector interface of the vSphere Web Services API.
9. The configuration collection device for VMware virtualization platform according to claim 6, characterized in that: The processing module comprises: A third acquisition unit, used to parse the preset processing request and acquire key fields and processing algorithms included in the preset processing request; A first search unit, configured to traverse the configuration data and search for a configuration data value corresponding to the key field in the configuration data; A second determining unit is configured to determine the target configuration data based on the configuration data value and the processing algorithm.
10. The configuration collection device for VMware virtualization platform according to claim 6, characterized in that: Also includes: A detection module, used to detect whether the target configuration data is abnormal; The determination module is used to stop collecting the target configuration data and store the abnormal record when the target configuration data is abnormal.
11. A storage medium, characterized in that: The storage medium includes a stored program, wherein the program executes the steps of the configuration collection method for the VMware virtualization platform according to any one of claims 1 to 5.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the configuration collection method for the VMware virtualization platform described in any one of claims 1 to 5 are implemented.