A network address configuration method and computing device

By mounting a target block device carrying the target IP address on a bare metal server and automatically configure the network address, the problems of low manual configuration efficiency and high error rate are solved, efficient and accurate network address configuration is achieved, and user experience is improved.

CN117938641BActive Publication Date: 2025-03-21XFUSION DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311733289.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-15
Publication Date
2025-03-21
Estimated Expiration
2043-12-15

AI Technical Summary

Technical Problem

Bare metal servers need to manually configure network addresses during the operation stage, resulting in low configuration efficiency and prone to configuration errors, causing network failures and affecting user experience.

Method used

By mounting the target block device on a bare metal server, the device carries the target Internet protocol IP address and automatically obtains and configures the network address.

Benefits of technology

It improves the efficiency of network address configuration, reduces the configuration error rate, reduces the probability of network failures, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117938641B_ABST
    Figure CN117938641B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method for configuring a network address and a computing device. Through the target block device mounted on the BMS, and the target block device includes a target IP address, the BMS can automatically obtain the target IP address from the target block device. In this way, when the BMS needs to configure the network address, the target IP address in the target block device can be used to automatically configure the network address of the BMS. It can be seen that the embodiment of the present application can automatically obtain the target IP address and perform automatic configuration, which is highly efficient compared to manually configuring the network address. In addition, by pre-storing the network address, the embodiment of the present application can reduce manual configuration errors, help improve the configuration accuracy, reduce the probability of network failures of the BMS, and improve the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of servers, and in particular to a configuration method and computing device for a network address. Background Art

[0002] A bare metal server (BMS) is a physical server that has the characteristics of flexibility, high-performance computing capabilities comparable to traditional physical machines, and secure physical isolation. Therefore, BMS is increasingly widely used.

[0003] During the BMS operation phase, the network address needs to be configured, specifically the Internet Protocol (IP) address, so that the BMS can access the Internet normally through the network address. However, in related solutions, users need to manually configure the network address, which is inefficient and prone to configuration errors, causing BMS network failures and affecting user experience. Summary of the invention

[0004] The embodiments of the present application provide a method and a computing device for configuring a network address, which are used to improve the efficiency of configuring a network address, reduce the configuration error rate, reduce the probability of network failures, and improve user experience.

[0005] In a first aspect, an embodiment of the present application provides a method for configuring a network address. The method is applied to a bare metal server BMS, and is characterized in that the method includes:

[0006] Get the target block device mounted on the BMS; the target block device carries the target Internet Protocol IP address; configure the network address in the BMS based on the target IP address.

[0007] The embodiment of the present application uses a target block device mounted on the BMS, and the target block device includes a target IP address, so that the BMS can automatically obtain the target network address from the target block device. In this way, when the BMS needs to configure the network address, the target network address in the target block device can be used to automatically configure the network address of the BMS. The embodiment of the present application can automatically obtain the target network address and perform automatic configuration, which has high configuration efficiency compared to manual configuration of the network address. In addition, by pre-storing the network address, the embodiment of the present application can reduce manual configuration errors, help improve the configuration accuracy, reduce the probability of network failures of the BMS, and improve the user experience.

[0008] In a possible implementation, the target block device includes a preset tag, and the embodiment of the present application can obtain the target block device from at least one block device mounted on the BMS based on the preset tag. In this way, the target block device can be quickly and accurately obtained from the mounted block devices by carrying the preset tag in the target block device.

[0009] In another possible implementation, before obtaining the target block device mounted on the BMS, the virtual hard disk mounted on the BMS is obtained, and the target virtual hard disk is obtained from the virtual hard disk. Each virtual hard disk is established based on a block device, and the target virtual hard disk is established based on the target block device. In this way, the target block device is mounted on the BMS through the target virtual hard disk.

[0010] In another possible implementation, before obtaining the target virtual hard disk mounted on the BMS, a network configuration file is obtained; wherein the network configuration file includes the target IP address; an image file corresponding to the network configuration file is generated; wherein the image file includes a preset tag; a target block device is created based on the image file, and the target block device includes the preset tag; and a target virtual hard disk is created based on the target block device. In this way, the target IP address is configured to the network configuration file, and the network configuration file is used to construct an image file and a target block device with a preset tag.

[0011] In another possible implementation, a first file and a second file are obtained; wherein the first file is used to store the login password of the BMS management system, and the second file is used to store the identification information of the BMS instance; an image file is generated based on the network configuration file, the first file, and the second file; wherein the image file is an ISO image file including a preset tag. In this way, the network configuration file, the file storing the login password of the BMS management system, and the file storing the identification information of the BMS instance are packaged and configured at the same time, thereby improving the configuration speed.

[0012] In another possible implementation, a system cloud disk is created and configured based on the cloud disk configuration parameters in the bare metal instance configuration parameters issued by the cloud management platform; wherein the system cloud disk is used to store the operating system OS to be installed of the BMS; and the operating system OS is installed based on the system cloud disk. Optionally, a virtual network card is created and configured based on the network card configuration parameters in the bare metal instance configuration parameters issued by the cloud management platform. In this way, by customizing the virtual network card or cloud disk configuration through the cloud management platform, a network configuration block device is created in advance and mounted on the BMS Host, so as to realize automatic IP configuration while improving the efficiency of BMS instance issuance and enhancing user experience.

[0013] Optionally, the network address in the BMS is the network address of the virtual network card, and the network address of the virtual network card is configured based on the target IP address, thereby realizing configuration of the network address in the BMS based on the target IP address.

[0014] In another possible implementation, before acquiring the target block device mounted on the BMS, the BMS is restarted in response to a restart instruction of the cloud management platform, so that the target block device mounted on the BMS can be acquired after the restart.

[0015] In a second aspect, an embodiment of the present application provides a computing device, the computing device including a first processor, the first processor being configured to:

[0016] Obtain a target block device mounted on the BMS; wherein the target block device includes a target IP address; and configure a network address in the BMS based on the target IP address.

[0017] In a possible implementation, the target block device includes a preset tag; and the first processor is configured to obtain the target block device from at least one block device mounted on the BMS based on the preset tag.

[0018] In another possible implementation, before the first processor is used to obtain the target block device mounted on the BMS, the first processor is also used to: obtain the virtual hard disk mounted on the BMS; wherein each virtual hard disk is established based on the block device; obtain the target virtual hard disk from the virtual hard disk; wherein the target virtual hard disk is established based on the target block device.

[0019] In another possible implementation, the computing device further includes a second processor, and before the first processor is used to obtain the target virtual hard disk mounted on the bare metal server BMS, the second processor is used to:

[0020] Obtain a network configuration file; wherein the network configuration file includes a target IP address; generate an image file corresponding to the network configuration file; wherein the image file includes a preset tag; create a target block device based on the image file, wherein the target block device includes a preset tag; and create a target virtual hard disk based on the target block device.

[0021] In another possible implementation, the second processor is further used to: obtain a first file and a second file; wherein the first file is used to store a login password of the BMS management system, and the second file is used to store identification information of the BMS instance; generate an image file based on the network configuration file, the first file and the second file; wherein the image file is an ISO image file including a preset label.

[0022] Optionally, the second processor is also used to: create and configure a system cloud disk based on the cloud disk configuration parameters in the bare metal instance configuration parameters issued by the cloud management platform; wherein the system cloud disk is used to store the operating system OS to be installed of the BMS; and install the operating system OS based on the system cloud disk.

[0023] Optionally, the second processor is further used to: create and configure a virtual network card based on the network card configuration parameters in the bare metal instance configuration parameters issued by the cloud management platform.

[0024] In yet another possible implementation, the network address in the BMS is a network address of a virtual network card; and the first processor is configured to configure the network address of the virtual network card based on the target IP address.

[0025] In yet another possible implementation, before the first processor is used to obtain the target block device mounted on the BMS, the second device is further used to: restart the BMS in response to a restart instruction of the cloud management platform.

[0026] Optionally, the first processor is a central processing unit CPU; the second processor is a data processing unit DPU

[0027] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is run on a computer, the computer executes the operating steps of any possible network address configuration method of the first aspect described above.

[0028] In a fifth aspect, an embodiment of the present application further provides a computer program product, which, when executed on a computer, implements the operating steps of any possible method for configuring a network address in the first aspect.

[0029] Any of the network address configuration method computing devices or computer-readable storage media or computer program products provided above are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A schematic diagram of a method for manually configuring an IP address;

[0031] Figure 2 A flow chart of a method for configuring a network address provided in an embodiment of the present application;

[0032] Figure 3 A method for implementing target block device mounting provided in an embodiment of the present application;

[0033] Figure 4 A schematic diagram of the structure of a network address configuration system provided in an embodiment of the present application;

[0034] Figure 5A A schematic diagram of creating a target block device and system cloud disk based on DPU;

[0035] Figure 5B A schematic diagram of creating a target block device, system cloud disk, and virtual network card based on DPU;

[0036] Figure 6 An interactive diagram of another method for configuring a network address provided in an embodiment of the present application;

[0037] Figure 7 A schematic diagram of an interface display of a cloud management platform provided in an embodiment of the present application;

[0038] Figure 8 A schematic diagram of a network address configuration device structure is provided for an embodiment of the present application;

[0039] Fig. 9 A schematic diagram of the structure of a computing device is provided for an embodiment of the present application. DETAILED DESCRIPTION

[0040] The computing device provided in the embodiment of the present application does not specifically limit the application scenario. For example, the computing device is introduced by taking a server as an example, and the type of the server is not specifically limited. For example, the computing device can be a rack server or an edge server. The server can be located in a data center or in other areas, and the embodiment of the present application does not make specific limitations.

[0041] Servers are a type of computing device that runs faster and has a higher load than ordinary computers. Servers provide computing or application services to other clients (such as PCs, smartphones, and other devices) in the network. Servers have high-speed CPU computing power, long-term reliable operation, strong external data throughput, and better scalability. Servers are divided into rack-mounted, blade-mounted, tower-mounted, and cabinet-mounted types.

[0042] Bare metal server (BMS) is a type of physical server, also known as a bare metal node or a physical machine with a "bare" operating system. It generally refers to a server without an operating system or virtualization software installed. A physical machine with a "bare" operating system can also refer to a physical machine with an operating system installed but no virtualization software installed. BMS is flexible and elastic, has high-performance computing capabilities comparable to traditional physical machines, and features secure physical isolation, so its application is becoming more and more widespread.

[0043] In order to achieve normal Internet access, the BMS needs to configure the network address after the BMS instance is decentralized. In related solutions, users use the out-of-band management software corresponding to the BMS, such as the server intelligent management software (intelligent baseboard management controller, IBMC) to observe in real time whether the BMS is successfully started. If it is successfully started, the user manually configures the network address for the BMS, specifically the IP address. Figure 1 , this figure is a schematic diagram of a method for manually configuring an IP address.

[0044] Figure 1 (a) in the figure shows the IBMC login interface. After the user enters the login password on the IBMC login interface, he logs in to the IBMC interface. Figure 1(b) in the figure shows the IBMC interface, which indicates whether the BMS instance is started successfully. Figure 1 (b) in the figure shows the startup status of the BMS instance using a startup progress bar, wherein the BMS instance is started 50%.

[0045] Figure 1 (c) in the figure shows the IBMC interface corresponding to the successful startup of the BMS instance. The IBMC interface corresponding to the successful startup of the BMS instance shows a startup success mark, and the user can confirm that the BMS instance has been successfully started through the startup success mark. In addition, Figure 1 The IBMC interface corresponding to (c) in FIG. 1 also shows a trigger item corresponding to entering the manual configuration IP address interface. For example, the trigger item may be a "Next" button. When the user clicks the "Next" button, the manual configuration IP address interface is entered. In addition, the IBMC interface is also provided with a "Cancel" button. When the user clicks the "Cancel" button, the IP address is no longer configured.

[0046] Figure 1 (d) in the figure shows a schematic diagram of the manual configuration IP address interface. The user can enter the IP address in the manual configuration position and use the entered IP address to configure the IP address of the BMS. Figure 1 (d) in FIG. 4 also shows a configuration completion trigger item, for example, the trigger item is a "confirm" button, and the user clicks the "confirm" button to complete the configuration. A "cancel" button is also shown, and the user clicks the "cancel" button to reconfigure the IP address.

[0047] However, manual configuration of network addresses has low configuration efficiency and is prone to configuration errors, causing network failures of the BMS and affecting user experience.

[0048] In view of the above problems, the embodiment of the present application uses a target block device mounted on the BMS, wherein the target block device includes a target network address, so that the BMS can automatically obtain the target IP address from the target block device. In this way, when the BMS needs to configure the network address, the target IP address in the target block device can be used to automatically configure the network address of the BMS. It can be seen that the embodiment of the present application can automatically obtain the target IP address and perform automatic configuration, which has high configuration efficiency compared to manual configuration of the network address. In addition, the embodiment of the present application can reduce manual configuration errors by pre-storing the network address, thereby helping to improve the configuration accuracy, reduce the probability of network failures of the BMS, and improve the user experience.

[0049] Embodiment 1

[0050] The following provides a detailed and complete description of the embodiments of the present application in conjunction with the accompanying drawings.

[0051] See also Figure 2, which is a flow chart of a method for configuring a network address provided in an embodiment of the present application. The method is performed by a BMS, specifically a first processor of the BMS. Exemplarily, the first processor may be a central processing unit (CPU) of the BMS. The method includes:

[0052] S21: BMS obtains the target block device from the pre-mounted block devices.

[0053] The target block device refers to a device that pre-stores the target Internet Protocol IP address. In the embodiment of the present application, the target block device is mounted on the BMS, so that the BMS can directly obtain the target block device from the mounted block device.

[0054] Since there may be multiple block devices mounted on the BMS, in order to quickly and accurately obtain the target block device from the mounted block devices, a preset label is added to the target block device mounted on the BMS, and the preset label is used to uniquely identify the target block device.

[0055] For example, among the N block devices mounted on the BMS, a preset label cidata is added to the target block device, and no label is added to other block devices. The BMS can quickly obtain the target block device from the N block devices based on the preset label cidata.

[0056] For another example, N block devices are mounted on the BMS, and a label is added to each block device. The label added to the block device storing the target IP address is cidata, and the labels added to other block devices are different from cidata. In this way, the BMS can quickly obtain the target block device from the N block devices based on cidata.

[0057] The above-mentioned preset tag cidata is only for illustrative purposes. The present application embodiment does not specifically limit the form of the preset tag. For example, the preset tag can be a key content topic of a block device, such as a block device storing network configuration parameters, which can add a network-config tag. The tag can also be the content format of the block device, or a preset identifier can be used as a tag.

[0058] It should be noted that the correspondence between the label and the block device needs to be saved in advance on the BMS. In this way, when the BMS obtains the label information, it can quickly obtain the target block device from multiple mounted block devices based on the correspondence between the label and the block device.

[0059] The target IP address refers to the IP address that the BMS needs to configure. In the embodiment of the present application, in order for the BMS to access the Internet normally, the target IP address configured by the BMS cannot conflict with the IP addresses of other servers. Other servers are located in the same local area network as the BMS, or other servers share the same network with the BMS.

[0060] The embodiment of the present application does not specifically limit the form in which the target IP address exists in the target block device. For example, the target IP address can be written into a network configuration file, and the target block device is formed based on the network configuration file. Or the target IP address is written into a network configuration file, the network configuration file is first packaged into a mirror file, and then the target block device is formed based on the mirror file.

[0061] In addition, the embodiment of the present application does not specifically limit the time for acquiring the target block device. For example, the BMS can be automatically triggered to acquire the target block device after the BMS instance is successfully launched. The BMS can also be automatically triggered to acquire the target block device during the restart of the BMS host operating system (Host OS).

[0062] S22: Configure the network address of the BMS based on the target network protocol address IP in the target block device.

[0063] After the BMS obtains the target block device, it automatically obtains the target IP address from the target block device.

[0064] The embodiment of the present application does not specifically limit the method of obtaining the target IP address. Compared with manually inputting the target IP address, the embodiment of the present application is less prone to manual input errors and is faster to obtain. In addition, by pre-ensuring that the target IP address does not conflict with the IP addresses of other servers during storage, the configuration accuracy is further improved.

[0065] In one example, the BMS may traverse all information stored in the target block device and obtain the target IP address therefrom.

[0066] In another example, consider that there are multiple files in the target block device, such as user data files, network configuration files, etc., and each file has a corresponding network identifier, for example, the identifier of the user data file is user-data, and the identifier of the network configuration file is network-config. In addition, the target IP address is stored in the network configuration file. The BMS can obtain the network configuration file based on the network identifier network-config, and then obtain the target IP address from the network configuration file. Compared with traversing the information in all target block devices, the acquisition efficiency is higher.

[0067] In another example, the BMS may call a reading tool to read the target IP address from the target block device. For example, the reading tool may be Cloud-Init. Cloud-Init is a tool developed specifically for initializing virtual machines in a cloud environment, and is used to read relevant data from various data sources when creating a virtual machine startup and customize the virtual machine accordingly.

[0068] The BMS configures the IP address using the target IP address.

[0069] In some examples, the IP address configured by the BMS is the same as the target IP address. For example, if the target IP address is 70:182:40:116, the IP address configured by the BMS may be 70:182:40:116.

[0070] In other examples, the BMS stores a correspondence between a target IP address and an IP address configured by the BMS, and the BMS automatically configures the IP address using the target IP address and the correspondence between the IP addresses.

[0071] The embodiment of the present application uses a target block device mounted on the BMS, wherein the target block device includes a target network address, so that the BMS can automatically obtain the target network address from the target block device. In this way, when the BMS needs to configure the network address, the target network address in the target block device can be used to automatically configure the network address of the BMS. It can be seen that the embodiment of the present application can automatically obtain the target network address and perform automatic configuration, which has high configuration efficiency compared to manual configuration of the network address. In addition, the embodiment of the present application can reduce manual configuration errors by pre-storing the network address, thereby helping to improve the configuration accuracy, reduce the probability of network failures of the BMS, and improve the user experience.

[0072] See also Figure 3 , which is a method for implementing target block device mounting provided by an embodiment of the present application. The execution subject of the method is the second processor of the BMS. Exemplarily, the second processor may be a data processor (dataprocession unit, DPU) of the BMS. The method specifically includes:

[0073] S31: Create network configuration related files in the DPU file system.

[0074] The network configuration related file refers to at least one file required to configure the IP address of the BMS.

[0075] Among them, the network configuration related files include network configuration files, which are used to enable the BMS to configure network address information, such as IP address, gateway address, mask, etc. The BMS obtains the network address configuration information through the network configuration file, and uses the network address configuration information to automatically configure the network address.

[0076] This application does not specifically limit the format of the network configuration file. For example, the format of the network configuration file is:

[0077] root@localhost: / home? ubuntu / cloud-init#cat network-config

[0078] version: 1

[0079] config:

[0080] type:physical

[0081] name:ens9

[0082] mac_address:'86:a1:80:de:1e:f7'

[0083] subnets:

[0084] type:static

[0085] address:70:182:40:116

[0086] netmask:255.255.255.0

[0087] gateway:70.182.40.1

[0088] Among them, the network configuration file is identified as network-config, and the version number is 1. In the configuration information, the type is a physical network card, and the name of the network card to be configured is ens9. The media access control (MAC) address of the network card to be configured is 86:a1:80:de:1e:f7. In the subnet information, the subnet type is static, the target IP address, that is, the subnet IP address is 70:182:40:116, the subnet mask is 255.255.255.0, and the subnet gateway is 70.182.40.1.

[0089] After the BMS obtains the network configuration file, it can create a network card to be configured according to the corresponding information and configure the subnet network address to enable normal Internet communication of the BMS.

[0090] The embodiment of the present application can create network configuration related files in the file system of the DPU and write the target IP address into the network configuration file.

[0091] The embodiment of the present application does not specifically limit the writing method. For example, the BMS can overwrite the original IP address with the target IP address based on the writing location corresponding to the target IP address, that is, the address in the above file format. Assume that the target IP address is 70.182.40.11. At this time, the address in the network configuration file is 70:182:40:11.

[0092] In addition, network configuration parameter information such as subnet gateway and mask can also be written into the network configuration file.

[0093] In an example, the network configuration related files also include but are not limited to the first file and the second file.

[0094] The first file is also called the user-data file, which is used to store the login password required to log in to IBMC. BMS can obtain the login password through the first file and automatically connect to IBMC.

[0095] The embodiment of the present application does not specifically limit the format of the first file. For example, the format of the first file may be:

[0096] root@localhost: / home? ubuntu / cloud-init#cat user-data

[0097] #cloud-connect

[0098] password:pass

[0099] expire:False

[0100] password is the default login password. In the example, the default login password is pass. expire indicates whether the user needs to reset the password the next time he logs in. If the content corresponding to expire is the first preset flag, such as the preset flag is False, it means that the password does not need to be reset and the default login is the next time. If it is the second preset flag, such as empty or True, it means that the password needs to be reset. user-data is the first file identifier. Through user-data, BMS can confirm that the acquired file is the first file. user-data is only an illustrative description, and technicians in this field can adjust it as needed.

[0101] The second file user stores the first identity of the instance to be configured, wherein the instance to be configured is the instance required by the BMS.

[0102] The cache area caches the instance information being sent and the second identity corresponding to the instance information. To ensure that the instance sent is the instance to be configured, the BMS checks whether the second identity of the cache area is the same as the first identity. If they are the same, the instance cached in the cache area is the instance to be configured. If they are not the same, it means that the instance cached in the cache area is not the instance to be configured, and the cache area needs to reload the configured instance information.

[0103] The embodiment of the present application does not specifically limit the format of the second file. For example, the format of the second file is:

[0104] root@localhost: / home? ubuntu / cloud-init#cat meta-data

[0105] instance-id: id-10.

[0106] Wherein, meta-data is the second file identifier, instance-id is the first identity identifier, and the first identity identifier is specifically id-10. meta-data is the second file identifier. Through meta-data, the BMS can confirm that the acquired file is the second file. meta-data is only a schematic illustration, and those skilled in the art can adjust it as needed.

[0107] S32: Generate an image file corresponding to the network configuration related files.

[0108] A mirror file is similar to a compressed file, which is used to compress network configuration-related files into a file with a smaller storage space to save storage space.

[0109] The embodiment of the present application does not specifically limit the type of the image file, for example, the image file may be an ISO image file, wherein the network configuration-related files in the ISO image file cannot be modified at will, and the security is higher during the transmission and storage process.

[0110] In order to facilitate the subsequent identification of the image file, the image file carries a preset tag, such as the preset tag cidata tag. That is, the network configuration related file is converted into an image file, and the image file is added with a preset tag. Through the preset tag, the image file corresponding to the network configuration related file can be quickly obtained.

[0111] The embodiment of the present application does not specifically limit the method of generating the image file.

[0112] In one example, in the local disk, click on the network configuration-related file to be added. After adding the network configuration-related file to the disc, click on the disc name under the disc directory to rename the newly added network configuration-related file to a preset label. Convert the network configuration-related file to an image file by saving the image file type as. For example, rename the network configuration-related file to cidata, and save it as ISO to successfully output the network configuration-related file to an ISO image file with the cidata label.

[0113] In another example, the DPU may use a production tool to produce network configuration related files into an image file with a preset tag, such as using a genisoimage tool to package the network configuration related files into an ISO image file with a cidata tag.

[0114] S33: The DPU generates a target block device based on the image file.

[0115] A block device is a storage device that supports reading and writing data in fixed-size blocks. A target block device is a block device to which the image file is written as blocks.

[0116] The embodiment of the present application generates a target block device based on an image file. Optionally, the target block device has the same label as the image file. For example, the image file is an ISO image file with a cidata label, and the generated target block device has a cidata label, for example, the target block device is a bdev device with a cidata label.

[0117] The purpose of creating a target block device in the embodiment of the present application is to use the target block device to create a virtual hard disk and mount network configuration information such as the target IP address on the BMS.

[0118] S34: Create a virtual hard disk based on the target block device.

[0119] In an embodiment of the present application, a virtual hard disk is created based on the target block device. After the BMS is restarted, the basic input output system (BIOS) mounts the virtual hard disk on the BMS. The BMS can obtain the target block device based on the mounted virtual hard disk, and obtain other network configuration information such as the target IP address from the target block device.

[0120] The embodiment of the present application does not specifically limit the BMS restart method. For example, the cloud management platform issues a restart instruction to restart the BMS operating system.

[0121] The embodiment of the present application does not specifically limit the type of virtual hard disk, for example, the virtual hard disk is implemented through virtio-blk. Virtio-blk is an implementation method of virtual hard disk under the virtualized KVM platform, which is essentially a semi-simulation technology. The virtio-blk device uses io_event_fd for front-end to back-end notification, uses interrupt injection to implement back-end to front-end notification, and shares data through the IO ring (vring).

[0122] The embodiment of the present application does not specifically limit the method of creating a virtual hard disk. For example, a storage performance development kit (SPDK) may be used to create a virtual hard disk.

[0123] The embodiment of the present application creates a network configuration-related file in the DPU file system, generates an ISO image file of the network configuration-related file, generates a target block device based on the ISO image file, and creates a virtual hard disk based on the target block device, thereby mounting the target block device including the target IP address on the BMS. The BMS can obtain the target IP address based on the mounted target block device and configure the IP address.

[0124] Embodiment 2

[0125] Furthermore, the current BMS instance issuance process is as follows: the cloud management platform schedules the bare metal, and then controls the bare metal to execute the preboot execute environment (PXE) to start. Next, the bare metal loads the downloaded Mini OS into the bare metal's memory by accessing the trivial file transfer protocol (TFTP) service, and downloads the OS image to be installed to the local hard disk by accessing the image service; finally, the cloud management platform or IBMC controls the bare metal to start from the local hard disk. Since the entire bare metal server issuance process requires starting the bare metal twice and downloading the image, the bare metal server issuance process takes a long time, resulting in low efficiency in BMS instance issuance.

[0126] In view of the above problems, the embodiment of the present application also provides another method for configuring the network address. This method customizes the virtual network card and cloud disk configuration based on the cloud management platform, uses the DPU to pre-create the network configuration block device and mount it on the BMS host, so as to realize automatic IP configuration, improve the efficiency of BMS instance distribution, and enhance the user experience.

[0127] See also Figure 4 , which is a schematic diagram of the BMS structure corresponding to a method for configuring a network address provided in an embodiment of the present application. The BMS includes a first processor and a second processor. Specifically, the first processor is a CPU, and the second processor is a DPU. The CPU communicates data with the DPU.

[0128] It should be noted that the DPU is a special processor with a data-centric structure. In the embodiment of the present application, the DPU creates a block device in advance and mounts the created block device on the BMS, so that the BMS can access the block device.

[0129] The CPU can obtain the block device and configure the corresponding IP address of the BMS according to the IP address included in the block device, so that the BMS can communicate with the Internet normally.

[0130] The embodiment of the present application does not specifically limit the data communication method between the CPU and the DPU. For example, the CPU communicates with the DPU via the peripheral component interconnect express (PCIE) PCIE, etc.

[0131] The embodiment of the present application does not specifically limit the type of DPU. For example, the DPU may be a PCIE smart network card.

[0132] like Figure 5A As described above, the figure is a schematic diagram of creating a target block device and a system cloud disk based on DPU.

[0133] S1: Create a system cloud disk.

[0134] The DPU obtains the cloud disk configuration parameters and uses them to create a system cloud disk.

[0135] Cloud disk configuration parameters refer to the parameters for configuring the system cloud disk, including but not limited to the maximum capacity, maximum throughput, and maximum input / output per second (IOPS) of the cloud disk.

[0136] The DPU can obtain cloud disk configuration parameters in a variety of ways.

[0137] For example, the DPU is connected to a cloud management platform, and the user can directly input cloud disk configuration parameters through the cloud management platform. Or the cloud management platform stores cloud disk configuration parameters and preset trigger rules, and the DPU can directly read cloud disk configuration parameters from the cloud management platform based on the preset trigger rules.

[0138] The system cloud disk is a network storage tool dedicated to storage, and the system cloud disk can specifically be a virtual hard disk. The system cloud disk created in the embodiment of the present application can be the same as the cloud disk configuration parameters, or can have a corresponding relationship with the cloud disk configuration parameters.

[0139] For example, the maximum capacity of the cloud disk configuration parameter is 32TB, and the maximum capacity of the system cloud disk is configured as 32TB.

[0140] For another example, the mapping relationship between DPU storage and cloud disk configuration parameters and system cloud disk parameters, assuming that half of the mapping relationship is the system cloud disk parameters. If the maximum capacity of the cloud disk configuration parameters is 32TB, based on the above mapping relationship, the maximum capacity of the system cloud disk is configured to be 16TB.

[0141] The operating system program to be installed is stored in the system cloud disk. The operating system program to be installed includes a BMS image startup program for implementing the BMS image startup.

[0142] S2: Create a virtual hard disk.

[0143] Specific creation method Figure 3 As shown, it is not discussed here.

[0144] The embodiment of the present application does not specifically limit the execution order of S1 and S2. S1 may be executed first and then S2, or S2 may be executed first and then S1, or they may be performed simultaneously.

[0145] Optionally, the DPU can also create a virtual network card, and the CPU of the BMS configures the target IP address to the virtual network card.

[0146] See Figure 5B, which is a schematic diagram of creating a target block device, a system cloud disk, and a virtual network card based on the DPU.

[0147] Relative to Figure 5A , added the process of creating a virtual network card.

[0148] S3: Create a virtual network card. The DPU obtains the network card configuration parameters and uses them to create a virtual network card. When the BMS goes online, it can communicate online based on the pre-created virtual network card.

[0149] The network card configuration parameters are used to configure the network card. The network card configuration parameters include but are not limited to the network card type, the MAC address corresponding to the network card, the subnet type, the subnet mask, the IP address, and the gateway. For example, the network card configuration parameters are as follows:

[0150] type:physical

[0151] name:ens9

[0152] mac_address:'86:a1:80:de:1e:f7'

[0153] subnets:

[0154] type:static

[0155] address:70:182:40:116

[0156] netmask:255.255.255.0

[0157] gateway:70.182.40.1

[0158] The configuration of the virtual network card created at this time is: type is static, target IP address is 70:182:40:116, subnet mask is 255.255.255.0, and gateway is 70.182.40.1.

[0159] The embodiment of the present application does not specifically limit the implementation of the virtual network card, for example, it can be virtio-Net. Virtio-Net is an implementation of the virtual network card under the virtualized KVM platform, and is also a network card device in the virtio standard and is widely used.

[0160] The DPU can obtain network card configuration parameters in multiple ways.

[0161] For example, the DPU is connected to a cloud management platform, and the user can directly input the network card configuration parameters through the cloud management platform. Or the cloud management platform stores the network card configuration parameters and preset trigger rules, and the DPU can directly read the network card configuration parameters from the cloud management platform based on the preset trigger rules.

[0162] See also Figure 6 , which is an interactive diagram of a network address configuration method provided in an embodiment of the present application. The method uses a cloud management platform to create a customized bare metal instance, sends virtual network card and cloud disk configuration parameters to DPU_agent, and implements bare metal instance distribution creation and IP configuration through DPU and CPU. The method specifically includes:

[0163] S61: Configure bare metal instance configuration parameters on the cloud management platform.

[0164] Bare metal instance configuration parameters are the parameters required to configure a bare metal instance.

[0165] In the embodiment of the present application, the bare metal instance configuration parameters may include hard disk size, hard disk type and other parameters. In addition, the bare metal instance configuration parameters also include network card configuration parameters and cloud disk configuration parameters. The DPU may create a virtual network card according to the network card configuration parameters, and create a system cloud disk according to the cloud disk configuration parameters.

[0166] The embodiments of the present application do not specifically limit the implementation method in which the user sends the bare metal instance configuration parameters through the cloud management platform.

[0167] See also Figure 7 , which is a schematic diagram of the interface display of a cloud management platform provided in an embodiment of the present application.

[0168] Figure 7 (a) in FIG. 1 shows a bare metal instance configuration parameter interface, where the user can manually input bare metal instance configuration parameters at a specified position 701 of the bare metal instance configuration parameter interface. In addition, the user can also trigger the cloud management platform to obtain bare metal instance configuration parameters from a pre-stored bare metal instance configuration parameter area in other ways.

[0169] S62: The cloud management platform service sends the network card configuration parameters to the DPU.

[0170] In the embodiment of the present application, after the cloud management platform obtains the network card configuration parameters, it sends the network card configuration parameters to the DPU. Specifically, it sends them to the DPU Agent. The DPU Agent is an intermediate service deployed on the DPU OS, which is used to receive requests from the cloud management platform, create virtual network cards and virtual hard disk devices, and provide them to the BMS for use.

[0171] S63: The DPU creates a virtual network card according to the network card configuration parameters.

[0172] S64: The DPU returns the virtual network card creation result to the cloud management platform.

[0173] The DPU returns the network card creation result to the cloud management platform. The cloud management platform determines whether the virtual network card is successfully created based on the network card creation result.

[0174] In one example, the network card creation result includes a creation success identifier. The cloud management platform can determine that the virtual network card is successfully created based on the creation success identifier.

[0175] In another example, the network card creation result includes network card configuration parameters, such as IP address, subnet gateway, and subnet mask. The cloud management platform compares the network card configuration parameters returned by the DPU with the network card configuration parameters sent to the DPU. If the two are consistent, the cloud management platform displays a virtual network card creation success mark. Otherwise, the cloud management platform displays a virtual network card creation failure mark.

[0176] S65: DPU configures user-data, meta-data, and network-config files.

[0177] In the embodiment of the present application, the DPU does not initially contain user-data, meta-data, and network-config files. The DPU first creates user-data, meta-data, and network-config files. Specifically, they can be created on the DPU file system.

[0178] For example, the created user-data file is:

[0179] root@localhost: / home? ubuntu / cloud-init#cat user-data

[0180] #cloud-connect

[0181] password:pass

[0182] expire:False

[0183] The created meta-data file is:

[0184] root@localhost: / home? ubuntu / cloud-init#cat meta-data

[0185] instance-id: id-10.

[0186] The network-config file created is:

[0187] root@localhost: / home? ubuntu / cloud-init#cat network-config

[0188] version: 1

[0189] config:

[0190] type:physical

[0191] name:ens9

[0192] mac_address:'86:a1:80:de:1e:f7'

[0193] subnets:

[0194] type:static

[0195] address:

[0196] netmask:

[0197] gateway:

[0198] The DPU configures the network file based on the network card configuration parameters. For example, the subnet IP address is 70:182:40:116, the subnet mask is 255.255.255.0, and the subnet gateway is 70.182.40.1.

[0199] The configured network-config file is:

[0200] root@localhost: / home? ubuntu / cloud-init#cat network-config

[0201] version: 1

[0202] config:

[0203] type:physical

[0204] name:ens9

[0205] mac_address:'86:a1:80:de:1e:f7'

[0206] subnets:

[0207] type:static

[0208] address:70:182:40:116

[0209] netmask:255.255.255.0

[0210] gateway:70.182.40.1

[0211] S66: The DPU creates an ISO image file, creates a target block device based on the ISO image file, and creates a target virtual hard disk based on the target block device.

[0212] The DPU uses the genisoimage tool to package the user-data, meta-data, and network-config files into an ISO image file identified as cidata. It also creates a target block device based on the ISO image file identified as cidata, namely, a bdev device identified as cidata.

[0213] Finally, a virtual hard disk is created based on the bdev device identified as cidata. In this way, when the BMS is restarted, the target block device can be mounted to the BMS instance to display the target block device on the BMS.

[0214] S67: The cloud management platform sends cloud disk configuration parameters to the DPU.

[0215] The cloud management platform obtains the cloud disk configuration parameters from the bare metal instance configuration parameters and sends them to the DPU.

[0216] S68: DPU creates a system cloud disk.

[0217] After receiving the cloud disk configuration parameters, the DPU creates a system cloud disk based on the cloud disk configuration parameters and a third correspondence between the cloud disk configuration parameters and the system cloud disk pre-stored by the DPU.

[0218] S69: The DPU returns the cloud disk configuration result to the cloud management platform.

[0219] After the creation is complete, the DPU returns the cloud disk configuration result to the cloud management platform. The cloud management platform determines whether the system cloud disk is configured successfully based on the cloud disk configuration result.

[0220] In one example, the cloud disk configuration result includes a creation success identifier. The cloud management platform can determine that the creation is successful based on the creation success identifier.

[0221] In another example, the cloud disk configuration result includes cloud disk configuration parameters. The cloud management platform compares the cloud disk configuration parameters returned by the DPU with the cloud disk configuration parameters sent to the DPU. If the two are consistent, the cloud management platform displays a configuration success mark. Otherwise, the cloud management platform displays a configuration failure mark.

[0222] S610: The cloud management platform triggers the restart of the BMS operating system.

[0223] After the cloud management platform completes the creation of the virtual network card and system cloud disk, it calls the IBMC interface to send a command to restart the BMSHost OS.

[0224] S611: The CPU determines a target block device.

[0225] The BMS restarts, triggering the BMC to search for the target block device. In the embodiment of the present application, the BMC uses Cloud Init to search for block devices with the cidata tag by traversal.

[0226] S612: The CPU reads the network configuration file and completes the IP address configuration.

[0227] After the CPU obtains the block device with the cidata tag, it reads the internal network configuration file and uses Cloud Init to search for the network configuration file by traversal.

[0228] The CPU can complete the IP address configuration based on the read network address configuration file.

[0229] In one example, the BMC directly configures the IP address using the target IP address of the network address configuration file.

[0230] For example, if the target IP address in the network address configuration file is 70:182:40:116, the configured IP address is 70:182:40:116.

[0231] The embodiments of the present application do not specifically limit the implementation method of IP address configuration.

[0232] S613: The cloud management platform periodically uses the connection instruction to connect to the BMS instance.

[0233] In the embodiment of the present application, the cloud management platform can connect to the BMS instance through a connection instruction at preset time intervals.

[0234] Among them, the preset time interval can be 1ms, 2ms, etc., which is not specifically limited in this application.

[0235] The connection instruction may specifically be a ping instruction. For example, you may use ping+configured IP address to connect to the BMS instance.

[0236] S614: In response to the successful connection, the cloud management platform feeds back a successful creation indicator to the user.

[0237] If the connection instruction is successful, the cloud management platform will feedback to the user the successful creation of the BMS instance.

[0238] like Figure 7 As shown, Figure 7 (b) in the figure shows the sign that the BMS instance was successfully created.

[0239] In this way, the embodiment of the present application implements BMS instance creation and IP configuration through the interaction between the DPU and the CPU.

[0240] The embodiment of the present application provides a method for automatic IP configuration, which solves the problem that the traditional bare metal virtual network card needs to manually configure the IP. In addition, the embodiment of the present application allows users to perceive in real time whether the bare metal instance is deployed successfully through the bare metal management platform, allowing users to quickly perceive the status of the bare metal instance in real time, greatly improving the user experience. In addition, the embodiment of the present application uses the cloud management platform to create a customized bare metal instance, sends the virtual network card and cloud disk configuration parameters to the DPU_agent, and realizes the rapid distribution of bare metal instances and the rapid configuration of IP through the DPU.

[0241] In addition, an embodiment of the present application also provides a device for configuring a network address.

[0242] See also Figure 8 , which is a schematic diagram of the structure of a network address configuration device provided by an embodiment of the present application. The configuration device specifically includes:

[0243] The acquisition unit 801 is used to acquire the target block device mounted on the BMS; wherein the target block device includes a target Internet Protocol IP address; the configuration unit 802 is used to configure the network address in the BMS based on the target IP address.

[0244] In a possible implementation, the target block device includes a preset tag. The acquisition unit 801 is specifically configured to: acquire the target block device from at least one block device mounted on the BMS based on the preset tag.

[0245] In another possible implementation, the configuration device also includes: a mounting unit 803, and the mounting unit 803 is specifically used to: obtain a virtual hard disk mounted on the BMS; wherein each virtual hard disk is established based on a block device; obtain a target virtual hard disk from the virtual hard disk; wherein the target virtual hard disk is established based on the target block device.

[0246] Optionally, the mounting unit 803 is further used for:

[0247] Obtain a network configuration file; wherein the network configuration file includes the target IP address; generate an image file corresponding to the network configuration file; wherein the image file includes a preset tag; create the target block device based on the image file, the target block device includes the preset tag; and create the target virtual hard disk based on the target block device.

[0248] In another possible implementation, the configuration device further includes an image file generating unit 804, and the image file generating unit 804 is specifically used to:

[0249] Obtain a first file and a second file; wherein the first file is used to store a login password of the management system of the BMS, and the second file is used to store identification information of the BMS instance; generate the image file based on the network configuration file, the first file and the second file; wherein the image file is an ISO image file including the preset tag.

[0250] Optionally, the configuration device further includes a creation unit 805. The creation unit 805 is further used to: create and configure a system cloud disk based on the cloud disk configuration parameters in the bare metal instance configuration parameters issued by the cloud management platform; wherein the system cloud disk is used to store the operating system OS to be installed of the BMS; and install the operating system OS based on the system cloud disk.

[0251] Optionally, the creation unit 805 is further used to create and configure a virtual network card based on the network card configuration parameters in the bare metal instance configuration parameters sent by the cloud management platform.

[0252] Optionally, the network address in the BMS is the network address of the virtual network card;

[0253] The configuration unit 802 is used to configure the network address of the virtual network card based on the target IP address.

[0254] Optionally, the configuration device further includes a restart unit 806, which is specifically configured to restart the BMS in response to a restart instruction of the cloud management platform.

[0255] The configuration device provided in the embodiment of the present application, through the target block device mounted on the BMS, wherein the target block device includes a target IP address, can enable the BMS to automatically obtain the target IP address from the target block device. In this way, when the BMS needs to configure the network address, the target IP address in the target block device can be used to automatically configure the network address of the BMS. It can be seen that the embodiment of the present application can automatically obtain the target IP address and perform automatic configuration, and the configuration efficiency is high compared to manual configuration of the network address. In addition, the embodiment of the present application can reduce manual configuration errors by pre-storing the network address, thereby helping to improve the configuration accuracy, reduce the probability of network failures of the BMS, and improve the user experience.

[0256] like Fig. 9 As shown, an embodiment of the present application further provides a computing device 900, including a first processor 901, a second processor 902 and a memory 903, wherein the memory 903 is electrically connected to the first processor 901 and the second processor 902, respectively; the memory 903 is used to store program instructions, and the program instructions are used for the network address configuration method involved in the above-mentioned embodiments; the first processor 901 and the second processor 902 are used to call the corresponding parts of the above-mentioned program instructions so that the computing device can execute the network address configuration method involved in the above-mentioned embodiments.

[0257] An embodiment of the present application further provides a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed on a computing device, the computing device executes the network address configuration method involved in the above embodiments.

[0258] For the explanation of the relevant contents and description of the beneficial effects of any of the above-mentioned computer-readable storage media, reference may be made to the above-mentioned corresponding embodiments, which will not be repeated here.

[0259] An embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the network address configuration method involved in the above embodiments.

[0260] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using a software program, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions in the embodiments of the present application are generated.

[0261] The computer may be a bare metal server. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a magnetic disk, a magnetic tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid state drive (SSD)), etc.

[0262] The above is only a preferred embodiment of the present application and does not constitute any formal limitation to the present application. Although the present application has been disclosed as above with a preferred embodiment, it is not intended to limit the present application. Any technician familiar with the art can make many possible changes and modifications to the technical solution of the present application using the methods and technical contents disclosed above without departing from the scope of the technical solution of the present application, or modify it into an equivalent embodiment of equivalent changes. Therefore, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application still fall within the scope of protection of the technical solution of the present application.

Claims

1. A method for configuring a network address, characterized in that: The method is applied to a bare metal server BMS, and the method includes: Obtain a network configuration file, the network configuration file including a target Internet Protocol IP address; generate an ISO image file corresponding to the network configuration file; the ISO image file includes a preset tag; create a target block device based on the ISO image file, the target block device includes the preset tag; create a target virtual hard disk based on the target block device; Based on the network card configuration parameters in the bare metal instance configuration parameters issued by the cloud management platform, create and configure a virtual network card, and based on the cloud disk configuration parameters in the bare metal instance configuration parameters issued by the cloud management platform, create and configure a system cloud disk; wherein the system cloud disk is used to store the operating system OS to be installed of the BMS; In response to a BMC restart instruction triggered after the virtual network card, the system cloud disk, and the target block device are created, the BMS is restarted, and based on the preset tag, the target virtual hard disk is obtained from at least one virtual hard disk mounted on the BMS; based on the target IP address in the target block device corresponding to the target virtual hard disk, the network address in the BMS is configured.

2. The method according to claim 1, characterized in that: The method further comprises: Obtain a first file and a second file; wherein the first file is used to store a login password of the management system of the BMS, and the second file is used to store identification information of the BMS instance; The generating of the image file corresponding to the network configuration file comprises: The image file is generated based on the network configuration file, the first file and the second file; wherein the image file is an ISO image file including the preset tag.

3. The method according to claim 1, characterized in that: The network address in the BMS is the network address of the virtual network card; The configuring the network address in the BMS based on the target IP address includes: The network address of the virtual network card is configured based on the target IP address.

4. A computing device, characterized in that The computing device includes a first processor and a second processor, wherein the second processor is configured to: Obtaining a network configuration file, the network configuration file including a target Internet Protocol (IP) address; generating an image file corresponding to the network configuration file; the image file including a preset tag; Creating a target block device based on the image file, wherein the target block device includes the preset label; creating a target virtual hard disk based on the target block device; Based on the network card configuration parameters in the bare metal instance configuration parameters issued by the cloud management platform, create and configure a virtual network card, and based on the cloud disk configuration parameters in the bare metal instance configuration parameters issued by the cloud management platform, create and configure a system cloud disk; wherein the system cloud disk is used to store the operating system OS to be installed on the bare metal server BMS; The first processor is used to: in response to a BMC restart instruction triggered after the virtual network card, the system cloud disk, and the target block device are created, restart the BMS, and obtain the target virtual hard disk from at least one virtual hard disk mounted on the BMS based on the preset tag; Based on the target IP address in the target block device corresponding to the target virtual hard disk, a network address in the BMS is configured.

5. The computing device according to claim 4, characterized in that: The second processor is further configured to: Obtain a first file and a second file; wherein the first file is used to store a login password of the management system of the BMS, and the second file is used to store identification information of the BMS instance; The generating of the image file corresponding to the network configuration file comprises: The image file is generated based on the network configuration file, the first file and the second file; wherein the image file is an ISO image file including the preset tag.

6. The computing device according to claim 4, characterized in that: The network address in the BMS is the network address of the virtual network card; The first processor is used to configure the network address in the BMS based on the target IP address, including: the first processor is used to configure the network address of the virtual network card based on the target IP address.

7. The computing device according to claim 4, characterized in that: The first processor is a central processing unit (CPU); the second processor is a data processing unit (DPU).

Citation Information

Patent Citations

  • Bare metal server configuration method and device

    CN112291096A

  • Bare metal server deployment method and device, and medium

    CN116954638A