Method, device and system for constructing cloud host based on virtual IP
By creating a virtual extended LAN in a virtual private network and binding the virtual IP to the cloud host, the problem of slow cloud host failure recovery speed is solved, achieving rapid failure recovery and business continuity, and improving the system's flexibility and security.
Patent Information
- Application Number
- CN202511341395.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2025-11-14
AI Technical Summary
Cloud server architecture suffers from slow fault recovery and cannot achieve rapid switching, leading to business interruption and data loss.
By creating a virtual extended LAN through the virtual private network interface, first and second virtual IPs are created under the first and second subnets respectively, and bound to the corresponding cloud hosts to build an efficient primary and backup service architecture, enabling flexible migration and seamless switching of virtual IPs between cloud hosts.
It enables rapid fault recovery in the event of cloud server failure, ensuring business continuity, improving system flexibility and security, and reducing failover latency.
Smart Images

Figure CN120956733A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of cloud computing and computer network technology, and in particular to a method, apparatus and system for constructing cloud hosts based on virtual IP. Background Technology
[0002] As the core carrier of cloud computing infrastructure, cloud servers pool physical server resources through virtualization technology to form elastically scalable computing units. Their core value lies in enabling on-demand supply of computing, storage, and network resources through resource decoupling and dynamic allocation, supporting the high concurrency and high availability requirements of internet services. However, while the distributed nature of cloud server architecture improves resource utilization, it also introduces system complexity and the risk of fault propagation. When physical servers, network devices, or the virtualization layer fail, the inability to quickly switch over can lead to serious consequences such as business interruption and data loss. Failover capability is a core indicator for ensuring business continuity, but traditional cloud server architecture solutions still have certain limitations in their fault recovery mechanisms. Summary of the Invention
[0003] To address the aforementioned technical problems, this invention is proposed. Embodiments of this invention provide a method, apparatus, and system for constructing cloud servers based on virtual IPs, which can improve the speed of fault recovery when a cloud server fails.
[0004] According to one aspect of the present invention, a method for constructing a cloud host based on a virtual IP is provided, comprising: creating a virtual extended local area network (VLAN) in a virtual private network interface; wherein the VLAN includes a first subnet and a second subnet; creating a first virtual IP under the first subnet and creating a second virtual IP under the second subnet; creating a first cloud host under the first subnet and creating a second cloud host under the second subnet; binding the first virtual IP to the first cloud host and adding a first address pair to the main network interface card (NIC) port of the first cloud host, wherein the IP address of the first address pair is the internal network IP of the first virtual IP; binding the second virtual IP to the second cloud host and adding a second address pair to the main NIC port of the second cloud host, wherein the IP address of the second address pair is the internal network IP of the second virtual IP.
[0005] In one embodiment, creating a first virtual IP under the first subnet and creating a second virtual IP under the second subnet includes: selecting the first subnet, filling in the first virtual IP name, specifying the first virtual IP address, and creating the first virtual IP; selecting the second subnet, filling in the second virtual IP name, specifying the second virtual IP address, and creating the second virtual IP.
[0006] In one embodiment, the method for constructing a cloud host based on a virtual IP further includes: calling a virtual IP database to store the first virtual IP information and the second virtual IP information; wherein, the first virtual IP information includes: a first virtual IP name, the internal network IP address of the first virtual IP, the network to which the first virtual IP belongs, and a first subnet; the second virtual IP information includes: a second virtual IP name, the internal network IP address of the second virtual IP, the network to which the second virtual IP belongs, and a second subnet.
[0007] In one embodiment, the method for constructing a cloud host based on a virtual IP further includes: executing a network connectivity test command on the first cloud host, sending a network probe data packet to the second cloud host via an internal network IP, and receiving a response data packet returned by the second cloud host, and recording a first test result; executing a network connectivity test command on the second cloud host, sending a network probe data packet to the first cloud host via an internal network IP, and receiving a response data packet returned by the first cloud host, and recording a second test result; when both the first test result and the second test result indicate successful sending and successful receiving, it is determined that the first cloud host and the second cloud host can successfully exchange network probe and response data packets via an internal network IP, and a valid network connection exists between the first cloud host and the second cloud host.
[0008] In one embodiment, the method for constructing a cloud host based on a virtual IP further includes: executing a network connectivity test command on the first cloud host, sending a network probe data packet to the second cloud host through the first virtual IP, and receiving a response data packet returned by the second cloud host, and recording a third test result; executing a network connectivity test command on the second cloud host, sending a network probe data packet to the first cloud host through the second virtual IP, and receiving a response data packet returned by the first cloud host, and recording a fourth test result; when both the third test result and the fourth test result indicate successful sending and successful receiving, it is determined that the first cloud host and the second cloud host can successfully exchange network probe and response data packets through the virtual IP, and the first cloud host and the second cloud host have network interoperability.
[0009] According to another aspect of the present invention, an apparatus for constructing a cloud host based on a virtual IP is provided, comprising: a first creation module for creating a virtual extended local area network (VLAN) in a virtual private network interface; wherein the VLAN includes a first subnet and a second subnet; a second creation module for creating a first virtual IP under the first subnet and a second virtual IP under the second subnet; a third creation module for creating a first cloud host under the first subnet and a second cloud host under the second subnet; a first binding module for binding the first virtual IP to the first cloud host and adding a first address pair to the main network interface card (NIC) port of the first cloud host, wherein the IP address of the first address pair is the internal network IP of the first virtual IP; and a second binding module for binding the second virtual IP to the second cloud host and adding a second address pair to the main NIC port of the second cloud host, wherein the IP address of the second address pair is the internal network IP of the second virtual IP.
[0010] According to another aspect of the present invention, a system for constructing cloud hosts based on virtual IPs is provided, applicable to the method for constructing cloud hosts based on virtual IPs as described in the first aspect or any embodiment thereof. The system for constructing cloud hosts based on virtual IPs includes: a northbound interface component, which provides an interface for virtual IP operations to an upper-layer cloud management platform, a third-party system, and the platform; a virtual IP management and control component, which is used for core business logic processing of virtual IPs; wherein the core business logic processing includes the creation, modification, and binding of virtual IPs to cloud hosts; a virtual IP database, which stores virtual IP information; a virtual IP configuration component, which is used for configuring and managing virtual IP quotas for cloud host network cards; and an application programming interface (API), which is used for managing the creation, deletion, modification, and querying of virtual extended local area networks (VLANs).
[0011] In one embodiment, the northbound interface component accesses the virtual IP database and application programming interface through the virtual IP management and control component. When a virtual IP is created and bound to a cloud host, the northbound interface component triggers the virtual IP management and control component to create, modify, and bind the virtual IP to the cloud host. The virtual IP management and control component records the virtual IP information in the virtual IP database.
[0012] In one embodiment, the operation interfaces provided by the northbound interface component include: viewing a list of virtual IPs, viewing details, modifying, deleting, binding a cloud host, unbinding a cloud host, binding an elastic public IP, unbinding an elastic public IP, creating, deleting, modifying, querying a list of cloud hosts, and viewing details; and creating, deleting, modifying, querying a list of network interface cards, and viewing details.
[0013] In one embodiment, the virtual IP database is used to store virtual IP information through a virtual IP table, wherein the virtual IP table stores information including port ID, name, IPv4 address, MAC address, network ID, subnet ID, creation time, intranet resource type, and bound intranet IP.
[0014] The present invention provides a method, apparatus and system for building cloud hosts based on virtual IPs. It creates a virtual extended local area network, creates cloud hosts in a first subnet and a second subnet respectively, and then binds the virtual IP to the network card of the cloud host to build an efficient primary and backup service architecture. Through a flexible binding and unbinding mechanism, the virtual IP can be easily migrated between cloud hosts, ensuring a rapid and seamless switchover in the event of host failure, achieving fast fault recovery and high security. Attached Figure Description
[0015] The above and other objects, features, and advantages of the present invention will become more apparent from the more detailed description of the embodiments of the invention in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same parts or steps.
[0016] Figure 1 This is a schematic diagram of the structure of a system for building a cloud host based on a virtual IP according to an embodiment of this application.
[0017] Figure 2 This is a flowchart illustrating a method for constructing a cloud host based on a virtual IP, provided by an exemplary embodiment of the present invention. Detailed Implementation
[0018] Hereinafter, exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments of the present invention. It should be understood that the present invention is not limited to the exemplary embodiments described herein.
[0019] Virtual IP (VIP) technology is a powerful networking technology that creates a virtual IP address within a network to achieve load balancing, failover, and high availability. It plays a crucial role in improving the performance and reliability of network services. Through VIP, client requests can be distributed across multiple servers, achieving load balancing and improving overall system performance and response speed. If a server fails, VIP can quickly redirect traffic to other available servers, ensuring service continuity. VIP technology ensures that when one server fails, another can quickly take over its work, achieving high availability. Users can use VIP proxies to hide their real IP addresses, avoiding tracking and attacks by malicious attackers and improving network access security. Cloud servers are a type of cloud computing infrastructure that provides computing, storage, and network resources, allowing for flexible configuration and use. Virtual IP is a very important resource that helps us better manage cloud servers and improve their availability.
[0020] For example, a Virtual IP Address is an internal network IP address allocated from a VPC subnet segment. It is an internal network IP address that can be independently applied for and deleted, and is suitable for the following scenarios:
[0021] Scenario 1: Binding one or more virtual IPs to a single cloud server allows access to the cloud server via any IP address (private IP / virtual IP). Typically, when multiple services are deployed on a single cloud server, each service can be accessed through different virtual IPs.
[0022] Scenario 2: Binding a single virtual IP to multiple cloud servers simultaneously. This virtual IP needs to be paired with high-availability software (such as Keepalived) to build a highly available primary-backup cluster. To improve service high availability and avoid single points of failure, cloud servers can be used in combination using a "one primary, one backup" or "one primary, multiple backups" approach. These cloud servers present a single virtual IP to the outside world. When the primary cloud server fails, the backup cloud server can take over as the primary cloud server and continue providing services, thus achieving high availability (HA).
[0023] To meet the high availability requirements of cloud servers in cloud computing platforms using virtual IP technology and to address issues such as high latency or unstable failover during cloud server switching, this application proposes a system for constructing cloud servers based on virtual IP, and a method for doing so. Figure 1 This is a schematic diagram of the structure of a system for building a cloud host based on a virtual IP according to an embodiment of this application. See also... Figure 1The system 1, which builds cloud hosts based on virtual IPs, includes: a northbound interface component 11, which provides an interface for virtual IP operations to the upper-layer cloud management platform, third-party systems, and the platform; a virtual IP management and control component 12, which is used for core business logic processing of virtual IPs, including the creation, modification, and binding of virtual IPs to cloud hosts; a virtual IP database 13, which stores virtual IP information; a virtual IP configuration component 14, which is used for configuring and managing virtual IP quotas for cloud host network cards; and an application programming interface 15, which is used for managing the creation, deletion, modification, and querying of virtual extended local area networks.
[0024] Employing virtual IP technology to achieve high availability for cloud servers eliminates the need for any single physical hardware device, enhancing the continuous operation of business systems and improving system flexibility and compatibility. Binding virtual IPs to the cloud server's network interface card (NIC) creates a highly efficient primary / backup service architecture. Through flexible binding and unbinding mechanisms, virtual IPs can easily migrate between cloud servers, ensuring rapid and seamless failover in case of server failure, enabling fast fault recovery and high security. The virtual IP configuration module manages and configures users' virtual IP resource quotas, allowing for quota adjustments based on cloud center needs, ensuring flexible and efficient resource configuration.
[0025] In one embodiment, the northbound interface component can access the virtual IP database and application programming interface through the virtual IP management and control component. When a virtual IP is created and bound to a cloud host, the northbound interface component will trigger the virtual IP management and control component to create, modify and bind the virtual IP to the cloud host. The virtual IP management and control component will record the virtual IP information in the virtual IP database.
[0026] In one embodiment, the operation interface provided by the northbound interface component may include: viewing a list of virtual IPs, viewing details, modifying, deleting, binding a cloud host, unbinding a cloud host, binding an elastic public IP, unbinding an elastic public IP, creating, deleting, modifying, querying a list of cloud hosts, and viewing details; and creating, deleting, modifying, querying a list of network interface cards (NICs) and viewing details.
[0027] In one embodiment, the virtual IP management and control component is mainly responsible for the core business logic processing of virtual IP. When a user creates a virtual IP and binds it to a cloud host through the cloud management platform interface or API interface, the northbound interface component will trigger the virtual IP management and control component to perform specific virtual IP operations, such as creating, modifying, and binding cloud hosts. The virtual IP management and control component will record the user's virtual IP information in the virtual IP database for persistence.
[0028] As one possible implementation, the business process of creating a virtual IP and binding it to a cloud host using the virtual IP management and control component can be as follows: Step 1: When creating a virtual IP, you need to select a network and subnet. For example, select a VxLAN network named VPC. This VPC has two subnets: subnet-01 with a network segment of 192.168.1.0 / 24 and subnet-02 with a network segment of 192.168.2.0 / 24. Step 2: Select subnet-01, fill in the virtual IP name, specify the virtual IP address, and create virtual IP vip-01; select subnet-02, fill in the virtual IP name, specify the virtual IP address, and create virtual IP vip-02. Step 3: The virtual IP creation in Step 2 will call the Neutron API interface to specify the IP creation port. Step 4: Call the virtual IP database to store virtual IP information, including the virtual IP name, internal network IP address, network, and subnet. Step 5: Select the VPC from Step 1 and create two cloud servers, eCS-01 and eCS-02, under the two subnets respectively. Step 6: Select the virtual IP vip-01 from Step 2, bind it to the cloud server eCS-01, and use the Neutron API to add an address pair to the cloud server's main network interface port. The IP address of the address pair should be the virtual IP's internal network IP; the physical address does not need to be specified and will default to the same physical address as the main network interface. Step 7: Select the virtual IP vip-02 from Step 2 and bind it to the cloud server eCS-02. The Neutron API operation is the same as in Step 6. Step 8: Update the internal network resources bound to the virtual IP using the virtual IP database, including the internal network resource type and the bound internal network IP.
[0029] In one embodiment, the virtual IP database is used to store virtual IP information through a virtual IP table, wherein the virtual IP table stores information including port ID, name, IPv4 address, MAC address, network ID, subnet ID, creation time, intranet resource type, and bound intranet IP.
[0030] The virtual IP database is primarily responsible for persisting virtual IP data. When the system restarts or exits abnormally, it can restore the user's virtual IP information and the binding information between the cloud host and the virtual IP from the virtual IP database, ensuring the availability of the user's virtual IP services. Virtual IP information can be stored in a table, namely the virtual IP table (VIP). The virtual IP table stores information such as port ID, name, IPv4 address, MAC address, network ID, subnet ID, creation time, internal network resource type, and bound internal network IPs.
[0031] In one embodiment, the virtual IP configuration component is mainly responsible for configuring the cloud host network interface card, including adding and removing virtual IPs, and also for managing and configuring the user's virtual IP resource quota, with a default quota of 50.
[0032] As one possible implementation, the command for configuring an address for a cloud host's network interface card using the virtual IP configuration component can be as follows:
[0033] Step 1: Log in to the cloud server ecs-01 and execute ip addr add<virtual IP vip-01 internal IP> / subnet mask dev eth0;
[0034] Step 2: Log in to the cloud server ecs-02 and execute ipaddr add<virtual IP vip-02 internal IP> / subnet mask dev eth0;
[0035] Step 3: Executing ipaddr will show that there are two addresses on the network interface eth0, including the main network interface address of the cloud host and the virtual IP address.
[0036] In some embodiments, the application programming interface (API) can be the Neutron Network API, which is responsible for the overall management of the VxLAN network lifecycle (including creation, deletion, modification, and querying) and the corresponding operations of the virtual IP. When binding a cloud host in the virtual IP product interface, pay attention to the setting of the allowedAddressPair property; the address of the cloud host's network card must be set to the internal network address of the virtual IP.
[0037] Understandably, `allowed-address-pairs` is an extended attribute used to define which IP address and MAC address pairs are allowed to communicate with the port. These pairs can include the port's own IP address and MAC address, or additional combinations of IP and MAC addresses. Users can specify allowed IP and MAC address pairs for a port via the CLI (command-line interface) or API (application interface). These pairs will be added to the port's `allowed_address_pairs` attribute.
[0038] Figure 2 This is a flowchart illustrating a method for constructing a cloud host based on a virtual IP, as provided in an exemplary embodiment of the present invention. Figure 2 As shown, the method for building a cloud host based on a virtual IP includes: creating a virtual extended LAN in a virtual private network interface (see...). Figure 2 (S210); wherein, the virtual extended LAN includes a first subnet and a second subnet; a first virtual IP is created under the first subnet, and a second virtual IP is created under the second subnet (see S210); Figure 2 (S220); Create the first cloud host under the first subnet, and create the second cloud host under the second subnet (see S220); Figure 2 (S230); bind the first virtual IP to the first cloud host, and add the first address pair to the main network interface port of the first cloud host. The IP address of the first address pair is the internal network IP of the first virtual IP (see S230). Figure 2 (S240); bind the second virtual IP to the second cloud host, and add a second address pair to the main network interface port of the second cloud host. The IP address of the second address pair is the internal IP of the second virtual IP (see S240). Figure 2 (S250).
[0039] In one embodiment, S220 may include: selecting a first subnet, filling in a first virtual IP name, specifying a first virtual IP address, and creating a first virtual IP; selecting a second subnet, filling in a second virtual IP name, specifying a second virtual IP address, and creating a second virtual IP.
[0040] For example, in the Virtual Private Network (VPC) interface, create a VxLAN network named VPC with a network segment of 192.168.0.0 / 16. Under VPC, there are two subnets: subnet-01 with a network segment of 192.168.1.0 / 24 and subnet-02 with a network segment of 192.168.2.0 / 24. You can use the northbound interface to create the virtual private network and store the VPC and subnet information. 2. In the Virtual IP Management interface, click "Create Virtual IP," select Virtual Private Network and Subnet, fill in the virtual IP name, specify the virtual IP address, and create virtual IPs under the two subnets named vip-01 (first virtual IP) and vip-02 (second virtual IP). Use the northbound interface to create the virtual IPs and store the virtual IP information.
[0041] Next, as one possible implementation, you can select the already created VPC and subnet-01, create a cloud host eCS-01, and store the information of cloud host eCS-01 and its elastic network interface card (NIC). Then, select the created VPC and subnet-02, create a cloud host eCS-02, and store the information of cloud host eCS-01 and its NIC. Virtual IP vip-01 is bound to cloud host eCS-01, and virtual IP vip-02 is bound to cloud host eCS-02. Log in to the cloud server ecs-01 and execute `ipaddr add <virtual IP vip-01 internal IP> / subnet mask dev eth0`. This step can be achieved through keepalived configuration. The configuration command is: `ipaddr add 192.168.1.100 / 24dev eth0`. Log in to the cloud server ecs-02 and execute `ipaddr add <virtual IP vip-02 internal IP> / subnet mask dev eth0`. This step can be achieved through keepalived configuration. The configuration command is: `ipaddr add 192.168.2.100 / 24dev eth0`.
[0042] In one embodiment, the method for constructing a cloud host based on a virtual IP may further include: calling a virtual IP database to store first virtual IP information and second virtual IP information; wherein, the first virtual IP information includes: a first virtual IP name, the internal network IP address of the first virtual IP, the network to which the first virtual IP belongs, and a first subnet; the second virtual IP information includes: a second virtual IP name, the internal network IP address of the second virtual IP, the network to which the second virtual IP belongs, and a second subnet.
[0043] In one embodiment, the method for constructing a cloud host based on a virtual IP further includes: executing a network connectivity test command on the first cloud host, sending a network probe data packet to the second cloud host via an internal network IP, and receiving a response data packet returned by the second cloud host, and recording a first test result; executing a network connectivity test command on the second cloud host, sending a network probe data packet to the first cloud host via an internal network IP, and receiving a response data packet returned by the first cloud host, and recording a second test result; when both the first test result and the second test result indicate successful sending and successful receiving, it is determined that the first cloud host and the second cloud host can successfully exchange network probe and response data packets via the internal network IP, and a valid network connection exists between the first cloud host and the second cloud host.
[0044] In one embodiment, the method for constructing a cloud host based on a virtual IP further includes: executing a network connectivity test command on the first cloud host, sending a network probe data packet to the second cloud host through the first virtual IP, and receiving a response data packet returned by the second cloud host, and recording a third test result; executing a network connectivity test command on the second cloud host, sending a network probe data packet to the first cloud host through the second virtual IP, and receiving a response data packet returned by the first cloud host, and recording a fourth test result; when both the third test result and the fourth test result indicate successful sending and successful receiving, it is determined that the first cloud host and the second cloud host can successfully exchange network probe and response data packets through the virtual IP, and the first cloud host and the second cloud host have network interoperability.
[0045] Understandably, from the ECS-01 host, pinging the internal IP and virtual IP of ECS-02 is successful, and from the ECS-02 host, pinging the internal IP and virtual IP of ECS-01 is successful. Both cloud hosts can communicate with each other via pinging their internal IPs and virtual IPs. This solution, employing virtual IP technology to achieve high availability for cloud hosts, enhances the continuous operation of business systems and realizes high availability for cloud hosts. This solution binds virtual IPs to the network interface cards of cloud hosts, building an efficient primary / backup service architecture. Through flexible binding and unbinding mechanisms, virtual IPs can easily migrate between cloud hosts, ensuring rapid and seamless switching in the event of host failure, achieving fast fault recovery, and providing high security.
[0046] In one embodiment, the virtual IP supports binding to multiple cloud hosts. When the virtual machine binds to a cloud host, the Neutron API interface is called to add an address pair to the main network interface port of the cloud host. The IP address to which the address pair belongs is the internal network IP of the virtual IP. The physical address does not need to be specified and is consistent with the physical address of the main network interface by default.
[0047] Understandably, besides binding the first cloud server to the first virtual IP one-to-one, a cloud server can be bound to a maximum of 10 virtual IPs by default. The quota can be adjusted according to needs, which requires modifying the neutron configuration file.
[0048] In one embodiment, the virtual IP can be bound to an Elastic IP (EIP) to enable external network communication for the cloud host. The EIP is used for public network communication.
[0049] In another embodiment, the virtual IP can also be bound to a floating IP (FIP) to enable FIP communication between cloud hosts.
[0050] In some embodiments, an apparatus is provided for implementing a method of building a cloud host based on a virtual IP, namely, an apparatus for building a cloud host based on a virtual IP. The apparatus for building a cloud host based on a virtual IP includes: a first creation module 31, used to create a virtual extended local area network (VLAN) in a virtual private network interface; wherein the virtual extended local area network includes a first subnet and a second subnet; a second creation module, used to create a first virtual IP under the first subnet and a second virtual IP under the second subnet; a third creation module, used to create a first cloud host under the first subnet and a second cloud host under the second subnet; a first binding module, used to bind the first virtual IP to the first cloud host and add a first address pair to the main network interface card (NIC) port of the first cloud host, wherein the IP address of the first address pair is the internal network IP of the first virtual IP; and a second binding module, used to bind the second virtual IP to the second cloud host and add a second address pair to the main NIC port of the second cloud host, wherein the IP address of the second address pair is the internal network IP of the second virtual IP.
[0051] This invention provides an apparatus for building a cloud host based on a virtual IP. The apparatus can be implemented in software, hardware, or a combination of both. From a hardware perspective, in addition to a CPU, memory, network interface, and non-volatile memory, the device in the embodiment typically includes other hardware, such as a forwarding chip responsible for processing packets. Taking software implementation as an example, as a logically defined apparatus, it is formed by the CPU of the device loading the corresponding computer program instructions from the non-volatile memory into memory for execution.
[0052] According to another aspect of the present invention, a computer-readable storage medium is provided, the storage medium storing a computer program for performing the method of constructing a cloud host based on virtual IP according to any of the above embodiments.
[0053] In addition to the methods and devices described above, embodiments of the present invention may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the methods for constructing cloud hosts based on virtual IPs according to various embodiments of the present invention described above.
[0054] According to another aspect of the present invention, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; and a processor for executing the method of building a cloud host based on virtual IP according to any of the above embodiments.
[0055] Furthermore, embodiments of the present invention may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps in the methods for constructing cloud hosts based on virtual IPs according to various embodiments of the present invention described above.
[0056] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for constructing a cloud server based on a virtual IP, characterized in that, include: Create a virtual extended LAN in the Virtual Private Network (VPN) interface; wherein the virtual extended LAN includes a first subnet and a second subnet; Create a first virtual IP under the first subnet, and create a second virtual IP under the second subnet; Create a first cloud host under the first subnet, and create a second cloud host under the second subnet; Bind the first virtual IP to the first cloud host, and add a first address pair to the main network interface port of the first cloud host, wherein the IP address to which the first address pair belongs is the internal network IP of the first virtual IP; Bind the second virtual IP to the second cloud host, and add a second address pair to the main network interface port of the second cloud host. The IP address of the second address pair is the internal network IP of the second virtual IP.
2. The method for constructing a cloud host based on a virtual IP according to claim 1, characterized in that, Create a first virtual IP under the first subnet, and create a second virtual IP under the second subnet, including: Select the first subnet, enter the first virtual IP name, specify the first virtual IP address, and create the first virtual IP; Select the second subnet, enter the second virtual IP name, specify the second virtual IP address, and create the second virtual IP.
3. The method for constructing a cloud host based on a virtual IP according to claim 1, characterized in that, Methods for building cloud servers based on virtual IPs also include: The virtual IP database is invoked to store the first virtual IP information and the second virtual IP information; wherein, the first virtual IP information includes: the first virtual IP name, the internal network IP address of the first virtual IP, the network to which the first virtual IP belongs, and the first subnet; the second virtual IP information includes: the second virtual IP name, the internal network IP address of the second virtual IP, the network to which the second virtual IP belongs, and the second subnet.
4. The method for constructing a cloud host based on a virtual IP according to claim 1, characterized in that, Methods for building cloud servers based on virtual IPs also include: Execute a network connectivity test command on the first cloud host, send a network probe data packet to the second cloud host via the internal network IP, receive the response data packet returned by the second cloud host, and record the first test result; On the second cloud host, execute a network connectivity test command, send a network probe data packet to the first cloud host via the internal network IP, receive the response data packet returned by the first cloud host, and record the second test result; When both the first test result and the second test result indicate successful transmission and successful reception, it is determined that the first cloud host and the second cloud host can successfully exchange network probe and response data packets through the internal network IP, and there is a valid network connection between the first cloud host and the second cloud host.
5. The method for constructing a cloud host based on a virtual IP according to claim 1, characterized in that, Methods for building cloud servers based on virtual IPs also include: Execute a network connectivity test command on the first cloud host, send a network probe data packet to the second cloud host through the first virtual IP, receive the response data packet returned by the second cloud host, and record the third test result; On the second cloud host, execute a network connectivity test command, send a network probe data packet to the first cloud host through the second virtual IP, receive the response data packet returned by the first cloud host, and record the fourth test result; When both the third and fourth test results indicate successful transmission and successful reception, it is determined that the first cloud host and the second cloud host can successfully exchange network probe and response data packets through virtual IP, and the first cloud host and the second cloud host have network interoperability.
6. An apparatus for constructing cloud hosts based on virtual IP, characterized in that, include: The first creation module is used to create a virtual extended local area network (LAN) in the virtual private network interface; wherein the virtual extended LAN includes a first subnet and a second subnet; The second creation module is used to create a first virtual IP under the first subnet and a second virtual IP under the second subnet; The third creation module is used to create a first cloud host under the first subnet and a second cloud host under the second subnet; The first binding module is used to bind the first virtual IP to the first cloud host and add a first address pair to the main network interface port of the first cloud host, wherein the IP address to which the first address pair belongs is the internal network IP of the first virtual IP; The second binding module is used to bind the second virtual IP to the second cloud host and add a second address pair to the main network interface port of the second cloud host. The IP address of the second address pair is the internal network IP of the second virtual IP.
7. A system for constructing cloud hosts based on virtual IPs, applicable to the method for constructing cloud hosts based on virtual IPs as described in any one of claims 1-5, characterized in that, Systems that build cloud servers based on virtual IPs include: A northbound interface component, which provides an interface for virtual IP operation to the upper-layer cloud management platform, third-party systems and the platform; A virtual IP management and control component is used for core business logic processing of virtual IPs; wherein, the core business logic processing includes the creation, modification, and binding of virtual IPs to cloud hosts; A virtual IP database, which is used to store virtual IP information; A virtual IP configuration component, which is used for configuring and managing virtual IP quotas for cloud host network interface cards; An application programming interface (API) for managing the creation, deletion, modification, and querying of virtual extended local area networks (VLANs).
8. The system for constructing cloud hosts based on virtual IP according to claim 7, characterized in that, The northbound interface component accesses the virtual IP database and application programming interface through the virtual IP management and control component. When a virtual IP is created and bound to a cloud host, the northbound interface component triggers the virtual IP management and control component to create, modify, and bind the virtual IP to the cloud host. The virtual IP management and control component records the virtual IP information in the virtual IP database.
9. The system for constructing cloud hosts based on virtual IP according to claim 7, characterized in that, The operation interfaces provided by the northbound interface component include: viewing the list, viewing details, modifying, deleting, binding cloud hosts, unbinding cloud hosts, binding elastic public IPs, unbinding elastic public IPs, creating, deleting, modifying, querying the list, and viewing details of cloud hosts, and creating, deleting, modifying, querying the list, and viewing details of network cards.
10. The system for constructing cloud hosts based on virtual IP according to claim 7, characterized in that, The virtual IP database is used to store virtual IP information through a virtual IP table. The virtual IP table stores information including port ID, name, IPv4 address, MAC address, network ID, subnet ID, creation time, intranet resource type, and bound intranet IPs.