Method and system for realizing automatic operation and maintenance of OpenStack cloud computing

The Ansible automated operation and maintenance tool is used to implement service status inspection, resource usage monitoring and configuration management in OpenStack cloud computing, solving the problems of manual intervention and security risks in operation and maintenance, and improving operation and maintenance efficiency and system stability.

CN118860799AActive Publication Date: 2024-10-29QINGDAO CIVIL AVIATION KAIYA SYST INTEGRATION CO LTD

Patent Information

Application Number
CN202411328145.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2024-10-29
Estimated Expiration
2044-09-24

AI Technical Summary

Technical Problem

Existing technologies cannot effectively reduce manual intervention and manual operations in the operation and maintenance of OpenStack cloud computing, resulting in huge time consumption, security risks, and low system stability.

Method used

Use the Ansible automated operation and maintenance tool to build an automated operation and maintenance system through the OpenStack management server to implement OpenStack service status check, server resource usage check, network connectivity check and server system configuration management, using Ansible's conditional statements and modules (such as lineinfile, blockinfile) to modify the configuration and restart the service, and combine it with Mitogen to optimize SSH connection performance.

Benefits of technology

It significantly reduces manual intervention and manual operations, saves time and human resources, reduces the risk of human negligence or misoperation, and improves system stability and operation and maintenance efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860799A_ABST
    Figure CN118860799A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of information, and discloses a method and a system for realizing automatic operation and maintenance of OpenStack cloud computing. Constructing an automatic operation and maintenance tool; the method comprises the following steps: automatically operating inspection and configuration modification of openstack, checking the service state of the OpenStack, and checking the service state by Ansible through interacting with an API (Application Program Interface) of the OpenStack or executing a CLI (Call Line Interface) command of the OpenStack; and checking whether the resource utilization rate of the host exceeds a threshold value or not, and performing server system configuration management. According to the method, the working efficiency of operation and maintenance personnel can be improved by using Ansible, the error probability of manual intervention is reduced, and problems can be responded and solved more quickly, which is very important for maintaining a large-scale and high-complexity IT system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of information technology, and in particular relates to a method and system for realizing automated operation and maintenance of OpenStack cloud computing. Background Art

[0002] OpenStack is mainly used to deploy cloud computing data centers. Cloud data centers involve many nodes, and traditional manual operation and maintenance are not suitable for the management of large-scale servers. Because there are many server nodes to manage, it takes a lot of time and manpower to query information and modify configurations for each server, and it is inefficient. When one person modifies the configuration of hundreds or thousands of servers, it is easy to make mistakes and there are security risks. Therefore, in the operation and maintenance of OpenStack, how to manage OpenStack cloud data centers efficiently and securely is particularly important. In order to solve this problem, a professional automated operation and maintenance tool is needed to assist in batch management, improve efficiency, and reduce the risk of mistakes.

[0003] Through the above analysis, the problems and defects of the existing technology are as follows: the existing technology cannot effectively reduce human intervention and manual operation during operation and maintenance, requires a lot of time and human resources, and cannot effectively reduce the potential risks caused by human negligence or misoperation, and the system stability is low. Summary of the invention

[0004] To overcome the problems existing in the related art, the disclosed embodiments of the present invention provide a method and system for realizing automated operation and maintenance of OpenStack cloud computing.

[0005] The technical solution is as follows: A method for realizing automated operation and maintenance of OpenStack cloud computing, comprising: S1, using the OpenStack management server as the basic framework, builds automated operation and maintenance tools; automatically operates and maintains OpenStack inspection and configuration modification. OpenStack inspection includes OpenStack service status check, server resource utilization check, and server and virtual machine network connectivity check; S2, check the status of OpenStack services. Ansible checks the status of services by interacting with the OpenStack API or executing OpenStack CLI commands, stores the results in variables, and uses Ansible's conditional statements to analyze the data to determine whether any services are abnormal. S3, checks whether the host resource usage exceeds the threshold. Ansible uses the defined shell script to collect system information and evaluates whether the resource usage exceeds the preset threshold by setting logical conditions. S4, server system configuration management, use the 'lineinfile' or 'blockinfile' module to modify existing configuration files and control the content of the lines or blocks in the file; use the 'handlers' and 'notify' keywords in combination to restart the corresponding service when the configuration file changes.

[0006] In step S1, the OpenStack service status check includes: using a command to obtain a list of all components, using a regular expression to extract the component name from the output, executing a command for each service, and outputting the detailed status of the component corresponding to the service; filtering and presenting the execution results, and printing the services with abnormal status; The command to obtain a list of all components includes: 1) Ansible performs operational tasks according to Playbook; 2) openstack service list is a command to query all components of the cloud platform; 3) Ansible sends the 'openstack service list' command to the cloud platform according to the Playbook. After the cloud platform executes the command, it returns a list of all components. 4) The corresponding Playbook is displayed; The use of regular expressions to extract component names from the output includes: Use the 'openstack service list' command to get a list of all components and store the resulting output in the 'services_output' variable. At this point, the component list is equal to the services_output variable. Parse the 'services_output' variable content and use regular expressions to match the variable content to find the component name in each line. The filtering includes: (i) Check if the status of each service contains the string 'disabled' or 'down'; if it does, then display The service <service> is down; (ii) Playbook display; The server resource utilization check includes: monitoring the usage of CPU, memory and disk partitions in the server, and only displaying information with a usage rate of more than 80%; using the 'ansible.builtin.setup' module to collect hardware and configuration information, using the 'mpstat' command to obtain the CPU idle time, and register the output, if the CPU idle time is less than 20%, a warning message is displayed; using the 'free' command to calculate the memory usage, and register the output; if the memory usage exceeds 80%, a warning message is displayed; using the 'df' command to check the usage of a specific partition, and register the output, if the disk usage exceeds 80%, a warning message is displayed; The use of the 'free' command to calculate the memory usage includes: using the free command to obtain memory information, filtering out physical memory through the grep Mem parameter, and calculating the memory usage through the awk parameter; assigning the memory usage to the variable mem_usage, at which time the memory usage is equal to the variable mem_usage; comparing the variable mem_usage with an alarm threshold of 80%, and outputting an alarm if it is higher than the threshold.

[0007] In step S1, the network connectivity check of the server and the virtual machine includes: using the 'ping' module of Ansible to check the IP network connectivity of each host in the server list and display the hosts that are not connected to the network. If the 'ping' module cannot successfully connect to the host, it will return a failure status; The use of Ansible's 'ping' module to check the IP network connectivity of each host in the server list includes: In Ansible, the ping module is used to verify the connectivity between the Ansible control node and the target host; Testing through SSH remote connection to ensure that Ansible can successfully connect and execute commands; If the ping module is successfully run using the ansible command or in the playbook, the host will return pong; Ansible indicates that the connection is successfully established; If the connection fails, Ansible will return an error; The configuration modification includes: using the 'lineinfile' module to ensure that specific settings in the file meet security requirements, and modifying the content of specific lines to set password minimum length and password validity period parameters; Modifying the content of a specific row includes: (I) Ansible's lineinfile module is used to modify or delete specified lines in the configuration file; (II) Modify the password configuration file / etc / login.defs, modify the maximum password length represented by the PASS_MIN_LEN value in the file, and modify the maximum password duration represented by the PASS_MAX_DAYS field value in the file; (III) Modify the line configuration file in the playbook file.

[0008] In step S2, executing the CLI command of OpenStack to check the service status includes: using the 'command' module of Ansible as a tool for executing the OpenStack command line to obtain the OpenStack service status; the OpenStack command includes the command openstack service list for displaying the service status.

[0009] The method further includes: Step 1. The user writes Ansible to perform tasks. The user initiates a request to execute the Ansible script or playbook to perform an automation task. The request initiated by the user includes command line input, automation script, and playbook; Step 2. The Ansible core program calls the Host Inventory program to read the host hosts file. After parsing the host hosts file, Ansible obtains the IP address, host name, and password of each target host. Ansible uses this information to determine the server or device that needs to be operated; Step 3. Obtain the operation execution content through local scripts Playbooks, where the local scripts are used to define the automated task sequence that needs to be executed on the target host. Each local script Playbook includes one or more Plays, and each Play specifies a group of hosts and the tasks to be executed on these hosts; Step 4. Call the core modules Core Modules and custom modules Custom Modules to perform operations. The core modules Core Modules provide support for file management, service management, and software package installation tasks; the custom modules Custom Modules are used by users to extend the functions of Ansible and call the corresponding modules to perform operations according to the tasks defined in the Playbook; Step 5. Use the SSH protocol to connect to the OpenStack server through the Connection Plugins connection plug-in to perform operations. After the task instructions are generated, Ansible establishes a connection with the target host through the Connection Plugins. Among them, SSH protocols include: Single process model: Mitogen manages and maintains a long-running SSH connection and a Python interpreter to perform tasks on the target machine; the implementation process is: 1. Create and maintain long-term SSH connections; (1) Establishing an SSH connection: Mitogen first establishes an SSH connection with the target cloud server; (2) Connection reuse: By reusing existing SSH connections, Mitogen reduces the time and resources required to establish new connections; 2. Start the Python interpreter of the target cloud service: Start the sub-interpreter. Once connected to the target cloud server via SSH, Mitogen will start a lightweight Python sub-interpreter; the sub-interpreter runs on the target cloud server and acts as a host environment for executing remote commands and scripts; 3. Resource optimization: The sub-interpreter is specially designed to minimize resource usage and provide functions to complete the call to the cloud server; 4. Task execution; (1) Code transmission and execution: Mitogen serializes the commands issued by the Ansible management host and sends them to the sub-interpreter of the target cloud server through an SSH connection. The Python sub-interpreter of the target cloud server deserializes the commands, receives them and executes them. Deserialization is the reverse process of serialization, which restores the serialized format to the original data structure. (2) Data transmission: The execution results or standard output will be serialized and transmitted back to Ansible through the established SSH connection; Mitogen can execute tasks on the target cloud server in an efficient and resource-optimized manner, improving the efficiency of remote command execution; Function proxy: Mitogen uses a centralized Python process to proxy and execute all subsequent tasks, without the need for repeated initialization and settings; implementation process: (1) Initialize the central controller: First, Mitogen starts a central controller process on the Ansible management server. This process is responsible for managing all communications and task dispatching. The controller becomes the agent for all subsequent tasks, allowing operations to be performed from a single entry point without initializing a new environment each time a task is executed. (2) Establish a secure connection: The central controller connects to the target cloud server via SSH. The connection is encrypted, ensuring the security of data transmission. (3) Channel reuse: Establish a connection with the target cloud server. Mitogen starts a child Python process on the target cloud server. The child process communicates with the central controller through a data stream channel. The central controller on the Ansible management service serializes the code and commands and transmits them to the child process. All subsequent tasks reuse the channel. (4) Task execution: The central controller sends task instructions to the target cloud server through the established channel. The subprocess on the target host receives these instructions, deserializes them, and executes them locally. The execution results are serialized again and returned to the central controller through the same secure channel. (5) Maintaining persistent sessions; Mitogen is designed to keep channels open during multi-tasking, thereby reducing the overhead of establishing and tearing down each task execution; (6) Result processing and error management: The execution results are sent back to the central controller, which is responsible for processing the above results, including successful output and error information, and the central controller records this information; Mitogen manages the execution of all subsequent tasks through a centralized process, and improves the efficiency and response speed of remote task execution by establishing persistent connections and resource reuse.

[0010] Another object of the present invention is to provide a system for realizing OpenStack cloud computing automated operation and maintenance, and to implement the method for realizing OpenStack cloud computing automated operation and maintenance, the system comprising: The core program Ansible Core unit is responsible for task execution, module scheduling and result aggregation; The Host Inventory unit is used to identify all hosts managed by Ansible automation; Playbooks are units used to write command sequences that configure policies or series; Core Modules, including: 'command' to execute command line commands, 'shell' to execute shell commands on the remote system, 'copy' to copy files from the local to the remote target host, 'user' to manage users, including creating, deleting and modifying user attributes; Custom Modules are used by users to create custom functions for specific environments or non-standard requirements when the core modules cannot meet special needs; Plugins are used to provide different functions for various task requirements; OpenStack cloud platform is an open source cloud computing management platform used for large-scale deployment of virtual servers and cloud services and for managing computing, storage and network resources.

[0011] Furthermore, the core program Ansible Core unit also provides: task execution and control functions, AnsibleCore is responsible for parsing Playbooks and executing the tasks defined therein in sequence; The module calling function calls the built-in core modules or custom modules as needed when executing tasks.

[0012] Further, the Host Inventory unit is a static file that lists hosts and their related variables, or a dynamic script that dynamically generates a host list from a cloud service or management tool; The Playbooks unit contains one or more Plays, each Play corresponds to a group of hosts performing a series of tasks; The plug-ins include connection plug-ins, which are responsible for establishing and managing connections with remote devices; Filter plugin Filter, a tool for data transformation in Ansible, is used to modify or filter the contents of these variables; Lookup plugin, used to retrieve data in Ansible playbook, allowing information to be dynamically pulled from external data sources or local data files when executing tasks; The callback plugin Callback, in Ansible, is used to hook into the execution process of Ansible and respond to events at different execution stages.

[0013] Further, the OpenStack cloud computing platform includes a management server, a computing server and a storage server; The management server is responsible for handling authentication, scheduling, and management of network and storage services; The computing server is used to provide computing resources, run virtual machine instances, and manage the life cycle of virtual machine instances, including start, pause, and terminate operations; Specifically, managing virtual machine instances includes: creating virtual machines, receiving instructions from the computing scheduling service of the management node, creating virtual machine instances using the underlying KVM virtualization technology, and reporting virtual machine information status information after the creation is completed; virtual machine creation process: parsing the XML description file in the virtual machine creation request, calling the neutron component to create the virtual machine's network card and allocate IP, calling the cinder component to create the virtual machine's disk, starting the virtual machine installation process through the virsh tool, calling glance to inject the image into the virtual machine disk; calling KVM virtualization through the Libvirt library to allocate CPU and memory and pull up the virtual machine. The virtual machine status is running, and the virtual machine status is reported to the management node through the nova-compute service; Virtual machine query, which is used to provide the status and information of all virtual machines on the current computing node; Pause and resume, used to support pausing a running virtual machine and resuming it from a paused state to a running state; Start and stop, metaphorically controlling the startup and shutdown operations of the virtual machine; The storage server is used for data storage and management, and provides persistent block storage for virtual machines.

[0014] Furthermore, the OpenStack cloud computing automated operation and maintenance system is mounted on a computer-readable storage medium, and the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the functions of the OpenStack cloud computing automated operation and maintenance system can be realized.

[0015] In combination with all the above technical solutions, the beneficial effects of the present invention are as follows: the present invention proposes a method and system for automated operation and maintenance of openstack cloud computing in airport information systems, which reduces human intervention and manual operation through automated operation and maintenance, saves a lot of time and human resources, reduces potential risks caused by human negligence or misoperation, and improves the stability of the system.

[0016] The present invention uses Ansible to automate operation and maintenance, greatly improving operation and maintenance efficiency, reducing manual intervention, and reducing the risks brought by manual operations. The following are its main functions: OpenStack service status check: In a complex environment like OpenStack, Ansible can automatically check the status of multiple components and services to ensure that all components are running in the correct state, simplifying the management process and reducing the risk of errors.

[0017] Server resource utilization check: Ansible can be used with bash scripts to regularly check server resource usage, such as server CPU, memory, and disk partition utilization, to promptly identify resource bottlenecks and enable operations and maintenance personnel to respond promptly.

[0018] Network connectivity check: Ensuring communication between services is a key point of automated operation and maintenance. Ansible can execute automated scripts to batch test network connectivity, ensure the connection between nodes is normal, quickly discover network faults, and ensure the stable operation of the system.

[0019] Server system configuration management: Ansible can write playbooks to standardize configuration tasks, such as password policy modification, user and permission management, system parameter modification, etc., to ensure that each system is configured according to predetermined standards. This can eliminate manual configuration errors and improve configuration consistency and repeatability.

[0020] The present invention uses Ansible to improve the work efficiency of operation and maintenance personnel, reduce the error probability of manual intervention, and respond to and solve problems more quickly, which is very important for maintaining large-scale, highly complex IT systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure; Figure 1 This is a flow chart of a method for implementing automated operation and maintenance of OpenStack cloud computing provided by an embodiment of the present invention; Figure 2 This is a schematic diagram of the logical architecture of the OpenStack cloud computing automated operation and maintenance system provided by an embodiment of the present invention; Figure 3 This is a schematic diagram of the deployment architecture of an OpenStack cloud computing automated operation and maintenance system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0022] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by the specific implementation disclosed below.

[0023] The innovation of the present invention is that the main point of automated operation and maintenance is that it can significantly improve the efficiency and accuracy of task processing, reduce human errors, reduce long-term operation and maintenance costs, and can easily cope with large-scale and complex OpenStack cloud platform environments. In addition, the automation of the OpenStack cloud platform realizes the two most time-consuming work tasks in operation and maintenance, namely system inspection and batch configuration modification, which greatly improves the efficiency and response speed of operation and maintenance, improves accuracy and reduces operation and maintenance costs, and solves the problem that commercial companies in this field have always pursued high efficiency and low cost.

[0024] Embodiment 1: The method for implementing OpenStack cloud computing automated operation and maintenance provided by the embodiment of the present invention includes: S1, using the OpenStack management server as the basic framework, builds automated operation and maintenance tools; automatically operates and maintains OpenStack inspection and configuration modification. OpenStack inspection includes OpenStack service status check, server resource utilization check, and server and virtual machine network connectivity check; Exemplarily, building an automated operation and maintenance tool includes: installing the Mitogen Python library when building an automated operation and maintenance system through Ansible. The Mitogen Python library can accelerate the interaction between programs through optimization, mainly by reducing the overhead of system calls and network communications to improve efficiency. In the context of Ansible, Mitogen can significantly improve ssh performance and efficiency, especially when managing a large number of nodes.

[0025] S2, check the status of OpenStack services. Ansible checks the status of services by interacting with the OpenStack API or executing OpenStack CLI commands, stores the results in variables, and uses Ansible's conditional statements to analyze the data to determine whether any services are abnormal. In an OpenStack environment, maintaining the running status of each service is one of the core operation and maintenance tasks. Ansible checks the service status by interacting with the OpenStack API or executing OpenStack CLI commands. Use Ansible's 'command' module as a tool to execute OpenStack command lines, such as "openstack servicelist" (a command to display service status) to obtain the status of OpenStack services. The results can be stored in variables, and the conditional statements of Ansible can be used to analyze the data to determine whether any service has abnormalities.

[0026] For example, when Ansible's 'command' module is used as a tool to execute the OpenStack command line, Ansible executes the operation task according to the Playbook. The OpenStack cloud platform is composed of multiple components, each of which contains multiple services.

[0027] The logical order of cloud platform: cloud platform > components > services; Ansible sends the 'openstack service list' command to the cloud platform according to the Playbook. After the cloud platform executes the command, it returns a "list of all components", which contains information such as component name and component status. Ansible filters the component name from the component list and assigns the value name to the variable. At this time, the "component name" is equal to the "variable". Ansible executes the 'openstack service show <variable>' command. After the cloud platform executes the command, it returns a "service status list". Ansible judges the service status list based on the conditional statement and displays the services with abnormal status.

[0028] Another example is to use Ansible's conditional statements to analyze the data and determine whether any service has an abnormality, including: Ansible sends the 'openstack service list' command to the cloud platform according to the Playbook. After executing the command, the cloud platform returns a "list of all components", which contains information such as component names and component status. Ansible filters out component names from the component list and assigns the assigned names to variables. At this time, the "component name" is equal to the "variable". Ansible executes the 'openstack service show<variable>' command. After executing the command, the cloud platform returns a "service status list". Check whether the status of each service contains the strings 'disabled' or 'down'. If it contains these strings, it will display "The service<service>is down" (a certain service has been offline).

[0029] S3, checks whether the host resource usage exceeds the threshold. Ansible uses the defined shell script to collect system information and evaluates whether the resource usage exceeds the preset threshold by setting logical conditions. Resource monitoring is an integral part of automated operations and maintenance, and involves the usage of key resources such as CPU, memory, and disk. Ansible uses defined shell scripts to collect system information. Logical conditions are set to evaluate whether resource usage exceeds preset thresholds.

[0030] Exemplarily, setting a logical condition to evaluate whether resource usage exceeds a preset threshold includes: Use the command to obtain CPU, memory, and disk information, filter the used capacity and total capacity contained in the CPU, memory, and disk information, and use the used capacity ÷ total capacity × 100 = percentage. Compare the percentage of CPU, memory, and disk with the threshold of 80% to determine whether it exceeds the threshold.

[0031] S4, server system configuration management, using the 'lineinfile' or 'blockinfile' modules to modify existing configuration files and control the content of lines or blocks in the files; using the 'handlers' and 'notify' keywords together to restart the corresponding service when the configuration file changes; Automated configuration management is Ansible's strength, especially for handling configuration file changes, service restarts, and other operations. Use the 'lineinfile' or 'blockinfile' modules to modify existing configuration files. These 'lineinfile' or 'blockinfile' modules support precise control of the content of specific lines or blocks in the file. Combine the 'handlers' and 'notify' keywords to restart the corresponding service when the configuration file changes.

[0032] For example, use the 'lineinfile' or 'blockinfile' module to modify an existing configuration file. Ansible's 'lineinfile' and 'blockinfile' provide the ability to operate on single-line and multi-line content respectively.

[0033] lineinfile module: used to modify or delete a single line of content in a file. It can be used to modify a single line setting value in a configuration file.

[0034] blockinfile module: focuses more on managing a continuous block (multiple consecutive lines) in a file. Used to add or modify multiple lines of configuration in the configuration file.

[0035] As another example, the 'lineinfile' or 'blockinfile' module supports precise control of the content of a specific line or block in a file, and is used to modify a parameter in a line of a file, for example, modifying "line 1" in "file 1".

[0036] Another exemplary method is to use the 'handlers' and 'notify' keywords together to restart the corresponding service when the configuration file changes, including: In Ansible, 'handlers' and 'notify' are tasks used to restart or reload services when system configuration files or their system settings are changed.

[0037] Handlers are a special type of task (action) that are usually used to perform operations that only need to be triggered once under certain conditions, such as restarting a service or reloading a configuration file. Handlers are defined in Play, but will only be executed when explicitly notified. Even if multiple tasks trigger the same handler, the handler will only be executed once, usually after all main tasks have completed execution.

[0038] Notify is a property defined in a task that triggers one or more 'handlers'. When a task with 'notify' reports a change (i.e. a configuration file is modified), it will call the corresponding handler. 'notify' matches the name of a handler.

[0039] Example 2, as another embodiment of the present invention, Figure 2 The present invention provides a logical architecture principle for implementing the OpenStack cloud computing automated operation and maintenance system, including: Ansible Core is the heart of the entire Ansible automation tool, responsible for core functions such as task execution, module scheduling, and result aggregation. It provides the following main functions: Task execution and control, Ansible Core is responsible for parsing Playbooks and executing the tasks defined in them in sequence. Module call, when executing tasks, calls built-in (Core Modules) or custom modules (Custom Modules) as needed.

[0040] The Host Inventory unit identifies all hosts that Ansible can automate. It can be a simple static file that lists the hosts and their associated variables, or it can be a dynamic script that dynamically generates a list of hosts from a cloud service or other management tool. It supports grouping hosts for easier management and specific tasks.

[0041] Playbooks are one of the most powerful features of Ansible. They are a configuration, deployment, and orchestration language that allows you to write configuration policies or a series of command sequences. The Playbook structure contains one or more "Plays", each of which corresponds to a set of hosts to perform a series of tasks. Playbooks can perform tasks such as software deployment, system configuration, and update management.

[0042] Core Modules: Core modules are standard components of Ansible. Common core modules include: 'command' executes command line commands. 'shell' is used to execute shell commands on remote systems. It supports the use of Bash functions, such as pipes and redirections. 'copy' is used to copy files from the local to the remote target host. 'user' is used to manage users, including creating, deleting, and modifying user attributes.

[0043] Custom Modules When Ansible's core modules cannot meet special needs, users can create custom modules. These modules are usually developed for specific environments or non-standard system requirements and support python and shell languages.

[0044] Plugins add additional functionality to the running process of Ansible. They provide support for various task requirements. Plugin types include connection plugins, filter plugins, lookup plugins, callback plugins, etc. Plugins functions, such as Connection Plugins, are responsible for establishing and managing connections with remote devices.

[0045] Filter plugins are used in Ansible. Filter plugins are tools for data conversion, which are used to modify or filter the contents of these variables. Using filters, you can perform data formatting, conversion, and calculations in Ansible tasks. You can filter lists to keep only unique elements, and support converting variables into JSON strings, YAML formats, and Python data structures; Lookup plugins for Ansible are used to retrieve data in Ansible playbooks, allowing information to be dynamically pulled from external data sources or local data files when executing tasks. Lookup plugins can obtain data from various sources, such as files, environment variables, DNS records, key management systems, databases, etc.

[0046] Callback plugins are used in Ansible to hook into the execution process of Ansible and respond to events at different stages of execution, such as the execution of tasks. These plugins can be used to record logs, send notifications, collect statistics, and other custom behaviors. The functions of callback plugins include logging (recording detailed information that occurs during task execution), user-defined display output (changing the standard output formatting during Ansible execution and outputting according to the user-defined display format), error handling and reporting (additional logging when errors occur).

[0047] As you can understand, Mitogen is a library for Python that can speed up the interaction between programs through various optimizations, mainly by reducing the overhead of system calls and network communications to improve efficiency. In the context of Ansible, Mitogen can significantly improve ssh performance and efficiency, especially when managing a large number of nodes. The optimizations include the following, single process model: Mitogen manages and maintains a long-running SSH connection (or other connection type) and a Python interpreter for executing tasks on the target machine. This reduces the need to start a new connection and a new interpreter for each task. Functional proxy: Mitogen further reduces repeated calculations and network communication overhead by proxying and executing all subsequent tasks with a centralized Python process without repeated initialization and setup. Serialization optimization: Data serialization and transmission are usually the more expensive parts of Ansible, especially when modules and plug-ins are used extensively. Mitogen optimizes this process to reduce the cost of polling and data transmission.

[0048] OpenStack cloud platform is an open source cloud computing management platform used to deploy virtual servers and other cloud services on a large scale. It manages huge computing, storage and network resources.

[0049] In summary, automation tools such as Ansible not only make operation and maintenance work faster and more effective, but also significantly improve the accuracy and reliability of system management, reduce human errors, and improve overall IT operation efficiency.

[0050] Example 3, as another embodiment of the present invention, Figure 3 The embodiment of the present invention provides a principle for implementing an OpenStack cloud computing automated operation and maintenance system deployment architecture, including: (1) OpenStack cloud computing platform. In the OpenStack cloud computing platform, the allocation and management of resources and services are mainly achieved through different types of servers, including management servers, computing servers, and storage servers.

[0051] The management server is the most critical part of the OpenStack architecture, which is responsible for handling authentication, scheduling, and management of network and storage services. The API of each component of OpenStack runs on this node, and the API is the entry point for calling and managing each component.

[0052] Among them, the OpenStack management server is deployed with the OpenStack management service, which provides functions such as authentication between services, scheduling computing nodes, OpenStack storage and network management.

[0053] Authentication: It is implemented through the Keystone service in OpenStack. The Keystone service provides authentication tokens for its users and services. The interaction between users or services is based on token-based permission authentication.

[0054] Scheduling function: Taking computing scheduling in OpenStack as an example, the nova component is responsible for providing computing services. The computing scheduling service in the nova component schedules computing resources. The computing service is mainly used to create virtual machines. When a user initiates a virtual machine creation request, the computing scheduling service will filter out hosts that meet the requirements for virtual machine creation based on the virtual machine specifications, and then send the virtual machine creation request to the computing node to complete the creation of the virtual machine.

[0055] Network management: Network management is implemented by the Neutron component. Network management provides functions such as managing virtual network interfaces, networks, subnetworks, security groups, and routing, and implements network communication between virtual machines and management of network communication.

[0056] Storage service management: Cinder is the block storage service of OpenStack, which provides persistent storage devices for virtual machines. It provides functions such as virtual machine disk creation, deletion, addition, and snapshot.

[0057] The computing server provides computing resources for the cloud platform and runs virtual machine instances. It manages the life cycle of virtual machine instances, including starting, pausing, and terminating operations. Computing nodes must be equipped with sufficient processing power, memory, and network connections to ensure efficient operation of virtual machines.

[0058] Among them, the computing node is responsible for managing the life cycle of the virtual machine instance in the cloud computing environment and operates the virtual machine according to the scheduling tasks issued by the management node.

[0059] Managing virtual machine instances includes: creating virtual machines (receiving instructions from the computing scheduling service of the management node, using the underlying KVM virtualization technology to create virtual machine instances, and reporting virtual machine information status information after creation), virtual machine query (providing the status and information of all virtual machines on the current computing node), pausing and resuming (supporting pausing the running virtual machine, and resuming from the paused state to the running state), starting and stopping (controlling the startup and shutdown operations of the virtual machine).

[0060] The storage server is dedicated to data storage and management, providing persistent block storage for virtual machines. Storage nodes can be expanded as needed to support growing data storage needs. They usually have a large amount of disk space and a network configuration that adapts to high throughput.

[0061] (2) Install Ansible. Since the OpenStack cloud platform is deployed on the Linux system, it is planned to integrate the Ansible tool with the OpenStack management server. Considering the business security, OpenStack adopts a private cloud model and cannot directly access the Internet. Ansible is installed using the rpm package. First, download the Ansible installation package and Ansible dependency package. The Ansible dependency package includes software packages such as the EPEL repository, Python language, and SSH protocol. Upload the installation package to the OpenStack management server for installation. After the installation is complete, write the Host Inventory host list and the Playbook script execution file.

[0062] (2.1) The Host Inventory file identifies all hosts that Ansible can automatically manage. It contains information such as the host's IP address, host group, host username and password, host variables, etc. Example: [compute_node] 192.168.1.10 192.168.1.11 192.168.1.12 ansible_ssh_user=root ansible_ssh_pass=password ansible_port=23 [storage_node] 192.168.2.1 192.168.2.2 192.168.2.3 ansible_ssh_user=root ansible_ssh_pass=password ansible_port=23 (2.2) Playbooks are a core feature of Ansible. They provide an advanced, highly expressive automation scripting language to describe the configuration, deployment, and other IT processes of IT application environments. Playbooks are composed of a series of "Plays" (operations), each of which corresponds to a group of hosts performing a series of tasks. The content of Playbooks is divided into a series of tasks such as OpenStack service status check, server resource utilization check, network connectivity check, and server system configuration management.

[0063] (2.2.1) OpenStack service status check task. Use the command to get a list of all components. Use regular expressions to extract component names from the output. Execute the command for each service and output the detailed status of the component corresponding to the service. Filter and present the execution results, and print the services with abnormal status. The corresponding information will only be displayed if the output contains the "disabled" (fault) or "down" (shutdown) keywords. Example: name:Check Openstack Services Status#Check the status of OpenStack components hosts:openstack gather_facts:false tasks: name : Get service list from openstack #Get component list command:openstack service list register:services_output ignore_errors:true name:Parse service list#Analysis component list set_fact: services: "{{ services output.stdout | regex findall('(?<=\\| )\\S+?(?= \\ / \\s+\\|)')}}" name:Check each service status #Check each service status command:"openstack service show i{ item}}" loop:"{{ services}}" register:service status ignore errors:true name:Filter and Display down services #Filter abnormal services debug: msg: "The service ff item.item}} is down." loop:"{{ service_status.results}}" when:"'disabled' in item.stdout or 'down' in item.stdout" The command to obtain a list of all components includes: 1) Ansible performs operational tasks based on Playbook; 2) "openstack service list" is the command used by the cloud platform to query all components; 3) Ansible sends the 'openstack service list' command to the cloud platform according to the Playbook. After the cloud platform executes the command, it returns a list of all components. 4) Corresponding Playbook: The use of regular expressions to extract component names from the output includes: Use the 'openstack service list' command to get a list of all components and store the resulting output in the 'services_output' variable. At this time, the 'component list' is equal to the 'services_output' variable. Parse the 'services_output' variable content and use regular expressions to match the variable content to find the component name in each line (assuming that the component name is in the first field of the output component list, then output the first field); The filtering includes: (i) Check if the status of each service contains the string 'disabled' or 'down'. If it does, then it will display "The service <service> is down"; (ii) Corresponding Playbook: (2.2.2) Check server resource usage. Monitor the usage of CPU, memory, and disk partitions in the server, and only display those with usage exceeding 80%. Use the 'ansible.builtin.setup' module to collect hardware and configuration information. Use the 'mpstat' command to obtain the CPU idle time and register the output. If the CPU idle time is less than 20% (that is, the usage exceeds 80%), a warning message is displayed. Use the 'free' command to calculate the memory usage and register the output. If the memory usage exceeds 80%, a warning message is displayed. Use the 'df' command to check the usage of a specific partition and register the output. If the disk usage exceeds 80%, a warning message is displayed. Example: name:Check Server Resource Usage#Check server resource usage hosts:al1 tasks: name:Gather facts#Collect information ansible.builtin.setup: name:CheckCPuusage#Check CP usage ansible.builtin.command:mpstat11 register:cpu_usage changed_when:false name:Display CPU usage if high #Judge CPU usage debug: msg:"High CPU usage detected: CPU Idle is{{ cpu idle}}%" vars: cpu_idle: "{{cpu_usage.stdout _lines[3].split()last}}" name:Check memory usage#Check memory usage ansible.builtin.shell:free|grepMem|awk'{print $3 / $2*100.0}' register:mem_usage changed_when:false name:Display memory usage if high#Judge memory usage debug : msg"High MemoryUsage:{{mem_usg}}%used" when:mem_usg|int>80 vars : mem_usg:"{{mem_usage.stdout|float|round(2)}}" name:Check disk usage#Check disk partition usage ansible.builtin.shell:df-h--output=pcent / |grep -v Use%reqister:disk_usage changed_when:false name:Display disk usage if high #Judge the disk partition usage debug : msg"High Disk Usage detected on / :{{ disk_usg}}" vars: disk usg:"{{ disk_usage.stdout.split('%')[0]}}" The calculation of memory usage using the 'free' command includes: (a) How to calculate: Use the "free" command to obtain memory information, filter out physical memory through the "grep Mem" parameter, and calculate the memory usage through the awk parameter. Assign the memory usage to the variable "mem_usage". At this time, the memory usage is equal to the variable "mem_usage". Compare the variable "mem_usage" with the alarm threshold of 80%. If it is higher than the threshold, an alarm is output.

[0064] (b) Added memory usage command display; (c) Corresponding Playbook.

[0065] (2.2.3) Network connectivity check, used to check the IP network connectivity of each host in the server list and display those hosts that are not connected to the network, using the nsible's 'ping' module to achieve this. If the 'ping' module cannot successfully connect to the host, it will return a failure status. Example: Name:Check Network Connectivity#Check network connectivity hosts:all gather_facts:no tasks: name:Ping all hosts #ping the host ansible.builtin.ping: register:ping_result ignore_errors:true name: Report unreachable hosts#Show unreachable hosts ansible.builtin.debug: msg: "Host {{inventory hostname}}is unreachable. " when: ping_result is failed For example, using Ansible's 'ping' module to check the IP network connectivity of each host in the server list includes: In Ansible, the ping module is a very basic and important module, which is used to verify the connectivity between the Ansible control node and the target host. This module does not execute the ICMP ping command, but instead performs a simple test through an SSH remote connection to ensure that Ansible can successfully connect and execute commands. The module functions include verifying connectivity (checking whether the host is online by trying to establish a connection with the host), not requiring privileges (no superuser permissions are required), and not using ICMP (this is not a traditional network ping, and the ICMP protocol will not be used to test network connectivity). If the ping module is successfully run using the ansible command or in a playbook, the host will return pong. This is Ansible's way of indicating a successful connection. If the connection fails, Ansible will return an error.

[0066] (2.2.4) Modify the system configuration file to modify the system's password configuration file, such as ' / etc / login.defs', which is usually used to define the parameters of the user password policy. The 'lineinfile' module can be used to ensure that specific settings in the file meet security requirements. This method allows the content of specific lines to be modified to set parameters such as the minimum password length and password expiration period. Example: name:Update Password Configuration hosts:all become:yes#Execute with sudo privileges tasks: name:Set minimum password length to 12 characters ansible.builtin.lineinfile: path: / etc / login.defs reqexp:`^PASS_MIN_LEN 12` state:present backup:yes #Create a backup of the original file name:Set maximum password age to 90 days ansible.builtin.lineinfile: path: / etc / login.defs regexp:`^PASS_MAX_DAYS` state:present backup:yes#Create a backup of the original file Among them, the 'lineinfile' module is used to ensure that the specific settings in the file meet the security requirements, and the host password policy file is uniformly modified according to the national standard security level requirements for password policies.

[0067] Modifying the content of a specific row includes: (I) Ansible's lineinfile module is used to modify or delete specified lines in the configuration file.

[0068] (II) Modify the password configuration file " / etc / login.defs". Change the value of "PASS_MIN_LEN" in the file to "12" to indicate that the minimum password length is 12 characters. Change the value of "PASS_MAX_DAYS" in the file to "90" to indicate that the maximum password validity period is 90 days.

[0069] (III) The playbook file can also modify other configuration files. For example, changing " / etc / login.defs" to " / etc / ssh / sshd_config" means modifying the " / etc / ssh / sshd_config" file.

[0070] Example 4, as another implementation of the present invention, the method for implementing OpenStack cloud computing automated operation and maintenance provided by the embodiment of the present invention includes: Step 1. The user executes the task according to the written Ansible. The user initiates a request to execute the Ansible script or Playbook to perform an automated task. The request initiated by the user can be command line input, automated script, Playbook, etc.

[0071] Step 2. The Ansible core program calls the Host Inventory program to read the hosts file. Host Inventory is a component used in Ansible to define the operation object (i.e., host or host group). This information is usually stored in the hosts file or dynamic host library. After parsing the hosts file, Ansible obtains the relevant information of each target host (such as IP address, host name, password, etc.), and Ansible uses this information to determine the server or device that needs to be operated; Step 3. Get the action execution content through Playbooks, which is Ansible's configuration, deployment, and orchestration language. They can describe strategic deployments and a series of configuration tasks and are written in YAML format. From Playbooks, Ansible understands which tasks need to be performed on each target host. Get the action execution content through local scripts (Playbooks): Playbooks are one of the core components of Ansible, which defines the sequence of automated tasks that need to be performed on the target host. Each Playbook includes one or more Plays, and each Play specifies a set of hosts and the tasks to be performed on these hosts.

[0072] Step 4. Call core modules and custom modules to perform operations. Core modules are standard modules of Ansible, providing support for various common tasks, such as file management, service management, and package installation. Custom modules allow users to extend the functionality of Ansible to meet specific needs. Custom modules are developed by users based on specific operating environments and can be written in shell scripting languages. Call appropriate modules to perform operations based on the tasks defined in the Playbook.

[0073] Step 5. Use the SSH protocol to connect to the OpenStack server through the Connection Plugins connection plug-in to perform operations. After the task instructions are generated, Ansible establishes a connection with the target host through its Connection Plugins. For OpenStack servers, the SSH protocol is usually used. These plug-ins support multiple connection methods (such as SSH, WinRM, etc.), ensuring that Ansible can securely access and execute defined tasks on remote hosts.

[0074] This process shows how Ansible performs operations and data transmission between different levels and components from the initial user request to the final task execution to achieve the purpose of automated management and configuration. This mechanism provides high flexibility and powerful automation capabilities, suitable for managing and automating large-scale IT infrastructure.

[0075] Among them, the SSH protocol includes: By combining Mitogen and Ansible, the SSH connection performance and calling efficiency are optimized.

[0076] Mitogen is a library for Python that can speed up the interaction between programs through various optimizations, mainly by reducing the overhead of system calls and network communications to improve efficiency. In the context of Ansible, Mitogen can significantly improve ssh performance and efficiency, especially when managing a large number of nodes.

[0077] When Mitogen and Ansible are used together, performance is improved mainly by optimizing Ansible's calls to remote systems and task execution. Mitogen's optimizations for Ansible include the following: Single process model: Mitogen manages and maintains a long-running SSH connection (or other connection type) and a Python interpreter for executing tasks on the target machine. This reduces the need to start new connections and new interpreters for each task. Functional proxy: Mitogen further reduces repeated computing and network communication overhead by proxying and executing all subsequent tasks with a centralized Python process without repeated initialization and setup. Serialization optimization: Data serialization and transmission are usually the more expensive parts of Ansible, especially when modules and plug-ins are used extensively. Mitogen optimizes this process to reduce the cost of polling and data transmission.

[0078] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered within the protection scope of the present invention.

Claims

1. A method for realizing automated operation and maintenance of OpenStack cloud computing, characterized in that: The method includes: S1, using the OpenStack management server as the basic framework, builds automated operation and maintenance tools; automatically operates and maintains OpenStack inspection and configuration modification. OpenStack inspection includes OpenStack service status check, server resource utilization check, and server and virtual machine network connectivity check; S2, check the status of OpenStack services. Ansible checks the status of services by interacting with the OpenStack API or executing OpenStack CLI commands, stores the results in variables, and uses Ansible's conditional statements to analyze the data to determine whether any services are abnormal. S3, checks whether the host resource usage exceeds the threshold. Ansible uses the defined shell script to collect system information and evaluates whether the resource usage exceeds the preset threshold by setting logical conditions. S4, server system configuration management, use the 'lineinfile' or 'blockinfile' module to modify existing configuration files and control the content of the lines or blocks in the file; use the 'handlers' and 'notify' keywords in combination to restart the corresponding service when the configuration file changes.

2. The method for realizing automated operation and maintenance of OpenStack cloud computing according to claim 1, characterized in that: In step S1, the OpenStack service status check includes: using a command to obtain a list of all components, using a regular expression to extract the component name from the output, executing a command for each service, and outputting the detailed status of the component corresponding to the service; filtering and presenting the execution results, and printing the services with abnormal status; The command to obtain a list of all components includes: 1) Ansible performs operational tasks according to Playbook; 2) openstack service list is a command to query all components of the cloud platform; 3) Ansible sends the 'openstack service list' command to the cloud platform according to the Playbook. After the cloud platform executes the command, it returns a list of all components. 4) The corresponding Playbook is displayed; The use of regular expressions to extract component names from the output includes: Use the 'openstack service list' command to get a list of all components and store the resulting output in the 'services_output' variable. At this point, the component list is equal to the services_output variable. Parse the 'services_output' variable content and use regular expressions to match the variable content to find the component name in each line. The filtering includes: (i) Check if the status of each service contains the string 'disabled' or 'down'; if it does, then display The service <service> is down; (ii) Playbook display; The server resource utilization check includes: monitoring the usage of CPU, memory and disk partitions in the server, and only displaying information with a usage rate of more than 80%; using the 'ansible.builtin.setup' module to collect hardware and configuration information, using the 'mpstat' command to obtain the CPU idle time, and register the output, if the CPU idle time is less than 20%, a warning message is displayed; using the 'free' command to calculate the memory usage, and register the output; if the memory usage exceeds 80%, a warning message is displayed; using the 'df' command to check the usage of a specific partition, and register the output, if the disk usage exceeds 80%, a warning message is displayed; The use of the 'free' command to calculate the memory usage includes: using the free command to obtain memory information, filtering out physical memory through the grepMem parameter, and calculating the memory usage through the awk parameter; assigning the memory usage to the variable mem_usage, at which time the memory usage is equal to the variable mem_usage; comparing the variable mem_usage with an alarm threshold of 80%, and outputting an alarm if it is higher than the threshold.

3. The method for realizing automated operation and maintenance of OpenStack cloud computing according to claim 1, characterized in that: In step S1, the network connectivity check of the server and the virtual machine includes: using the 'ping' module of Ansible to check the IP network connectivity of each host in the server list and display the hosts that are not connected to the network. If the 'ping' module cannot successfully connect to the host, it will return a failure status; The use of Ansible's 'ping' module to check the IP network connectivity of each host in the server list includes: In Ansible, the ping module is used to verify the connectivity between the Ansible control node and the target host; Testing through SSH remote connection to ensure that Ansible can successfully connect and execute commands; If the ping module is successfully run using the ansible command or in the playbook, the host will return pong; Ansible indicates that the connection is successfully established; If the connection fails, Ansible will return an error; The configuration modification includes: using the 'lineinfile' module to ensure that specific settings in the file meet security requirements, and modifying the content of specific lines to set password minimum length and password validity period parameters; Modifying the content of a specific row includes: (I) Ansible's lineinfile module is used to modify or delete specified lines in the configuration file; (II) Modify the password configuration file / etc / login.defs, modify the minimum password length represented by the PASS_MIN_LEN value in the file, and modify the maximum password duration represented by the PASS_MAX_DAYS field value in the file; (III) Modify the line configuration file in the playbook file.

4. The method for realizing automated operation and maintenance of OpenStack cloud computing according to claim 1, characterized in that: In step S2, executing the CLI command of OpenStack to check the service status includes: using the 'command' module of Ansible as a tool for executing the OpenStack command line to obtain the OpenStack service status; the OpenStack command includes the command openstack service list for displaying the service status.

5. The method for realizing automated operation and maintenance of OpenStack cloud computing according to claim 1, characterized in that: The method further includes: Step 1. The user writes Ansible to perform tasks. The user initiates a request to execute the Ansible script or playbook to perform an automation task. The request initiated by the user includes command line input, automation script, and playbook; Step 2. The Ansible core program calls the Host Inventory program to read the host hosts file. After parsing the host hosts file, Ansible obtains the IP address, host name, and password of each target host. Ansible uses this information to determine the server or device that needs to be operated; Step 3. Obtain the operation execution content through local scripts Playbooks, where the local scripts are used to define the automated task sequence that needs to be executed on the target host. Each local script Playbook includes one or more Plays, and each Play specifies a group of hosts and the tasks to be executed on these hosts; Step 4. Call the core modules Core Modules and custom modules Custom Modules to perform operations. The core modules Core Modules provide support for file management, service management, and software package installation tasks; the custom modules CustomModules are used by users to extend the functions of Ansible and call the corresponding modules to perform operations according to the tasks defined in the Playbook; Step 5. Use the SSH protocol to connect to the OpenStack server through the Connection Plugins connection plug-in to perform operations. After the task instructions are generated, Ansible establishes a connection with the target host through the Connection Plugins. Among them, SSH protocols include: Single process model: Mitogen manages and maintains a long-running SSH connection and a Python interpreter to perform tasks on the target machine; the implementation process is:

1. Create and maintain long-term SSH connections; (1) Establishing an SSH connection: Mitogen first establishes an SSH connection with the target cloud server; (2) Connection reuse: By reusing existing SSH connections, Mitogen reduces the time and resources required to establish new connections; 2. Start the Python interpreter of the target cloud service: Start the sub-interpreter. Once connected to the target cloud server via SSH, Mitogen will start a lightweight Python sub-interpreter; the sub-interpreter runs on the target cloud server and acts as a host environment for executing remote commands and scripts; 3. Resource optimization: The sub-interpreter is specially designed to minimize resource usage and provide functions to complete the call to the cloud server; 4. Task execution; (1) Code transmission and execution: Mitogen serializes the commands issued by the Ansible management host and sends them to the sub-interpreter of the target cloud server through an SSH connection. The Python sub-interpreter of the target cloud server deserializes the commands, receives them and executes them. Deserialization is the reverse process of serialization, which restores the serialized format to the original data structure. (2) Data transmission: The execution results or standard output will be serialized and transmitted back to Ansible through the established SSH connection; Mitogen can execute tasks on the target cloud server in an efficient and resource-optimized manner, improving the efficiency of remote command execution; Function proxy: Mitogen uses a centralized Python process to proxy and execute all subsequent tasks, without the need for repeated initialization and settings; implementation process: (1) Initialize the central controller: First, Mitogen starts a central controller process on the Ansible management server. This process is responsible for managing all communications and task dispatching. The controller becomes the agent for all subsequent tasks, allowing operations to be performed from a single entry point without initializing a new environment each time a task is executed. (2) Establish a secure connection: The central controller connects to the target cloud server via SSH. The connection is encrypted, ensuring the security of data transmission. (3) Channel reuse: Establish a connection with the target cloud server. Mitogen starts a child Python process on the target cloud server. The child process communicates with the central controller through a data stream channel. The central controller on the Ansible management service serializes the code and commands and transmits them to the child process. All subsequent tasks reuse the channel. (4) Task execution: The central controller sends task instructions to the target cloud server through the established channel. The subprocess on the target host receives these instructions, deserializes them, and executes them locally. The execution results are serialized again and returned to the central controller through the same secure channel. (5) Maintaining persistent sessions; Mitogen is designed to keep channels open during multi-tasking, thereby reducing the overhead of establishing and tearing down each task execution; (6) Result processing and error management: The execution results are sent back to the central controller, which is responsible for processing the above results, including successful output and error information, and the central controller records this information; Mitogen manages the execution of all subsequent tasks through a centralized process, and improves the efficiency and response speed of remote task execution by establishing persistent connections and resource reuse.

6. A system for realizing OpenStack cloud computing automated operation and maintenance, characterized in that: Implementing the method for realizing OpenStack cloud computing automated operation and maintenance as described in any one of claims 1 to 5, the system comprises: The core program Ansible Core unit is responsible for task execution, module scheduling and result aggregation; The Host Inventory unit is used to identify all hosts managed by Ansible automation; Playbooks are units used to write command sequences that configure policies or series; Core Modules, including: 'command' to execute command line commands, 'shell' to execute shell commands on the remote system, 'copy' to copy files from the local to the remote target host, 'user' to manage users, including creating, deleting and modifying user attributes; Custom Modules are used by users to create custom functions for specific environments or non-standard requirements when the core modules cannot meet special needs; Plugins are used to provide different functions for various task requirements; OpenStack cloud platform is an open source cloud computing management platform used for large-scale deployment of virtual servers and cloud services and for managing computing, storage and network resources.

7. The system for realizing OpenStack cloud computing automated operation and maintenance according to claim 6, characterized in that: The core program Ansible Core unit also provides: task execution and control functions. Ansible Core is responsible for parsing Playbooks and executing the tasks defined therein in sequence; The module calling function calls the built-in core modules or custom modules as needed when executing tasks.

8. The system for realizing OpenStack cloud computing automated operation and maintenance according to claim 6, characterized in that: The Host Inventory unit is a static file that lists hosts and their related variables, or a dynamic script that dynamically generates a host list from a cloud service or management tool; The Playbooks unit contains one or more Plays, each Play corresponds to a group of hosts performing a series of tasks; The plug-ins include connection plug-ins, which are responsible for establishing and managing connections with remote devices; Filter plugin Filter, a tool for data transformation in Ansible, is used to modify or filter the contents of these variables; Lookup plugin, used to retrieve data in Ansible playbook, allowing information to be dynamically pulled from external data sources or local data files when executing tasks; The callback plugin Callback, in Ansible, is used to hook into the execution process of Ansible and respond to events at different execution stages.

9. The system for realizing OpenStack cloud computing automated operation and maintenance according to claim 6, characterized in that: The OpenStack cloud computing platform includes a management server, a computing server and a storage server; The management server is responsible for handling authentication, scheduling, and management of network and storage services; The computing server is used to provide computing resources, run virtual machine instances, and manage the life cycle of virtual machine instances, including start, pause, and terminate operations; Specifically, managing virtual machine instances includes: creating virtual machines, receiving instructions from the computing scheduling service of the management node, creating virtual machine instances using the underlying KVM virtualization technology, and reporting virtual machine information status information after the creation is completed; virtual machine creation process: parsing the XML description file in the virtual machine creation request, calling the neutron component to create the virtual machine's network card and allocate IP, calling the cinder component to create the virtual machine's disk, starting the virtual machine installation process through the virsh tool, calling glance to inject the image into the virtual machine disk; calling KVM virtualization through the Libvirt library to allocate CPU and memory and pull up the virtual machine. The virtual machine status is running, and the virtual machine status is reported to the management node through the nova-compute service; Virtual machine query, which is used to provide the status and information of all virtual machines on the current computing node; Pause and resume, used to support pausing a running virtual machine and resuming it from a paused state to a running state; Start and stop, metaphorically controlling the startup and shutdown operations of the virtual machine; The storage server is used for data storage and management, and provides persistent block storage for virtual machines.

10. The system for realizing OpenStack cloud computing automated operation and maintenance according to claim 6, characterized in that: The system for realizing the automated operation and maintenance of OpenStack cloud computing is mounted on a computer-readable storage medium, and the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the functions of the system for realizing the automated operation and maintenance of OpenStack cloud computing are realized.

Citation Information

Patent Citations

  • Operation and maintenance automation system and method

    CN105323111A

  • Method for arranging and deploying Weblogic application based on Ansible

    CN110795108A

  • Method for lightweight deployment of distributed system in private cloud environment

    CN112181592A

  • Cloud platform computing node abnormity automatic processing system

    CN114257495A

  • Operation and maintenance method and system of cloud platform and computer storage medium

    CN115438813A

Cited By

  • Virtual machine information synchronization method, apparatus and device, and storage medium

    CN119066130A