CN112637033A - VLAN (virtual local area network) distribution method, device and equipment based on hardware service board card - Google Patents

VLAN (virtual local area network) distribution method, device and equipment based on hardware service board card Download PDF

Info

Publication number
CN112637033A
CN112637033A CN202011455960.9A CN202011455960A CN112637033A CN 112637033 A CN112637033 A CN 112637033A CN 202011455960 A CN202011455960 A CN 202011455960A CN 112637033 A CN112637033 A CN 112637033A
Authority
CN
China
Prior art keywords
vlan
vrouter
target
hardware service
service board
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.)
Granted
Application number
CN202011455960.9A
Other languages
Chinese (zh)
Other versions
CN112637033B (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.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech 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 Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN202011455960.9A priority Critical patent/CN112637033B/en
Publication of CN112637033A publication Critical patent/CN112637033A/en
Application granted granted Critical
Publication of CN112637033B publication Critical patent/CN112637033B/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
    • 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]

Abstract

The embodiment of the application discloses a VLAN distribution method, a device and equipment based on a hardware service board card. In the application, when the OpenStack cloud computing management platform detects a virtual router Vreout creation event triggered by a tenant, a target hardware service board is selected from all existing hardware service boards, and a target VLAN which is not used currently is selected from a VLAN range according to a VLAN range bound by the configured target hardware service board; if the Vrouter corresponding to the tenant does not exist at present, the target hardware service board is controlled to create the Vrouter corresponding to the tenant based on the Vrouter creating event, so that messages which are sent by the tenant from the internal network and used for accessing the external network are forwarded to the external network through the Vrouter, the Vrouter is associated with the target VLAN, VLAN resources on the hardware service board are distributed to the tenant when a plurality of hardware service boards exist in OpenStack, and the tenant can process services according to the distributed VLAN resources.

Description

VLAN (virtual local area network) distribution method, device and equipment based on hardware service board card
Technical Field
The present application relates to the field of network communications, and in particular, to a method, an apparatus, and a device for VLAN assignment based on a hardware service board.
Background
The OpenStack is an open-source cloud computing management platform project, covers various aspects such as networks, virtualization, operating systems and servers, focuses on the realization of functions, and needs to map OpenStack system resources and hardware equipment resources to ensure the stability of the functions.
However, only one hardware service board card is provided in hardware equipment for constructing an OpenStack cloud computing management platform at present, which limits service expansion, and in order to implement more services, multiple hardware service board cards need to be inserted into the equipment for subsequent service development.
Disclosure of Invention
The application discloses a VLAN (virtual local area network) allocation method, device and equipment based on hardware service board cards, which are used for allocating VLAN resources on the hardware service board cards for tenants when a plurality of hardware service board cards exist.
According to a first aspect of the embodiments of the present application, a VLAN assignment method based on hardware service boards is provided, where the method is applied to an OpenStack cloud computing management platform, where the OpenStack cloud computing management platform includes at least two hardware service boards, and includes:
when a Vouter creation event of a virtual router is detected and is triggered by a tenant, selecting a target hardware service board from all existing hardware service boards, and selecting a target VLAN which is not used currently from VLAN ranges according to the VLAN range bound by the configured target hardware service board, wherein the target VLAN is used for creating a special internal network for the tenant;
if the Vrouter corresponding to the tenant does not exist at present, the target hardware service board is controlled to create the Vrouter corresponding to the tenant based on the Vrouter creation event, so that a message which is sent by the tenant from the internal network and accesses an external network is forwarded to the external network through the Vrouter, and the Vrouter is associated with the target VLAN.
Optionally, the selecting a target hardware service board from all existing hardware service boards includes:
counting the number of VLAN usage and the number of residual VLANs in a VLAN range corresponding to each existing hardware service board card;
and selecting the hardware service board with the minimum ratio of the VLAN use number to the residual VLAN number as a target hardware service board.
Optionally, the controlling the target hardware service board to create the Vrouter based on the Vrouter creation event includes:
obtaining a Vrouter profile for creating Vrouter;
and issuing the Vreuter configuration file and the target VLAN to a target hardware service board card so that the target hardware service board card establishes the Vreuter based on the Vreuter configuration file and the target VLAN.
Optionally, the selecting, according to the VLAN range bound by the configured target hardware service board, a target VLAN that is not currently used from the VLAN ranges includes:
when the VLAN range has the VLAN which is not used currently, one of the VLANs which is not used currently is selected as a target VLAN;
when the VLAN range does not have the VLAN which is not used currently, releasing the VLAN which meets the specified requirement from all the used VLANs; the specified requirements are: the unused duration exceeds a set threshold and/or there is currently no associated traffic.
Optionally, the method further comprises:
and when the time length of the target VLAN which is not used by the Vreuter exceeds a set threshold value and/or no service related to the target VLAN exists currently, removing the relation between the Vreuter and the target VLAN and deleting the Vreuter from a target hardware service board card.
Optionally, if there is a Vrouter corresponding to the tenant currently, the method further includes:
controlling the Vreuter to be associated with the target VLAN so that messages sent by the tenant from the internal network and accessing an external network are forwarded to the external network through the Vreuter.
Optionally, the tenants correspond to the vroters one to one.
According to a second aspect of the embodiments of the present application, there is provided a VLAN assignment device based on hardware service boards, where the OpenStack cloud computing management platform includes at least two hardware service boards, and the device includes:
a VLAN determining unit, when detecting a Vouter creation event of a virtual router, the Vouter creation event is triggered by a tenant, a target hardware service board is selected from all existing hardware service boards, a target VLAN which is not used currently is selected from a VLAN range according to a VLAN range bound by the configured target hardware service board, and the target VLAN is used for creating a special internal network for the tenant;
a VLAN association unit, configured to, if there is no Vrouter corresponding to the tenant at present, control the target hardware service board to create the Vrouter corresponding to the tenant based on the Vrouter creation event, so that a packet that is sent by the tenant from the internal network and accesses an external network is forwarded to the external network via the Vrouter, where the Vrouter associates with the target VLAN.
Optionally, if there is a Vrouter corresponding to the tenant currently, the VLAN association unit is further configured to:
controlling the Vreuter to be associated with the target VLAN so that messages sent by the tenant from the internal network and accessing an external network are forwarded to the external network through the Vreuter.
According to a third aspect of the embodiments of the present application, an electronic device for implementing a VLAN assignment method based on a hardware service board is provided, where the electronic device includes: a processor and a memory;
the memory for storing machine executable instructions;
the processor is configured to read and execute the machine executable instructions stored in the memory, so as to implement the above VLAN assignment method based on the hardware service board.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
according to the technical scheme, when the OpenStack cloud computing management platform detects a virtual router Vouter creation event triggered by a tenant, a target hardware service board card is selected from all existing hardware service board cards, and a target VLAN which is not used currently is selected from a VLAN range according to the VLAN range bound by the configured target hardware service board card; if the Vrouter corresponding to the tenant does not exist at present, the target hardware service board is controlled to create the Vrouter corresponding to the tenant based on the Vrouter creating event, so that messages which are sent by the tenant from the internal network and used for accessing the external network are forwarded to the external network through the Vrouter, the Vrouter is associated with the target VLAN, VLAN resources on the hardware service board are distributed to the tenant when a plurality of hardware service boards exist in OpenStack, and the tenant can process services according to the distributed VLAN resources.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present specification and together with the description, serve to explain the principles of the specification.
Fig. 1 is a flowchart of a VLAN assignment method based on a hardware service board according to an embodiment of the present application;
fig. 2 is a flowchart of a method for determining a target hardware service board according to an embodiment of the present disclosure;
fig. 3 is a flowchart of another method for determining a target hardware service board according to an embodiment of the present application;
fig. 4 is a schematic diagram of a VLAN assignment device based on a hardware service board according to an embodiment of the present application;
fig. 5 is a schematic hardware structure diagram for implementing a VLAN assignment method based on a hardware service board according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein 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 appended 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 refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such 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. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In order to make the technical solutions provided in the embodiments of the present application better understood and make the above objects, features and advantages of the embodiments of the present application more comprehensible, the technical solutions in the embodiments of the present application are described in further detail below with reference to the accompanying drawings.
It should be noted that, before the embodiment of the present application is implemented, the following configuration needs to be added to the OpenStack cloud computing management platform:
optionally, a plurality of slot (board card) configuration groups are newly added to existing hardware service board cards in a configuration file stored on the OpenStack cloud computing management platform, names of the configuration groups start with slots, and each hardware service board card corresponds to one slot configuration group. Each slot configuration group at least comprises a slot number and a vlan range configuration item, wherein the slot number is used for identifying the hardware service board card, and each hardware service board card can be numbered according to the sequence. When a slot configuration group is added, reasonable planning is carried out on VLAN range (VLAN range) corresponding to each hardware service board according to the specification of each hardware service board and the number of the hardware service boards in the OpenStack cloud computing management platform.
For example, the VLAN range planned for the OpenStack cloud computing management platform is from VLAN1 to VLAN1500, the platform has 3 hardware service boards, the numbers of the three hardware service boards are slot1, slot2 and slot3, if the specifications of slot1, slot2 and slot3 are the same, the VLAN range corresponding to slot1 can be planned to be from VLAN1 to VLAN500, the VLAN range corresponding to slot2 can be from VLAN501 to VLAN1000, and the VLAN range corresponding to slot3 can be from VLAN1001 to VLAN 1500. This is by way of example only and is not intended to limit the present application.
After a plurality of slot configuration groups are added into a configuration file of an OpenStack cloud computing management platform, the configuration file needs to be loaded next, wherein the specific loading mode is to analyze the configuration file added with the slot configuration groups, find the slot configuration group starting with the slot in the configuration file by taking the slot as a key so as to establish a mapping relation between a hardware service board and a board number and a VLAN range allocated to the hardware service board.
Optionally, two data tables need to be newly added in a neutron database of the OpenStack cloud computing management platform to implement the embodiment of the present application. A data table is used for recording the corresponding relationship between the virtual router Vrouter of the tenant and the hardware service board card used for creating the virtual router Vrouter, for example, a router _ slots (router id _ board) table is newly added, the table includes a virtual router-id (virtual router id) field and a slot field, and the slot field is a board card number. Another data table is used for storing the number of used VLANs and used VLANs on each hardware service board, for example, a slot _ VLAN _ cnt (board _ VLAN usage number) table is newly added, and the table includes a slot field, a VLAN _ cnt field, and a VLAN _ used field, where the VLAN _ cnt field indicates the number of used VLANs and the VLAN _ used field indicates used VLANs. For convenience of description, when the embodiments of the present application are introduced below, the three hardware service boards, slot1, slot2, and slot3, and the slot _ slots table and the slot _ vlans _ cnt table are used as examples for description.
Based on the above description, the following describes embodiments related to the present application:
referring to fig. 1, fig. 1 is a flowchart of a method provided in an embodiment of the present application. As an embodiment, the process shown in fig. 1 may be applied to an OpenStack cloud computing management platform. The OpenStack cloud computing management platform at least includes at least two hardware service boards, and the number of the hardware service boards is not specifically limited in this embodiment.
As shown in fig. 1, the process may include the following steps:
step 101, when detecting a Vrouter creation event of a virtual router, the Vrouter creation event being triggered by a tenant, selecting a target hardware service board from all existing hardware service boards, and selecting a target VLAN which is not currently used from VLAN ranges according to a VLAN range bound by the configured target hardware service board, where the target VLAN is used to create a dedicated internal network for the tenant.
In the embodiment of the application, the Vrouter creation event is triggered by the tenant at the tenant management interface of Openstack, where the Vrouter creation event may be a request event for creating a Vrouter for the tenant and allocating a VLAN to create an internal network based on the VLAN, or a request event for allocating a new VLAN for the Vrouter existing in the tenant to create an internal network based on the VLAN. For the two types of Vrouter creation events, different manners may be selected to determine the target hardware service board in the embodiment of the present application, and a specific determination manner will be described in detail below, which is not described herein again.
Optionally, when determining a target VLAN which is not currently used, if a VLAN which is not currently used exists in the VLAN range bound by the target hardware service board, selecting one of the VLANs which is not currently used as the target VLAN; if the VLAN which is not currently used does not exist in the VLAN range, the VLAN which meets the specified requirement is released from all the used VLANs, wherein the VLAN which meets the specified requirement can be the VLAN of which the unused duration exceeds the set threshold, and/or the VLAN of which the service which is associated with the VLAN does not exist currently.
Optionally, when there is no VLAN which is not currently used in the VLAN range, an error report of "no available VLAN" may occur, then an admin of the OpenStack cloud computing management platform performs data configuration analysis, and then determines a VLAN to be released from the used VLAN according to a specified requirement.
In specific implementation, when a target VLAN which is not currently used is selected from VLAN ranges according to the VLAN range bound by the configured target hardware service board card, 1 is added to a value represented by a VLAN _ cnt field value corresponding to the target hardware service board card in the slots _ VLAN _ cnt table, and the target VLAN is also recorded in a VLAN _ used field value representing the used VLAN corresponding to the target hardware service board card in the slots _ VLAN _ cnt table. For example, when the hardware service board selected for Vrouter in this embodiment is slot1, it is assumed that a corresponding VLAN _ cnt field value in a slot _ VLAN _ cnt table of the current slot1 is 2, the corresponding VLAN _ used field value includes VLAN1 and VLAN2, if a target VLAN selected for Vrouter is VLAN3 at this time, a corresponding VLAN _ cnt field value in a slot1 in the slot _ VLAN _ cnt table is updated to 3, and the corresponding VLAN _ used field value includes VLAN1, VLAN2, and VLAN 3.
As an embodiment, the target VLAN is used to create a proprietary internal network for the tenant, and the internal network realizes isolation of resources in the internal network from an external network such as a public network, and guarantees security of the resources in the internal network. The specific creation process may be created according to a specific service that needs to be processed on the internal network according to an existing scheme, for example, the target VLAN is divided into different subnets according to the specific service, and after the internal network is created, the tenant may further construct virtual cloud hosts for service processing, and the virtual cloud hosts perform service interaction through the internal network.
Step 102, if there is no Vrouter corresponding to the tenant at present, controlling the target hardware service board to create the Vrouter corresponding to the tenant based on the Vrouter creation event, so that a message, which is sent by the tenant from the internal network and accesses an external network, is forwarded to the external network via the Vrouter, and the Vrouter is associated with the target VLAN.
In the embodiment of the application, after the target VLAN is obtained, if the target hardware service board creates Vrouter for the first time, the obtained Vrouter configuration file for creating Vrouter and the target VLAN are issued to the target hardware service board together, so that the target hardware service board creates Vrouter based on the Vrouter configuration file and the target VLAN. The Vrouter profile used here to create Vrouter may be a template file that creates Vrouter, from which multiple vrouters may be created, and different configuration information.
Optionally, each time the Vrouter is created, before the Vrouter configuration file is issued to the target hardware service board, the Vrouter configuration file needs to be modified according to the target VLAN and configuration information of other vrouters, such as routing and NAT, so that the target hardware service board creates the Vrouter based on the modified Vrouter configuration file.
Optionally, in this embodiment of the present application, the Vrouter configuration file may be sent to the target hardware service board only when the first Vrouter is created on the target hardware service board, the target hardware service board may store the Vrouter configuration file after the first Vrouter is created, and then the target hardware service board may send only configuration information of the target VLAN and other vrouters, such as routing and NAT, to the target hardware service board when the Vrouter is created, and the target hardware service board may create the Vrouter according to the template file of the stored Vrouter configuration file and the received configuration information of the target VLAN and other vrouters.
Thus, the flow shown in fig. 1 is completed.
As can be seen from the process shown in fig. 1, in this embodiment, when the OpenStack cloud computing management platform detects a virtual router Vrouter creation event triggered by a tenant, a target hardware service board is selected from all existing hardware service boards, and a target VLAN which is not currently used is selected from a VLAN range according to a VLAN range bound by the configured target hardware service board; if the Vrouter corresponding to the tenant does not exist at present, the target hardware service board is controlled to create the Vrouter corresponding to the tenant based on the Vrouter creating event, so that messages which are sent by the tenant from the internal network and used for accessing the external network are forwarded to the external network through the Vrouter, the Vrouter is associated with the target VLAN, VLAN resources on the hardware service board are distributed to the tenant when a plurality of hardware service boards exist in OpenStack, and the tenant can process services according to the distributed VLAN resources.
Further, in this embodiment, when the unused duration of the Vrouter exceeds a set threshold, and/or when there is no service associated with the Vrouter currently, the association between the Vrouter and the target VLAN may be released, and the Vrouter may be deleted from the target hardware service board.
It should be noted that, in this embodiment, the tenants and the vrouters generally correspond to each other one to one, that is, one tenant only has one Vrouter, and the Vrouter is used to connect an internal network and an external network of the tenant, so that a user working in the internal network of the tenant can access resources of the external network through the Vrouter, and meanwhile, the user can log in a virtual cloud host of the internal network from the external network through the Vrouter.
In the above, embodiments of the VLAN assignment method based on the hardware service board are generally described, and two ways of determining the target hardware service board in this embodiment will be described below:
as an embodiment, when detecting that the Vrouter creation event is a request event for creating a Vrouter for a tenant and assigning a VLAN to create an internal network based on the VLAN, a target hardware service board is selected from all existing hardware service boards. How to select the target hardware service board card can be in various ways, and in the embodiment of the application, the following method can be used for selecting one target hardware service board card: counting the number of VLAN usage and the number of residual VLANs in a VLAN range corresponding to each existing hardware service board card; and selecting the hardware service board with the minimum ratio of the VLAN use number to the residual VLAN number as a target hardware service board. The flow for specifically implementing the embodiment is shown in fig. 2, and includes the following steps:
step 201, find the VLAN _ cnt field value corresponding to each hardware service board card and indicating the VLAN usage number in the slots _ VLAN _ cnt table.
In this embodiment, the VLAN _ cnt field value corresponding to each hardware service board card may be found in the slots _ VLAN _ cnt table through the board card number corresponding to each hardware service board card, where the VLAN _ cnt field in the table records the number of VLANs used on the hardware service board card, and therefore the VLAN _ cnt field value corresponding to each hardware service board card in the table is the number of VLANs used on each hardware service board card.
Step 202, obtaining the total number of VLANs on each hardware service board according to the VLAN range corresponding to each hardware service board.
In this step 202, obtaining the VLAN range corresponding to each hardware service board may be obtained by a configuration file added with multiple slot configuration groups, which is saved before, or a field indicating the VLAN range may be added to a slot _ VLAN _ cnt table when the table is created.
Optionally, in this embodiment, a field for recording the total number of VLANs corresponding to each hardware service board may also be added in the slots _ VLANs _ cnt table, so that the VLAN use number and the VLAN total number corresponding to each hardware service board may be directly found through the board number.
And step 203, subtracting the value represented by the VLAN _ cnt field value from the total number of the VLANs to obtain the number of the remaining VLANs.
Step 204, calculating the number of the used VLANs on each hardware service board: and taking the hardware service board with the minimum ratio as a target hardware service board according to the ratio of the number of the residual VLANs.
Optionally, the target hardware service board may also select a hardware service board with the least VLAN usage number or the most remaining VLAN number from all the existing hardware service boards as the target hardware service board, which is not limited in the present application.
Further, in this embodiment, after creating Vrouter through the process shown in fig. 1, a Vrouter-id is randomly allocated to the created Vrouter to identify the Vrouter, and the corresponding relationship between the Vrouter and the target hardware service board is recorded in a routerid _ slots table.
As another embodiment, when it is detected that the Vrouter creation event is a request event for allocating a new VLAN to an existing Vrouter in a tenant to create an internal network based on the VLAN, when selecting a target hardware service board from all existing hardware service boards, it is required to determine to which hardware service board a resource on the Vrouter belongs, and use the hardware service board corresponding to the Vrouter as the target hardware service board.
Here, associating a plurality of VLANs with the Vrouter is to open DCI (Data Center Interconnect) across a Data Center, and a tenant can perform traffic interaction between a plurality of internal networks created based on the plurality of VLANs associated with the Vrouter. Through the embodiment, a plurality of VLANs distributed for one tenant can be on the same hardware service board, so that service flows of the same tenant are all sent to the same hardware service board for processing. The flow for specifically implementing the embodiment is shown in fig. 3, and includes the following steps:
step 301, obtaining Vrouter.
Step 302, finding out a corresponding slot field value in the router _ slots table according to the vrouter-id.
Step 303, using the hardware service board indicated by the slot field value as a target hardware service board.
In this embodiment, it can be known that there is currently a Vrouter corresponding to the tenant according to the Vrouter creation event, and at this time, when a target VLAN is not currently used, the Vrouter may be controlled to associate with the target VLAN, so that a packet, which is sent by the tenant from the internal network and accesses the external network, is forwarded to the external network via the Vrouter.
Further, in this embodiment, if Vrouter is to be deleted, firstly, VLANs and the like configured to establish DCI across the data center need to be deleted, after deletion, the number of deleted VLANs _ cnt field value needs to be subtracted from the VLAN _ cnt field value corresponding to the target hardware service board where the Vrouter is located in the data table slots _ VLAN _ cnt, and the recorded information of the VLANs configured to establish DCI across the data center in the VLAN _ used field value is eliminated, which indicates that the VLAN is released to be an unused VLAN.
In this embodiment, after the VLAN and other configurations used for establishing the DCI across the data center are deleted, the VLAN and other configurations used for establishing the Vroute are deleted, and after the VLAN used for establishing the Vroute is deleted, a VLAN _ cnt field value corresponding to a target hardware service board card where the Vrouter is located in a data table slot _ VLAN _ cnt is reduced by 1, and recorded VLAN information configured when the Vroute is established in the VLAN _ used field value is eliminated.
The above description is provided for the embodiments of the VLAN assignment method based on the hardware service board card according to the embodiments of the present application. The following describes the apparatus provided in the embodiments of the present application:
referring to fig. 4, fig. 4 is a schematic view of an apparatus for implementing VLAN assignment based on a hardware service board according to an embodiment of the present disclosure. The device includes:
a VLAN determining unit 401, configured to, when a Vrouter creation event of the virtual router is detected, where the Vrouter creation event is triggered by a tenant, select a target hardware service board from all existing hardware service boards, and select a target VLAN that is not currently used from a VLAN range according to a VLAN range bound by the configured target hardware service board.
A VLAN association unit 402, configured to, if there is no Vrouter corresponding to the tenant at present, control the target hardware service board to create the Vrouter corresponding to the tenant based on the Vrouter creation event, so that a packet that is sent by the tenant from the internal network and accesses an external network is forwarded to the external network via the Vrouter, where the Vrouter associates with the target VLAN.
Optionally, the VLAN determining unit 401 selects one target hardware service board from all existing hardware service boards, where the target hardware service board includes:
counting the number of VLAN usage and the number of residual VLANs in a VLAN range corresponding to each existing hardware service board card; and selecting the hardware service board with the minimum ratio of the VLAN use number to the residual VLAN number as a target hardware service board.
Optionally, the VLAN determining unit 401 selects, according to the VLAN range bound by the configured target hardware service board, one target VLAN which is not currently used from the VLAN ranges, where the target VLAN includes: when the VLAN range has the VLAN which is not used currently, one of the VLANs which is not used currently is selected as a target VLAN; when the VLAN range does not have the VLAN which is not used currently, releasing the VLAN which meets the specified requirement from all the used VLANs; the specified requirements are: the unused duration exceeds a set threshold and/or there is currently no associated traffic.
Optionally, the controlling, by the VLAN association unit 402, the target hardware service board to create the Vrouter based on the Vrouter creation event includes: obtaining a Vrouter profile for creating Vrouter; and issuing the Vreuter configuration file and the target VLAN to a target hardware service board card so that the target hardware service board card establishes the Vreuter based on the Vreuter configuration file and the target VLAN.
Optionally, if there is a Vrouter corresponding to the tenant currently, the VLAN associating unit 402 is further configured to: controlling the Vreuter to be associated with the target VLAN so that messages sent by the tenant from the internal network and accessing an external network are forwarded to the external network through the Vreuter.
Thus, the structure of the embodiment of the apparatus shown in FIG. 4 is completed. For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units.
Correspondingly, an embodiment of the present application further provides a hardware structure diagram for implementing a VLAN assignment method based on a hardware service board, which is specifically shown in fig. 5. As shown in fig. 5, the hardware structure includes: a processor and a memory.
Wherein the memory is to store machine executable instructions;
the processor is configured to read and execute the machine executable instructions stored in the memory, so as to implement the embodiment of the VLAN assignment method based on the hardware service board as described above.
For one embodiment, the memory may be any electronic, magnetic, optical, or other physical storage device that may contain or store information such as executable instructions, data, and the like. For example, the memory may be: volatile memory, non-volatile memory, or similar storage media. In particular, the Memory may be a RAM (random Access Memory), a flash Memory, a storage drive (e.g., a hard disk drive), a solid state disk, any type of storage disk (e.g., an optical disk, a DVD, etc.), or similar storage medium, or a combination thereof.
So far, the description of the apparatus shown in fig. 5 is completed.
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. A VLAN distribution method based on hardware service board cards is characterized in that the method is applied to an OpenStack cloud computing management platform, the OpenStack cloud computing management platform at least comprises at least two hardware service board cards, and the method comprises the following steps:
when a Vouter creation event of a virtual router is detected and is triggered by a tenant, selecting a target hardware service board from all existing hardware service boards, and selecting a target VLAN which is not used currently from VLAN ranges according to the VLAN range bound by the configured target hardware service board, wherein the target VLAN is used for creating a special internal network for the tenant;
if the Vrouter corresponding to the tenant does not exist at present, the target hardware service board is controlled to create the Vrouter corresponding to the tenant based on the Vrouter creation event, so that a message which is sent by the tenant from the internal network and accesses an external network is forwarded to the external network through the Vrouter, and the Vrouter is associated with the target VLAN.
2. The method of claim 1, wherein the selecting a target hardware service board from all existing hardware service boards comprises:
counting the number of VLAN usage and the number of residual VLANs in a VLAN range corresponding to each existing hardware service board card;
and selecting the hardware service board with the minimum ratio of the VLAN use number to the residual VLAN number as a target hardware service board.
3. The method of claim 1, wherein the controlling the target hardware traffic board to create Vrouter based on the Vrouter creation event comprises:
obtaining a Vrouter profile for creating Vrouter;
and issuing the Vreuter configuration file and the target VLAN to a target hardware service board card so that the target hardware service board card establishes the Vreuter based on the Vreuter configuration file and the target VLAN.
4. The method of claim 1, wherein selecting a target VLAN from the VLAN ranges that is not currently used according to the configured VLAN range bound by the target hardware service board comprises:
when the VLAN range has the VLAN which is not used currently, one of the VLANs which is not used currently is selected as a target VLAN;
when the VLAN range does not have the VLAN which is not used currently, releasing the VLAN which meets the specified requirement from all the used VLANs; the specified requirements are: the unused duration exceeds a set threshold and/or there is currently no associated traffic.
5. The method of claim 1, further comprising:
and when the time length of the target VLAN which is not used by the Vreuter exceeds a set threshold value and/or no service related to the target VLAN exists currently, removing the relation between the Vreuter and the target VLAN and deleting the Vreuter from a target hardware service board card.
6. The method of claim 1, wherein if there is a Vrouter corresponding to the tenant currently, the method further comprises:
controlling the Vreuter to be associated with the target VLAN so that messages sent by the tenant from the internal network and accessing an external network are forwarded to the external network through the Vreuter.
7. The method according to any of claims 1 to 6, characterized in that said tenants are in one-to-one correspondence with said Vrouter.
8. The VLAN distribution device based on hardware service board cards is characterized in that the device is applied to an OpenStack cloud computing management platform, the OpenStack cloud computing management platform at least comprises at least two hardware service board cards, and the VLAN distribution device comprises:
a VLAN determining unit, configured to, when a Vrouter creation event of a virtual router is detected, trigger the Vrouter creation event by a tenant, select a target hardware service board from all existing hardware service boards, and select a target VLAN that is not currently used from a VLAN range according to a VLAN range bound by the configured target hardware service board, where the target VLAN is used to create a dedicated internal network for the tenant;
a VLAN association unit, configured to, if there is no Vrouter corresponding to the tenant at present, control the target hardware service board to create the Vrouter corresponding to the tenant based on the Vrouter creation event, so that a packet that is sent by the tenant from the internal network and accesses an external network is forwarded to the external network via the Vrouter, where the Vrouter associates with the target VLAN.
9. The apparatus of claim 8, wherein if there is a Vrouter corresponding to the tenant currently, the VLAN association unit is further configured to:
controlling the Vreuter to be associated with the target VLAN so that messages sent by the tenant from the internal network and accessing an external network are forwarded to the external network through the Vreuter.
10. An electronic device, comprising: a processor and a memory;
the memory for storing machine executable instructions;
the processor is configured to read and execute the machine-executable instructions stored in the memory to implement the method of any one of claims 1 to 7.
CN202011455960.9A 2020-12-10 2020-12-10 VLAN (virtual local area network) distribution method, device and equipment based on hardware service board card Active CN112637033B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011455960.9A CN112637033B (en) 2020-12-10 2020-12-10 VLAN (virtual local area network) distribution method, device and equipment based on hardware service board card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011455960.9A CN112637033B (en) 2020-12-10 2020-12-10 VLAN (virtual local area network) distribution method, device and equipment based on hardware service board card

Publications (2)

Publication Number Publication Date
CN112637033A true CN112637033A (en) 2021-04-09
CN112637033B CN112637033B (en) 2022-08-26

Family

ID=75309960

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011455960.9A Active CN112637033B (en) 2020-12-10 2020-12-10 VLAN (virtual local area network) distribution method, device and equipment based on hardware service board card

Country Status (1)

Country Link
CN (1) CN112637033B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113556265A (en) * 2021-07-14 2021-10-26 国家计算机网络与信息安全管理中心 Data processing method, computer device and readable storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160036774A1 (en) * 2014-07-31 2016-02-04 Brocade Communications Systems, Inc. Global vlan services
CN107769938A (en) * 2016-08-16 2018-03-06 北京金山云网络技术有限公司 The system and method that a kind of Openstack platforms support Multi net voting region
US20180285166A1 (en) * 2017-03-29 2018-10-04 Juniper Networks, Inc. Micro-level monitoring, visibility and control of shared resources internal to a processor of a host machine for a virtual environment
CN109936629A (en) * 2019-02-27 2019-06-25 山东浪潮云信息技术有限公司 A kind of mixed cloud network interconnecting method and system
CN111343011A (en) * 2020-02-16 2020-06-26 苏州浪潮智能科技有限公司 Openstack network fusion control method and system for cloud management platform
CN111654443A (en) * 2020-06-05 2020-09-11 山东汇贸电子口岸有限公司 Method for directly accessing public network by virtual machine IPv6 address in cloud environment
CN111654452A (en) * 2020-05-08 2020-09-11 杭州迪普科技股份有限公司 Message processing method and device
US20200344119A1 (en) * 2019-04-26 2020-10-29 Juniper Networks, Inc. Initializing server configurations in a data center
CN111865749A (en) * 2020-06-30 2020-10-30 新华三信息安全技术有限公司 Port binding method and device
CN111865655A (en) * 2020-06-04 2020-10-30 烽火通信科技股份有限公司 ARP table configuration method and system for service board card

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160036774A1 (en) * 2014-07-31 2016-02-04 Brocade Communications Systems, Inc. Global vlan services
CN107769938A (en) * 2016-08-16 2018-03-06 北京金山云网络技术有限公司 The system and method that a kind of Openstack platforms support Multi net voting region
US20180285166A1 (en) * 2017-03-29 2018-10-04 Juniper Networks, Inc. Micro-level monitoring, visibility and control of shared resources internal to a processor of a host machine for a virtual environment
CN109936629A (en) * 2019-02-27 2019-06-25 山东浪潮云信息技术有限公司 A kind of mixed cloud network interconnecting method and system
US20200344119A1 (en) * 2019-04-26 2020-10-29 Juniper Networks, Inc. Initializing server configurations in a data center
CN111343011A (en) * 2020-02-16 2020-06-26 苏州浪潮智能科技有限公司 Openstack network fusion control method and system for cloud management platform
CN111654452A (en) * 2020-05-08 2020-09-11 杭州迪普科技股份有限公司 Message processing method and device
CN111865655A (en) * 2020-06-04 2020-10-30 烽火通信科技股份有限公司 ARP table configuration method and system for service board card
CN111654443A (en) * 2020-06-05 2020-09-11 山东汇贸电子口岸有限公司 Method for directly accessing public network by virtual machine IPv6 address in cloud environment
CN111865749A (en) * 2020-06-30 2020-10-30 新华三信息安全技术有限公司 Port binding method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113556265A (en) * 2021-07-14 2021-10-26 国家计算机网络与信息安全管理中心 Data processing method, computer device and readable storage medium
CN113556265B (en) * 2021-07-14 2024-02-20 国家计算机网络与信息安全管理中心 Data processing method, computer device, and readable storage medium

Also Published As

Publication number Publication date
CN112637033B (en) 2022-08-26

Similar Documents

Publication Publication Date Title
CN109714239B (en) Management message issuing method, VNFM (virtual network management frequency) equipment and server
US10282120B2 (en) Method, apparatus and system for inserting disk
CN111367887A (en) Multi-tenant data sharing system, management method thereof and database deployment method
CN111866209A (en) Method and equipment for distributing network card for cloud host
CN112637033B (en) VLAN (virtual local area network) distribution method, device and equipment based on hardware service board card
CN108073352A (en) Virtual disk processing method and processing device
CN109032799A (en) Storage resource management method, apparatus, equipment and readable storage medium storing program for executing
EP3901766A1 (en) Offline configuration method and apparatus for smart device
CN111638853A (en) Data storage method and device, storage cluster, gateway equipment and main equipment
CN112328363B (en) Cloud hard disk mounting method and device
CN112738290B (en) NAT (network Address translation) conversion method, device and equipment
CN108965093B (en) VLAN (virtual local area network) distribution method and device
CN111124614B (en) Virtual machine migration flow control test method, device, equipment and storage medium
CN111915811A (en) Method and equipment for controlling cabinet access by multiple hosts
CN107493181B (en) Indication method and device of virtual expansion port
CN113472799B (en) Interconnection management method, device and equipment based on cloud platform
CN115766661A (en) IPV6 address data management method and system based on resource capacity center
CN110519403A (en) A kind of gateway down-hanging device management method and system
CN111722783B (en) Data storage method and device
CN112367256B (en) Creation method, device and storage medium
CN113347285B (en) Automatic allocation method, device and equipment for managing IP address
CN113438334B (en) Port PVID configuration method, device and system
CN115603923A (en) Access Control List (ACL) policy management method, device and related equipment
US20060168108A1 (en) Methods and systems for defragmenting subnet space within an adaptive infrastructure
CN107544746B (en) Heterogeneous processing method, heterogeneous processing device and system of storage equipment

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