Communication method and device for paas component management end and virtual machine agent
By creating multiple host ports and virtual network cards in the OpenStack environment, dynamically obtaining IP addresses, and using keepalived to create virtual IPs, Layer 2 communication between the PaaS component management terminal and the virtual machine agent is achieved, solving the communication limitation problem and improving adaptability and reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG INSPUR SCI RES INST CO LTD
- Filing Date
- 2022-06-29
- Publication Date
- 2026-07-07
AI Technical Summary
Communication between the PaaS component management terminal and the virtual machine agent is limited by the external network configuration and the user's Layer 3 network selection, making it impossible to flexibly choose the upper-layer network, especially when the business network card and the management network card are located on different switches and cannot communicate with each other.
By creating multiple host ports in the private network corresponding to the PaaS component, and using Open vSwitch to build a virtual network card on the br-int bridge of the control node to dynamically obtain IP addresses, and using keepalived to create virtual IPs, Layer 2 communication between the PaaS component management terminal and the virtual machine agent is realized.
It breaks through the dependence on the planning of external networks for virtual machines and physical machine networks, improves the adaptability of PaaS components to different physical network architectures, and achieves high availability and high reliability communication.
Smart Images

Figure CN115185637B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud computing technology, and in particular to a communication method and apparatus between a PaaS component management terminal and a virtual machine agent. Background Technology
[0002] With the development of cloud computing technology, cloud service methods have evolved from basic IaaS layer virtualization to various PaaS and SaaS services.
[0003] PaaS services require further software encapsulation within the IaaS layer virtual machine, providing users with a directly usable software product, thus eliminating the need for user deployment and maintenance. The management interface of the PaaS component needs to manage and maintain the state of the software within the virtual machine, necessitating network communication between the management interface and the virtual machine. Since the virtual machine resides within a private network, this requires connecting the private network to a specific external network. Communication between the virtual machine and the PaaS component management interface on the management node must then occur via a Layer 3 switch after exiting from the business network interface card (NIC). This approach is highly limiting and lacks flexibility in selecting the upper-layer network. Furthermore, in some network environments, the business NIC and management NIC are located on different switches, preventing interoperability. Summary of the Invention
[0004] To address the aforementioned problems in the existing technology, this application provides a communication method and apparatus between a PaaS component management terminal and a virtual machine agent.
[0005] In a first aspect, the present invention provides a communication method between a PaaS component management terminal and a virtual machine agent, comprising:
[0006] In the private network corresponding to the PaaS component, multiple host ports are created, and the number of host ports is the same as the number of control nodes.
[0007] Virtual network interface cards (NICs) are constructed using Open vSwitch on the br-int bridge at each control node, and the information of the virtual NICs is associated with the information of the corresponding host ports.
[0008] The IP address corresponding to the virtual network card is dynamically obtained from the DHCP service provided by neutron.
[0009] A virtual IP is created based on keepalived, which is used as a proxy within the virtual machine to respond to communication requests from the PaaS component management end.
[0010] Optionally, the method further includes:
[0011] When constructing the virtual network interface card (NIC), the information of the virtual NIC is specified, including the NIC type, status, port ID, MAC address, and MTU value.
[0012] Optionally, the port ID, MAC address, and MTU value of the virtual network card are the same as the port ID, MAC address, and MTU value of the corresponding host port.
[0013] Optionally, the virtual network card is of type Internal and the virtual network card is in state Active.
[0014] Optionally, dynamically obtaining the IP address corresponding to the virtual network card from the DHCP service provided by Neutron includes:
[0015] The IP address corresponding to the virtual network card can be dynamically obtained from the DHCP service provided by Neutron using the dhclient command.
[0016] Optionally, the method further includes:
[0017] Adjust the listening port of the management service that the PaaS component depends on to listen across the entire network segment.
[0018] Secondly, this application also provides a communication device between a PaaS component management terminal and a virtual machine agent, comprising:
[0019] The host port creation module is used to create multiple host ports in the private network corresponding to the PaaS component. The number of host ports is the same as the number of control nodes.
[0020] A virtual network interface card (NIC) construction module is used to construct virtual NICs on the br-int bridge of each control node using Open vSwitch. The information of the virtual NIC is associated with the information of the corresponding host port.
[0021] The IP address acquisition module is used to dynamically obtain the IP address corresponding to the virtual network card from the DHCP service provided by neutron.
[0022] The virtual IP creation module is used to create virtual IPs for a private network plane based on keepalived. These virtual IPs are used as agents within the virtual machine to respond to communication requests from the PaaS component management end.
[0023] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a communication method between any of the PaaS component management terminals and virtual machine agents as described in the first aspect above.
[0024] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a communication method between any of the PaaS component management terminals and virtual machine agents as described in the first aspect above.
[0025] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a communication method between any of the PaaS component management terminals and virtual machine agents as described in the first aspect above.
[0026] The communication method and apparatus between the PaaS component management terminal and the virtual machine agent provided by this invention utilizes OpenvSwich technology to realize Layer 2 communication between the OpenStack PaaS component management terminal and the virtual machine agent, breaking through the dependence of PaaS components on the external network of virtual machines and the physical machine network planning, and improving the adaptability of PaaS components to different physical network architectures. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0028] Figure 1 This is a flowchart illustrating the communication method between the PaaS component management terminal and the virtual machine agent provided in this embodiment of the application.
[0029] Figure 2 This is a schematic diagram of the communication device between the PaaS component management terminal and the virtual machine agent provided in the embodiments of this application;
[0030] Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0031] To better describe the technical solutions in the embodiments of this application, relevant knowledge is introduced below.
[0032] (1) Cloud computing
[0033] Based on the type of services provided, cloud computing can be categorized into the following three implementation methods:
[0034] ①IaaS: Infrastructure as a Service, from which users can request hardware or virtual hardware, including bare metal and virtual machines, and then install operating systems or other applications on them.
[0035] ②PaaS: Platform as a Service. Users can directly apply for and use software from PaaS services. For software obtained through PaaS services, users do not have permission to log in to the underlying virtual machine, nor can they perceive the underlying virtual machine. PaaS services are needed to maintain the software status.
[0036] ③SaaS: Software as a Service. Users can use software online on a rental basis instead of purchasing it. The common model is to provide a set of account and password. The difference between SaaS and PaaS is that PaaS software is for developers and is part of the overall application (APP) architecture, while SaaS software is the entire APP software for users.
[0037] (2) OpenStack
[0038] OpenStack currently comprises seven core components: Compute, Object Storage, Identity, Dashboard, Block Storage, Network, and Image Service. Each component is a collection of services, and a service represents a running process.
[0039] Compute (Nova): The code name for Compute is Nova. It provides virtual machine services based on demand, such as creating virtual machines or performing hot migration of virtual machines.
[0040] Object Storage (Swift): It allows storing or retrieving objects, or you can think of it as allowing storing or retrieving files. It can manage large amounts of unstructured data in a low-cost way.
[0041] Identity (Keystone): Provides authentication and authorization for all OpenStack services, tracks users and their permissions, and provides a list of available services and application programming interfaces (APIs).
[0042] Dash Board (Horizon): It provides a modular Django-based interface for all OpenStack services. Through this interface, both end users and operations personnel can perform most operations, such as starting virtual machines, assigning Internet Protocol (IP) addresses, and dynamic migration.
[0043] Block Storage (Cinder): Provides block storage services.
[0044] Network (Neutron): Used to provide network connectivity services, allowing users to create their own virtual networks and connect to various network device interfaces.
[0045] Image Service (Glance): Provides a storage, query, and retrieval service for virtual machine images. It provides image services for Nova virtual machines by providing a directory and repository of virtual disk images.
[0046] Nova, Neutron, and Cinder are responsible for computing, networking, and storage, respectively.
[0047] The management console of a PaaS component needs to manage and maintain the state of the software inside the virtual machine, thus requiring communication between the management console and the virtual machine over a network. Since the virtual machine resides within a private network, this requires connecting the private network to a specific external network. The communication then goes through a Layer 3 switch from the business network card to the PaaS component management console on the management node. This approach is quite limiting and doesn't allow for flexible selection of the upper-layer network.
[0048] In some network planning environments, service network cards and management network cards are located on different switches, making interoperability impossible. To address the issue that communication between the PaaS component management terminal and the virtual machine agent requires cross-layer 3 communication, which restricts the component network to external network configuration and user layer 3 network selection, this application provides a communication method and apparatus between the PaaS component management terminal and the virtual machine agent. This method establishes communication between the OpenStack private network and management node services on a layer 2 network, eliminating the restriction to external network configuration and user layer 3 network selection, and providing high availability and high reliability.
[0049] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0050] The communication method and apparatus between the PaaS component management terminal and the virtual machine agent provided in this application are applicable to scenarios where the PaaS component management terminal and the virtual machine have communication requirements. The supported PaaS services include, but are not limited to, database service DBaaS (Trove component) and load balancing service LBaaS (Octavia component).
[0051] Figure 1 This is a flowchart illustrating the communication method between the PaaS component management terminal and the virtual machine agent provided in this application embodiment, as shown below. Figure 1 As shown, the method includes at least the following steps:
[0052] Step 101: Create multiple host ports in the private network corresponding to the PaaS component. The number of host ports is the same as the number of control nodes.
[0053] Specifically, multiple host ports are created in the private network corresponding to the PaaS component. The number of host ports is the same as the number of control nodes to ensure that each control node has the ability to communicate, thus ensuring the high availability and high reliability of the communication method between the PaaS component management terminal and the virtual machine agent.
[0054] Optionally, the network modes of the private network corresponding to the OpenStack PaaS component include, but are not limited to: Virtual Local Area Network (VLAN), Virtual eXtensible Local Area Network (VXLAN), Flat, and GRE.
[0055] Step 102: Use Open vSwitch to build virtual network interfaces on the br-int bridge of each control node, and associate the information of the virtual network interface with the information of the corresponding host port.
[0056] Specifically, Open vSwitch is similar to Linux bridge. It can abstract the Layer 2 network and provide distributed switching functionality for virtual networks. Multiple vSwitch running on various or identical virtualization platforms in the cloud environment implement a distributed architecture of virtual switches.
[0057] Virtual network interface cards (NICs) are built on the br-int bridges of each control node using Open vSwitch. The number of virtual NICs, control nodes, and host ports are all the same to improve communication availability and flexibility. The information of the virtual NICs is associated with the information of the corresponding host ports. This information may include port identifiers, media access control addresses, etc. The association between the two information means that their information has the same content.
[0058] When OpenStack uses Open vSwitch as a network plugin, it enables communication between the OpenStack private network and the host in the Layer 2 network plane.
[0059] Step 103: Dynamically obtain the IP address corresponding to the virtual network card from the DHCP service provided by neutron.
[0060] Specifically, the IP address corresponding to the virtual network card is dynamically obtained from the Dynamic Host Configuration Protocol (DHCP) service provided by neutron.
[0061] During startup, OpenStack instances can automatically obtain the IP address corresponding to the virtual network adapter from the DHCP service provided by Neutron. OpenStack virtual machine instances can be assigned two types of addresses: one is a private IP address, which can be viewed using the `ip a` command; the other is a floating IP address, which is a service provided by the Neutron component and does not require DHCP service, but can be statically set directly on the client side.
[0062] The main components of DHCP include:
[0063] DHCP Agent (neutron-dhcp-agent): Provides DHCP functionality for the project network and offers metadata request services.
[0064] DHCP driver: Used to manage DHCP servers. The default is DNSmasq, which is an open-source software that provides DHCP and DNS services, including DNS caching and DHCP service functionality.
[0065] DHCP Agent Scheduler: Responsible for scheduling DHCP agents and networks.
[0066] Step 104: Create a virtual IP for a private network plane based on keepalived. The virtual IP is used as a proxy inside the virtual machine to respond to communication requests from the PaaS component management end.
[0067] Specifically, keepalived is used to create a virtual IP (Virtual Internet Protocol, VIP) on the host, which is used to create a private network plane VIP for the PaaS component. The VIP is used to enable communication between the virtual machine's internal agent and the PaaS component management terminal.
[0068] The virtual machine agent accesses host management services through the VIP, such as responding to Remote Procedure Call (RPC) requests from the PaaS component management end. The management service can directly access the virtual machine IP.
[0069] The communication method between the PaaS component management terminal and the virtual machine agent provided in this application embodiment utilizes OpenvSwich technology to realize Layer 2 communication between the OpenStack PaaS component management terminal and the virtual machine agent, breaking the dependence of PaaS components on the external network of virtual machines and the physical machine network planning, and improving the adaptability of PaaS components to different physical network architectures.
[0070] Optionally, the method further includes:
[0071] When constructing the virtual network interface card (NIC), the information of the virtual NIC is specified, including the NIC type, status, port ID, MAC address, and MTU value.
[0072] Specifically, in step 102, when constructing a virtual network interface card (NIC) using Open vSwitch on the br-int bridge of each control node, it is necessary to specify information such as the NIC type, status, port identifier (Identity Document, ID), Media Access Control Address (MAC) address, and Maximum Transmission Unit (MTU) value of the virtual NIC.
[0073] Optionally, the port ID, MAC address, and MTU value of the virtual network card are the same as the port ID, MAC address, and MTU value of the corresponding host port.
[0074] Specifically, in step 102: when constructing a virtual network interface card (NIC) using Open vSwitch on the br-int bridge of each control node, the port ID, MAC address, and MTU value of the virtual NIC are specified to be the same as the port ID, MAC address, and MTU value of the corresponding host port.
[0075] Optionally, the virtual network card is of type Internal and the virtual network card is in state Active.
[0076] Specifically, in step 102: when constructing a virtual network interface card (NIC) using Open vSwitch on the br-int bridge of each control node, the NIC type of the virtual NIC is Internal and the status is Active.
[0077] Optionally, dynamically obtaining the IP address corresponding to the virtual network card from the DHCP service provided by Neutron includes:
[0078] The IP address corresponding to the virtual network card can be dynamically obtained from the DHCP service provided by Neutron using the dhclient command.
[0079] Specifically, the IP address corresponding to the virtual network card is obtained dynamically via dhclient.
[0080] The `dhclient` command is used to dynamically acquire or release IP addresses. Before using the `dhclient` command, you should set your network card mode to DHCP automatic acquisition; otherwise, a statically typed network card will not actively obtain network card information such as IP addresses from the server.
[0081] Optionally, the method further includes:
[0082] Adjust the listening port of the management service that the PaaS component depends on to listen across the entire network segment.
[0083] Specifically, before creating multiple host ports in the private network corresponding to the PaaS component in step 101, the listening port of the management service that the PaaS component depends on can be adjusted to listen on the entire network, ensuring that all network planes of the control node can access the corresponding service.
[0084] Optionally, after adjusting the listening port of the management service that the PaaS component depends on to listen across the entire network segment, and before creating multiple host ports in the private network corresponding to the PaaS component, you can also create a security group within OpenStack and restrict security policies to enhance communication security.
[0085] The technical solution provided in this application will be illustrated below with a specific example.
[0086] This application provides a communication method between a PaaS component management terminal and a virtual machine agent, the method including:
[0087] Step 1: Adjust the listening port of the management service that the PaaS component depends on to listen across the entire network segment, ensuring that the service can be accessed by all network planes of the control node.
[0088] Step 2: Create a security group within OpenStack and restrict security policies.
[0089] Step 3: Create multiple host ports within the private network corresponding to the PaaS component. The number of host ports should be equal to the number of control nodes. Use the security group created in Step 2 for each host port, and allow the same VIP address on each host port to pass through normally, ensuring that network packets from the VIP address can pass through the host port normally.
[0090] Step 4: View the following information about the host port created in Step 3: Port ID, MAC address, and MTU value.
[0091] Step 5: Create virtual network interface cards (NICs) on the br-int bridges of each control node. The NIC type is internal, the status is active, and the Port ID, MAC address, and MTU value use the host port information obtained in Step 4.
[0092] Step 6: Set the link test port on the control node. The MAC address is the same as the MAC address of the host port in Step 5.
[0093] Step 7: Use the dhclient command to obtain the IP information corresponding to the network card of the current node from the neutron dhcp agent.
[0094] Step 8: After configuring the ports on all control nodes, use keepalived to start the VIP to resolve the single point of failure issue.
[0095] Step 9: The virtual machine agent of the PaaS component can then communicate with the management service through the VIP.
[0096] The communication method between the PaaS component management terminal and the virtual machine agent provided in this application embodiment utilizes OpenvSwich technology to realize Layer 2 communication between the OpenStack PaaS component management terminal and the virtual machine agent, breaking the dependence of PaaS components on the external network of virtual machines and the physical machine network planning, and improving the adaptability of PaaS components to different physical network architectures.
[0097] The communication device between the PaaS component management terminal and the virtual machine agent provided by the present invention will be described below. The communication device between the PaaS component management terminal and the virtual machine agent described below can be referred to in correspondence with the communication method between the PaaS component management terminal and the virtual machine agent described above.
[0098] Figure 2 This is a schematic diagram of the communication device between the PaaS component management terminal and the virtual machine agent provided in the embodiments of this application, as shown below. Figure 2 As shown, the device includes at least:
[0099] The host port creation module 201 is used to create multiple host ports in the private network corresponding to the PaaS component, wherein the number of host ports is the same as the number of control nodes;
[0100] The virtual network interface card (NIC) construction module 202 is used to construct virtual NICs on the br-int bridge of each control node using Open vSwitch, and the information of the virtual NIC is associated with the information of the corresponding host port.
[0101] IP address acquisition module 203 is used to dynamically obtain the IP address corresponding to the virtual network card from the DHCP service provided by neutron;
[0102] The virtual IP creation module 204 is used to create a virtual IP for a private network plane based on keepalived. The virtual IP is used as a proxy inside the virtual machine to respond to communication requests from the PaaS component management terminal.
[0103] Optionally, the device further includes:
[0104] The information specification module is used to specify the information of the virtual network interface card (NIC) when constructing the virtual NIC, including NIC type, status, port ID, MAC address and MTU value.
[0105] Optionally, the port ID, MAC address, and MTU value of the virtual network card are the same as the port ID, MAC address, and MTU value of the corresponding host port.
[0106] Optionally, the virtual network card is of type Internal and the virtual network card is in state Active.
[0107] Optionally, the IP address acquisition module is further configured to:
[0108] The IP address corresponding to the virtual network card can be dynamically obtained from the DHCP service provided by Neutron using the dhclient command.
[0109] Optionally, the device further includes:
[0110] The monitoring adjustment module is used to adjust the monitoring port of the management service on which the PaaS component depends to monitor the entire network segment.
[0111] Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 3 As shown, the electronic device may include: a processor 301, a communication interface 302, a memory 303, and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304.
[0112] Furthermore, the logical instructions in the aforementioned memory 303 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0113] Processor 301 can invoke logical instructions in memory 303 to execute a communication method between the PaaS component management terminal and the virtual machine agent, the method including:
[0114] In the private network corresponding to the PaaS component, multiple host ports are created, and the number of host ports is the same as the number of control nodes.
[0115] Virtual network interface cards (NICs) are constructed using Open vSwitch on the br-int bridge at each control node, and the information of the virtual NICs is associated with the information of the corresponding host ports.
[0116] The IP address corresponding to the virtual network card is dynamically obtained from the DHCP service provided by neutron.
[0117] A virtual IP is created based on keepalived, which is used as a proxy within the virtual machine to respond to communication requests from the PaaS component management end.
[0118] Optionally, the method further includes:
[0119] When constructing the virtual network interface card (NIC), the information of the virtual NIC is specified, including the NIC type, status, port ID, MAC address, and MTU value.
[0120] Optionally, the port ID, MAC address, and MTU value of the virtual network card are the same as the port ID, MAC address, and MTU value of the corresponding host port.
[0121] Optionally, the virtual network card is of type Internal and the virtual network card is in state Active.
[0122] Optionally, dynamically obtaining the IP address corresponding to the virtual network card from the DHCP service provided by Neutron includes:
[0123] The IP address corresponding to the virtual network card can be dynamically obtained from the DHCP service provided by Neutron using the dhclient command.
[0124] Optionally, the method further includes:
[0125] Adjust the listening port of the management service that the PaaS component depends on to listen across the entire network segment.
[0126] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is able to execute the communication method between the PaaS component management terminal and the virtual machine agent provided by the above methods, the method comprising:
[0127] In the private network corresponding to the PaaS component, multiple host ports are created, and the number of host ports is the same as the number of control nodes.
[0128] Virtual network interface cards (NICs) are constructed using Open vSwitch on the br-int bridge at each control node, and the information of the virtual NICs is associated with the information of the corresponding host ports.
[0129] The IP address corresponding to the virtual network card is dynamically obtained from the DHCP service provided by neutron.
[0130] A virtual IP is created based on keepalived, which is used as a proxy within the virtual machine to respond to communication requests from the PaaS component management end.
[0131] Optionally, the method further includes:
[0132] When constructing the virtual network interface card (NIC), the information of the virtual NIC is specified, including the NIC type, status, port ID, MAC address, and MTU value.
[0133] Optionally, the port ID, MAC address, and MTU value of the virtual network card are the same as the port ID, MAC address, and MTU value of the corresponding host port.
[0134] Optionally, the virtual network card is of type Internal and the virtual network card is in state Active.
[0135] Optionally, dynamically obtaining the IP address corresponding to the virtual network card from the DHCP service provided by Neutron includes:
[0136] The IP address corresponding to the virtual network card can be dynamically obtained from the DHCP service provided by Neutron using the dhclient command.
[0137] Optionally, the method further includes:
[0138] Adjust the listening port of the management service that the PaaS component depends on to listen across the entire network segment.
[0139] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a communication method between the PaaS component management terminal and the virtual machine agent provided by the methods described above, the method comprising:
[0140] In the private network corresponding to the PaaS component, multiple host ports are created, and the number of host ports is the same as the number of control nodes.
[0141] Virtual network interface cards (NICs) are constructed using Open vSwitch on the br-int bridge at each control node, and the information of the virtual NICs is associated with the information of the corresponding host ports.
[0142] The IP address corresponding to the virtual network card is dynamically obtained from the DHCP service provided by neutron.
[0143] A virtual IP is created based on keepalived, which is used as a proxy within the virtual machine to respond to communication requests from the PaaS component management end.
[0144] Optionally, the method further includes:
[0145] When constructing the virtual network interface card (NIC), the information of the virtual NIC is specified, including the NIC type, status, port ID, MAC address, and MTU value.
[0146] Optionally, the port ID, MAC address, and MTU value of the virtual network card are the same as the port ID, MAC address, and MTU value of the corresponding host port.
[0147] Optionally, the virtual network card is of type Internal and the virtual network card is in state Active.
[0148] Optionally, dynamically obtaining the IP address corresponding to the virtual network card from the DHCP service provided by Neutron includes:
[0149] The IP address corresponding to the virtual network card can be dynamically obtained from the DHCP service provided by Neutron using the dhclient command.
[0150] Optionally, the method further includes:
[0151] Adjust the listening port of the management service that the PaaS component depends on to listen across the entire network segment.
[0152] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0153] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0154] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A communication method between a PaaS component management terminal and a virtual machine agent, characterized in that, include: In the private network corresponding to the PaaS component, multiple host ports are created, and the number of host ports is the same as the number of control nodes. Virtual network interface cards (NICs) are constructed using Open vSwitch on the br-int bridge of each control node. The information of the virtual NIC is associated with the information of the corresponding host port. The information association means that the information of the virtual NIC and the information of the corresponding host port have the same content. The port ID, MAC address and MTU value of the virtual NIC are the same as the port ID, MAC address and MTU value of the corresponding host port, respectively. The IP address corresponding to the virtual network card is dynamically obtained from the DHCP service provided by neutron. A virtual IP is created based on keepalived, which is used as a proxy within the virtual machine to respond to communication requests from the PaaS component management end.
2. The communication method between the PaaS component management terminal and the virtual machine agent according to claim 1, characterized in that, The method further includes: When constructing the virtual network interface card (NIC), the information of the virtual NIC is specified, including the NIC type, status, port ID, MAC address, and MTU value.
3. The communication method between the PaaS component management terminal and the virtual machine agent according to claim 2, characterized in that, The virtual network card is of type Internal and its state is Active.
4. The communication method between the PaaS component management terminal and the virtual machine agent according to claim 1, characterized in that, The step of dynamically obtaining the IP address corresponding to the virtual network card from the DHCP service provided by Neutron includes: The IP address corresponding to the virtual network card can be dynamically obtained from the DHCP service provided by Neutron using the dhclient command.
5. The communication method between the PaaS component management terminal and the virtual machine agent according to claim 1, characterized in that, The method further includes: Adjust the listening port of the management service that the PaaS component depends on to listen across the entire network segment.
6. A communication device between a PaaS component management terminal and a virtual machine agent, characterized in that, include: The host port creation module is used to create multiple host ports in the private network corresponding to the PaaS component. The number of host ports is the same as the number of control nodes. A virtual network interface card (NIC) construction module is used to construct virtual NICs on the br-int bridge of each control node using Open vSwitch. The information of the virtual NIC is associated with the information of the corresponding host port. The information association means that the information of the virtual NIC and the information of the corresponding host port have the same content. The port ID, MAC address and MTU value of the virtual NIC are the same as the port ID, MAC address and MTU value of the corresponding host port, respectively. The IP address acquisition module is used to dynamically obtain the IP address corresponding to the virtual network card from the DHCP service provided by neutron. The virtual IP creation module is used to create virtual IPs for a private network plane based on keepalived. These virtual IPs are used as agents within the virtual machine to respond to communication requests from the PaaS component management end.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the communication method between the PaaS component management terminal and the virtual machine agent as described in any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the communication method between the PaaS component management terminal and the virtual machine agent as described in any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the communication method between the PaaS component management terminal and the virtual machine agent as described in any one of claims 1 to 5.