An implementation method of cloud external bare metal access VPC
By establishing a Layer 2 access point between the bare metal server outside the cloud and the leaf switch, and setting up a tagged or untagged mode to create a mapping relationship, the problem of interconnection between the bare metal server outside the cloud and the VPC inside the cloud is solved, and efficient resource utilization is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-18
- Publication Date
- 2026-04-07
AI Technical Summary
After users create a VPC on the cloud platform, there is a lack of effective interoperability solutions between bare metal servers outside the cloud and VPCs inside the cloud, making it impossible to achieve business interconnection.
By physically connecting the bare metal server and the leaf switch, a Layer 2 access point is configured, and a Layer 2 access instance is created. The tag or untag mode is set, and a mapping relationship is established to ensure the reasonable allocation and reclamation of VLANs, thereby achieving interconnection between the bare metal server and the VPC.
It enables communication between bare metal servers outside the cloud and VPCs inside the cloud, avoiding the waste of VLAN resources and improving the utilization efficiency of network resources.
Smart Images

Figure CN116366396B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of public cloud networks, and particularly relates to a method for realizing access of a cloud-outside bare metal to a VPC. BACKGROUND
[0002] A virtual private cloud (VPC) is a cloud computing service in which a public cloud provider isolates a specific part of its public cloud infrastructure for private use. The VPC infrastructure is managed by the public cloud provider, but the resources allocated to the VPC are not shared with any other customers. The VPC is a hybrid model of cloud computing, which provides a private cloud solution within the infrastructure of a public cloud provider. The VPC builds an isolated, user self-configured and managed virtual network environment for elastic cloud servers, improves the security of resources in the cloud of the user, and simplifies the network deployment of the user. The VPC is a basic cloud network environment purchased and built by the user in the cloud vendor. The user can safely, conveniently and quickly configure and manage the internal network through the VPC, and can customize many network products and configurations to build a network topology dedicated to the user.
[0003] A bare metal server is a hardware device that has both the characteristics of a traditional physical server and the virtualization service function of cloud computing technology, and is a combination of hardware and software advantages. The bare metal server can provide a dedicated physical server on the cloud for enterprises, and provide excellent computing performance and data security for core databases, key application systems, high-performance computing, big data and other businesses.
[0004] When a user creates a VPC on a cloud platform, there are businesses in the VPC, and there are also businesses on a bare metal server outside the cloud. A solution is urgently needed to meet the needs of interconnection between the bare metal and the VPC inside the cloud. SUMMARY
[0005] Therefore, the present application aims to provide a method for realizing access of a cloud-outside bare metal to a VPC to at least solve at least one problem in the background art.
[0006] To achieve the above-mentioned purpose, the technical scheme of the present application is as follows:
[0007] A method for realizing access of a cloud-outside bare metal to a VPC, comprising the following steps:
[0008] S1, the bare metal server is first physically connected to the interface of the leaf switch, and then the connected interface is set as a two-layer access port;
[0009] S2, the user creates a two-layer access instance to bind the cloud-out bare metal server with the interface of the cloud-in VPC and leaf switch, and sets the tag or untag mode;
[0010] S3, after the user creates the two-layer access, one or more mapping relationships can be created under the instance;
[0011] S4, when the user deletes the mapping relationship, the vlan is unreserved, and the service-instance configuration is deleted;
[0012] S5, when the user deletes the two-layer access instance, only if there is no two-layer mapping relationship under the instance, the instance is allowed to be deleted, and deleting the instance will unbind the relationship between the bare metal and the interface of the VPC and leaf switch.
[0013] Further, in step S2, the mode cannot be changed after being set.
[0014] Further, in step S3, one mapping relationship is created in the tag mode, and multiple mapping relationships are created in the untag mode.
[0015] Further, in step S3, when creating the mapping relationship, the tag mode checks whether the vlan has been allocated on the leaf, if not, the mapping relationship corresponding vlan is reserved in the cloud-in vlan pool, and the service-instance configuration is configured on the leaf switch.
[0016] Further, the preparation work includes:
[0017] Leaf switch: first, set an unconfigured port on the leaf switch to a two-layer access port, and ensure that there is no service-instance configuration under the port;
[0018] Bare metal server: configure the tag or untag mode on the bond port of the bare metal as needed.
[0019] Further, the creation process includes:
[0020] Each bare metal and switch interface can create a two-layer access instance, after the preparation work is completed, first create a two-layer access instance, if the two-layer instance is in the tag mode, multiple mapping relationships can be created, each mapping relationship can specify a vlan, if the two-layer instance is in the untag mode, only one mapping relationship can be created under the two-layer instance, and each mapping relationship is in one-to-one relationship with the service-instance;
[0021] The VLAN of the service-instance corresponding to the mapping relationship cannot conflict with the existing overlay VLAN. After creating the Layer 2 mapping, the VLAN on the bare metal needs to be reserved in the VLAN pool in the cloud to prevent VLAN conflicts.
[0022] A Layer 2 access instance, i.e. a bare metal server, can only be connected to one VPC at a time and cannot be connected to multiple VPCs simultaneously.
[0023] Furthermore, this includes the deletion process:
[0024] When deleting a mapping relationship, the service-instance configuration of the relevant VLAN under the leaf switch interface is deleted, and the VLAN corresponding to the mapping relationship is recycled in the VLAN pool to ensure that it can still be allocated and reused normally in the future.
[0025] The deletion of a Layer 2 access instance is only permitted after all mapping relationships corresponding to that instance have been deleted.
[0026] Furthermore, this solution discloses an electronic device, including a processor and a memory communicatively connected to the processor and used to store executable instructions of the processor, wherein the processor is used to execute a method for implementing bare metal access to a VPC outside the cloud.
[0027] Furthermore, this solution discloses a server, including at least one processor and a memory communicatively connected to the processor. The memory stores instructions executable by the at least one processor, which are executed by the processor to enable the at least one processor to perform an implementation method for accessing a bare metal VPC outside the cloud.
[0028] Furthermore, this solution discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements a method for accessing a bare metal VPC outside the cloud.
[0029] Compared with existing technologies, the method for implementing bare metal access to a VPC outside the cloud described in this invention has the following advantages:
[0030] (1) The present invention provides a method for accessing a bare metal server outside the cloud to a VPC, which enables the bare metal server outside the cloud to access the VPC inside the cloud and realizes the interconnection between the bare metal server and the elastic cloud host or bare metal server inside the cloud.
[0031] (2) The method for implementing bare metal access to VPC outside the cloud described in this invention allows VLANs in the address pool to be recycled and reused, which can avoid the waste of the limited number of VLANs on the leaf switch. Attached Figure Description
[0032] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:
[0033] Figure 1 This is the overall topology diagram of the implementation scheme, illustrating the network topology connections and functions of the VPC and bare metal;
[0034] Figure 2 This is a diagram illustrating the configuration of a network interface card (NIC) on bare metal in tag mode, showing how a bare metal NIC should be configured in tag mode.
[0035] Figure 3 This is a diagram showing the interface configuration of the leaf switch connected to the bare metal server in tag mode, illustrating the configuration of the leaf switch in tag mode.
[0036] Figure 4 This is a diagram showing the network interface card (NIC) configuration of a bare metal server in untag mode, illustrating how bare metal servers should be configured in untag mode.
[0037] Figure 5 This is a diagram showing the interface configuration of a Leaf switch in untag mode, illustrating the configuration method of a Leaf switch in untag mode.
[0038] Figure 6 This is a schematic diagram illustrating one method for implementing bare metal access to a VPC outside the cloud in this solution. Detailed Implementation
[0039] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.
[0040] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0041] The bare metal and the leaf switch in the cloud need to be physically routed together, as shown by the red line in the diagram above, and the underlays need to be interconnected.
[0042] There are two types of bare metal access methods outside the cloud: tagged and untagged. In tagged mode, packets coming from the interface connecting the bare metal and leaf nodes all carry the VLAN ID, and the leaf node connection interface also needs to be configured with the same VLAN ID. In untagged mode, packets coming from the interface connecting the bare metal and leaf nodes do not carry a fixed VLAN ID, and the leaf node connection interface needs to be able to receive all VLAN IDs.
[0043] I. Tag Mode
[0044] Tag mode requires a VLAN number to be configured on the bare metal surface, and the same VLAN number must also be configured on the leaf. However, if the same VLAN is already configured on the leaf, it cannot be configured again. Also, because the number of VLANs on the same leaf is limited, the number of VLANs cannot exceed the device's maximum limit of 4096.
[0045] Figure 2 and Figure 3 This is a configuration diagram of bare metal and switches in tag mode. Figure 2 The bare metal interface connecting to the leaf switch is Bond0. One of the VLANs configured in tag mode is 2477. Therefore, when a bare metal packet is sent, it will carry the VLAN tag 2477 through the Bond0.2477 sub-interface. Figure 3 In tag mode, the switch interface is Bridge-Aggregation9 (BAGG9), and a service instance with VLAN 2477 is configured under BAGG9. In this case, packets with VLAN 2477 sent from the bare metal can be received and allowed by the switch's BAGG9 port. Figure 3 The configuration in the red box allows vlantag2477 packets to pass and associates them with the VSI interface, connecting them to the Layer 2 subnet of the VPC. This enables communication between bare metal clouds outside the cloud and VPCs inside the cloud.
[0046] II. Untag Mode
[0047] In untag mode, packets sent from bare metal no longer carry VLAN tags or have VLAN sub-interfaces. Only one service-instance configuration is allowed per interface on the switch.
[0048] In untag mode, packets that do not carry VLAN tags are matched. The Bond0 interface on the bare metal switch is no longer configured with sub-interfaces. Only one service-instance can be configured on the BAGG9 interface of the switch, and the mode is changed to untag. Packets coming from the bare metal server do not need to be configured with VLAN tags. When they arrive at the leaf, because the BAGG9 interface has been configured in untag mode, it no longer matches the VLAN tags of the filtered packets, so traffic can pass through.
[0049] III. Detailed Implementation Process of the Solution
[0050] Preparation:
[0051] Leaf Switch: First, you need to set an unconfigured port on the leaf switch as a Layer 2 access port (marked in the database table), and ensure that there is no service-instance configuration under this port.
[0052] Bare metal server: Configure tag or untag mode on the bare metal bond port as needed.
[0053] Creation process:
[0054] Each bare metal interface to the switch can create a Layer 2 access instance. That is, each interface (physical port or logical port) has a one-to-one relationship with a Layer 2 access instance. After the preparation is completed, a Layer 2 access instance is created first. If the Layer 2 instance is in tagged mode, multiple mapping relationships can be created, and each mapping relationship can specify a VLAN. If the Layer 2 instance is in untagged mode, only one mapping relationship can be created under that Layer 2 instance, and each mapping relationship has a one-to-one relationship with the service-instance.
[0055] The VLAN of the service-instance corresponding to the mapping relationship cannot conflict with the existing overlay VLAN. After creating the Layer 2 mapping, the VLAN on the bare metal needs to be reserved in the VLAN pool in the cloud to prevent VLAN conflicts.
[0056] A Layer 2 access instance, i.e. a bare metal server, can only be connected to one VPC at a time and cannot be connected to multiple VPCs simultaneously.
[0057] Deletion process:
[0058] Deleting a mapping relationship will remove the service-instance configuration of the relevant VLAN under the Leaf switch interface, and reclaim the corresponding VLAN from the VLAN pool to ensure normal allocation and reuse in the future. Only after all mapping relationships corresponding to a Layer 2 access instance have been deleted can the Layer 2 access instance be deleted.
[0059] The bare metal server is first physically connected to the interface of the leaf switch, and then the connected interface is configured as a Layer 2 access point.
[0060] Users create Layer 2 access instances to bind the interfaces of external bare metal servers to internal VPCs and leaf switches, and set either tagged or untagged modes. Once the mode is set, it cannot be changed.
[0061] Once a user creates a Layer 2 access point, they can create one (tag mode) or multiple (untag mode) mappings under that instance. When creating a mapping, tag mode checks if the VLAN has already been allocated on this leaf. If not, the VLAN corresponding to the mapping is reserved in the cloud VLAN pool (after reservation, the VPC will not be allocated this VLAN). Service-instance configuration is then configured on the leaf switch.
[0062] When a user deletes a mapping relationship, the VLAN is canceled from reservation and the service-instance configuration is deleted.
[0063] When a user deletes a Layer 2 access instance, the deletion is only allowed if there are no Layer 2 mapping relationships under the instance. Deleting the instance will unbind the relationship between the bare metal interface and the VPC and Leaf switch interfaces.
[0064] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0065] In the several embodiments provided in this application, it should be understood that the disclosed methods and systems can be implemented in other ways. For example, the division of units described above is merely a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. The aforementioned units may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention according to actual needs.
[0066] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.
[0067] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for implementing bare metal access to a VPC outside the cloud, characterized in that, Includes the following steps: S1. First, physically connect the bare metal server to the interface of the leaf switch, and then configure the connected interface as a Layer 2 access point. S2. Users create a Layer 2 access instance to bind the interfaces of the bare metal server outside the cloud to the VPC and leaf switch inside the cloud, and set the tag or untag mode. S3. After a user creates a Layer 2 access instance, create one or more mapping relationships under that instance. S4. When a user deletes a mapping relationship, the VLAN reservation is canceled and the service-instance configuration is deleted. S5. When a user deletes a Layer 2 access instance, the deletion is only allowed if there is no Layer 2 mapping relationship under the instance. Deleting the instance will unbind the relationship between the bare metal and the interfaces of the VPC and Leaf switch. Including preparatory work: Leaf Switch: First, you need to set up an unconfigured port on the leaf switch as a Layer 2 access port and ensure that there is no service-instance configuration under this port. Bare metal server: Configure tagged or untagged mode on the bare metal bond interface as needed; Including the creation process: Each bare metal interface with the switch creates a Layer 2 access instance. After the preparation is complete, a Layer 2 access instance is created first. If the Layer 2 instance is in tagged mode, multiple mapping relationships can be created, and each mapping relationship specifies a VLAN. If the Layer 2 instance is in untagged mode, only one mapping relationship can be created under that Layer 2 instance, and each mapping relationship is a one-to-one relationship with the service-instance. The VLAN of the service-instance corresponding to the mapping relationship cannot conflict with the existing overlay VLAN. After creating the Layer 2 mapping, the VLAN on the bare metal needs to be reserved in the VLAN pool in the cloud to prevent VLAN conflicts. A Layer 2 access instance, i.e. a bare metal server, can only be connected to one VPC at a time and cannot be connected to multiple VPCs simultaneously. Including the deletion process: When deleting a mapping relationship, the service-instance configuration of the relevant VLAN under the leaf switch interface is deleted, and the VLAN corresponding to the mapping relationship is recycled in the VLAN pool to ensure that it can still be allocated and reused normally in the future. The deletion of a Layer 2 access instance is only permitted after all mapping relationships corresponding to that instance have been deleted.
2. The method for implementing bare metal access to a VPC outside the cloud according to claim 1, characterized in that, Once the mode is set in step S2, it cannot be changed.
3. The method for implementing bare metal access to a VPC outside the cloud according to claim 1, characterized in that, In step S3, one mapping relationship is created in tag mode and multiple mapping relationships are created in untag mode.
4. The method for implementing bare metal access to a VPC outside the cloud according to claim 1, characterized in that, In step S3, when creating the mapping relationship, the tag mode checks whether the VLAN has been allocated on this leaf. If it has not been allocated, the VLAN corresponding to the mapping relationship is reserved in the cloud VLAN pool, and the service-instance configuration is configured on the leaf switch.
5. An electronic device, comprising a processor and a memory communicatively connected to the processor and used for storing processor-executable instructions, characterized in that: The processor is used to execute the implementation method of bare metal access to VPC outside the cloud as described in any one of claims 1-4.
6. A server, characterized in that: It includes at least one processor and a memory communicatively connected to the processor, the memory storing instructions executable by the at least one processor, the instructions being executed by the processor to cause the at least one processor to perform an implementation method for off-cloud bare metal access to a VPC as described in any one of claims 1-4.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, it implements the method for accessing a bare metal VPC outside the cloud as described in any one of claims 1-4.