A bare metal deployment method, device, computer equipment and storage medium
By creating and configuring the mapping relationship between VLAN ID and VXLAN network identifier (VNI) in cross-regional SDN controller scenarios, the network communication isolation and data transmission security issues in bare metal deployments are resolved, achieving efficient and accurate network communication and deployment, and improving product compatibility and security.
Patent Information
- Application Number
- CN202410379613.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-29
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2044-03-29
AI Technical Summary
In scenarios where there is no SDN controller across regions, how can bare metal deployment be achieved to solve the problems of high cost, easy failure, scalability and complexity of SDN controllers?
By creating detection networks and deployment networks, configuring different VLAN IDs for them, establishing a mapping relationship between VLAN IDs and VXLAN network identifiers (VNIs), saving the data to the service network switches of the management node and bare metal nodes, and establishing VXLAN tunnels between the switches, network communication isolation and data transmission security are achieved.
Achieve efficient and accurate network communication in cross-regional environments, improve product compatibility and deployment efficiency, reduce manual intervention, and enhance system security.
Smart Images

Figure CN118233296B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cloud computing, and in particular to a bare metal deployment method and device, computer equipment and a storage medium. BACKGROUND
[0002] Bare metal, also known as bare machine, as the name implies, is to have both the performance of a physical machine and the flexibility of a cloud. Bare metal architecture is to install an operating system directly on hardware. At present, the network mode supported by bare metal is VLAN mode, FLAT mode and VXLAN mode. The FLAT mode is generally used in test environments, the VLAN mode is used in local production environments, and the VXLAN mode needs to be matched with an SDN controller. The SDN controller is a highly programmable and centralized network management architecture, which can realize flexible scheduling and fine management of network resources.
[0003] However, the application of the SDN controller in some scenarios has certain limitations: 1. The deployment and operation and maintenance of the SDN controller often involve high cost investment, including hardware device procurement, software license fees and professional skill requirements for network engineers; 2. The SDN controller is the hub of network communication, and once it fails, it may cause the entire network service to be interrupted. In addition, with the expansion of the scale of the data center and the increase in cross-regional deployment, the performance and processing capacity requirements of the SDN controller also increase, which may affect its scalability and reliability in large-scale environments; 3. In the cross-regional multi-data center scenario, many SDN controllers need to be coordinated and managed, increasing the complexity of network operation and maintenance.
[0004] Therefore, how to realize bare metal deployment in a cross-regional scenario without an SDN controller is a technical problem that needs to be solved by those skilled in the art. SUMMARY
[0005] Therefore, it is necessary to provide a bare metal deployment method, device, computer equipment and storage medium capable of realizing bare metal deployment in a cross-regional scenario without an SDN controller in view of the above technical problems.
[0006] In one aspect, a bare metal deployment method is provided, the method comprising:
[0007] creating a detection network and a deployment network, and configuring different vlan ids for the detection network and the deployment network;
[0008] respectively establishing a mapping relationship between the vlan ids of the detection network and the deployment network and a VXLAN network identifier vni;
[0009] The mapping relationship between the VLAN and the VXLAN is respectively stored into the management node service network switch and the bare metal node service network switch, and the service network switches are configured;
[0010] The bare metal is deployed according to the configured network environment and the mapping relationship.
[0011] In one embodiment, before the detection network and the deployment network are created, the method further comprises:
[0012] The OpenStack environment is built on the management node, and the Ironic bare metal function is deployed.
[0013] In one embodiment, the mapping relationship between the VLAN ID of the detection network and the deployment network and the VXLAN network identifier VNI is respectively established, comprising:
[0014] The port of the bare metal node service network switch connected with the bare metal node is configured as an access mode;
[0015] The port of the management node service network switch connected with the management node is configured as a trunk mode, and multiple VLANs are allowed to join;
[0016] According to the detection network and the deployment network, respective virtual switching instances VSI are created;
[0017] Corresponding VXLANs are created under the virtual switching instances VSI, wherein the virtual switching instances VSI and the VXLANs are in one-to-one correspondence;
[0018] The VXLAN tunnel between the management node service network switch and the bare metal node service network switch is established;
[0019] The VXLAN tunnel is associated with the VXLANs corresponding to the detection network and the deployment network;
[0020] The VLAN IDs of the detection network and the deployment network are respectively associated with the corresponding virtual switching instances VSI;
[0021] Based on the association relationship between the VLAN IDs and the VSI and the association relationship between the VSI and the VXLAN network identifier VNI, the VLAN IDs of the detection network and the deployment network are bound with the VNI, and the mapping relationship between the VLAN and the VXLAN is established.
[0022] In one embodiment, the bare metal is deployed according to the configured network environment and the mapping relationship, comprising:
[0023] According to the instructions of the Ironic conductor, a request is sent to the bare metal node service network switch through the management network, and a vlan id of the bare metal node service network switch is switched to a different network.
[0024] In response to the port of the bare metal node service network switch joining the detection network, hardware information is collected through the detection network, and the hardware information is used for deployment of the bare metal.
[0025] In response to the port of the bare metal node service network switch joining the deployment network, deployment of the bare metal is implemented through the deployment network.
[0026] In one embodiment, in response to the port of the bare metal node service network switch joining the detection network vlan, hardware information is collected through the detection network, including:
[0027] Based on the mapping relationship between the vlan and the vxlan, the received Ethernet data frame is encapsulated, forwarded and decapsulated through the management node service network switch and the bare metal node service network switch.
[0028] Through network booting, an IP address is obtained from the detection network, and a kernel and a ramdisk are loaded.
[0029] The hardware information is collected and recorded, and a corresponding port is created for the mac address of the bare metal in the pxe subnet in the neutron.
[0030] In one embodiment, in response to the port of the bare metal node service network switch joining the deployment network, deployment of the bare metal is implemented through the deployment network, including:
[0031] Based on the mapping relationship between the vlan and the vxlan, the received Ethernet data frame is encapsulated, forwarded and decapsulated through the management node service network switch and the bare metal node service network switch.
[0032] Through network booting, an IP address is obtained from the dhcp server of the deployment network, and a deploy kernel and a deploy ramdisk used for deployment are obtained through a tftp protocol.
[0033] The disk of the bare metal is mounted to a controller through an iscsi protocol, the controller is used to write a user-specified operating system to the disk, and deployment of the bare metal is completed.
[0034] In one embodiment, after the bare metal is deployed according to the configured network environment and mapping relationship, including:
[0035] switching the vlan id of the bare metal node service network switch port to a target network vlan in response to the ironic conductor sending a request to the bare metal node service network switch through a management network;
[0036] booting a deployed operating system from a local hard disk, obtaining an intranet ip address through neutron, and realizing intercommunication between the bare metal and the target network.
[0037] In another aspect, a bare metal deployment apparatus is provided, the apparatus comprising:
[0038] a creating module configured to create a detection network and a deployment network, and configure different vlan ids for the detection network and the deployment network;
[0039] a mapping module configured to respectively establish mapping relationships between the vlan ids of the detection network and the deployment network and vxlan network identifiers vnis;
[0040] a configuring module configured to respectively save the mapping relationships between the vlans and the vxlan into a management node service network switch and a bare metal node service network switch, and configure the service network switches;
[0041] a deployment module configured to deploy the bare metal according to the configured network environment and mapping relationships.
[0042] In yet another aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
[0043] creating a detection network and a deployment network, and configuring different vlan ids for the detection network and the deployment network;
[0044] respectively establishing mapping relationships between the vlan ids of the detection network and the deployment network and vxlan network identifiers vnis;
[0045] respectively saving the mapping relationships between the vlans and the vxlan into a management node service network switch and a bare metal node service network switch, and configuring the service network switches;
[0046] deploying the bare metal according to the configured network environment and mapping relationships.
[0047] In yet another aspect, a computer readable storage medium is provided, having a computer program stored thereon, the computer program being executable by a processor to implement the following steps:
[0048] Create a detection network and a deployment network, and configure different vlan ids for the detection network and the deployment network;
[0049] Map the vlan ids of the detection network and the deployment network to vxlan network identifiers vnis, respectively;
[0050] Save the mapping relationship between the vlan and the vxlan in the management node service network switch and the bare metal node service network switch, and configure the service network switches;
[0051] Deploy the bare metal according to the configured network environment and mapping relationship.
[0052] The bare metal deployment method, device, computer equipment and storage medium have the following technical effects:
[0053] 1. By creating and configuring detection networks and deployment networks with different vlan ids, and establishing a mapping relationship with vxlan network identifiers vnis, the Ironic realizes flexible deployment of bare metals in a cross-regional scenario without an SDN controller, ensures network communication isolation and data transmission security in different stages, improves product compatibility, enriches product use scenarios, and improves product competitiveness;
[0054] 2. By establishing a vxlan tunnel between the management node service network switch and the bare metal node service network switch, and associating and binding the vlan id, virtual switch instance vsi and vni, a mapping relationship between the vlan id and the vxlan vni is established, ensuring that the bare metal can efficiently and accurately communicate in a cross-regional environment;
[0055] 3. During deployment, the vlan id of the bare metal node service network switch is controlled by the management network, so that the bare metal can switch between the detection network and the deployment network as needed, collect necessary hardware information through the detection network for subsequent deployment, and finally realize the installation and deployment of the operating system and other software through the deployment network, greatly improving the standardization and automation of the deployment process, realizing efficient deployment of bare metals in complex network environments, reducing manual intervention, and improving deployment efficiency and accuracy;
[0056] 4. After the deployment of the bare metal is completed, the vlan id of the switch is switched to the target network, which can conveniently migrate the deployed bare metal from the dedicated deployment network environment to the actual business operation network environment to provide services externally, and using different network environments in the deployment stage and the running stage is conducive to realizing logical isolation of the network and enhancing the security of the system. BRIEF DESCRIPTION OF DRAWINGS
[0057] Figure 1 This is a schematic diagram of a VLAN-mode bare metal deployment method in the prior art;
[0058] Figure 2 This is a flowchart illustrating a bare metal deployment method in one embodiment;
[0059] Figure 3 This is a schematic diagram illustrating bare metal deployment based on VLAN and VXLAN network mapping in one embodiment;
[0060] Figure 4 This is a structural block diagram of a bare metal deployment device in one embodiment;
[0061] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0062] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0063] As described in the background section, VLAN (Virtual Local Area Network) is a Layer 2 networking technology used to achieve logical isolation within a single physical network. In bare metal deployments, VLANs are used to isolate different types of network traffic, such as inspection networks, deployment networks, and user-specified service networks. However, the maximum number of VLANs is limited (typically a maximum of 4096), making it difficult to meet the needs of large-scale or complex multi-tenant environments requiring more independent networks, and it lacks the ability to scale across regions or data centers.
[0064] like Figure 1 As shown, the deployment of Ironic bare metal in VLAN mode requires network switching. The process includes a detection phase, a deployment phase, and a post-deployment phase. In the detection phase, the bare metal switch port is pre-configured as VLAN 100 in the detection network, and hardware information is collected through this network. In the deployment phase, the Ironic conductor sends a request to the service network switch via the management network to switch the bare metal switch port's VLAN ID to the designated deployment network's VLAN 101, thus achieving bare metal deployment. Finally, the Ironic conductor sends a request to the service network switch via the management network to switch the bare metal switch port to the user-specified VLAN 200, achieving interoperability between the bare metal and service networks.
[0065] In one embodiment, such as Figure 2As shown, a bare metal deployment method is provided, comprising the following steps:
[0066] Step S1, create a detection network and a deployment network, and configure different vlan ids for the detection network and the deployment network.
[0067] Specifically, before creating the detection network and the deployment network, an OpenStack cloud environment is built and configured on the management node, and an Ironic bare metal function is deployed.
[0068] Wherein, OpenStack is a cloud computing infrastructure open source project, which can control large computing, storage, network and other resource pools through data centers. Before deploying the bare metal, a complete OpenStack environment needs to be built first, including installing and configuring a series of core services of OpenStack, such as Keystone (identity authentication service), Neutron (network service), Glance (image service), Nova (computing service) and the like. Among them, Ironic is the core component of OpenStack bare metal service, which is used to manage and control the life cycle of bare metal, that is, the management from registration to the whole state process management of system installation and deployment.
[0069] As shown in the figure, Figure 3 The OpenStack management network needs to interwork with the IPMI network and the switch management ip to manage the network, wherein eth is the Ethernet interface, and if there are multiple Ethernet interfaces on the same device, eth0, eth1…… are used. On the OpenStack management node, the network structure is started to be built through a network management tool (such as Neutron service), and considering network isolation and function division, two independent networks are created, which are a detection network for hardware detection and a deployment network for operating system deployment.
[0070] Exemplarily, for the detection network and the deployment network, different vlan ids are defined for them respectively, for example, the detection network vlan 100 and the deployment network vlan 101. For the convenience of description, the following is described according to the detection network vlan 100 and the deployment network vlan 101.
[0071] Step S2, respectively establish the mapping relationship of the vlan id of the detection network and the deployment network to the vxlan network identifier vni.
[0072] Wherein, the vxlan (Virtual eXtensible Local Area Network) is a kind of tunnel technology, using MAC in UDP (User Datagram Protocol) encapsulation mode, that is, the original Ethernet message sent by virtual machine is completely encapsulated in UDP message, and then the outer layer uses the IP message header and Ethernet message header of physical network to encapsulate, can establish layer 2 Ethernet network tunnel on the basis of layer 3 network, to realize the interconnection of layer 2 in cross-region.
[0073] Vxlan provides up to 16 million tenant identification capabilities through the 24-bit vni field in vxlan, far exceeding the number limit of vlan;On the other hand, vxlan allows building layer 2 network tunnel on layer 3 IP network, essentially building a virtual tunnel between two switches across the basic IP network, virtualizing the IP basic network into a giant "layer 2 switch", that is, large layer 2 network, to meet the demand of virtual machine large-scale layer 2 interconnection, so as to realize the interconnection of layer 2 in different regions, different data centers or even across multiple network providers.
[0074] Through the mapping of vlan and vxlan, the deployment and management of bare metal across regions can be realized without relying on SDN controller, and the problem of cross-regional network isolation and interconnection that cannot be met by traditional vlan is solved.
[0075] Specifically, the steps of establishing the mapping relationship of vlan id to vxlan network identifier vni of the detection network and the deployment network respectively include:
[0076] Step S21, the port of the bare metal node service network switch connected with the bare metal node is configured as access mode.This means that the port only allows receiving and sending single specified vlan data frame, which is set to detection network vlan 100.
[0077] Step S22, the port of the management node service network switch connected with the management node is configured as trunk mode, allowing multiple vlans to join.Ensure that the traffic of detection network vlan 100 and deployment network vlan 101 can pass through the port.
[0078] Step S23, create respective virtual switch instance vsi according to the detection network and the deployment network.For example, create vsi inspect for detection network, and scenario vsi deploy for deployment network, the two vsis are used to carry the traffic of corresponding vlan respectively.
[0079] Step S24, a corresponding vxlan is created under the virtual switch instance vsi, wherein the virtual switch instance vsi and the vxlan are in one-to-one correspondence. For example, the vxlan 10100 is created for the vsiinspect, and the vxlan 10101 is created for the vsideploy. Each vxlan has a 24-bit vni field for distinguishing different network tenants.
[0080] Step S25, a vxlan tunnel is established between the management node service network switch and the bare metal node service network switch. Through the configuration command of the switch, it is ensured that the data can be transmitted between the two nodes through the vxlan.
[0081] Step S26, the vxlan tunnel is associated with the vxlan corresponding to the detection network and the deployment network. It is ensured that the data is encapsulated and decapsulated through the vxlan tunnel at the physical network layer, and the layer 2 communication across regions is realized.
[0082] Step S27, the vlan ids of the detection network and the deployment network are respectively associated with the corresponding virtual switch instances vsi.
[0083] Specifically, the detection network vlan 100 is associated with the vsiinspect, and the deployment network vlan 101 is associated with the vsideploy, so as to ensure that the vlan traffic can be processed through the corresponding vsi.
[0084] Step S28, based on the association relationship between the vlan id and the vsi and the association relationship between the vsi and the vxlan network identifier vni, the vlan ids of the detection network and the deployment network are bound with the vnis, and the mapping relationship between the vlan and the vxlan is established.
[0085] Specifically, the vlan 100 of the detection network is bound with the vxlan 10100 through the switch configuration command, and the vlan 101 of the deployment network is bound with the vxlan 10101, so as to form the mapping relationship between the vlan and the vxlan, and ensure that the bare metal server can still realize efficient network deployment in the cross-region scenario without the SDN controller, greatly expanding the manageability and flexibility of network resources.
[0086] Step S3, the mapping relationship between the vlan and the vxlan is saved into the management node service network switch and the bare metal node service network switch respectively, and the service network switch is configured.
[0087] For the management node service network switch and the bare metal node service network switch, respectively through the switch command line interface to ensure that the detection network vlan and the deployment network vlan are mapped to the correct vxlan, and ensure that the switch port configuration is correct. After completing the configuration, it is necessary to check whether the mapping relationship takes effect, and ensure that the vlan traffic can be correctly encapsulated and decapsulated through the vxlan tunnel. After confirmation, save all configurations to the switch to ensure that these mapping relationships remain effective even after the switch restarts.
[0088] It should be noted that the vxlan adopts a MAC in UDP (User Datagram Protocol) encapsulation manner, that is, the original Ethernet message sent by the virtual machine is completely encapsulated in the UDP message, and then the outer layer uses the IP message header and the Ethernet message header of the physical network for encapsulation.
[0089] Exemplarily, the received original Ethernet frame (Original L2 Frame) is "packaged" by the VTEP (vxlan Tunnel End Point) as follows:
[0090] vxlan Header: add a vxlan header (8 bytes), which contains a 24-bit vni field for defining different tenants in the vxlan network. In addition, it also contains vxlan Flags (8 bits, taking the value of 00001000) and two reserved fields (24 bits and 8 bits, respectively).
[0091] UDP Header: the vxlan header and the original Ethernet frame are used as the data of UDP. In the UDP header, the destination port number (vxlan Port) is fixed at 4789, and the source port number (UDP Src. Port) is the value calculated by the original Ethernet frame through a hash algorithm.
[0092] Outer IP Header: encapsulate the outer IP header. Among them, the source IP address (Outer Src. IP) is the IP address of the VTEP to which the source VM belongs, and the destination IP address (Outer Dst. IP) is the IP address of the VTEP to which the destination virtual machine belongs.
[0093] Outer MAC Header: encapsulate the outer Ethernet header. Among them, the source MAC address (Src. MAC Addr.) is the MAC address of the VTEP to which the source virtual machine belongs, and the destination MAC address (Dst. MAC Addr.) is the MAC address of the next hop device in the path to the destination VTEP.
[0094] The VTEP generally refers to network devices supporting the vxlan technology and capable of encapsulating and decapsulating the vxlan packet, such as a virtual switch, a physical switch or a router, etc. In the embodiment, since the management node service network switch and the bare metal node service network switch support the vxlan function and undertake the work of encapsulating the original Ethernet frame into the vxlan packet and vice versa, the two service network switches can play the role of VTEP in this case to encapsulate, forward and decapsulate the received Ethernet data frame. Through such layer-by-layer encapsulation, the original Ethernet frame becomes a vxlan encapsulated packet that can be transmitted on a three-layer network, thereby realizing the expansion of a large-scale two-layer network across a wide area network or within a data center.
[0095] In step S4, the bare metal is deployed according to the configured network environment and mapping relationship.
[0096] It should be noted that the bare metal deployment process includes a detection phase, a deployment phase and a post-deployment phase. According to the instructions of the Ironic conductor, a request can be sent to the bare metal node service network switch through the management network to switch the vlan id of the bare metal node service network switch to different networks to complete the deployment task in different phases.
[0097] According to the preconfigured network environment, the port of the bare metal node service network switch is preset as the detection network vlan100, and the hardware information is collected through the detection network, wherein the hardware information is used for deploying the bare metal.
[0098] Specifically, based on the mapping relationship between the vlan and the vxlan, the received Ethernet data frame is encapsulated, forwarded and decapsulated by the management node service network switch and the bare metal node service network switch, the vxlan 10100 enables the switches in different areas to transmit data through the tunnel technology; the IP address is obtained from the detection network through the network boot (PXE Boot), and the kernel and the ramdisk are loaded; the Ironic Python Agent embedded in the ramdisk automatically collects the hardware information of the server, including but not limited to the CPU model, the memory capacity, the hard disk configuration, etc., and reports these information to the Ironic Conductor component of the OpenStack in real time; at the same time, the corresponding port is created for the mac address of the bare metal in the pxe subnet of the neutron service, ensuring that the network configuration is correct and accurate.
[0099] Further, after collecting the hardware information and determining the configuration, the Ironic conductor sends a request to the bare metal node service network switch through the management network, adds the port of the bare metal node service network switch to the deployment network vlan 101, and realizes the deployment of the bare metal through the deployment network.
[0100] Specifically, based on the mapping relationship between the vlan and the vxlan, the received Ethernet data frame is encapsulated, forwarded and decapsulated by the management node service network switch and the bare metal node service network switch; an ip address is obtained from the dhcp server of the deployment network through network boot (PXE Boot), and deploykernel and deploy ramdisk used for deployment are obtained through the tftp protocol; the disk of the bare metal is mounted to the controller of the cloud platform through the iscsi protocol, and the controller is used to write the user-specified operating system image to the disk, thereby completing the deployment of the bare metal.
[0101] Further, after deploying the bare metal according to the configured network environment and mapping relationship, the method further comprises:
[0102] In response to the Ironic conductor sending a request to the bare metal node service network switch through the management network, the vlan id of the port of the bare metal node service network switch is switched to the target network vlan 200; the deployed operating system is booted from the local hard disk, an intranet ip address is obtained through the neutron, and the interworking between the bare metal and the service network is realized.
[0103] After obtaining the intranet ip address, the bare metal is completely integrated into the intranet environment of the target user, and seamless interworking with the service network is realized. This means that the bare metal server can participate in various operations such as data transmission and service provision in the service network as a normal physical server, and complete collaborative work with other resources in the cloud environment.
[0104] Further, the above vxlan tunnel is taken as a first vxlan tunnel, in addition to which a second vxlan tunnel can be additionally arranged between the management node service network switch and the bare metal node service network switch, and different vnis are allocated to the vxlan associated therewith;
[0105] The mapping relationship between the vlan id and the vxlan vni is configured.
[0106] Different network switching logic and strategies are configured, so that the bare metal switches the first vxlan tunnel or the second vxlan tunnel to access the network according to the business requirements.
[0107] The utilization of the first vxlan tunnel and the second vxlan tunnel is obtained through a monitoring tool, including but not limited to bandwidth utilization, packet loss rate, delay and other key performance indicators;
[0108] If the utilization of the first vxlan tunnel reaches a preset threshold, an alarm is triggered and an automatic operation and maintenance system is notified, the bare metal is switched to the second vxlan tunnel, and the network configuration in Neutron is updated to ensure uninterrupted service.
[0109] The above bare metal deployment method can be implemented through the following code. It can be understood that the following code is only for illustrative purposes and is not the only implementation method.
[0110] 1) Switch end (take H3C UNIS S7800XP switch configuration as an example)
[0111] Management node end service switch configuration:
[0112] # Declare inspect vlan
[0113] vlan 100
[0114] name inspect
[0115] # Declare deploy vlan
[0116] vlan 101
[0117] name deploy
[0118] # Bind vsi deploy to vxlan 10101
[0119] vsi deploy
[0120] mtu 1700
[0121] arp suppression enable
[0122] vxlan 10101
[0123] tunnel 89
[0124] # Bind vsiinspect to vxlan 10100
[0125] vsiinspect
[0126] mtu 1700
[0127] arp suppression enable
[0128] vxlan 10100
[0129] tunnel 89
[0130] # Configure management node aggregation interface network properties
[0131] interface Bridge-Aggregation9
[0132] description To-EXCS-D09-U36-CON-R3810G5-03 XG2 / 1 port link-type trunk
[0133] undo port trunk permit vlan 1
[0134] port trunk permit vlan 2to 4094
[0135] link-aggregation mode dynamic
[0136] port m-lag group 9
[0137] stp edged-port
[0138] # Configure binding vlan 100 to vsi inspect
[0139] service-instance 100
[0140] encapsulation s-vid 100
[0141] xconnect vsi inspect
[0142] # Configure binding vlan 101 to vsi deploy service-instance 101
[0143] encapsulation s-vid 101
[0144] xconnect vsi deploy
[0145] # Bare metal node end-of-service switch configuration:
[0146] # Declare inspect vlan and bind vxlan vni 10100 vlan 100
[0147] vxlan vni 10100
[0148] # declare deploy vlan, and bind vxlan vni 10101 vlan 101 vxlan vni 10101
[0149] # make vsi deploy bind vxlan 10101 vsi deploy mtu 1700
[0150] arp suppression enable vxlan 10101
[0151] tunnel 98
[0152] # make vsi inspect bind vxlan 10100
[0153] vsi inspect
[0154] mtu 1700
[0155] arp suppression enable
[0156] vxlan 10100
[0157] tunnel 98
[0158] # configure bare metal node initial port vlan
[0159] interface Ten-GigabitEthernet1 / 0 / 14
[0160] port link-mode bridge
[0161] port access vlan 100 stp edged-port
[0162] 2) Management node network configuration:
[0163] # set inspect network, vlan 100
[0164] ovs-vsctl add-br bm-inspect br-ex 100
[0165] # set deploy network, vlan 101
[0166] ovs-vsctl add-br bm-deploy br-ex 101
[0167] It should be understood that, although Figure 2The steps in the flowchart of FIG. 1 are displayed in sequence according to the arrows, but the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other orders. Moreover, Figure 2 At least a part of the steps in FIG. 1 can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the sub-steps or stages is not necessarily sequential, but can be alternately executed with at least a part of other steps or sub-steps or stages of other steps.
[0168] In an embodiment, as shown in FIG. 2, a bare metal deployment apparatus is provided, comprising a creating module, a mapping module, a configuring module and a deploying module, wherein: Figure 4
[0169] The creating module is configured to create a detection network and a deployment network, and configure different vlan ids for the detection network and the deployment network;
[0170] The mapping module is configured to respectively establish mapping relationships between the vlan ids of the detection network and the deployment network and vxlan network identifiers vnis;
[0171] The configuring module is configured to save the mapping relationships between the vlans and the vxlan in a management node service network switch and a bare metal node service network switch, and configure the service network switches;
[0172] The deploying module is configured to deploy the bare metal according to the configured network environment and the mapping relationships.
[0173] In one embodiment, the mapping module is further configured to configure a port of the bare metal node service network switch connected with the bare metal node as an access mode; configure a port of the management node service network switch connected with the management node as a trunk mode, allowing multiple vlans to join; create respective virtual switching instances (VSIs) according to the detection network and the deployment network; create corresponding VXLANs under the virtual switching instances (VSIs), wherein the virtual switching instances (VSIs) and the VXLANs are in one-to-one correspondence; establish a VXLAN tunnel between the management node service network switch and the bare metal node service network switch; associate the VXLAN tunnel with the VXLANs corresponding to the detection network and the deployment network; associate the vlan ids of the detection network and the deployment network with the corresponding virtual switching instances (VSIs), respectively; bind the vlan ids of the detection network and the deployment network with the VNIs based on the association relationship between the vlan ids and the VSIs and the association relationship between the VSIs and the VXLAN network identifiers (VNIs), to establish a mapping relationship between the vlans and the VXLANs.
[0174] In one embodiment, the deployment module is further configured to switch the vlan id of the bare metal node service network switch to a different network by sending a request to the bare metal node service network switch through the management network according to an instruction of the Ironic conductor; collect hardware information through the detection network in response to the port of the bare metal node service network switch joining the detection network, wherein the hardware information is used for deploying the bare metal; and implement deployment of the bare metal through the deployment network in response to the port of the bare metal node service network switch joining the deployment network.
[0175] In one embodiment, the deployment module is further configured to encapsulate, forward and decapsulate an Ethernet data frame received through the management node service network switch and the bare metal node service network switch based on the mapping relationship between the vlans and the VXLANs; obtain an IP address from the detection network through network booting, and load a kernel and a ramdisk; collect and record hardware information, and create a corresponding port for the mac address of the bare metal in a pxe subnet in the neutron.
[0176] In one embodiment, the deployment module is further configured to encapsulate, forward and decapsulate the received Ethernet data frame by the management node service network switch and the bare metal node service network switch based on the mapping relationship between the vlan and the vxlan; obtain an IP address from a DHCP server of the deployment network through network booting, and obtain a deploy kernel and a deploy ramdisk for deployment through a TFTP protocol; and mount the disk of the bare metal to the controller through an iSCSI protocol, and write a user-specified operating system to the disk by the controller to complete deployment of the bare metal.
[0177] In one embodiment, the deployment module is further configured to switch the vlan id of the port of the bare metal node service network switch to a target network vlan in response to the Ironic conductor sending a request to the bare metal node service network switch through the management network; and boot the deployed operating system from the local hard disk, and obtain an intranet IP address through a neutron to realize intercommunication between the bare metal and the target network.
[0178] In one embodiment, the creation module is further configured to build an OpenStack environment on the management node, and deploy an Ironic bare metal function.
[0179] The specific limitations of the bare metal deployment apparatus can be referred to the limitations of the bare metal deployment method in the foregoing, and will not be described herein. Each module in the bare metal deployment apparatus described above can be realized by software, hardware and a combination thereof in whole or in part. Each module described above can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operation corresponding to each module.
[0180] In one embodiment, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in Figure 5 The computer device includes a processor, a memory, a network interface and a database connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store mapping relationship data of a vlan and a vxlan. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement a bare metal deployment method.
[0181] Those skilled in the art can understand that Figure 5The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0182] In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the following steps when executing the computer program:
[0183] Create a detection network and a deployment network, and configure different vlan ids for the detection network and the deployment network;
[0184] Respectively establish a mapping relationship between the vlan ids of the detection network and the deployment network and a vxlan network identifier vni;
[0185] Respectively save the mapping relationship between the vlan and the vxlan into a management node service network switch and a bare metal node service network switch, and configure the service network switches;
[0186] Deploy the bare metal according to the configured network environment and mapping relationship.
[0187] In one embodiment, the processor further implements the following steps when executing the computer program: configure the port of the bare metal node service network switch connected with the bare metal node as access mode; configure the port of the management node service network switch connected with the management node as trunk mode, allowing multiple vlans to join; create respective virtual switching instances vsi according to the detection network and the deployment network; create corresponding vxlan under the virtual switching instance vsi, wherein the virtual switching instance vsi and the vxlan correspond one-to-one; establish a vxlan tunnel between the management node service network switch and the bare metal node service network switch; associate the vxlan tunnel with the corresponding vxlan of the detection network and the deployment network; associate the vlan ids of the detection network and the deployment network with the corresponding virtual switching instances vsi respectively; based on the association relationship between the vlan ids and the vsi and the association relationship between the vsi and the vxlan network identifier vni, bind the vlan ids of the detection network and the deployment network with the vni, and establish the mapping relationship between the vlan and the vxlan.
[0188] In one embodiment, the processor, when executing the computer program, further implements the following steps: sending a request to the bare-metal node service network switch through the management network according to the instructions of the Ironic conductor, switching the vlan id of the bare-metal node service network switch to a different network; in response to the port of the bare-metal node service network switch joining the detection network, collecting hardware information through the detection network, the hardware information being used for deploying the bare metal; in response to the port of the bare-metal node service network switch joining the deployment network, implementing deployment of the bare metal through the deployment network.
[0189] In one embodiment, the processor, when executing the computer program, further implements the following steps: based on the mapping relationship between the vlan and the vxlan, encapsulating, forwarding and decapsulating the received Ethernet data frame through the management node service network switch and the bare-metal node service network switch; obtaining an IP address from the detection network through network booting, and loading a kernel and a ramdisk; collecting and recording hardware information, and creating a corresponding port for the mac address of the bare metal in a pxe subnet in the neutron.
[0190] In one embodiment, the processor, when executing the computer program, further implements the following steps: based on the mapping relationship between the vlan and the vxlan, encapsulating, forwarding and decapsulating the received Ethernet data frame through the management node service network switch and the bare-metal node service network switch; obtaining an IP address from the dhcp server of the deployment network, and obtaining a deploy kernel and a deploy ramdisk for deployment through a tftp protocol; mounting the disk of the bare metal to a controller through an iscsi protocol, writing a user-specified operating system to the disk by using the controller, and completing deployment of the bare metal.
[0191] In one embodiment, the processor, when executing the computer program, further implements the following steps: in response to the Ironic conductor sending a request to the bare-metal node service network switch through the management network, switching the vlan id of the port of the bare-metal node service network switch to a target network vlan; booting the deployed operating system from a local hard disk, obtaining an intranet IP address through the neutron, and realizing intercommunication of the bare metal and the target network.
[0192] In one embodiment, the processor, when executing the computer program, further implements the following steps: building an OpenStack environment on the management node, and deploying an Ironic bare-metal function.
[0193] In one embodiment, a computer readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, implements the following steps:
[0194] create a detection network and a deployment network, and configure different vlan ids for the detection network and the deployment network;
[0195] respectively establish mapping relationships between the vlan ids of the detection network and the deployment network and vxlan network identifiers vnis;
[0196] save the mapping relationships between the vlans and the vxlan in the management node service network switch and the bare metal node service network switch, and configure the service network switches;
[0197] deploy the bare metal according to the configured network environment and mapping relationships.
[0198] In one embodiment, the computer program, when executed by a processor, further implements the following steps: configure the port of the bare metal node service network switch connected with the bare metal node as access mode; configure the port of the management node service network switch connected with the management node as trunk mode, allowing multiple vlans to join; create respective virtual switching instances vsis for the detection network and the deployment network; create corresponding vxlan under the virtual switching instance vsi, wherein the virtual switching instance vsi and the vxlan are in one-to-one correspondence; establish a vxlan tunnel between the management node service network switch and the bare metal node service network switch; associate the vxlan tunnel with the corresponding vxlan of the detection network and the deployment network; associate the vlan ids of the detection network and the deployment network with the corresponding virtual switching instances vsis; based on the association relationship between the vlan ids and the vsis and the association relationship between the vsis and the vxlan network identifiers vnis, bind the vlan ids of the detection network and the deployment network with the vnis, and establish the mapping relationship between the vlans and the vxlan.
[0199] In one embodiment, the computer program, when executed by a processor, further implements the following steps: according to the instructions of the Ironic conductor, send a request to the bare metal node service network switch through the management network, switch the vlan id of the bare metal node service network switch to a different network; in response to the port of the bare metal node service network switch joining the detection network, collect hardware information through the detection network, the hardware information being used for deploying the bare metal; in response to the port of the bare metal node service network switch joining the deployment network, implement the deployment of the bare metal through the deployment network.
[0200] In one embodiment, the computer program is further implemented when executed by the processor to perform the following steps: based on the mapping relationship between the vlan and the vxlan, the received Ethernet data frame is encapsulated, forwarded and decapsulated by the management node service network switch and the bare metal node service network switch; an IP address is obtained from the detection network through network boot, and a kernel and a ramdisk are loaded; hardware information is collected and recorded, and a corresponding port is created for the mac address of the bare metal in the pxe subnet in the neutron.
[0201] In one embodiment, the computer program is further implemented when executed by the processor to perform the following steps: based on the mapping relationship between the vlan and the vxlan, the received Ethernet data frame is encapsulated, forwarded and decapsulated by the management node service network switch and the bare metal node service network switch; an IP address is obtained from the detection network through network boot, and a kernel and a ramdisk are loaded; hardware information is collected and recorded, and a corresponding port is created for the mac address of the bare metal in the pxe subnet in the neutron.
[0202] In one embodiment, the computer program is further implemented when executed by the processor to perform the following steps: in response to the Ironic conductor sending a request to the bare metal node service network switch through the management network, switching the vlan id of the bare metal node service network switch port to the target network vlan; booting the deployed operating system from the local hard disk, obtaining the intranet IP address through the neutron, and realizing the intercommunication of the bare metal and the target network.
[0203] In one embodiment, the computer program is further implemented when executed by the processor to perform the following steps: building an OpenStack environment in the management node, and deploying the Ironic bare metal function.
[0204] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, storage, databases, or other media in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0205] The technical features of the above embodiments can be combined in any way. In order to make the description simple, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.
[0206] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of the patent of the present application should be subject to the appended claims.
Claims
1. A bare metal deployment method, characterized by, The method comprises the following steps: creating a detection network and a deployment network, and configuring different vlan ids for the detection network and the deployment network; respectively establishing mapping relationships between the vlan ids of the detection network and the deployment network and vxlan network identifiers vnis; saving the mapping relationships between the vlans and the vxlan in the management node service network switch and the bare metal node service network switch, and configuring the service network switches; deploying the bare metal according to the configured network environment and the mapping relationships; wherein the step of respectively establishing the mapping relationships between the vlan ids of the detection network and the deployment network and the vxlan network identifiers vnis comprises the following steps: configuring the port of the bare metal node service network switch connected with the bare metal node as an access mode; configuring the port of the management node service network switch connected with the management node as a trunk mode, and allowing multiple vlans to join; respectively creating virtual switching instances vsis for the detection network and the deployment network; creating corresponding vxlan under the virtual switching instances vsis, wherein the virtual switching instances vsis and the vxlan are in one-to-one correspondence; establishing a vxlan tunnel between the management node service network switch and the bare metal node service network switch; associating the vxlan tunnel with the corresponding vxlan of the detection network and the deployment network; respectively associating the vlan ids of the detection network and the deployment network with the corresponding virtual switching instances vsis; based on the association relationship between the vlan ids and the vsis and the association relationship between the vsis and the vxlan network identifiers vnis, binding the vlan ids of the detection network and the deployment network with the vnis, and establishing the mapping relationship between the vlan and the vxlan.
2. The bare metal deployment method of claim 1, wherein, Before the step of creating the detection network and the deployment network, the method further comprises the following steps: building an OpenStack environment on the management node, and deploying an Ironic bare metal function.
3. The bare metal deployment method of any of claims 1 to 2, wherein, The step of deploying the bare metal according to the configured network environment and the mapping relationships comprises the following steps: sending a request to the bare metal node service network switch through the management network according to the instruction of the Ironic conductor, and switching the vlan id of the bare metal node service network switch to a different network; in response to the port of the bare metal node service network switch joining the detection network, collecting hardware information through the detection network, wherein the hardware information is used for deploying the bare metal; in response to the port of the bare metal node service network switch joining the deployment network, realizing the deployment of the bare metal through the deployment network.
4. The bare metal deployment method of claim 3, wherein, The step of collecting the hardware information through the detection network in response to the port of the bare metal node service network switch joining the detection network vlan comprises the following steps: based on the mapping relationship between the vlan and the vxlan, encapsulating, forwarding and decapsulating the received Ethernet data frame through the management node service network switch and the bare metal node service network switch. Obtain an IP address from the detection network through network booting, and load a kernel and a ramdisk; Collect and input hardware information, and create a corresponding port for the mac address of the bare metal in the pxe subnet in the neutron.
5. The bare metal deployment method of claim 3, wherein, The method further comprises: Based on the mapping relationship between the vlan and the vxlan, the management node service network switch and the bare metal node service network switch encapsulate, forward and decapsulate the received Ethernet data frame; Obtain an IP address from the dhcp server of the deployment network through network booting, and obtain a deploy kernel and a deploy ramdisk for deployment through a tftp protocol; Mount the disk of the bare metal to the controller through an iscsi protocol, write a user-specified operating system to the disk by using the controller, and complete the deployment of the bare metal.
6. The bare metal deployment method of claim 1, wherein, The method further comprises: Switch the vlan id of the port of the bare metal node service network switch to a target network vlan in response to the ironic conductor sending a request to the bare metal node service network switch through the management network; Boot the deployed operating system from the local hard disk, obtain an intranet IP address through the neutron, and realize intercommunication between the bare metal and the target network.
7. A bare metal deployment apparatus for implementing the bare metal deployment method of any one of claims 1-6, characterized in that, The apparatus comprises: A creating module configured to create a detection network and a deployment network, and configure different vlan ids for the detection network and the deployment network; A mapping module configured to establish a mapping relationship between the vlan id of the detection network and the vlan id of the deployment network and a vxlan network identifier vni, respectively; A configuration module configured to save the mapping relationship between the vlan and the vxlan in the management node service network switch and the bare metal node service network switch, respectively, and configure the service network switches; A deployment module configured to deploy the bare metal according to the configured network environment and mapping relationship.
8. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps of the method of any one of claims 1 to 6 when executing the computer program.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Bare metal server deployment method and device
CN116668277A
Bare metal tenant isolation method, device, equipment and medium
CN116708196A