CN117938641A - A network address configuration method and computing device - Google Patents
A network address configuration method and computing device Download PDFInfo
- Publication number
- CN117938641A CN117938641A CN202311733289.3A CN202311733289A CN117938641A CN 117938641 A CN117938641 A CN 117938641A CN 202311733289 A CN202311733289 A CN 202311733289A CN 117938641 A CN117938641 A CN 117938641A
- Authority
- CN
- China
- Prior art keywords
- bms
- target
- address
- file
- network
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 67
- 239000002184 metal Substances 0.000 claims description 45
- 230000004044 response Effects 0.000 claims description 6
- 238000012545 processing Methods 0.000 claims description 4
- 230000009286 beneficial effect Effects 0.000 abstract description 4
- 238000007726 management method Methods 0.000 description 60
- 238000003860 storage Methods 0.000 description 17
- 238000010586 diagram Methods 0.000 description 16
- 241000282326 Felis catus Species 0.000 description 7
- 238000004590 computer program Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 6
- 239000000243 solution Substances 0.000 description 6
- 230000003068 static effect Effects 0.000 description 6
- 239000003795 chemical substances by application Substances 0.000 description 4
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 3
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 3
- 238000009826 distribution Methods 0.000 description 3
- 238000013507 mapping Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000002452 interceptive effect Effects 0.000 description 2
- 238000002955 isolation Methods 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000002347 injection Methods 0.000 description 1
- 239000007924 injection Substances 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0876—Aspects of the degree of configuration automation
- H04L41/0886—Fully automatic configuration
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/083—Network architectures or network communication protocols for network security for authentication of entities using passwords
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Stored Programmes (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及服务器技术领域,尤其涉及一种网络地址的配置方法及计算设备。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 technique
裸金属服务器(bare metal server,BMS)是一种物理服务器,具有灵活弹性和与传统物理机相媲美的高性能计算能力以及安全物理隔离的特点,因此BMS应用日益广泛。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.
BMS运行阶段需要配置网络地址,具体为互联网协议(internet protocol,IP)地址,以使BMS通过网络地址正常上网。然而,相关方案中,用户需要手动配置网络地址,配置效率低,且手动配置容易出现配置错误,造成BMS的网络故障,影响用户体验。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
本申请实施例提供了一种网络地址的配置方法及计算设备,用于提高配置网络地址的效率,降低配置错误率,降低网络故障发生概率,提升用户体验。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.
第一方面,本申请实施例提供了网络地址的配置方法。该方法应用于裸金属服务器BMS,其特征在于,方法包括: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:
获取BMS上挂载的目标块设备;目标块设备携带目标互联网协议IP地址;基于目标IP地址配置BMS中的网络地址。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.
本申请实施例通过BMS上挂载的目标块设备,且目标块设备中包括目标IP地址,可以使BMS从目标块设备中自动获取目标网络地址。如此,当BMS需要配置网络地址时,可以利用目标块设备中的目标网络地址自动配置BMS的网络地址。本申请实施例可以自动获取目标网络地址并进行自动配置,相对于手动配置网络地址,配置效率高。此外,本申请实施例通过预先存储网络地址,可以减少手动配置误差,有助于提升配置正确率,降低BMS的网络故障发生概率,提升用户体验。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.
在一种可能的实现方式中,目标块设备包括预设标签,本申请实施例可以基于预设标签,从BMS上挂载的至少一个块设备中获取目标块设备。如此,通过目标块设备中携带有预设标签快速准确的从挂载的块设备中获取目标块设备。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.
在另一种可能的实现方式中,在获取BMS上挂载的目标块设备之前,获取BMS上挂载的虚拟硬盘,从虚拟硬盘中获取目标虚拟硬盘。其中,每个虚拟硬盘基于块设备建立,目标虚拟硬盘基于目标块设备建立。如此,通过目标虚拟硬盘将目标块设备挂载到BMS上。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.
在又一种可能的实现方式中,在获取BMS上挂载的目标虚拟硬盘之前,获取网络配置文件;其中,网络配置文件中包括目标IP地址;生成网络配置文件对应的镜像文件;其中,镜像文件包括预设标签;基于镜像文件创建目标块设备,目标块设备包括预设标签;基于目标块设备,创建目标虚拟硬盘。如此,实现将目标IP地址配置到网络配置文件,利用网络配置文件构建带有预设标签的镜像文件和目标块设备。In another possible implementation, before obtaining the target virtual hard disk mounted on the BMS, 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, the target block device includes a preset tag; and create a target virtual hard disk 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.
在又一种可能的实现方式中,获取第一文件和第二文件;其中,第一文件用于存储BMS的管理系统的登录密码,第二文件用于存储BMS实例的标识信息;基于网络配置文件、第一文件和第二文件,生成镜像文件;其中,镜像文件为包括预设标签的ISO镜像文件。如此,将网络配置文件和存储BMS管理系统的登录密码的文件和存储BMS实例的标识信息的文件同时打包配置,提高配置速度。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.
在又一种可能的实现方式中,基于云管平台下发的裸金属实例配置参数中的云盘配置参数,创建并配置系统云盘;其中,系统云盘用于存储BMS的待安装操作系统OS;基于系统云盘安装操作系统OS。可选地,基于云管平台下发的裸金属实例配置参数中的网卡配置参数,创建并配置虚拟网卡。如此,通过云管平台定制虚拟网卡或者云盘配置,将预先创建网络配置块设备并挂载到BMS的Host上,以实现IP自动配置的同时,提高BMS实例下发效率,提升用户体验。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 user experience.
可选地,BMS中的网络地址为虚拟网卡的网络地址;基于目标IP地址配置虚拟网卡的网络地址。从而实现基于目标IP地址配置BMS中的网络地址。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.
在又一种可能的实现方式中,在获取BMS上挂载的目标块设备之前,响应于云管平台的重启指令,重启BMS,如此重启之后可以获取BMS上挂载的目标块设备。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.
第二方面,本申请实施例提供了一种计算设备,计算设备包括第一处理器,第一处理器用于: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:
获取BMS上挂载的目标块设备;其中,目标块设备包括目标IP地址;基于目标IP地址配置BMS中的网络地址。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.
在一种可能的实现方式中,目标块设备包括预设标签;第一处理器用于基于预设标签,从BMS上挂载的至少一个块设备中获取目标块设备。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.
在另一种可能的实现方式中,在第一处理器用于获取BMS上挂载的目标块设备之前,第一处理器还用于:获取BMS上挂载的虚拟硬盘;其中,每个虚拟硬盘基于块设备建立;从虚拟硬盘中获取目标虚拟硬盘;其中,目标虚拟硬盘基于目标块设备建立。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.
在又一种可能的实现方式中,计算设备还包括第二处理器,在第一处理器用于获取裸金属服务器BMS上挂载的目标虚拟硬盘之前,第二处理器用于: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:
获取网络配置文件;其中,网络配置文件中包括目标IP地址;生成网络配置文件对应的镜像文件;其中,镜像文件包括预设标签;基于镜像文件创建目标块设备,目标块设备包括预设标签;基于目标块设备,创建目标虚拟硬盘。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.
在又一种可能的实现方式中,第二处理器还用于:获取第一文件和第二文件;其中,第一文件用于存储BMS的管理系统的登录密码,第二文件用于存储BMS实例的标识信息;基于网络配置文件、第一文件和第二文件,生成镜像文件;其中,镜像文件为包括预设标签的ISO镜像文件。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 tag.
可选地,第二处理器还用于:基于云管平台下发的裸金属实例配置参数中的云盘配置参数,创建并配置系统云盘;其中,系统云盘用于存储BMS的待安装操作系统OS;基于系统云盘安装操作系统OS。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.
可选地,第二处理器还用于:基于云管平台下发的裸金属实例配置参数中的网卡配置参数,创建并配置虚拟网卡。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.
在又一种可能的实现方式中,BMS中的网络地址为虚拟网卡的网络地址;第一处理器用于基于目标IP地址配置虚拟网卡的网络地址。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.
在又一种可能的实现方式中,在第一处理器用于在获取BMS上挂载的目标块设备之前,第二设备还用于:响应于云管平台的重启指令,重启BMS。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.
可选地,第一处理器为中央处理器CPU;第二处理器为数据处理器DPUOptionally, the first processor is a central processing unit CPU; the second processor is a data processing unit DPU
第三方面,本申请实施例还提供了一种计算机可读存储介质,其上储存有计算机程序,当该计算机程序在计算机上运行时,使得计算机执行上述第一方面任一种可能的网络地址的配置方法的操作步骤。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.
第五方面,本申请实施例还提供了一种计算机程序产品,当其在计算机上运行时,使得第一方面任一种可能的网络地址的配置方法的操作步骤。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.
上述提供的任一种网络地址的配置方法计算设备或计算机可读存储介质或计算机程序产品等均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考对应的方法中的有益效果,此处不再赘述。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
图1为一种手动配置IP地址的实现方式示意图;FIG1 is a schematic diagram of an implementation method of manually configuring an IP address;
图2为本申请实施例提供的一种网络地址的配置方法流程图;FIG2 is a flow chart of a method for configuring a network address provided in an embodiment of the present application;
图3为本申请实施例提供的一种目标块设备挂载的实现方式;FIG3 is a method for implementing target block device mounting provided in an embodiment of the present application;
图4为本申请实施例提供的一种网络地址的配置系统的结构示意图;FIG4 is a schematic diagram of the structure of a network address configuration system provided in an embodiment of the present application;
图5A为基于DPU创建目标块设备和系统云盘的示意图;FIG5A is a schematic diagram of creating a target block device and a system cloud disk based on a DPU;
图5B为基于DPU创建目标块设备、系统云盘和虚拟网卡的示意图;FIG5B is a schematic diagram of creating a target block device, a system cloud disk, and a virtual network card based on a DPU;
图6为本申请实施例提供的另一种网络地址的配置方法交互图;FIG6 is an interactive diagram of another method for configuring a network address provided in an embodiment of the present application;
图7为本申请实施例提供的一种云管平台的界面显示示意图;FIG7 is a schematic diagram of an interface display of a cloud management platform provided in an embodiment of the present application;
图8为本申请实施例提供一种网络地址的配置装置结构示意图;FIG8 is a schematic diagram of a network address configuration device according to an embodiment of the present application;
图9为本申请实施例提供一种计算设备结构示意图。FIG9 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application.
具体实施方式Detailed ways
本申请实施例提供的计算设备不具体限定应用的场景,例如,计算设备以服务器为例进行介绍,具体也不限定服务器的类型,例如计算设备可以为机架服务器或边缘服务器。服务器可以位于数据中心,也可以位于其他区域,本申请实施例不做具体限定。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.
服务器,属于计算设备的一种类型,服务器比普通计算机运行更快、负载更高。服务器在网络中为其它客户机(如PC机、智能手机等设备)提供计算或者应用服务。服务器具有高速的CPU运算能力、长时间的可靠运行、强大的外部数据吞吐能力以及更好的扩展性。服务器从外形分为机架式、刀片式、塔式和机柜式。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.
裸金属服务器(bare metal server,BMS),属于一种物理服务器,也可称为裸金属节点或“裸”操作系统的物理机,一般指没有安装操作系统或虚拟化软件的服务器。“裸”操作系统的物理机也可指安装有操作系统但是没有安装虚拟化软件的物理机。BMS具有灵活弹性的基础上,具备传统物理机相媲美的高性能计算能力,以及安全物理隔离的特点,因此应用日渐广泛。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.
BMS为实现正常上网功能,需要在BMS实例下放后进行网络地址配置。相关方案中,用户使用BMS对应的带外管理软件,例如服务器智能管理软件(intelligent baseboardmanagement controller,IBMC)实时观察BMS是否启动成功,若启动成功,用户手动为BMS配置网络地址,具体配置IP地址。IBMC参见图1,该图为一种手动配置IP地址的实现方式示意图。In order to achieve normal Internet access, 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 the startup is successful, the user manually configures the network address for the BMS, specifically the IP address. See Figure 1 for IBMC, which is a schematic diagram of a manual configuration of the IP address.
图1中的(a)展示了IBMC登录界面。用户在IBMC登录界面输入登录密码后,登录IBMC界面。图1中的(b)展示了IBMC界面,IBMC界面显示了BMS实例是否启动成功。图1中的(b)利用启动进度条展示了BMS实例的启动情况。其中,BMS实例启动50%。Figure 1 (a) shows the IBMC login interface. After the user enters the login password in the IBMC login interface, he logs in to the IBMC interface. Figure 1 (b) shows the IBMC interface, which shows whether the BMS instance is successfully started. Figure 1 (b) uses a startup progress bar to show the startup status of the BMS instance. Among them, the BMS instance is started 50%.
图1中的(c)展示了BMS实例启动成功对应的IBMC界面。BMS实例启动成功对应的IBMC界面展示有启动成功标识,用户可以通过启动成功标识确定BMS实例启动成功。此外,图1中的(c)对应的IBMC界面,还展示了进入手动配置IP地址界面对应的触发项,例如该触发项可以为“下一步”按钮,当用户点击“下一步”按钮,进入手动配置IP地址界面。此外,IBMC界面还设置有“取消”按钮,用户点击“取消”按钮,不再对IP地址进行配置。(c) in Figure 1 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 displays a startup success mark, and the user can confirm that the BMS instance has been successfully started through the startup success mark. In addition, the IBMC interface corresponding to (c) in Figure 1 also shows the trigger item corresponding to entering the manual configuration IP address interface. For example, the trigger item can 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. The user clicks the "Cancel" button to no longer configure the IP address.
图1中的(d)展示了手动配置IP地址界面的示意图。用户可以在手动配置位置输入IP地址,利用输入的IP地址对BMS的IP地址进行配置。图1中的(d)还展示了配置完成触发项,例如,该触发项为“确认”按钮,用户点击“确认”按钮,完成配置。并且展示了“取消”按钮,用户点击“取消”按钮,可以重新配置IP地址。(d) in FIG1 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 input IP address to configure the IP address of the BMS. (d) in FIG1 also shows the configuration completion trigger item, for example, the trigger item is a "Confirm" button, and the user clicks the "Confirm" button to complete the configuration. And the "Cancel" button is shown, and the user clicks the "Cancel" button to reconfigure the IP address.
然而,手动配置网络地址,配置效率低,且手动配置容易出现配置错误,造成BMS的网络故障,影响用户体验。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.
鉴于上述问题,本申请实施例通过BMS上挂载的目标块设备,其中,目标块设备中包括目标网络地址,可以使BMS从目标块设备中自动获取目标IP地址。如此,当BMS需要配置网络地址时,可以利用目标块设备中的目标IP地址自动配置BMS的网络地址。由此可知,本申请实施例可以自动获取目标IP地址并进行自动配置,相对于手动配置网络地址,配置效率高。此外,本申请实施例通过预先存储网络地址,可以减少手动配置误差,因此,有助于提升配置正确率,降低BMS的网络故障发生概率,提升用户体验。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.
实施例一Embodiment 1
下面结合附图说明,对本申请实施例提供详细完整说明。The following provides a detailed and complete description of the embodiments of the present application in conjunction with the accompanying drawings.
参见图2,该图为本申请实施例提供的一种网络地址的配置方法流程图。该方法的执行主体为BMS,具体可以为BMS的第一处理器。示例性的,该第一处理器可以为BMS的中央处理器(center procession unit,CPU)。该方法包括:See 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:
S21:BMS从预先挂载的块设备中获取目标块设备。S21: BMS obtains the target block device from the pre-mounted block devices.
目标块设备是指预先存储目标互联网络协议IP地址的设备。在本申请实施例中,目标块设备挂载在BMS上,如此,BMS可以直接从挂载的块设备中获取目标块设备。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.
由于BMS上挂载的块设备可能为多个,为快速准确从挂载的块设备中获取目标块设备,BMS上挂载的目标块设备添加有预设标签,利用预设标签唯一标识目标块设备。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.
例如,BMS上挂载的N个块设备中,为目标块设备添加预设标签cidata,其他块设备不添加标签,BMS可以基于预设标签cidata快速从N个块设备中获取目标块设备。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.
又例如,BMS上挂载有N个块设备,每个块设备添加一个标签,其中存储目标IP地址的块设备添加的标签为cidata,其他块设备添加的标签与cidata不同,如此,BMS可以基于cidata快速从N个块设备中获取目标块设备。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.
上述中预设标签为cidata仅为示意性说明,本申请实施例不具体限定预设标签的形式,例如预设标签可以为块设备的关键内容主题,比如存储网络配置参数的块设备,可以添加network-config标签。标签也可以为块设备的内容格式,或者利用预设标识符作为标签。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.
需说明,标签与块设备的对应关系需要预先保存在BMS上。如此,当BMS获取标签信息后,可以基于标签与块设备的对应关系,快速从挂载的多个块设备中获取目标块设备。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.
目标IP地址,是指BMS需要配置的IP地址。在本申请实施例中,为使BMS正常上网,BMS配置的目标IP地址不能与其他服务器的IP地址冲突。其他服务器与BMS位于同一局域网内,或者其他服务器与BMS共享同一网络。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.
本申请实施例不具体限定目标IP地址在目标块设备中存在形式。例如,目标IP地址可以写入网络配置文件中,基于网络配置文件形成目标块设备。或者目标IP地址写入网络配置文件中,首先将网络配置文件打包制作成镜像文件,然后,基于镜像文件形成目标块设备。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.
此外,本申请实施例不具体限定获取目标块设备的时间。例如,可以在BMS实例下放并启动成功后,自动触发BMS获取目标块设备。也可以在BMS主机操作系统(hostoperation system,Host OS)重启过程中,自动触发BMS获取目标块设备。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).
S22:基于目标块设备中的目标网络协议地址IP配置BMS的网络地址。S22: Configure the network address of the BMS based on the target network protocol address IP in the target block device.
BMS获取目标块设备后,从目标块设备中自动获取目标IP地址。After the BMS obtains the target block device, it automatically obtains the target IP address from the target block device.
本申请实施例不具体限定获取目标IP地址的方式。相对于手动输入目标IP地址,本申请实施例不容易出现手动输入错误,且获取速度更快。此外,通过存储时预先保证目标IP地址与其他服务器的IP地址不冲突,进一步提高配置正确率。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.
在一种示例中,BMS可以遍历目标块设备中存储的所有信息,从中获取目标IP地址。In one example, the BMS may traverse all information stored in the target block device and obtain the target IP address therefrom.
在另一种示例中,考虑到目标块设备中存在多个文件,例如用户数据文件、网络配置文件等,且每个文件都有对应的网络标识,例如用户数据文件的标识为user-data,网络配置文件的标识为network-config。此外,目标IP地址存储在网络配置文件中。BMS可以基于网络标识network-config获取网络配置文件,然后从网络配置文件中获取目标IP地址。相对于遍历所有目标块设备中信息,获取效率更高。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.
在又一种示例中,BMS可以调用读取工具从目标块设备中读取目标IP地址。例如读取工具可以为Cloud-Init。Cloud-Init是专为云环境中虚拟机的初始化而开发的工具,用于在创建虚拟机的启动时,从各种数据源读取相关数据并据此对虚拟机进行自定义配置。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.
BMS利用目标IP地址配置IP地址。The BMS configures the IP address using the target IP address.
在一些示例中,BMS配置的IP地址与目标IP地址相同。例如,目标IP地址为70:182:40:116,则BMS配置的IP地址可以为70:182:40:116。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.
在另一些示例中,BMS存储有目标IP地址与BMS配置的IP地址的对应关系,BMS利用目标IP地址,以及IP地址的对应关系,自动配置IP地址。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.
本申请实施例通过BMS上挂载的目标块设备,其中,目标块设备中包括目标网络地址,可以使BMS从目标块设备中自动获取目标网络地址。如此,当BMS需要配置网络地址时,可以利用目标块设备中的目标网络地址自动配置BMS的网络地址。由此可知,本申请实施例可以自动获取目标网络地址并进行自动配置,相对于手动配置网络地址,配置效率高。此外,本申请实施例通过预先存储网络地址,可以减少手动配置误差,因此,有助于提升配置正确率,降低BMS的网络故障发生概率,提升用户体验。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 from this 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 manually configuring 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.
参见图3,该图为本申请实施例提供的一种目标块设备挂载的实现方式。该方法的执行主体为BMS的第二处理器。示例性的,第二处理器可以为BMS的数据处理器(dataprocession unit,DPU)。该方法具体包括:See FIG. 3 , which is a method for implementing target block device mounting provided in 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 (DPU) of the BMS. The method specifically includes:
S31:在DPU文件系统中创建网络配置相关文件。S31: Create network configuration related files in the DPU file system.
网络配置相关文件是指配置BMS的IP地址所需要的至少一个文件。The network configuration related file refers to at least one file required to configure the IP address of the BMS.
其中,网络配置相关文件包括网络配置文件,用于使BMS配置网络地址信息,比如配置IP地址,网关地址、掩码等。BMS通过网络配置文件,获取网络地址配置信息,利用该网络地址配置信息自动配置网络地址。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.
本申请不具体限定网络配置文件的格式。例如,网络配置文件的格式为:This application does not specifically limit the format of the network configuration file. For example, the format of the network configuration file is:
root@localhost:/home?ubuntu/cloud-init#cat network-configroot@localhost:/home? ubuntu/cloud-init#cat network-config
version:1version: 1
config:config:
type:physicaltype:physical
name:ens9name:ens9
mac_address:’86:a1:80:de:1e:f7’mac_address: '86:a1:80:de:1e:f7'
subnets:subnets:
type:statictype:static
address:70:182:40:116address:70:182:40:116
netmask:255.255.255.0netmask:255.255.255.0
gateway:70.182.40.1gateway:70.182.40.1
其中,网络配置文件标识为network-config,版本号version为1。配置config信息中类型type为物理网卡,待配置网卡名称name为ens9。待配置网卡的媒体访问控制(mediaaccess control,mac)mac地址mac_address为86:a1:80:de:1e:f7。子网信息中,子网类型type为静态static,目标IP地址,也即子网IP地址为70:182:40:116,子网掩码为255.255.255.0,子网网关为70.182.40.1。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.
BMS获取网络配置文件后,可以通过对应的信息创建待配置网卡,并配置子网网络地址,实现BMS正常上网通信。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.
本申请实施例可以在DPU的文件系统中创建网络配置相关文件,并将目标IP地址写入网络配置文件。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.
本申请实施例不具体限定写入方式,例如BMS可以基于目标IP地址对应的写入位置,也即上述文件格式中address处,将目标IP地址覆盖原有的IP地址。假设目标IP地址为70.182.40.11。此时,网络配置文件中的address为70:182:40:11。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.
此外,也可以将子网网关、掩码等网络配置参数信息写入网络配置文件。In addition, network configuration parameter information such as subnet gateway and mask can also be written into the network configuration file.
在一种示例中,网络配置相关文件还包括但不局限于第一文件、第二文件。In an example, the network configuration related files also include but are not limited to the first file and the second file.
第一文件又称为用户数据user-data文件,用于存储登录IBMC所需的登录密码。BMS通过第一文件可以获取登录密码,自动连接IBMC。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.
本申请实施例不具体限定第一文件的格式,例如,第一文件的格式可以为: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:
root@localhost:/home?ubuntu/cloud-init#cat user-dataroot@localhost:/home? ubuntu/cloud-init#cat user-data
#cloud-congfig#cloud-connect
password:passpassword:pass
expire:Falseexpire:False
password为默认的登录密码。示例中默认登录密码为pass。expire表示用户下次登录时是否需要重置密码,若expire对应的内容为第一预设标志,例如预设标志为False,表示不需要重置密码,下次默认登录。若为第二预设标志,比如为空,或者为True,表示需要重置密码。user-data为第一文件标识,通过user-data,BMS可以确认获取的文件为第一文件。user-data仅为示意性说明,本领域技术人员根据需要可以自行调整。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 will be used 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.
第二文件用户存储待配置实例的第一身份标识。其中,待配置实例为BMS需要的实例。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.
缓存区域缓存了正在下发的实例信息以及该实例信息对应的第二身份标识。为确保下发的实例为待配置实例,BMS会检查缓存区域的第二身份标识与第一身份标识是否相同。若相同,缓存区域缓存的实例为待配置实例。若不相同,表示缓存区域缓存的实例不是待配置实例,缓存区域需要重新加载配置的实例信息。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.
本申请实施例不具体限定第二文件的格式,例如,第二文件格式为: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:
root@localhost:/home?ubuntu/cloud-init#cat meta-dataroot@localhost:/home? ubuntu/cloud-init#cat meta-data
instance-id:id-10。instance-id: id-10.
其中,meta-data为第二文件标识,instance-id为第一身份标识,第一身份标识具体为id-10。meta-data为第二文件标识。通过meta-data,BMS可以确认获取的文件为第二文件。meta-data仅为示意性说明,本领域技术人员根据需要可以自行调整。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 for illustrative purposes, and those skilled in the art can adjust it as needed.
S32:生成网络配置相关文件对应的镜像文件。S32: Generate an image file corresponding to the network configuration related files.
镜像文件类似于一种压缩文件,用于将网络配置相关文件压缩一种存储空间更小的文件,以节省存储空间。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.
本申请实施例不具体限定镜像文件的类型,例如镜像文件可以为ISO镜像文件。其中,ISO镜像文件中的网络配置相关文件不能随意修改,在传输和保存过程中安全性更高。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.
为了便于后续识别镜像文件,镜像文件携带有预设标签,例如预设标签为cidata标签。即,将网络配置相关文件转换成镜像文件,并将镜像文件添加上预设标签。通过预设标签,可以快速获取网络配置相关文件对应的镜像文件。In order to facilitate the subsequent identification of the image file, the image file carries a preset tag, for example, the preset tag is a 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.
本申请实施例不具体限定生成镜像文件的方式。The embodiment of the present application does not specifically limit the method of generating the image file.
在一种示例中,在本地磁盘中,点击需要添加的网络配置相关文件,将网络配置相关文件添加到光盘后,点击光盘目录下的光盘名称,对新添加的网络配置相关文件重命名为预设标签。通过镜像文件类型另存为,将网络配置相关文件转换为镜像文件。例如将网络配置相关文件重命名为cidata,并通过ISO另存为,将网络配置相关文件成功输出带有cidata标签的ISO镜像文件。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.
在另一种示例中,DPU可以使用制作工具,将网络配置相关文件制作为带有预设标签的镜像文件。例如使用genisoimage工具等,将网络配置相关文件打包,制作为带有cidata标签的ISO镜像文件。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.
S33:DPU基于镜像文件,生成目标块设备。S33: The DPU generates a target block device based on the image file.
块设备是指支持以固定大小的块读取和写入数据的存储设备。目标块设备是指将镜像文件作为块写入的块设备。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.
本申请实施例基于镜像文件,生成目标块设备。可选地,目标块设备与镜像文件具有相同的标签。例如镜像文件为带有cidata标签的ISO镜像文件,生成的目标块设备带有cidata标签,例如目标块设备为带有cidata标签的bdev设备。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.
本申请实施例创建目标块设备目的在于,利用目标块设备创建虚拟硬盘,将目标IP地址等网络配置信息挂载在BMS上。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.
S34:基于目标块设备创建虚拟硬盘。S34: Create a virtual hard disk based on the target block device.
本申请实施例中,基于目标块设备创建虚拟硬盘,BMS重启后,基本输入输出系统(basic input output system,BIOS)将虚拟硬盘挂载在BMS上,BMS就可以基于挂载的虚拟硬盘,获取目标块设备,从目标块设备中获取目标IP地址等其他网络配置信息。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.
本申请实施例不具体限定BMS重启方式,例如云管平台下发重启指令,使BMS操作系统重启。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.
本申请实施例不具体限定虚拟硬盘的类型,例如通过virtio-blk实现虚拟硬盘。virtio-blk是虚拟化KVM平台下虚拟硬盘的一种实现方式,本质上为一种半模拟技术。virtio-blk设备中采用io_event_fd进行前端到后端通知,采用中断注入方式实现后端到前端的通知,并通过IO环(vring)进行数据的共享。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).
本申请实施例不具体限定创建虚拟硬盘的方法。例如,可以采用存储性能开发套件(storage performance development kit,SPDK)方式创建虚拟硬盘。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.
本申请实施例通过在DPU文件系统中创建网络配置相关文件,生成网络配置相关文件的ISO镜像文件,并基于ISO镜像文件,生成目标块设备,基于目标块设备创建虚拟硬盘,从而实现将包括目标IP地址的目标块设备挂载到BMS上。BMS可以基于挂载的目标块设备获取目标IP地址,配置IP地址。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.
实施例二Embodiment 2
进一步的,目前BMS实例的发放过程为:云管平台对裸机进行调度,然后控制裸机执行预启动执行环境(preboot execute environment,PXE)启动。接着,裸机通过访问简单文件传输协议(trivial file transfer protocol,TFTP)服务将下载的Mini OS加载至裸机的内存中,并通过访问镜像服务将待安装OS镜像下载至本地硬盘中;最后,云管平台或者IBMC控制裸机从本地硬盘启动。由于整个裸金属服务器发放的过程需要启动裸机两次且需要下载镜像,因此,裸金属服务器发放的过程耗时较长导致BMS实例发放的效率较低。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.
鉴于上述问题,本申请实施例还提供了另一种网络地址的配置方法。该方法基于云管平台定制虚拟网卡和云盘配置,利用DPU预先创建网络配置块设备并挂载到BMS的Host上,以实现IP自动配置的同时,提高BMS实例下发效率,提升用户体验。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.
参见图4,该图为本申请实施例提供的一种网络地址的配置方法对应的BMS结构示意图。BMS包括第一处理器和第二处理器。具体地,第一处理器为CPU,第二处理器为DPU。CPU与DPU进行数据通信。See 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.
需要说明的是DPU是一种以数据为中心构造的专用处理器。在本申请实施例中,DPU预先创建块设备,并将创建的该块设备挂载到BMS上,如此,BMS可以访问到该块设备。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.
CPU可以获取块设备,并根据块设备中包括的IP地址,配置BMS对应IP地址,从而使BMS正常上网通信。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.
本申请实施例不具体限定CPU与DPU进行数据通信方式,例如,CPU通过周边设备高速连接标准(peripheral component interconnect express,PCIE)PCIE与DPU通信等。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.
本申请实施例不具体限定DPU的类型,例如DPU可以为一种PCIE智能网卡。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.
如图5A所述,该图为基于DPU创建目标块设备和系统云盘的示意图。As shown in FIG. 5A , this figure is a schematic diagram of creating a target block device and a system cloud disk based on a DPU.
S1:创建系统云盘。S1: Create a system cloud disk.
DPU获取云盘配置参数,利用云盘配置参数创建系统云盘。The DPU obtains the cloud disk configuration parameters and uses them to create a system cloud disk.
云盘配置参数是指配置系统云盘的参数,包括但不局限于云盘的最大容量、最大吞吐量、最大每秒输入输出量((input/output per second、IOPS)等。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.
DPU可以通过多种方式获取云盘配置参数。The DPU can obtain cloud disk configuration parameters in a variety of ways.
例如,DPU连接有云管平台,用户可以通过云管平台直接输入云盘配置参数。或者云管平台存储有云盘配置参数以及预设触发规则,DPU可以基于预设触发规则直接从云管平台读取云盘配置参数等。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.
系统云盘是一种专门进行存储的网络存储工具,系统云盘具体可以为虚拟硬盘。本申请实施例创建的系统云盘可以与云盘配置参数相同,也可以与云盘配置参数具有对应关系。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.
例如,云盘配置参数的最大容量为32TB,系统云盘的最大容量配置为32TB。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.
又例如,DPU存储与云盘配置参数与系统云盘参数的映射关系,假设映射关系为云盘配置参数的一半为系统云盘参数。若云盘配置参数的最大容量为32TB,基于上述映射关系,系统云盘的最大容量配置为16TB。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.
将待安装操作系统程序存储在系统云盘。其中,待安装操作系统程序包括BMS镜像启动程序,用于实现BMS镜像启动。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.
S2:创建虚拟硬盘。S2: Create a virtual hard disk.
具体创建方式创建图3所示,这里不在论述。The specific creation method is shown in Figure 3 and will not be discussed here.
本申请实施例不具体限定S1和S2的执行顺序,可以先执行S1,再执行S2,也可以先执行S2,再执行S1,还可以同时进行。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.
可选地,DPU还可以创建虚拟网卡,BMS的CPU将目标IP地址配置到虚拟网卡上。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.
参见5B所示,该图为基于DPU创建目标块设备、系统云盘和虚拟网卡的示意图。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.
相对于图5A,增加了创建虚拟网卡的过程。Compared with FIG. 5A , a process of creating a virtual network card is added.
S3:创建虚拟网卡。DPU获取网卡配置参数,利用网卡配置参数创建虚拟网卡。当BMS上网时,可以基于预先创建的虚拟网卡进行上网通信。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.
网卡配置参数用于进行网卡配置。网卡配置参数包括但不局限于网卡类型、网卡对应的mac地址、子网类型、子网掩码和IP地址以及网关等。例如网卡配置参数如下所示: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:
type:physicaltype:physical
name:ens9name:ens9
mac_address:’86:a1:80:de:1e:f7’mac_address: '86:a1:80:de:1e:f7'
subnets:subnets:
type:statictype:static
address:70:182:40:116address:70:182:40:116
netmask:255.255.255.0netmask:255.255.255.0
gateway:70.182.40.1gateway:70.182.40.1
此时创建的虚拟网卡的配置为:类型为静态static,目标IP地址为70:182:40:116,子网掩码为255.255.255.0,网关为70.182.40.1。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.
本申请实施例不具体限定虚拟网卡的实现方式,例如可以为virtio-Net。virtio-Net是虚拟化KVM平台下虚拟网卡的一种实现方式,也是virtio标准中的网卡设备,被广泛应用。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.
DPU可以通过多种方式获取网卡配置参数。The DPU can obtain network card configuration parameters in multiple ways.
例如,DPU连接有云管平台,用户可以通过云管平台直接输入网卡配置参数。或者云管平台存储有网卡配置参数以及预设触发规则,DPU可以基于预设触发规则直接从云管平台读取网卡配置参数等。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.
参见图6,该图为本申请实施例提供的一种网络地址的配置方法交互图。该方法使用云管平台创建定制化裸金属实例,下发虚拟网卡和云盘配置参数到DPU_agent,通过DPU和CPU实现裸金属实例分发创建和IP配置。该方法具体包括:See 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:
S61:在云管平台上配置裸金属实例配置参数。S61: Configure bare metal instance configuration parameters on the cloud management platform.
裸金属实例配置参数是指配置裸金属实例所需要的参数。Bare metal instance configuration parameters are the parameters required to configure a bare metal instance.
在本申请实施例中,裸金属实例配置参数可以硬盘大小,硬盘类型等参数。此外,裸金属实例配置参数还包括与网卡配置参数以及云盘配置参数。DPU可以根据网卡配置参数创建虚拟网卡,并根据云盘配置参数创建系统云盘。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.
本申请实施例不具体限定用户通过云管平台下发裸金属实例配置参数的实现方式。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.
参见图7,为本申请实施例提供的一种云管平台的界面显示示意图。See Figure 7, which is a schematic diagram of the interface display of a cloud management platform provided in an embodiment of the present application.
图7中的(a)展示了裸金属实例配置参数界面,用户可以在裸金属实例配置参数界面的指定位置701,手动输入裸金属实例配置参数。此外,用户也可以通过其他方式触发云管平台从预先存储的裸金属实例配置参数区域获取。(a) in FIG7 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.
S62:云管平台服务将网卡配置参数下发给DPU。S62: The cloud management platform service sends the network card configuration parameters to the DPU.
在本申请实施例中,云管平台获取到网卡配置参数后,将网卡配置参数发送至DPU。具体发送至DPU Agent。DPU Agent是一个部署在DPU OS上的中间服务,用于接收云管平台请求,创建虚拟网卡和虚拟硬盘设备,以提供给BMS使用。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.
S63:DPU根据网卡配置参数创建虚拟网卡。S63: The DPU creates a virtual network card according to the network card configuration parameters.
S64:DPU向云管平台返回虚拟网卡创建结果。S64: The DPU returns the virtual network card creation result to the cloud management platform.
DPU向云管平台返回网卡创建结果。云管平台根据网卡创建结果确定虚拟网卡是否创建成功。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.
在一种示例中,网卡创建结果包括创建成功标识。云管平台根据创建成功标识可以确定虚拟网卡创建成功。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 according to the creation success identifier.
在又一种示例中,网卡创建结果包括网卡配置参数,比如IP地址、子网网关和子网掩码等。云管平台比对DPU返回的网卡配置参数以及向DPU下发的网卡配置参数,如果两者一致,云管平台显示虚拟网卡创建成功标识。否则云管平台显示虚拟网卡创建失败标识。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.
S65:DPU配置user-data、meta-data、network-config文件。S65: DPU configures user-data, meta-data, and network-config files.
在本申请实施例中,DPU最初不含有user-data、meta-data、network-config文件。DPU首先创建user-data、meta-data、network-config文件。具体可以在DPU文件系统上创建。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.
示例性说明,创建的user-data文件为:For example, the created user-data file is:
root@localhost:/home?ubuntu/cloud-init#cat user-dataroot@localhost:/home? ubuntu/cloud-init#cat user-data
#cloud-congfig#cloud-connect
password:passpassword:pass
expire:Falseexpire:False
创建的meta-data文件为:The created meta-data file is:
root@localhost:/home?ubuntu/cloud-init#cat meta-dataroot@localhost:/home? ubuntu/cloud-init#cat meta-data
instance-id:id-10。instance-id: id-10.
创建的network-config文件为:The network-config file created is:
root@localhost:/home?ubuntu/cloud-init#cat network-configroot@localhost:/home? ubuntu/cloud-init#cat network-config
version:1version: 1
config:config:
type:physicaltype:physical
name:ens9name:ens9
mac_address:’86:a1:80:de:1e:f7’mac_address: '86:a1:80:de:1e:f7'
subnets:subnets:
type:statictype:static
address:address:
netmask:netmask:
gateway:gateway:
DPU根据网卡配置参数配置network文件。例如,子网IP地址为70:182:40:116,子网掩码为255.255.255.0,子网网关为70.182.40.1。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.
此时配置后的network-config文件为:The configured network-config file is:
root@localhost:/home?ubuntu/cloud-init#cat network-configroot@localhost:/home? ubuntu/cloud-init#cat network-config
version:1version: 1
config:config:
type:physicaltype:physical
name:ens9name:ens9
mac_address:’86:a1:80:de:1e:f7’mac_address: '86:a1:80:de:1e:f7'
subnets:subnets:
type:statictype:static
address:70:182:40:116address:70:182:40:116
netmask:255.255.255.0netmask:255.255.255.0
gateway:70.182.40.1gateway:70.182.40.1
S66:DPU制作ISO镜像文件,基于ISO镜像文件创建目标块设备,并基于目标块设备创建目标虚拟硬盘。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.
DPU使用genisoimage工具,将user-data、meta-data、network-config文件进行打包制作成标识为cidata的ISO镜像文件。并基于标识为cidata的ISO镜像文件创建目标块设备,即标识为cidata的bdev设备。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.
最后基于标识为cidata的bdev设备创建虚拟硬盘。如此,当BMS重启后,能够将目标块设备挂载到BMS实例上,以实现在BMS上显示目标块设备。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.
S67:云管平台向DPU下发云盘配置参数。S67: The cloud management platform sends cloud disk configuration parameters to the DPU.
云管平台获取裸金属实例配置参数中的云盘配置参数,将云盘配置参数下发至DPU。The cloud management platform obtains the cloud disk configuration parameters from the bare metal instance configuration parameters and sends them to the DPU.
S68:DPU创建系统云盘。S68: DPU creates a system cloud disk.
DPU接受到云盘配置参数后,基于该云盘配置参数,以及DPU预先存储的云盘配置参数与系统云盘的第三对应关系,创建系统云盘。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.
S69:DPU向云管平台返回云盘配置结果。S69: The DPU returns the cloud disk configuration result to the cloud management platform.
创建完成后,DPU向云管平台返回云盘配置结果。云管平台根据云盘配置结果确定系统云盘是否配置成功。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.
在一种示例中,云盘配置结果包括创建成功标识。云管平台根据创建成功标识可以确定创建成功。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.
在又一种示例中,云盘配置结果包括云盘配置参数。云管平台比对DPU返回的云盘配置参数以及向DPU下发的云盘配置参数,如果两者一致,云管平台显示配置成功标识。否则云管平台显示配置失败标识。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.
S610:云管平台触发重启BMS操作系统。S610: The cloud management platform triggers the restart of the BMS operating system.
云管平台完成创建虚拟网卡以及系统云盘之后,调用IBMC接口发送命令重启BMSHost OS。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.
S611:CPU确定目标块设备。S611: The CPU determines a target block device.
BMS重启,触发BMC查找目标块设备。在本申请实施例中,BMC利用Cloud Init通过遍历的方式查找带有cidata标签的块设备。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.
S612:CPU读取网络配置文件,完成IP地址配置。S612: The CPU reads the network configuration file and completes the IP address configuration.
CPU获取到带有cidata标签的块设备后,读取内部的网络配置文件。具体利用Cloud Init通过遍历的方式查找网络配置文件。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.
CPU可以根据读取的网络地址配置文件,完成IP地址配置。The CPU can complete the IP address configuration based on the read network address configuration file.
在一种示例中,BMC直接利用网络地址配置文件的目标IP地址,配置IP地址。In one example, the BMC directly configures the IP address using the target IP address of the network address configuration file.
例如网络地址配置文件中的目标IP地址为70:182:40:116,则配置的IP地址为70:182:40:116。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.
本申请实施例不具体限定IP地址配置的实现方式。The embodiments of the present application do not specifically limit the implementation method of IP address configuration.
S613:云管平台定时使用连接指令连接BMS实例。S613: The cloud management platform periodically uses the connection instruction to connect to the BMS instance.
本申请实施例中,云管平台可以每隔预设时间间隔,通过连接指令连接BMS实例。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.
其中,预设时间间隔可以为1ms、2ms等,本申请不具体限定。The preset time interval may be 1ms, 2ms, etc., which is not specifically limited in this application.
连接指令具体可以为ping指令。例如可以使用ping+配置的IP地址,连接BMS实例。The connection instruction may specifically be a ping instruction. For example, you may use ping+configured IP address to connect to the BMS instance.
S614:响应于连接成功,云管平台反馈给用户创建成功标识。S614: In response to the successful connection, the cloud management platform feeds back a successful creation indicator to the user.
若连接指令连接成功,云管平台会反馈给用户创建BMS实例创建成功标识。If the connection command is successful, the cloud management platform will feedback to the user the successful creation of the BMS instance.
如图7所示,图7中的(b)展示了BMS实例创建成功的标识。As shown in FIG. 7 , (b) in FIG. 7 shows a sign indicating that the BMS instance is successfully created.
如此,本申请实施例通过DPU和CPU的交互实现了BMS实例创建和IP配置。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.
本申请实施例提供IP自动配置的方法,解决了传统裸金属虚拟网卡需要手动配置IP的问题。此外,本申请实施例可以使用户通过裸金属管理平台实时感知裸金属实例是否部署成功,让用户可以快速实时感知裸金属实例状态,极大的提高了用户体验。此外,本申请实施例采用云管平台创建定制化裸金属实例,下发虚拟网卡和云盘配置参数到DPU_agent,通过DPU实现裸金属实例的快速分发和IP的快速配置。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 successfully deployed 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.
此外,本申请实施例还提供了一种网络地址的配置装置。In addition, an embodiment of the present application also provides a device for configuring a network address.
参见图8,该图为本申请实施例提供一种网络地址的配置装置结构示意图。该配置装置具体包括:See Figure 8, which is a schematic diagram of a network address configuration device according to an embodiment of the present application. The configuration device specifically includes:
获取单元801,用于获取所述BMS上挂载的目标块设备;其中,所述目标块设备包括目标互联网协议IP地址;配置单元802,用于基于所述目标IP地址配置所述BMS中的网络地址。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.
在一种可能的实现方式中,所述目标块设备包括预设标签。获取单元801具体用于:基于所述预设标签,从所述BMS上挂载的至少一个块设备中获取所述目标块设备。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.
在另一种可能的实现方式中,配置装置还包括:挂载单元803,挂载单元803具体用于:获取所述BMS上挂载的虚拟硬盘;其中,所述每个虚拟硬盘基于块设备建立;从所述虚拟硬盘中获取目标虚拟硬盘;其中,所述目标虚拟硬盘基于所述目标块设备建立。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.
可选地,挂载单元803还用于:Optionally, the mounting unit 803 is further used for:
获取网络配置文件;其中,所述网络配置文件中包括所述目标IP地址;生成所述网络配置文件对应的镜像文件;其中,所述镜像文件包括预设标签;基于所述镜像文件创建所述目标块设备,所述目标块设备包括所述预设标签;基于所述目标块设备,创建所述目标虚拟硬盘。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.
在又一种可能的实现方式中,配置装置还包括镜像文件生成单元804,镜像文件生成单元804具体用于: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:
获取第一文件和第二文件;其中,所述第一文件用于存储所述BMS的管理系统的登录密码,所述第二文件用于存储BMS实例的标识信息;基于所述网络配置文件、所述第一文件和所述第二文件,生成所述镜像文件;其中,所述镜像文件为包括所述预设标签的ISO镜像文件。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.
可选地,配置装置还包括下发创建单元805。下发创建单元805还用于:基于云管平台下发的裸金属实例配置参数中的云盘配置参数,创建并配置系统云盘;其中,所述系统云盘用于存储所述BMS的待安装操作系统OS;基于所述系统云盘安装所述操作系统OS。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.
可选地,下发创建单元805还用于:基于云管平台下发的裸金属实例配置参数中的网卡配置参数,创建并配置虚拟网卡。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.
可选地,所述BMS中的网络地址为虚拟网卡的网络地址;Optionally, the network address in the BMS is the network address of the virtual network card;
配置单元802用于:基于所述目标IP地址配置所述虚拟网卡的网络地址。The configuration unit 802 is used to configure the network address of the virtual network card based on the target IP address.
可选地,配置装置还包括重启单元806,具体用于:响应于云管平台的重启指令,重启所述BMS。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.
本申请实施例提供的配置装置,通过BMS上挂载的目标块设备,其中,目标块设备中包括目标IP地址,可以使BMS从目标块设备中自动获取目标IP地址。如此,当BMS需要配置网络地址时,可以利用目标块设备中的目标IP地址自动配置BMS的网络地址。由此可知,本申请实施例可以自动获取目标IP地址并进行自动配置,相对于手动配置网络地址,配置效率高。此外,本申请实施例通过预先存储网络地址,可以减少手动配置误差,因此,有助于提升配置正确率,降低BMS的网络故障发生概率,提升用户体验。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.
如图9所示,本申请实施例还提供了一种计算设备900,包括第一处理器901、第二处理器902和存储器903,存储器903分别与第一处理器901和第二处理器902电连接;存储器903用于存储程序指令,该程序指令用于上述各实施例中所涉及的网络地址的配置方法;第一处理器901和第二处理器902用于调用上述程序指令中的相应部分,以使得计算设备可以执行上述各实施例中所涉及的网络地址的配置方法。As shown in Figure 9, an embodiment of the present application also provides a computing device 900, including a first processor 901, a second processor 902 and a memory 903, 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.
本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机指令,当计算机指令在计算设备上运行时,使得计算设备执行上述各实施例中所涉及的网络地址的配置方法。An embodiment of the present application also 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.
关于上述提供的任一种计算机可读存储介质中相关内容的解释及有益效果的描述,均可以参考上述对应的实施例,此处不再赘述。For the explanation of the relevant contents and description of the beneficial effects in 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.
本申请实施例提供一种计算机程序产品,当其在计算机上运行时,使得计算机执行上述各实施例中所涉及的网络地址的配置方法。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.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机指令时,全部或部分地产生按照本申请实施例中的流程或功能。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.
该计算机可以是裸金属服务器。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,该计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))方式或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心传输。该计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包括一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质(例如,软盘、磁盘、磁带)、光介质(例如,数字视频光盘(digital video disc,DVD))、或者半导体介质(例如固态硬盘(solid state drives,SSD))等。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.
以上所述,仅是本申请的较佳实施例而已,并非对本申请作任何形式上的限制。虽然本申请已以较佳实施例揭露如上,然而并非用以限定本申请。任何熟悉本领域的技术人员,在不脱离本申请技术方案范围情况下,都可利用上述揭示的方法和技术内容对本申请技术方案做出许多可能的变动和修饰,或修改为等同变化的等效实施例。因此,凡是未脱离本申请技术方案的内容,依据本申请的技术实质对以上实施例所做的任何简单修改、等同变化及修饰,均仍属于本申请技术方案保护的范围内。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 falls within the scope of protection of the technical solution of the present application.
Claims (19)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311733289.3A CN117938641B (en) | 2023-12-15 | 2023-12-15 | A network address configuration method and computing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311733289.3A CN117938641B (en) | 2023-12-15 | 2023-12-15 | A network address configuration method and computing device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117938641A true CN117938641A (en) | 2024-04-26 |
CN117938641B CN117938641B (en) | 2025-03-21 |
Family
ID=90763861
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311733289.3A Active CN117938641B (en) | 2023-12-15 | 2023-12-15 | A network address configuration method and computing device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117938641B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104767649A (en) * | 2015-04-30 | 2015-07-08 | 杭州华三通信技术有限公司 | Bare metal server deployment method and device |
CN111782283A (en) * | 2020-06-28 | 2020-10-16 | 北京思特奇信息技术股份有限公司 | Automatic management method, device and medium for bare metal server |
CN112291096A (en) * | 2020-10-30 | 2021-01-29 | 北京思特奇信息技术股份有限公司 | Bare metal server configuration method and device |
CN112395084A (en) * | 2020-10-28 | 2021-02-23 | 安擎(天津)计算机有限公司 | Bare metal server deployment method |
US11178041B1 (en) * | 2020-07-07 | 2021-11-16 | Juniper Networks, Inc. | Service chaining with physical network functions and virtualized network functions |
US20210392039A1 (en) * | 2020-06-16 | 2021-12-16 | Robin Systems, Inc. | Automated Initialization Of Bare Metal Servers |
CN116954638A (en) * | 2023-08-11 | 2023-10-27 | 广东浪潮智慧计算技术有限公司 | Bare metal server deployment method, device and medium |
-
2023
- 2023-12-15 CN CN202311733289.3A patent/CN117938641B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104767649A (en) * | 2015-04-30 | 2015-07-08 | 杭州华三通信技术有限公司 | Bare metal server deployment method and device |
US20210392039A1 (en) * | 2020-06-16 | 2021-12-16 | Robin Systems, Inc. | Automated Initialization Of Bare Metal Servers |
CN111782283A (en) * | 2020-06-28 | 2020-10-16 | 北京思特奇信息技术股份有限公司 | Automatic management method, device and medium for bare metal server |
US11178041B1 (en) * | 2020-07-07 | 2021-11-16 | Juniper Networks, Inc. | Service chaining with physical network functions and virtualized network functions |
CN112395084A (en) * | 2020-10-28 | 2021-02-23 | 安擎(天津)计算机有限公司 | Bare metal server deployment method |
CN112291096A (en) * | 2020-10-30 | 2021-01-29 | 北京思特奇信息技术股份有限公司 | Bare metal server configuration method and device |
CN116954638A (en) * | 2023-08-11 | 2023-10-27 | 广东浪潮智慧计算技术有限公司 | Bare metal server deployment method, device and medium |
Non-Patent Citations (2)
Title |
---|
RAMANATH M. NITHYA;P. SUPRIYA;SANJAY SRIDHAR: "Remote Control of an Embedded Environment using Target Communication Framework Protocol", 《2019 3RD INTERNATIONAL CONFERENCE ON TRENDS IN ELECTRONICS AND INFORMATICS (ICOEI)》, 31 December 2019 (2019-12-31) * |
冯洋: "私有云平台DBaaS服务的设计与实现", 《CNKI》, 1 May 2019 (2019-05-01) * |
Also Published As
Publication number | Publication date |
---|---|
CN117938641B (en) | 2025-03-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7840736B2 (en) | Bus communication enumeration | |
US11849557B2 (en) | Infrastructure management device | |
US7240098B1 (en) | System, method, and software for a virtual host bus adapter in a storage-area network | |
US20240007347A1 (en) | Method and system for configuring bmc ip addresses of bare metal servers, medium and device | |
CN110908753B (en) | Intelligent fusion cloud desktop server, client and system | |
CN109558212B (en) | A virtualization management method, system, physical equipment and medium of physical equipment | |
CN109240754B (en) | Logic device, method and system for configuring BIOS starting item | |
US11349721B2 (en) | Discovering switch port locations and internet protocol addresses of compute nodes | |
CN106648838B (en) | Resource pool management configuration method and device | |
CN117857505A (en) | Configuration method of network address of virtual machine and computing device | |
CN107526595A (en) | A kind of method for supporting multiple operating system remote loading | |
US12093199B2 (en) | Infrastructure management device | |
CN117938641A (en) | A network address configuration method and computing device | |
CN117667313A (en) | Method and equipment for rapidly preparing bare metal server | |
CN114003342B (en) | A distributed storage method, device, electronic device and storage medium | |
US20050132084A1 (en) | Method and apparatus for providing server local SMBIOS table through out-of-band communication | |
CN116881072A (en) | Network card monitoring method, device, system and equipment of baseboard management controller | |
WO2022134918A1 (en) | Virtual machine attribute changing method and apparatus, storage medium, and electronic device | |
CN114443229A (en) | Mirror image file mounting method and device, electronic equipment and storage medium | |
CN111857598A (en) | A kind of mapping method, apparatus, device and readable medium for remote disk localization | |
CN111245681A (en) | Method for obtaining interconnection information of server ports | |
CN112994907B (en) | Network configuration method, device, storage medium and equipment of virtual machine | |
CN120255972A (en) | Smart network card deployment method and related device | |
CN118132205A (en) | Management method and device of desktop cloud virtual machine, electronic equipment and storage medium | |
CN118276883A (en) | A server installation system and method based on DPU |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |