CN112291382B - IP address allocation method and device - Google Patents

IP address allocation method and device Download PDF

Info

Publication number
CN112291382B
CN112291382B CN202011049387.1A CN202011049387A CN112291382B CN 112291382 B CN112291382 B CN 112291382B CN 202011049387 A CN202011049387 A CN 202011049387A CN 112291382 B CN112291382 B CN 112291382B
Authority
CN
China
Prior art keywords
address
target
vlan
tenant
pool
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
CN202011049387.1A
Other languages
Chinese (zh)
Other versions
CN112291382A (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.)
New H3C Security Technologies Co Ltd
Original Assignee
New H3C Security Technologies 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 New H3C Security Technologies Co Ltd filed Critical New H3C Security Technologies Co Ltd
Priority to CN202011049387.1A priority Critical patent/CN112291382B/en
Publication of CN112291382A publication Critical patent/CN112291382A/en
Application granted granted Critical
Publication of CN112291382B publication Critical patent/CN112291382B/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
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • 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/5061Pools of addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Abstract

The present application relates to the technical field of cloud platforms, and in particular, to a method and an apparatus for allocating an IP address. The method comprises the following steps: when it is monitored that a target tenant creates a target business service, determining a target address pool corresponding to the target business service based on the first incidence relation; acquiring an unallocated target IP address from the target address pool based on a preset IP address allocation rule; judging whether a corresponding first VLAN is distributed to the target tenant or not based on the second incidence relation; and if the target tenant is judged to be allocated with the corresponding first VLAN, the target IP address and the first VLAN are issued to a target virtual machine for running the target service, and the target IP address is marked as allocated in the target address pool.

Description

IP address allocation method and device
Technical Field
The present application relates to the technical field of cloud platforms, and in particular, to a method and an apparatus for allocating an IP address.
Background
With the development of computer hardware processing capacity and network virtualization technology, especially the generation of NFV technology, the resource utilization rate can be effectively improved, the software configuration process is simplified, and the cost of operation and maintenance service of enterprises can be reduced.
In a cloud computing platform of virtualization technology, a unit for providing services for applications with different requirements is a virtual device. The virtual device, like a normal service device, may install an operating system, access network resources, and service orchestration, among other things. These virtual devices are created on the cloud computing platform and need to be assigned IP addresses.
At present, an IP address is generally allocated from an address pool (e.g., an address pool of a DHCP server) according to a preset rule for virtual devices applying for IP addresses, when customers requiring a large number of IP addresses, such as operators and government industry clouds, have 10000 tenants, each tenant needs to create 100 Web application protections, 100 operation and maintenance audits, and when multiple tenants concurrently create service services, the IP addresses are sequentially allocated from the same address pool for the virtual devices corresponding to the service services, the message overhead in the process of applying for IP addresses is large, and the allocation efficiency is low.
Disclosure of Invention
The application provides an IP address allocation method and device, which are used for solving the problem of low resource allocation efficiency in the prior art.
In a first aspect, the present application provides an IP address allocation method, which is applied to an address management server in a cloud platform system, where the address management server maintains a plurality of address pools, a VLAN resource pool, a first association relationship between each service and its corresponding address pool, and a second association relationship between a tenant having at least one service and its allocated VLAN, and the method includes:
when it is monitored that a target tenant creates a target business service, determining a target address pool corresponding to the target business service based on the first incidence relation;
acquiring an unallocated target IP address from the target address pool based on a preset IP address allocation rule;
judging whether a corresponding first VLAN is distributed to the target tenant or not based on the second incidence relation;
and if the target tenant is judged to be allocated with the corresponding first VLAN, the target IP address and the first VLAN are issued to a target virtual machine for running the target service, and the target IP address is marked as allocated in the target address pool.
Optionally, the method further comprises:
if the target tenant is judged not to be allocated with the corresponding first VLAN, acquiring an unallocated second VLAN from the VLAN resource pool based on a preset VLAN allocation rule;
and sending the target IP address and the second VLAN to a target virtual machine for running the target service, marking the target IP address as allocated in the target address pool, and marking the second VLAN as allocated in the VLAN resource pool.
Optionally, the target address pool comprises at least two sub-address pools; the step of obtaining an unallocated destination IP address from the destination address pool includes:
determining a target sub-address pool which is enabled currently and has an unallocated IP address from the at least two sub-address pools;
and acquiring an unallocated target IP address from the target sub-address pool.
Optionally, the method further comprises:
when any service of any tenant is detected to be deleted, the IP address allocated to the virtual machine for running any service is recovered, and the IP address is marked as unallocated in the address pool where the IP address is located.
Optionally, the method further comprises:
judging whether any tenant has other established business services;
if the any tenant is judged to have no other established service, the VLAN distributed to the any tenant is recovered, and the VLAN is marked as unallocated in the VLAN resource pool.
In a second aspect, an embodiment of the present application provides an IP address allocation apparatus, which is applied to an address management server in a cloud platform system, where the address management server maintains a plurality of address pools, a VLAN resource pool, a first association relationship between each service and its corresponding address pool, and a second association relationship between a tenant created with at least one service and its allocated VLAN, and the apparatus includes:
the determining unit is used for determining a target address pool corresponding to the target business service based on the first incidence relation when the fact that the target tenant creates the target business service is monitored;
the acquisition unit is used for acquiring an unallocated target IP address from the target address pool based on a preset IP address allocation rule;
a judging unit, configured to judge whether a corresponding first VLAN has been allocated to the target tenant based on the second association relationship;
if the judging unit judges that the corresponding first VLAN is allocated to the target tenant, the issuing unit is used for issuing the target IP address and the first VLAN to a target virtual machine for running the target service, and marking the target IP address as allocated in the target address pool.
Optionally, if the determining unit determines that the target tenant is not assigned with the corresponding first VLAN, the obtaining unit is further configured to obtain an unassigned second VLAN from the VLAN resource pool based on a preset VLAN assignment rule;
the issuing unit is configured to issue the target IP address and the second VLAN to a target virtual machine for running the target service, mark the target IP address as allocated in the target address pool, and mark the second VLAN as allocated in the VLAN resource pool.
Optionally, the target address pool comprises at least two sub-address pools; when the unallocated target IP address is obtained from the target address pool, the obtaining unit is specifically configured to:
determining a target sub-address pool which is enabled currently and has an unallocated IP address from the at least two sub-address pools;
and acquiring an unallocated target IP address from the target sub-address pool.
Optionally, the apparatus further comprises:
and the recovery unit is used for recovering the IP address allocated to the virtual machine for running any service when any service of any tenant is detected to be deleted, and marking the IP address as unallocated in an address pool where the IP address is located.
Optionally, the determining unit is further configured to determine whether any tenant further has another created business service;
if the judging unit judges that any tenant does not have other created service services, the withdrawing unit is further configured to withdraw the VLAN allocated to any tenant, and mark the VLAN as unallocated in the VLAN resource pool.
In a third aspect, an embodiment of the present application provides an IP address allocation apparatus, including:
a memory for storing program instructions;
a processor for calling program instructions stored in said memory and for executing the steps of the method according to any one of the above first aspects in accordance with the obtained program instructions.
In a fourth aspect, the present application further provides a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the steps of the method according to any one of the above first aspects.
To sum up, the IP address allocation method provided in the embodiment of the present application is applied to an address management server in a cloud platform system, where the address management server maintains a plurality of address pools, a VLAN resource pool, a first association relationship between each service and its corresponding address pool, and a second association relationship between a tenant having at least one service and its allocated VLAN, and the method includes: when it is monitored that a target tenant creates a target business service, determining a target address pool corresponding to the target business service based on the first incidence relation; acquiring an unallocated target IP address from the target address pool based on a preset IP address allocation rule; judging whether a corresponding first VLAN is distributed to the target tenant or not based on the second incidence relation; and if the target tenant is judged to be allocated with the corresponding first VLAN, the target IP address and the first VLAN are issued to a target virtual machine for running the target service, and the target IP address is marked as allocated in the target address pool.
By adopting the IP address allocation method provided by the embodiment of the application, the association relationship between the business service and the corresponding address pool is preset in the address management server, the address management server monitors the action of a tenant for creating the business service (a virtual machine corresponding to the business service) and actively allocates the corresponding IP address for the tenant from the address pool corresponding to the business service, when the business service is concurrently created by multiple tenants, the resource allocation can be carried out in a multi-thread manner, the virtual machine is not required to send a resource application message to the address management server, the message overhead is reduced, the resource allocation efficiency is greatly improved, and the corresponding VLAN is actively allocated for the tenant from the VLAN resource pool, so that the isolation of tenant data is realized.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments of the present application or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings of the embodiments of the present application.
Fig. 1 is a detailed flowchart of an IP address allocation method according to an embodiment of the present application;
fig. 2 is a schematic process diagram of an IP address allocation method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an IP address assignment device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of another IP address assignment device according to an embodiment of the present application.
Detailed Description
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein is meant to encompass any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in the embodiments of the present application to describe various information, the information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. Depending on the context, moreover, the word "if" as used may be interpreted as "at … …" or "when … …" or "in response to a determination".
Exemplarily, referring to fig. 1, a detailed flowchart of an IP address assignment method provided in an embodiment of the present application is shown, where the method is applied to an address management server in a cloud platform system, where the address management server maintains a plurality of address pools, VLAN resource pools, a first association relationship between each service and its corresponding address pool, and a second association relationship between a tenant having at least one service and its assigned VLAN, and the method includes the following steps:
step 100: and when the target tenant is monitored to create the target business service, determining a target address pool corresponding to the target business service based on the first incidence relation.
In this embodiment of the present application, a plurality of address pools (IP address pools) are maintained in an address management server, and an address pool corresponding to each service is configured in advance based on a service type of each service, for example, if the service includes service 1, service 2, … …, and service n, the maintained address pools may include address pool 1, address pool 2, … …, and address pool n, and then, an association relationship between a service maintained in the address management server and its corresponding address pool may include: the address pool corresponding to the service 1 is the address pool 1, the address pool corresponding to the service 2 is the address pool 2, … …, and the address pool corresponding to the service n is the address pool n.
That is to say, when it is monitored that any tenant creates a virtual machine for running the service 1, it is determined that an address pool corresponding to the service 1 is the address pool 1, that is, an available IP address needs to be allocated to the virtual machine from the address pool 1, and when it is monitored that any tenant creates a virtual machine for running the service 2, it is determined that an address pool corresponding to the service 2 is the address pool 2, that is, an available IP address needs to be allocated to the virtual machine from the address pool 2.
Step 110: and acquiring the unallocated target IP address from the target address pool based on a preset IP address allocation rule.
In the embodiment of the present application, a preferred implementation manner is that the target address pool includes at least two sub-address pools; then, when the unallocated target IP address is obtained from the target address pool, a preferred implementation manner is to determine a target sub-address pool which is currently enabled and has no allocated IP address from the at least two sub-address pools; and acquiring the unallocated target IP address from the target sub-address pool.
For example, assuming that each address pool includes three sub-address pools, only one sub-address pool is enabled at the same time, for example, the destination address pool includes sub-address pool 1, sub-address pool 2, and sub-address pool 3, and the currently enabled sub-address pool is sub-address pool 1(IP address is not allocated), when it is monitored that the destination tenant creates a destination service, an unallocated destination IP address is obtained from sub-address pool 1 of the destination address pool.
It should be noted that, in the embodiment of the present application, a flag indicating whether each IP address in one sub-address pool is allocated to a virtual machine is set, where if the IP address is allocated to a virtual machine for use, the IP address is marked as allocated (e.g., a state flag is 1), and if the IP address is not allocated to a virtual machine for use, the IP address is marked as unallocated (e.g., a state flag is 0).
Step 120: and judging whether the corresponding first VLAN is distributed to the target tenant or not based on the second association relation.
In the embodiment of the application, a VLAN resource pool is also maintained in the address management server, and if at least one service is currently created by a tenant, it indicates that the tenant is already assigned with a corresponding VLAN, and an association relationship between the tenant and the VLAN assigned to the tenant is locally maintained.
That is to say, if a tenant does not currently have a created service, when the tenant creates a first service, the tenant allocates a corresponding VLAN to the tenant, and locally maintains an association relationship between the tenant and the VLAN allocated to the tenant. Subsequently, on the premise that the first service created by the tenant is not deleted, when the tenant creates another service, it may be determined that the corresponding VLAN is allocated to the tenant.
Step 130: and if the target tenant is judged to be allocated with the corresponding first VLAN, the target IP address and the first VLAN are issued to a target virtual machine for running the target service, and the target IP address is marked as allocated in the target address pool.
Specifically, if the association relationship between the target tenant and the first VLAN is determined to be maintained locally based on the second association relationship, it may be determined that the target tenant is already assigned with the corresponding VLAN, and it is not necessary to obtain an unassigned VLAN from the VLAN resource pool. At this time, the determined target IP address and the first VLAN may be directly sent to a target virtual machine for a target service of a target tenant, which is created on the cloud platform, so that the target virtual machine performs network configuration based on the target IP address and the first VLAN. Meanwhile, the destination IP address may be marked as allocated in the destination address pool. Obviously, the IP addresses marked as allocated cannot be reallocated for use by other virtual machines.
Further, if it is determined that the target tenant is not assigned with the corresponding first VLAN, acquiring an unassigned second VLAN from the VLAN resource pool based on a preset VLAN assignment rule; and issuing the target IP address and the second VLAN to a target virtual machine for running the target service, marking the target IP address as allocated in the target address pool, and marking the second VLAN as allocated in the VLAN resource pool.
That is, the target service created by the target tenant is the first service created currently, and a VLAN is not allocated to the target tenant before the target service, at this time, an unallocated VLAN needs to be obtained from the VLAN resource pool, and the VLAN is allocated to the target tenant, and after the VLAN is issued to the target virtual machine, the VLAN is marked as allocated in the VLAN resource pool. Obviously, VLANs marked as allocated cannot be reallocated for use by other tenants.
Further, in this embodiment of the present application, the IP address allocation method may further include the following steps: when any service of any tenant is detected to be deleted, the IP address allocated to the virtual machine for running any service is recovered, and the IP address is marked as unallocated in the address pool where the IP address is located.
That is, when a business service (virtual machine corresponding to the business service) of a tenant is deleted, the IP address allocated to the business service is reclaimed, and the IP address is marked as unallocated in the address pool.
Furthermore, in this embodiment of the present application, the IP address allocation method may further include the following steps: judging whether any tenant has other established business services; if it is determined that any tenant does not have any other created service, the VLAN allocated to any tenant is retrieved, and the VLAN is marked as unallocated in the VLAN resource pool.
That is, when all the service services created by a tenant are deleted (the virtual machine corresponding to the service is deleted), the VLAN assigned to the tenant may be received, and the VLAN is marked as unassigned in the VLAN resource pool.
The IP address allocation method provided in the embodiments of the present application is described in detail below with reference to specific application scenarios. For example, referring to fig. 2, a process schematic diagram of an IP address allocation method provided in this embodiment of the present application is assumed that an address pool corresponding to a service 1 maintained by an IP address allocation server is an address pool 1, the address pool 1 includes a sub-address pool 11, a sub-address pool 12 and a sub-address pool 13, an address pool corresponding to a service 2 is an address pool 2, the address pool 2 includes a sub-address pool 21, a sub-address pool 22 and a sub-address pool 23, the IP address allocation server further maintains a VLAN resource pool, and detailed description is given by taking an example of creating the service 1 by the tenant 1, the tenant 1 performs operations of a common service 1 through a client, at this time, a CAS (Cloud Automation System, Cloud computing management platform) creates a VM1 for running the service 1 created by the tenant 1, and accordingly, the address pool management server monitors operations created by the VM1, and the address management server needs to allocate an IP address and a VLAN1, the address management server determines that an address pool corresponding to the business service 1 is an address pool 1, and a sub-address pool which is enabled in the address pool 1 and has no allocated IP address is a sub-address pool 11, the address pool management server can acquire an IP address (such as the IP address 1) from the sub-address pool 11, further, the address pool management server judges whether a VLAN is allocated to the tenant 1, if the VLAN is allocated (such as other business services are established before the tenant 1 establishes the business service 1, and when other business services are established, a VLAN is allocated to the tenant 1), the allocated VLAN (such as the VLAN1) is acquired, and finally, the acquired IP address 1 and the VLAN1 are sent to a CAS platform, so that the VM platform performs network configuration on the CAS platform for VM 1; further, when the CAS platform deletes the VM1 corresponding to the service 1, the IP address 1 is released, and it is determined whether the VLAN1 needs to be released according to a judgment basis of whether all the service currently created by the tenant 1 is deleted.
Preferably, in this embodiment of the present application, the IP addresses stored in one address pool or one sub-address pool of the address pool in the address management server are IP addresses of the same network segment.
Exemplarily, referring to fig. 3, a schematic structural diagram of an IP address allocating apparatus provided in an embodiment of the present application is shown, where the IP address allocating apparatus is applied to an address management server in a cloud platform system, the address management server maintains a plurality of address pools, VLAN resource pools, a first association relationship between each service and its corresponding address pool, and a second association relationship between a tenant having at least one service and its allocated VLAN, the apparatus includes a determining unit 30, an obtaining unit 31, a determining unit 32, and a issuing unit 33, where,
a determining unit 30, configured to determine, when it is monitored that a target tenant creates a target service, a target address pool corresponding to the target service based on the first association relationship;
an obtaining unit 31, configured to obtain an unallocated target IP address from the target address pool based on a preset IP address allocation rule;
a determining unit 32, configured to determine whether a corresponding first VLAN has been allocated to the target tenant based on the second association relationship;
if the determining unit 32 determines that the target tenant is assigned with the corresponding first VLAN, the issuing unit 33 is configured to issue the target IP address and the first VLAN to a target virtual machine for running the target service, and mark the target IP address as assigned in the target address pool.
Optionally, if the determining unit 32 determines that the corresponding first VLAN is not allocated to the target tenant, the obtaining unit 31 is further configured to obtain an unallocated second VLAN from the VLAN resource pool based on a preset VLAN allocation rule;
the issuing unit 33 issues the target IP address and the second VLAN to a target virtual machine for running the target service, marks the target IP address as allocated in the target address pool, and marks the second VLAN as allocated in the VLAN resource pool.
Optionally, the target address pool comprises at least two sub-address pools; when the unallocated target IP address is obtained from the target address pool, the obtaining unit 31 is specifically configured to:
determining a target sub-address pool which is enabled currently and has an unallocated IP address from the at least two sub-address pools;
and acquiring an unallocated target IP address from the target sub-address pool.
Optionally, the apparatus further comprises:
and the recovery unit is used for recovering the IP address allocated to the virtual machine for running any service when any service of any tenant is detected to be deleted, and marking the IP address as unallocated in an address pool where the IP address is located.
Optionally, the determining unit 32 is further configured to determine whether there are other created business services for any tenant;
if the determining unit 32 determines that there is no other created service for any tenant, the reclaiming unit is further configured to reclaim the VLAN allocated to any tenant, and mark the VLAN as unallocated in the VLAN resource pool.
The above units may be one or more integrated circuits configured to implement the above methods, for example: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above units is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
To sum up, the IP address allocation method provided in the embodiment of the present application is applied to an address management server in a cloud platform system, where the address management server maintains a plurality of address pools, a VLAN resource pool, a first association relationship between each service and its corresponding address pool, and a second association relationship between a tenant having at least one service and its allocated VLAN, and the method includes: when it is monitored that a target tenant creates a target business service, determining a target address pool corresponding to the target business service based on the first incidence relation; acquiring an unallocated target IP address from the target address pool based on a preset IP address allocation rule; judging whether a corresponding first VLAN is distributed to the target tenant or not based on the second incidence relation; and if the target tenant is judged to be allocated with the corresponding first VLAN, the target IP address and the first VLAN are issued to a target virtual machine for running the target service, and the target IP address is marked as allocated in the target address pool.
By adopting the IP address allocation method provided by the embodiment of the application, the association relationship between the business service and the corresponding address pool is preset in the address management server, the address management server monitors the action of a tenant for creating the business service (a virtual machine corresponding to the business service) and actively allocates the corresponding IP address for the tenant from the address pool corresponding to the business service, when the business service is concurrently created by multiple tenants, the resource allocation can be carried out in a multi-thread manner, the virtual machine is not required to send a resource application message to the address management server, the message overhead is reduced, the resource allocation efficiency is greatly improved, and the corresponding VLAN is actively allocated for the tenant from the VLAN resource pool, so that the isolation of tenant data is realized.
Further, in the IP address assignment device provided in the embodiment of the present application, from a hardware level, a schematic diagram of a hardware architecture of the IP address assignment device may be shown in fig. 4, where the IP address assignment device may include: a memory 40 and a processor 41, which,
memory 40 is used to store program instructions; processor 41 calls program instructions stored in memory 40 and executes the above-described method embodiments in accordance with the obtained program instructions. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the present application also provides an address management server comprising at least one processing element (or chip) for performing the above method embodiments.
Optionally, the present application also provides a program product, such as a computer-readable storage medium, having stored thereon computer-executable instructions for causing the computer to perform the above-described method embodiments.
Here, a machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and so forth. For example, the machine-readable storage medium may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Furthermore, these computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

1. An IP address allocation method is applied to an address management server in a cloud platform system, the address management server maintains a plurality of address pools, VLAN resource pools, a first association relationship between each business service and the corresponding address pool, and a second association relationship between a tenant with at least one business service and an allocated VLAN, and the method comprises the following steps:
when it is monitored that a target tenant creates a target business service, determining a target address pool corresponding to the target business service based on the first incidence relation;
acquiring an unallocated target IP address from the target address pool based on a preset IP address allocation rule;
judging whether a corresponding first VLAN is distributed to the target tenant or not based on the second incidence relation;
and if the target tenant is judged to be allocated with the corresponding first VLAN, the target IP address and the first VLAN are issued to a target virtual machine for running the target service, and the target IP address is marked as allocated in the target address pool.
2. The method of claim 1, wherein the method further comprises:
if the target tenant is judged not to be allocated with the corresponding first VLAN, acquiring an unallocated second VLAN from the VLAN resource pool based on a preset VLAN allocation rule;
and sending the target IP address and the second VLAN to a target virtual machine for running the target service, marking the target IP address as allocated in the target address pool, and marking the second VLAN as allocated in the VLAN resource pool.
3. The method of claim 1, wherein the pool of target addresses comprises at least two sub-pools of addresses; the step of obtaining an unallocated destination IP address from the destination address pool includes:
determining a target sub-address pool which is enabled currently and has an unallocated IP address from the at least two sub-address pools;
and acquiring an unallocated target IP address from the target sub-address pool.
4. The method of any one of claims 1-3, further comprising:
when any service of any tenant is detected to be deleted, the IP address allocated to the virtual machine for running any service is recovered, and the IP address is marked as unallocated in the address pool where the IP address is located.
5. The method of claim 4, wherein the method further comprises:
judging whether any tenant has other established business services;
if the any tenant is judged to have no other established service, the VLAN distributed to the any tenant is recovered, and the VLAN is marked as unallocated in the VLAN resource pool.
6. An IP address allocation apparatus, applied to an address management server in a cloud platform system, where the address management server maintains a plurality of address pools, a VLAN resource pool, a first association relationship between each service and its corresponding address pool, and a second association relationship between a tenant created with at least one service and its allocated VLAN, the apparatus comprising:
the determining unit is used for determining a target address pool corresponding to the target business service based on the first incidence relation when the fact that the target tenant creates the target business service is monitored;
the acquisition unit is used for acquiring an unallocated target IP address from the target address pool based on a preset IP address allocation rule;
a judging unit, configured to judge whether a corresponding first VLAN has been allocated to the target tenant based on the second association relationship;
if the judging unit judges that the corresponding first VLAN is allocated to the target tenant, the issuing unit is used for issuing the target IP address and the first VLAN to a target virtual machine for running the target service, and marking the target IP address as allocated in the target address pool.
7. The apparatus of claim 6,
if the judging unit judges that the corresponding first VLAN is not allocated to the target tenant, the acquiring unit is further used for acquiring an unallocated second VLAN from the VLAN resource pool based on a preset VLAN allocation rule;
the issuing unit is configured to issue the target IP address and the second VLAN to a target virtual machine for running the target service, mark the target IP address as allocated in the target address pool, and mark the second VLAN as allocated in the VLAN resource pool.
8. The apparatus of claim 6, wherein the pool of target addresses comprises at least two sub-pools of addresses; when the unallocated target IP address is obtained from the target address pool, the obtaining unit is specifically configured to:
determining a target sub-address pool which is enabled currently and has an unallocated IP address from the at least two sub-address pools;
and acquiring an unallocated target IP address from the target sub-address pool.
9. The apparatus of any of claims 6-7, wherein the apparatus further comprises:
and the recovery unit is used for recovering the IP address allocated to the virtual machine for running any service when any service of any tenant is detected to be deleted, and marking the IP address as unallocated in an address pool where the IP address is located.
10. The apparatus of claim 9,
the judging unit is also used for judging whether any tenant has other established business services;
if the judging unit judges that any tenant does not have other created service services, the withdrawing unit is further configured to withdraw the VLAN allocated to any tenant, and mark the VLAN as unallocated in the VLAN resource pool.
CN202011049387.1A 2020-09-29 2020-09-29 IP address allocation method and device Active CN112291382B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011049387.1A CN112291382B (en) 2020-09-29 2020-09-29 IP address allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011049387.1A CN112291382B (en) 2020-09-29 2020-09-29 IP address allocation method and device

Publications (2)

Publication Number Publication Date
CN112291382A CN112291382A (en) 2021-01-29
CN112291382B true CN112291382B (en) 2022-04-01

Family

ID=74422984

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011049387.1A Active CN112291382B (en) 2020-09-29 2020-09-29 IP address allocation method and device

Country Status (1)

Country Link
CN (1) CN112291382B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113489701B (en) * 2021-06-29 2022-09-30 深信服科技股份有限公司 Firewall configuration method, system and equipment
CN114039951A (en) * 2021-11-08 2022-02-11 北京天融信网络安全技术有限公司 Method, device and system for dynamically allocating address pool
CN114244842B (en) * 2021-12-23 2023-07-25 绿盟科技集团股份有限公司 Secure resource scheduling method and device, electronic equipment and storage medium
CN114301731B (en) * 2021-12-31 2023-12-22 德力西电气有限公司 Address management method, master device and slave device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105872126A (en) * 2016-05-05 2016-08-17 成都西加云杉科技有限公司 Method and gateway for distributing IP addresses
CN106878483A (en) * 2017-01-24 2017-06-20 新华三技术有限公司 A kind of IP address distribution method and device
CN109088823A (en) * 2017-06-14 2018-12-25 大唐移动通信设备有限公司 A kind of method and device for realizing terminal interconnection
CN109451084A (en) * 2018-09-14 2019-03-08 华为技术有限公司 A kind of service access method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9338091B2 (en) * 2014-03-27 2016-05-10 Nicira, Inc. Procedures for efficient cloud service access in a system with multiple tenant logical networks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105872126A (en) * 2016-05-05 2016-08-17 成都西加云杉科技有限公司 Method and gateway for distributing IP addresses
CN106878483A (en) * 2017-01-24 2017-06-20 新华三技术有限公司 A kind of IP address distribution method and device
CN109088823A (en) * 2017-06-14 2018-12-25 大唐移动通信设备有限公司 A kind of method and device for realizing terminal interconnection
CN109451084A (en) * 2018-09-14 2019-03-08 华为技术有限公司 A kind of service access method and device

Also Published As

Publication number Publication date
CN112291382A (en) 2021-01-29

Similar Documents

Publication Publication Date Title
CN112291382B (en) IP address allocation method and device
US9385989B2 (en) Method and apparatus for managing MAC address generation for virtualized environments
CN106330769B (en) Service processing method and server
US10684894B2 (en) Capacity management in provider networks using dynamic host device instance model reconfigurations
JP2018503897A (en) Resource management in cloud systems
CN111506386A (en) Virtual machine online migration method, device, equipment and computer readable storage medium
US20170093742A1 (en) Managing a shared pool of configurable computing resources having an arrangement of a set of dynamically-assigned resources
GB2558163A (en) Dynamically assigning network addresses
CN113204407A (en) Memory over-allocation management method and device
CN111611050A (en) Information processing method, device, equipment and storage medium
CN111782383A (en) Task allocation method, server, electronic terminal and computer readable storage medium
CN108073423A (en) A kind of accelerator loading method, system and accelerator loading device
US11301299B2 (en) Data based scheduling for horizontally scalable clusters
US11416306B1 (en) Placement to optimize heterogeneous physical host utilization
CN113703912A (en) Virtual machine management method and device
US10009249B2 (en) System with on-demand state for applications
CN112231053B (en) Load balancing service distribution method and device
WO2016074130A1 (en) Batch processing method and device for system invocation commands
CN109347661B (en) Instantiation method and device of consumer VNF
CN113626173B (en) Scheduling method, scheduling device and storage medium
CN108228272B (en) WEB container generation processing method, equipment and server
CN112148426A (en) Bandwidth allocation method and device
CN109062781B (en) Message buffer management method and device
CN110879748B (en) Shared resource allocation method, device and equipment
CN107066335A (en) A kind of optimization method of cloud platform internal memory and optimization 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