Method, system, device and storage medium for OpenStack load balancing service adaptation
By adding interface settings and distribution configuration files to the Octavia source code, the problem that the load balancing service cannot be started under the arm architecture is solved, and the normal operation and access traffic distribution of the OpenStack load balancing service are realized.
Patent Information
- Application Number
- CN202210766656.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-01
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-07-01
AI Technical Summary
Under the arm architecture, OpenStack's Octavia load balancing service cannot distribute configuration files, causing the load balancing business virtual machine amphora-agent service to fail to start, and SSL and HTTPS communication between Octavia and the load balancing server unable to be realized.
Add interface settings to the Octavia source code, generate and distribute configuration files, including creating private keys, ca certificates and amphora-agent configuration files, transfer files to the load balancing server through the secure shell protocol, and start load balancing by starting the amphora-agent interface Business client service that establishes SSL and HTTPS communication between Octavia and the load balancing server.
The normal operation of the OpenStack load balancing service is realized under the arm architecture, ensuring that access traffic can be correctly distributed to cloud resources and ensuring the normal delivery and return of requests.
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of load balancing, and in particular to a method, system, device and storage medium for OpenStack adaptation of load balancing services. Background Art
[0002] The current open source OpenStack load balancing service is through the loadbalance service lbaas in Neutron, which can distribute the access traffic from the public network or internal network to the cloud hosts in the cloud resources. The number of backend cloud hosts can be added or reduced at any time without affecting the business. Octavia currently exists as a driver of lbaasV2, which is fully compatible with the interface of lbaasV2. The final development trend will be to replace lbaasV2 as an independent project. However, under the arm architecture, octavia does not support the distribution of some configuration files. The private key, certificate and amphora configuration file are passed to the virtual machine through cloud-init, but under the arm architecture, the file cannot be passed to the amphora virtual machine through cloud-init, which makes the load balancing business virtual amphora-agent service unable to start. Summary of the invention
[0003] The technical problem to be solved by the present invention is to overcome the deficiencies of the prior art and provide a method, system, device and storage medium for OpenStack adaptation load balancing service.
[0004] The technical solution adopted by the present invention to solve the technical problem is: a method for OpenStack to adapt load balancing service, comprising the following steps:
[0005] S1: Set up the interface in the octavia source code;
[0006] S2: Generate configuration file;
[0007] S3: distributes the configuration files to the load balancing server;
[0008] S4: SSL and HTTPS communication is established between Octavia and the load balancing server.
[0009] The step S1 includes the following sub-steps:
[0010] S1-1: Interface addition: including adding interfaces such as creating files, copying files, and starting amphora-agent services;
[0011] S1-2: Interface modification: Create interfaces such as virtual machine and amphora api base class.
[0012] In the step S2, a private key, a CA certificate and an amphora-agent configuration file are created using a file creation interface.
[0013] In step S3, the generated private key, ca certificate file and amphora-agent configuration file are distributed to the load balancing server by means of a secure shell protocol through a copy file interface.
[0014] In step S4, the load balancing business client service is started by starting the amphora-agent interface, so that SSL and HTTPS communications are established between Octavia and the load balancing server.
[0015] A system for OpenStack adaptation load balancing service, comprising an interface module, wherein the interface module is connected to a control module, and the control module is connected to a load balancing server via a communication module;
[0016] The interface module is used to add or modify interfaces;
[0017] The control module is used to control the interface to generate relevant private keys, ca certificate files and amphora-agent configurations, and distribute the corresponding files to the load balancing server;
[0018] The communication module is used for connection and communication between modules.
[0019] A device for OpenStack adaptation load balancing service, comprising:
[0020] at least one processor; and
[0021] a memory communicatively coupled to the at least one processor;
[0022] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the device for adapting the OpenStack load balancing service to execute the above-mentioned method for adapting the OpenStack load balancing service.
[0023] A storage medium for an OpenStack-adapted load balancing service, wherein a computer program is stored on the storage medium for the OpenStack-adapted load balancing service, and when the computer program is executed by a processor, the method for implementing the OpenStack-adapted load balancing service is implemented.
[0024] Compared with the prior art, the present invention has the following beneficial effects:
[0025] The present invention provides a method, system, device and storage medium for OpenStack to adapt load balancing service. The open source OpenStack implements load balancing service under the arm architecture. When a large number of requests are initiated, the access traffic from the public network or internal network is distributed to the cloud host in the cloud resources to ensure that all requests can be issued and returned normally. DETAILED DESCRIPTION
[0026] The embodiments of the present invention are further described below:
[0027] Example 1
[0028] OpenStack Octavia is an open source carrier-grade load balancing solution designed to work with OpenStack. Octavia has become the reference implementation of cloud computing network service load balancing version 2; OpenStack Octavia transfers files to virtual machines through cloud-init, but cloud-init cannot be used to send CA certificate files and amphora configuration files to the amphora virtual machine under the arm architecture. You can only add an interface in the Octavia source code and transfer files to the amphora virtual machine through the secure shell protocol.
[0029] Octavia's software architecture design is still the common "producer-consumer" model, with external interfaces separated from consumers and communicating through message queues. The relevant terms are explained as follows:
[0030] Octavia API: Standard RESTful API (an architectural style of application program interface that uses HTTP requests to access or use data. This data can be used for resource-related operations such as reading, updating, creating, and deleting). The second version of Octavia's external interface is a superset of the load balancing version 2 external interface and is fully backward compatible. Therefore, operating system platforms with outdated versions can also be integrated through the cloud computing network service octavia driver.
[0031] Octavia console consumer: The core of Octavia, the underlying driver and plug-in approach represents the openness of the operating system platform and supports the three components implemented in the upper layer.
[0032] Octavia Consumer: Responsible for completing external interface requests and is the executor of Octavia backbone functions.
[0033] Health Manager: Responsible for ensuring high availability of the load balancer.
[0034] Housekeeping Manager: A true housekeeping service, ensuring the healthy operation of Octavia.
[0035] amcphora: the image name of the Octavia service virtual machine;
[0036] The ARM architecture, formerly known as Advanced Reduced Instruction Set Machine, is a 32-bit Reduced Instruction Set Computer (RISC) processor architecture.
[0037] The method for OpenStack to adapt the load balancing service includes the following steps:
[0038] S1: Set up the interface in the OpenStack octavia source code; step S1 includes the following sub-steps:
[0039] S1-1: Interface addition: including adding interfaces such as creating files, copying files, and starting amphora-agent services;
[0040] Because the original interface cannot meet the requirements of establishing secure socket protocol and hypertext transfer protocol communication between the Octavia server and the business virtual machine, it is necessary to pass the configuration file (the configuration file mainly configures the address, port number, public key and private key path of the business virtual machine) to the business virtual machine through the newly added creation and copy interface, and then start the business virtual machine proxy service through the service startup interface, so as to achieve the purpose of communication between the Octavia server business and the virtual machine. In addition, the interface for creating a business virtual machine is also necessary. All basic operations are based on the creation of a business virtual machine.
[0041] S1-2: Interface modification: Create virtual machines and amphora api basic class interfaces. When creating a virtual machine, a ca certificate file and a business virtual machine proxy configuration file will be generated. These contents are written into the file by modifying the virtual machine creation interface, and then these files are written into the business virtual machine by modifying the external basic class interface.
[0042] S2: Generate a configuration file; in step S2, a private key, a CA certificate and an amphora-agent configuration file are created using a create file interface.
[0043] S3: Distribute the configuration file to the load balancing server; in step S3, the generated private key, ca certificate file and amphora-agent configuration file are distributed to the load balancing server in a secure shell protocol through the copy file interface.
[0044] S4: Secure Sockets Protocol and Hypertext Transfer Protocol communication is established between Octavia and the load balancing server. In step S4, the load balancing service client service is started by starting the amphora-agent interface, so that Octavia and the load balancing server can establish SSL and HTTPS communication.
[0045] Usually when creating a load balancer, a business virtual machine based on the amcphora image will be generated. The business virtual machine, as the carrier of load balancing, carries the communication between the agent and the load balancing server. However, in the arm architecture, the business virtual machine and the load balancing server cannot start the communication service due to the lack of configuration files. Therefore, we added the scp_files.py file in the \octavia\octavia\controller\consumer\v1\tasks path to create and copy the configuration file interface. At the same time, we also modified the ComputeCreate base class in the compute_task.py file in the \octavia\octavia\controller\consumer\v1\tasks path and the AmphoraAPIClientBase class in the rest_api_driver.py file in the octavia\amphorae\drivers\haproxy path to start the communication service, thereby realizing the communication between the load balancer server and the business end.
[0046] Example 2
[0047] An OpenStack load balancing service adaptation system applied to Example 1 includes an interface module, the interface module is connected to a control module, and the control module is connected to a load balancing server through a communication module;
[0048] The interface module is used to add or modify interfaces;
[0049] The control module is used to control the interface to generate relevant private keys, ca certificate files and amphora-agent configurations, and distribute the corresponding files to the load balancing server;
[0050] The communication module is used for connection and communication between modules.
[0051] Example 3
[0052] An OpenStack load balancing service adaptation device applied to Embodiment 1 and Embodiment 2 includes:
[0053] at least one processor; and
[0054] a memory communicatively coupled to the at least one processor;
[0055] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the device for adapting the OpenStack load balancing service to execute the method for adapting the OpenStack load balancing service of embodiment 1.
[0056] Example 4
[0057] A storage medium for an OpenStack-adapted load balancing service, wherein a computer program is stored on the storage medium, and when the computer program is executed by a processor, the method for an OpenStack-adapted load balancing service of embodiment 1 is implemented.
[0058] By adding some interfaces in the source code of Octavia, including interfaces such as creating files, copying files and starting amphora-agent services, and modifying some original interfaces, including interfaces such as creating virtual machines and amphora API basic classes, using the create file interface to create private keys, CA certificates and amphora-agent configuration files, and then using the copy file interface to distribute the generated private keys, CA certificate files and amphora-agent configuration files to the load balancing business virtual machine in the secure shell protocol, and finally starting the load balancing business client service by starting the amphora-agent interface, Octavia and the load balancing business virtual machine can establish SSL and HTTPS communication. The present invention will make a general implementation of load balancing services based on Xinchuang Cloud for the open source OpenStack under the arm architecture.
Claims
1. A method for OpenStack to adapt load balancing service, characterized in that: The following steps are involved: S1: Set up interfaces in the OpenStack octavia source code; step S1 includes the following sub-steps: S1-1: Interface addition: including creating files, copying files and starting the addition of amphora-agent service interface; S1-2: Interface modification: create virtual machine and amphora api basic class interface; S2: Generate configuration file; S3: Distribute the configuration file to the load balancing server; in step S3, the generated private key, ca certificate file and amphora-agent configuration file are distributed to the load balancing server by using the secure shell protocol through the copy file interface; S4: Secure socket protocol and hypertext transfer protocol communications are established between Octavia and the load balancing server.
2. The method for OpenStack load balancing service adaptation according to claim 1, characterized in that: In the step S2, a private key, a CA certificate and an amphora-agent configuration file are created using a file creation interface.
3. The method for OpenStack load balancing service adaptation according to claim 2, characterized in that: In step S4, the load balancing business client service is started by starting the amphora-agent interface, so that SSL and HTTPS communications are established between Octavia and the load balancing server.
4. A system for OpenStack adaptation load balancing service, characterized in that: It includes an interface module, the interface module is connected to a control module, and the control module is connected to a load balancing server via a communication module; The interface module is used to add or modify interfaces; Interface addition: including creating files, copying files and starting the amphora-agent service interface; Interface modification: create virtual machine and amphora api base class interface; The control module is used to control the interface to generate relevant private keys, CA certificate files and amphora-agent configurations, distribute the corresponding files to the load balancing server, and distribute the generated private keys, CA certificate files and amphora-agent configuration files to the load balancing server in a secure shell protocol through the copy file interface; The communication module is used for connection and communication between modules.
5. A device for OpenStack adaptation load balancing service, characterized in that: include: at least one processor; as well as a memory communicatively coupled to the at least one processor; The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the device for adapting the OpenStack load balancing service can execute the method for adapting the OpenStack load balancing service according to any one of claims 1 to 3.
6. A storage medium for OpenStack-adapted load balancing service, characterized in that: A computer program is stored on a storage medium of the OpenStack adapted load balancing service. When the computer program is executed by a processor, the method for the OpenStack adapted load balancing service according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Dynamic load balancing method and system based on tenant sensing
CN103957246A
Method and system for double-factor bidirectional authentication
CN104486343A
Visual load balancing deployment method and system based on service resource management
CN108234208A
Shared load balancing implementation method based on nginx
CN110266822A
Soft load balance dynamic issuing configuration method and system
CN112099915A
