CN112003964B - Multi-architecture-based IP address allocation method, device and medium - Google Patents

Multi-architecture-based IP address allocation method, device and medium Download PDF

Info

Publication number
CN112003964B
CN112003964B CN202010878486.4A CN202010878486A CN112003964B CN 112003964 B CN112003964 B CN 112003964B CN 202010878486 A CN202010878486 A CN 202010878486A CN 112003964 B CN112003964 B CN 112003964B
Authority
CN
China
Prior art keywords
address
reserved
cloud host
virtual cloud
virtual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010878486.4A
Other languages
Chinese (zh)
Other versions
CN112003964A (en
Inventor
张同剑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Inspur Data Technology Co Ltd
Original Assignee
Beijing Inspur Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Inspur Data Technology Co Ltd filed Critical Beijing Inspur Data Technology Co Ltd
Priority to CN202010878486.4A priority Critical patent/CN112003964B/en
Publication of CN112003964A publication Critical patent/CN112003964A/en
Application granted granted Critical
Publication of CN112003964B publication Critical patent/CN112003964B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5046Resolving address allocation conflicts; Testing of addresses

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses a multi-architecture-based IP address allocation method, a multi-architecture-based IP address allocation device and a multi-architecture-based IP address allocation medium, which are used for setting a corresponding network and a subnet network for a reserved IP address. And binding the reserved IP address with the reserved virtual port, and setting the port state of the virtual port as unavailable. When a high-availability service configuration instruction of the virtual cloud host is received, the target reserved IP address bound by the virtual port is used as the high-availability IP address of the virtual cloud host; the target reserved IP address is a reserved IP address matched with the subnet network to which the virtual cloud host belongs. And generating a floating IP address corresponding to the high available IP address according to a preset access rule, and calling the high available service of the virtual cloud host by the user according to the floating IP address. The unified management of all reserved IP addresses is realized through the reserved virtual ports, the resource waste of the IP addresses and the port addresses is reduced, and the management of the high-availability IP addresses is simpler and more efficient.

Description

Multi-architecture-based IP address allocation method, device and medium
Technical Field
The invention relates to the technical field of cloud computing, in particular to a multi-architecture-based IP address allocation method and device and a computer readable storage medium.
Background
In recent years, cloud computing is continuously developed, openstack is increasingly recognized by the industry and academia as a complete open-source cloud computing management platform, and meanwhile, many manufacturers and units also develop related services and products based on the Openstack platform, so that the requirement for integrating various service resources in the Openstack framework is further increased.
At present, in an application scenario of deploying a private cloud platform based on an Openstack framework, when high availability binding is performed on multiple virtual cloud hosts, a conventional method is to implement high availability of the virtual cloud hosts by using a keepalive mechanism and an address pair (allow _ address _ pairs) allowing use, and a specific implementation manner is to create idle ports (ports), use the idle ports to occupy high available Internet Protocol (IP) addresses for the virtual cloud hosts, and its main principle is to occupy IP addresses so as to prevent the IP addresses from being used by other resources.
Although the method can realize high availability of the Virtual cloud host, if a more complex environment with high availability of the Virtual cloud host for deploying various ecological Virtual machines and various ecological Virtual machines appears and a plurality of IP addresses are needed to be used as Virtual IP (Virtual Internet Protocol, VIP) addresses, a plurality of idle ports need to be created, a plurality of entries for managing the ports are added in a database of an Openstack network module (Neutron server), and firewall tools (iptable keys) based on packet filtering may be added, so that the maintenance and deployment costs of the high-availability IP addresses are greatly increased, and problems that the high-availability IP addresses are misused to cause IP address conflict and the like easily occur.
Therefore, how to simply and efficiently realize the management of the highly available IP addresses is a problem to be solved by those skilled in the art.
Disclosure of Invention
Embodiments of the present invention provide a method and an apparatus for allocating an IP address based on multiple architectures, and a computer-readable storage medium, which can simply and efficiently implement management of a high-availability IP address.
To solve the foregoing technical problem, an embodiment of the present invention provides a method for allocating an IP address based on multiple architectures, including:
when a reserved IP address is obtained, setting a corresponding network and a subnet network for the reserved IP address; wherein, the subnet network segment of the subnet network comprises the reserved IP address;
binding the reserved IP address with a reserved virtual port, and setting the port state of the virtual port as unavailable;
when a high-availability service configuration instruction of a virtual cloud host is received, taking a target reserved IP address bound by the virtual port as a high-availability IP address of the virtual cloud host; the target reserved IP address is a reserved IP address matched with a subnet network to which the virtual cloud host belongs;
and generating a floating IP address corresponding to the high-availability IP address according to a preset access rule, so that a user can call the high-availability service of the virtual cloud host according to the floating IP address.
Optionally, when the reserved IP address is obtained, setting a corresponding network and a subnet network for the reserved IP address includes:
judging whether the acquired reserved IP address belongs to the existing subnet section;
and when the reserved IP address does not belong to the existing subnet section, establishing the network of the reserved IP address and the subnet network.
Optionally, before the setting the target reserved IP address to which the virtual port is bound as the high available IP address of the virtual cloud host, the method further includes:
when a high-availability service configuration instruction of a virtual cloud host is received, judging whether an IP address allocated when the virtual cloud host is established is coincident with the reserved IP address;
when the IP address allocated during the virtual cloud host creation is coincident with the reserved IP address, displaying prompt information of high availability failure of the reserved IP address;
and when the allocated IP address does not coincide with the reserved IP address when the virtual cloud host is created, executing the step of taking the target reserved IP address bound by the virtual port as the high available IP address of the virtual cloud host.
Optionally, after the generating a floating IP address corresponding to the high available IP address according to the preset access rule, the method further includes:
judging whether the virtual cloud host bound by the high available IP address can be accessed smoothly according to the floating IP address;
when the virtual cloud host bound with the high available IP address can be smoothly accessed according to the floating IP address, deleting any virtual cloud host bound with the high available IP address;
judging whether the virtual cloud host bound by the high available IP address can be smoothly accessed according to the floating IP address after one virtual cloud host is deleted;
and when the virtual cloud host bound by the high available IP address cannot be accessed smoothly according to the floating IP address or when the virtual cloud host bound by the high available IP address cannot be accessed smoothly according to the floating IP address after one virtual cloud host is deleted, displaying the alarm information of the failure of the high available IP address.
Optionally, after the generating a floating IP address corresponding to the high available IP address according to the preset access rule, the method further includes:
when an available IP address used for virtual cloud host creation does not exist, judging whether an idle IP address exists in the reserved IP address or not;
and when the reserved IP address has an idle IP address, releasing the idle IP address, and creating a virtual cloud host according to the released idle IP address.
The embodiment of the invention also provides a multi-architecture-based IP address allocation device, which comprises a setting unit, a binding unit, an acting unit and a generating unit;
the setting unit is used for setting a corresponding network and a subnet network for the reserved IP address when the reserved IP address is obtained; wherein, the subnet network segment of the subnet network comprises the reserved IP address;
the binding unit is used for binding the reserved IP address with a reserved virtual port and setting the port state of the virtual port as unavailable;
the acting unit is used for taking a target reserved IP address bound by the virtual port as a high available IP address of the virtual cloud host when a high available service configuration instruction of the virtual cloud host is received; the target reserved IP address is a reserved IP address matched with a subnet network to which the virtual cloud host belongs;
the generating unit is used for generating a floating IP address corresponding to the high available IP address according to a preset access rule, so that a user can call the high available service of the virtual cloud host according to the floating IP address.
Optionally, the setting unit includes a judging subunit and a creating subunit;
the judging subunit is configured to judge whether the acquired reserved IP address belongs to an existing subnet section;
and the creating subunit is used for creating the network of the reserved IP address and the subnet network when the reserved IP address does not belong to the existing subnet section.
Optionally, the system further comprises a coincident address judging unit and a prompting unit;
the coincident address judging unit is used for judging whether the IP address allocated when the virtual cloud host is established is coincident with the reserved IP address or not when a high-availability service configuration instruction of the virtual cloud host is received; when the allocated IP address is not coincident with the reserved IP address when the virtual cloud host is created, triggering the acting unit to execute the step of taking the target reserved IP address bound by the virtual port as the high available IP address of the virtual cloud host;
and the prompt unit is used for displaying prompt information of high availability failure of the reserved IP address when the IP address allocated during the virtual cloud host creation is coincident with the reserved IP address.
Optionally, the system further comprises a high availability judgment unit, a deletion unit and an alarm unit;
the high availability judgment unit is used for judging whether the virtual cloud host bound by the high availability IP address can be accessed smoothly according to the floating IP address;
the deleting unit is used for deleting any virtual cloud host bound with the high available IP address when the virtual cloud host bound with the high available IP address can be smoothly accessed according to the floating IP address;
the high availability judgment unit is further used for judging whether the virtual cloud host bound by the high availability IP address can be smoothly accessed according to the floating IP address after one virtual cloud host is deleted;
the warning unit is used for displaying warning information that the high available IP address is invalid when the virtual cloud host bound by the high available IP address cannot be accessed smoothly according to the floating IP address or when the virtual cloud host bound by the high available IP address cannot be accessed smoothly according to the floating IP address after one virtual cloud host is deleted.
Optionally, the system further comprises an idle address judging unit, a releasing unit and a creating unit;
the idle address judging unit is used for judging whether an idle IP address exists in the reserved IP addresses or not when an available IP address used for virtual cloud host creation does not exist;
the release unit is used for releasing an idle IP address when the idle IP address exists in the reserved IP address;
and the creating unit is used for creating the virtual cloud host according to the released idle IP address.
The embodiment of the invention also provides a device for allocating the IP addresses based on the multi-architecture, which comprises the following components:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the multi-fabric based IP address assignment method as claimed in any one of the above.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the multi-architecture-based IP address allocation method described in any one of the above are implemented.
According to the technical scheme, when the reserved IP address is obtained, in order to ensure the availability of the reserved IP address, a corresponding network and a subnet network need to be set for the reserved IP address; the subnet section of the subnet network comprises a reserved IP address. And binding the reserved IP address and the reserved virtual port, and setting the port state of the virtual port as unavailable. By setting the state of the virtual port to be unavailable, the situation that the reserved IP address is randomly called by other services can be effectively avoided. When a high-availability service configuration instruction of the virtual cloud host is received, the target reserved IP address bound by the virtual port is used as the high-availability IP address of the virtual cloud host; the target reserved IP address is a reserved IP address matched with the subnet network to which the virtual cloud host belongs. In order to enable a user to call a high-availability service of a virtual cloud host, a floating IP address corresponding to a high-availability IP address needs to be generated according to a preset access rule. The floating IP address refers to an address presented to a user, and the user can call the highly available service of the virtual cloud host according to the floating IP address. In the technical scheme, the high-availability IP addresses required to be used for the virtual cloud host are reserved in advance, and unified management of all the reserved IP addresses is realized through one reserved virtual port, so that resource waste of the IP addresses and the port addresses is reduced, and the management of the high-availability IP addresses is simpler and more efficient.
Drawings
In order to more clearly illustrate the embodiments of the present invention, the drawings required for the embodiments will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a method for allocating an IP address based on multiple architectures according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an apparatus for allocating an IP address based on multiple architectures according to an embodiment of the present invention;
fig. 3 is a schematic hardware structure diagram of an apparatus for allocating an IP address based on multiple architectures according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without any creative work belong to the protection scope of the present invention.
In order that those skilled in the art will better understand the disclosure, reference will now be made in detail to the embodiments of the disclosure as illustrated in the accompanying drawings.
Next, a method for allocating an IP address based on multiple architectures according to an embodiment of the present invention will be described in detail. Fig. 1 is a flowchart of a method for allocating an IP address based on multiple architectures according to an embodiment of the present invention, where the method includes:
s101: and when the reserved IP address is obtained, setting a corresponding network and a subnet network for the reserved IP address.
In the embodiment of the invention, a certain IP address or IP address field can be appointed as a reserved IP address according to the requirement of a user.
To ensure availability of the reserved IP address, it is necessary to ensure that the reserved IP address has its corresponding network and subnet network. Therefore, in practical application, whether the acquired reserved IP address belongs to the existing subnet section can be judged. When the reserved IP address does not belong to the existing subnet section, a network of the reserved IP address and a subnet network need to be created. The subnet section of the subnet network comprises a reserved IP address.
When a network is created, attribute information required by the network, such as a network type, a management state, and an associated physical network card device, needs to be set. After the creation of the network is completed, a subnet network to which the IP address needs to be reserved and attribute information of the subnet, such as information of a subnet segment, a gateway, an address pool, etc., may be created under the created network view.
S102: and binding the reserved IP address with the reserved virtual port, and setting the port state of the virtual port as unavailable.
In the embodiment of the present invention, in order to manage the reserved IP address, a virtual port (Vport) may be reserved, and the reserved IP address is bound to the reserved virtual port.
To ensure that the reserved IP address is not called by other application services, the port state of the virtual port may be set to unavailable. In a specific implementation, relevant information such as the management state of the virtual port and the port security may be set to false.
S103: and when a high-availability service configuration instruction of the virtual cloud host is received, the target reserved IP address bound by the virtual port is used as the high-availability IP address of the virtual cloud host.
In practical application, a virtual cloud host can be established in a created subnet network, and when a high-availability service configuration instruction of the virtual cloud host is received, a reserved IP address matched with the subnet network to which the virtual cloud host belongs can be selected from the reserved IP addresses to serve as the high-availability IP address of the virtual cloud host.
In order to facilitate distinguishing from other reserved IP addresses, in the embodiment of the present invention, a reserved IP address that matches with a subnet network to which the virtual cloud host belongs may be referred to as a target reserved IP address.
S104: and generating a floating IP address corresponding to the high available IP address according to a preset access rule so as to facilitate a user to call the high available service of the virtual cloud host according to the floating IP address.
For a user, the high available IP address of the virtual cloud host cannot be known, so that the user can call the high available service of the virtual cloud host, a floating IP address for the user to use can be generated, and the floating IP address is bound with the high available IP address of the virtual cloud host, so that the user can access the high available virtual cloud host through the floating IP address.
An access rule refers to a rule on which a floating IP address is generated. The access rule may be set according to the address generation manner in the prior art, and is not limited herein.
According to the technical scheme, when the reserved IP address is obtained, in order to ensure the availability of the reserved IP address, a corresponding network and a subnet network need to be set for the reserved IP address; the subnet section of the subnet network comprises a reserved IP address. And binding the reserved IP address with the reserved virtual port, and setting the port state of the virtual port as unavailable. By setting the state of the virtual port to be unavailable, the condition that the reserved IP address is randomly called by other services can be effectively avoided. When a high-availability service configuration instruction of the virtual cloud host is received, the target reserved IP address bound by the virtual port is used as the high-availability IP address of the virtual cloud host; the target reserved IP address is a reserved IP address matched with the subnet network to which the virtual cloud host belongs. In order to enable a user to call a high-availability service of a virtual cloud host, a floating IP address corresponding to a high-availability IP address needs to be generated according to a preset access rule. The floating IP address refers to an address presented to a user, and the user can call the high-availability service of the virtual cloud host according to the floating IP address. In the technical scheme, the high-availability IP addresses required to be used for the virtual cloud host are reserved in advance, and unified management of all the reserved IP addresses is realized through one reserved virtual port, so that resource waste of the IP addresses and the port addresses is reduced, and the management of the high-availability IP addresses is simpler and more efficient.
In the embodiment of the present invention, in order to further verify whether the reservation of the reserved IP address is successful, before the target reserved IP address bound to the virtual port is used as the high available IP address of the virtual cloud host, when a high available service configuration instruction of the virtual cloud host is received, it may be determined whether the IP address allocated when the virtual cloud host is created coincides with the reserved IP address.
The reserved IP address can only be called by highly available services, other services cannot call the reserved IP address. When the allocated IP address does not coincide with the reserved IP address when the virtual cloud host is created, a step of using the target reserved IP address bound by the virtual port as a high available IP address of the virtual cloud host may be performed. When the allocated IP address is overlapped with the reserved IP address when the virtual cloud host is created, the reserved IP address is called by a service other than the high-availability service, and prompt information of high-availability failure of the reserved IP address can be displayed at the moment.
By comparing the IP address allocated when the virtual cloud host is created with the reserved IP address, whether the reserved IP address is only used for high-availability service can be effectively checked. By displaying the prompt message of the high availability failure of the reserved IP address, the manager can conveniently find the condition that the reserved IP address is illegally called in time, so that the service condition of the reserved IP address can be limited in time.
In the embodiment of the present invention, the high availability of the reserved IP address means that one reserved IP address can be bound to a plurality of virtual cloud hosts. In order to verify whether the reserved IP address meets high availability, after a floating IP address corresponding to the high availability IP address is generated according to a preset access rule, whether the virtual cloud host bound by the high availability IP address can be smoothly accessed according to the floating IP address can be judged.
When the virtual cloud host bound by the high available IP address can be smoothly accessed according to the floating IP address, the fact that the virtual cloud host bound by the high available IP address is indicated, at the moment, any one virtual cloud host bound by the high available IP address can be deleted, and then whether the virtual cloud host bound by the high available IP address can be smoothly accessed according to the floating IP address after one virtual cloud host is deleted is judged.
When the virtual cloud host bound by the high available IP address cannot be smoothly accessed according to the floating IP address, it is indicated that the binding between the high available IP address and the virtual cloud host fails, and the high available IP address does not meet the high availability.
When the virtual cloud host bound by the high available IP address cannot be smoothly accessed according to the floating IP address after one virtual cloud host is deleted, the high available IP address is only bound with one virtual cloud host, and the requirement of high availability is not met.
Therefore, when the virtual cloud host bound by the high available IP address cannot be accessed smoothly according to the floating IP address or when the virtual cloud host bound by the high available IP address cannot be accessed smoothly according to the floating IP address after one virtual cloud host is deleted, the alarm information that the high available IP address is invalid is displayed.
By displaying the alarm information of the high available IP address failure, the management personnel can timely know the condition that the high available IP address is not successfully bound to the virtual cloud host or only one virtual cloud host is bound, so that the management personnel can conveniently bind more virtual cloud hosts to the high available IP address, and the requirement of high availability is met.
The reserved IP address usually comprises a plurality of IP addresses, in practical application, the number of the reserved IP addresses can be dynamically adjusted, a new IP address can be added to serve as the reserved IP address, the reserved IP address can also be released, and the released reserved IP address can be called by other services.
In the specific implementation, after a floating IP address corresponding to a high available IP address is generated according to a preset access rule, when an available IP address used for virtual cloud host creation does not exist, whether an idle IP address exists in a reserved IP address or not can be judged; and when the idle IP address exists in the reserved IP address, releasing the idle IP address, and creating the virtual cloud host according to the released idle IP address. Wherein the free IP address refers to a reserved IP address that is not used.
By dynamically adjusting the number of the reserved IP addresses, different service requirements can be better met, and the service performance of the cloud platform is improved.
Fig. 2 is a schematic structural diagram of an apparatus for allocating an IP address based on multiple architectures according to an embodiment of the present invention, which includes a setting unit 21, a binding unit 22, an acting unit 23, and a generating unit 24;
a setting unit 21, configured to set a corresponding network and a subnet network for a reserved IP address when the reserved IP address is obtained; the subnet network segment of the subnet network comprises a reserved IP address;
a binding unit 22, configured to bind the reserved IP address with the reserved virtual port, and set a port state of the virtual port as unavailable;
a unit 23, configured to, when a high-availability service configuration instruction of the virtual cloud host is received, use the target reserved IP address bound to the virtual port as a high-availability IP address of the virtual cloud host; the target reserved IP address is a reserved IP address matched with a subnet network to which the virtual cloud host belongs;
the generating unit 24 is configured to generate a floating IP address corresponding to the high available IP address according to a preset access rule, so that a user can call the high available service of the virtual cloud host according to the floating IP address.
Optionally, the setting unit includes a judging subunit and a creating subunit;
the judging subunit is used for judging whether the acquired reserved IP address belongs to the existing subnet section;
and the creating subunit is used for creating the network with the reserved IP address and the subnet network when the reserved IP address does not belong to the existing subnet section.
Optionally, the system further comprises a coincident address judging unit and a prompting unit;
the system comprises a superposed address judging unit, a virtual cloud host establishing unit and a virtual cloud host configuration unit, wherein the superposed address judging unit is used for judging whether an IP address allocated when the virtual cloud host is established is superposed with a reserved IP address or not when a high-availability service configuration instruction of the virtual cloud host is received; when the allocated IP address is not coincident with the reserved IP address when the virtual cloud host is created, triggering as a unit to execute a step of using the target reserved IP address bound by the virtual port as a high-availability IP address of the virtual cloud host;
and the prompting unit is used for displaying the prompt information of the high availability failure of the reserved IP address when the allocated IP address is overlapped with the reserved IP address when the virtual cloud host is created.
Optionally, the system further comprises a high availability judgment unit, a deletion unit and an alarm unit;
the high availability judgment unit is used for judging whether the virtual cloud host bound by the high availability IP address can be smoothly accessed according to the floating IP address;
the deleting unit is used for deleting any virtual cloud host bound with the high available IP address when the virtual cloud host bound with the high available IP address can be smoothly accessed according to the floating IP address;
the high availability judgment unit is also used for judging whether the virtual cloud host bound by the high availability IP address can be smoothly accessed according to the floating IP address after one virtual cloud host is deleted;
and the warning unit is used for displaying warning information that the high available IP address is invalid when the virtual cloud host bound by the high available IP address cannot be accessed smoothly according to the floating IP address or when the virtual cloud host bound by the high available IP address cannot be accessed smoothly according to the floating IP address after one virtual cloud host is deleted.
Optionally, the system further comprises an idle address judging unit, a releasing unit and a creating unit;
the idle address judging unit is used for judging whether an idle IP address exists in the reserved IP addresses or not when the available IP address used for virtual cloud host creation does not exist;
the release unit is used for releasing the idle IP address when the idle IP address exists in the reserved IP address;
and the creating unit is used for creating the virtual cloud host according to the released idle IP address.
The description of the features in the embodiment corresponding to fig. 2 may refer to the related description of the embodiment corresponding to fig. 1, and is not repeated here.
According to the technical scheme, when the reserved IP address is obtained, in order to ensure the availability of the reserved IP address, a corresponding network and a subnet network need to be set for the reserved IP address; and the subnet section of the subnet network comprises the reserved IP address. And binding the reserved IP address with the reserved virtual port, and setting the port state of the virtual port as unavailable. By setting the state of the virtual port to be unavailable, the condition that the reserved IP address is randomly called by other services can be effectively avoided. When a high-availability service configuration instruction of the virtual cloud host is received, the target reserved IP address bound by the virtual port is used as the high-availability IP address of the virtual cloud host; the target reserved IP address is a reserved IP address matched with the subnet network to which the virtual cloud host belongs. In order to enable a user to call a high-availability service of a virtual cloud host, a floating IP address corresponding to a high-availability IP address needs to be generated according to a preset access rule. The floating IP address refers to an address presented to a user, and the user can call the highly available service of the virtual cloud host according to the floating IP address. In the technical scheme, the high-availability IP addresses required to be used for the virtual cloud host are reserved in advance, and unified management of all the reserved IP addresses is realized through one reserved virtual port, so that resource waste of the IP addresses and the port addresses is reduced, and the management of the high-availability IP addresses is simpler and more efficient.
Fig. 3 is a schematic hardware structure diagram of an apparatus 30 for allocating an IP address based on multiple architectures according to an embodiment of the present invention, including:
a memory 31 for storing a computer program;
a processor 32 for executing a computer program to implement the steps of the multi-fabric based IP address assignment method as described in any of the embodiments above.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the multi-architecture-based IP address allocation method according to any of the above embodiments are implemented.
The foregoing describes a method, an apparatus, and a computer-readable storage medium for allocating an IP address based on multiple architectures according to embodiments of the present invention in detail. The embodiments are described in a progressive mode in the specification, the emphasis of each embodiment is on the difference from the other embodiments, and the same and similar parts among the embodiments can be referred to each other. The device disclosed in the embodiment corresponds to the method disclosed in the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

Claims (10)

1. A multi-architecture based IP address allocation method is characterized by comprising the following steps:
when a reserved IP address is obtained, setting a corresponding network and a subnet network for the reserved IP address; wherein, the subnet network segment of the subnet network comprises the reserved IP address;
binding the reserved IP address with a reserved virtual port, and setting the port state of the virtual port as unavailable;
when a high-availability service configuration instruction of a virtual cloud host is received, taking a target reserved IP address bound by the virtual port as a high-availability IP address of the virtual cloud host; the target reserved IP address is a reserved IP address matched with a subnet network to which the virtual cloud host belongs;
and generating a floating IP address corresponding to the high-availability IP address according to a preset access rule, so that a user can call the high-availability service of the virtual cloud host according to the floating IP address.
2. The method according to claim 1, wherein the setting a corresponding network and a subnet network for the reserved IP address when the reserved IP address is obtained comprises:
judging whether the acquired reserved IP address belongs to the existing subnet section;
and when the reserved IP address does not belong to the existing subnet section, establishing the network of the reserved IP address and the subnet network.
3. The multi-architecture based IP address allocation method according to claim 1, further comprising, before the step of using the target reserved IP address bound by the virtual port as the high available IP address of the virtual cloud host:
when a high-availability service configuration instruction of a virtual cloud host is received, judging whether an IP address allocated when the virtual cloud host is created is coincident with the reserved IP address;
when the IP address allocated during the virtual cloud host creation is coincident with the reserved IP address, displaying prompt information of high availability failure of the reserved IP address;
and when the allocated IP address is not coincident with the reserved IP address when the virtual cloud host is created, executing the step of taking the target reserved IP address bound by the virtual port as a high-availability IP address of the virtual cloud host.
4. The method of claim 1, further comprising, after the generating a floating IP address corresponding to the high-availability IP address according to a preset access rule:
judging whether the virtual cloud host bound by the high available IP address can be accessed smoothly according to the floating IP address;
when the virtual cloud host bound with the high available IP address can be smoothly accessed according to the floating IP address, deleting any one virtual cloud host bound with the high available IP address;
judging whether the virtual cloud host bound by the high available IP address can be smoothly accessed according to the floating IP address after one virtual cloud host is deleted;
and when the virtual cloud host bound by the high available IP address cannot be accessed smoothly according to the floating IP address or when the virtual cloud host bound by the high available IP address cannot be accessed smoothly according to the floating IP address after one virtual cloud host is deleted, displaying the alarm information of the failure of the high available IP address.
5. The method according to any one of claims 1 to 4, further comprising, after the generating a floating IP address corresponding to the high available IP address according to a preset access rule:
when an available IP address used for virtual cloud host creation does not exist, judging whether an idle IP address exists in the reserved IP address or not;
and when the idle IP address exists in the reserved IP address, releasing the idle IP address, and creating the virtual cloud host according to the released idle IP address.
6. An IP address distribution device based on multi-architecture is characterized by comprising a setting unit, a binding unit, an acting unit and a generating unit;
the setting unit is used for setting a corresponding network and a subnet network for the reserved IP address when the reserved IP address is obtained; wherein, the subnet network segment of the subnet network comprises the reserved IP address;
the binding unit is used for binding the reserved IP address with a reserved virtual port and setting the port state of the virtual port as unavailable;
the acting unit is used for taking a target reserved IP address bound by the virtual port as a high-availability IP address of the virtual cloud host when a high-availability service configuration instruction of the virtual cloud host is received; the target reserved IP address is a reserved IP address matched with a subnet network to which the virtual cloud host belongs;
the generating unit is used for generating a floating IP address corresponding to the high-availability IP address according to a preset access rule, so that a user can call the high-availability service of the virtual cloud host according to the floating IP address.
7. The multi-fabric based IP address allocating apparatus according to claim 6, wherein the setting unit includes a judging subunit and a creating subunit;
the judging subunit is configured to judge whether the acquired reserved IP address belongs to an existing subnet section;
and the creating subunit is configured to create a network and a subnet network of the reserved IP address when the reserved IP address does not belong to an existing subnet section.
8. The multi-fabric based IP address allocating apparatus according to claim 6, further comprising a coincident address judging unit and a prompting unit;
the coincident address judging unit is used for judging whether the IP address allocated when the virtual cloud host is established is coincident with the reserved IP address or not when a high-availability service configuration instruction of the virtual cloud host is received; when the allocated IP address is not coincident with the reserved IP address when the virtual cloud host is created, triggering the acting unit to execute the step of taking the target reserved IP address bound by the virtual port as the high available IP address of the virtual cloud host;
and the prompting unit is used for displaying the prompt information of the high availability failure of the reserved IP address when the allocated IP address is overlapped with the reserved IP address when the virtual cloud host is created.
9. An apparatus for allocating an IP address based on a multi-architecture, comprising:
a memory for storing a computer program;
a processor for executing said computer program to implement the steps of the multi-fabric based IP address assignment method according to any of claims 1 to 5.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the multi-architecture based IP address allocation method according to any one of claims 1 to 5.
CN202010878486.4A 2020-08-27 2020-08-27 Multi-architecture-based IP address allocation method, device and medium Active CN112003964B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010878486.4A CN112003964B (en) 2020-08-27 2020-08-27 Multi-architecture-based IP address allocation method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010878486.4A CN112003964B (en) 2020-08-27 2020-08-27 Multi-architecture-based IP address allocation method, device and medium

Publications (2)

Publication Number Publication Date
CN112003964A CN112003964A (en) 2020-11-27
CN112003964B true CN112003964B (en) 2023-01-10

Family

ID=73471222

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010878486.4A Active CN112003964B (en) 2020-08-27 2020-08-27 Multi-architecture-based IP address allocation method, device and medium

Country Status (1)

Country Link
CN (1) CN112003964B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112887330B (en) * 2021-02-26 2022-05-31 浪潮云信息技术股份公司 Device and method for realizing network ACL isolation floating IP
CN115225612B (en) * 2022-06-29 2023-11-14 济南浪潮数据技术有限公司 Management method, device, equipment and medium for K8S cluster reserved IP

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107707393A (en) * 2017-09-26 2018-02-16 赛尔网络有限公司 More live systems based on Openstack O version characteristics
CN109314724A (en) * 2016-08-09 2019-02-05 华为技术有限公司 The methods, devices and systems of virtual machine access physical server in cloud computing system
CN109445912A (en) * 2018-11-14 2019-03-08 国网新疆电力有限公司信息通信公司 A kind of configuration method of virtual machine, configuration system and SDN controller
CN110177048A (en) * 2019-05-28 2019-08-27 银联商务股份有限公司 A kind of high availability implementation method and device of virtual private cloud system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109314724A (en) * 2016-08-09 2019-02-05 华为技术有限公司 The methods, devices and systems of virtual machine access physical server in cloud computing system
CN107707393A (en) * 2017-09-26 2018-02-16 赛尔网络有限公司 More live systems based on Openstack O version characteristics
CN109445912A (en) * 2018-11-14 2019-03-08 国网新疆电力有限公司信息通信公司 A kind of configuration method of virtual machine, configuration system and SDN controller
CN110177048A (en) * 2019-05-28 2019-08-27 银联商务股份有限公司 A kind of high availability implementation method and device of virtual private cloud system

Also Published As

Publication number Publication date
CN112003964A (en) 2020-11-27

Similar Documents

Publication Publication Date Title
US10659471B2 (en) Method for virtual machine to access physical server in cloud computing system, apparatus, and system
EP3481007B1 (en) Method, apparatus and management server for processing resource pool
CN109254831B (en) Virtual machine network security management method based on cloud management platform
CN111404753B (en) Flat network configuration method, computer equipment and storage medium
CN106790758B (en) Method and device for accessing network object in NAT network
CN109067877B (en) Control method for cloud computing platform deployment, server and storage medium
CN109981493B (en) Method and device for configuring virtual machine network
CN112003964B (en) Multi-architecture-based IP address allocation method, device and medium
CN103703724A (en) Resource payment method
CN103685608B (en) A kind of method and device for automatically configuring secure virtual machine IP address
CN105554015A (en) Management network and method for multi-tenant container cloud computing system
CN104205051A (en) Virtualized movement of enhanced network services associated with a virtual machine
WO2020253634A1 (en) Data processing method, system and device
CN112099913B (en) Method for realizing virtual machine security isolation based on OpenStack
CN110266761B (en) Load balancing application creation method and device, computer equipment and storage medium
US11070521B2 (en) Application attachment based firewall management
US10116622B2 (en) Secure communication channel using a blade server
CN113361913A (en) Communication service arranging method, device, computer equipment and storage medium
CN109819064B (en) Method for communication between modules, operating system module and conference panel
CN105208137A (en) Internet Protocol (IP) address allocation methods, device, server and terminal
CN112769829B (en) Deployment method of cloud physical machine, related equipment and readable storage medium
CN111818081A (en) Virtual encryption machine management method and device, computer equipment and storage medium
CN106878075A (en) A kind of message processing method and device
CN115904626A (en) Method and system for deploying cloud resource pool architecture
CN111683164B (en) IP address configuration method and VPN service system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant