TWI786766B - Bare device deploying method, electronic device, and storage medium - Google Patents

Bare device deploying method, electronic device, and storage medium Download PDF

Info

Publication number
TWI786766B
TWI786766B TW110129861A TW110129861A TWI786766B TW I786766 B TWI786766 B TW I786766B TW 110129861 A TW110129861 A TW 110129861A TW 110129861 A TW110129861 A TW 110129861A TW I786766 B TWI786766 B TW I786766B
Authority
TW
Taiwan
Prior art keywords
bare metal
bare
deployment
services
metal
Prior art date
Application number
TW110129861A
Other languages
Chinese (zh)
Other versions
TW202308355A (en
Inventor
鐘碩彥
Original Assignee
鴻海精密工業股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 鴻海精密工業股份有限公司 filed Critical 鴻海精密工業股份有限公司
Priority to TW110129861A priority Critical patent/TWI786766B/en
Application granted granted Critical
Publication of TWI786766B publication Critical patent/TWI786766B/en
Publication of TW202308355A publication Critical patent/TW202308355A/en

Links

Images

Landscapes

  • Encapsulation Of And Coatings For Semiconductor Or Solid State Devices (AREA)
  • Electrochromic Elements, Electrophoresis, Or Variable Reflection Or Absorption Elements (AREA)
  • Input Circuits Of Receivers And Coupling Of Receivers And Audio Equipment (AREA)
  • Stored Programmes (AREA)

Abstract

A bare device deploying method, an electronic device, and a storage medium are provided. The method includes: turning on a bare device to be deployed, and assigning an IP address to the bare device; downloading a deploy image to the bare device based on the IP address, and obtaining hardware information of the bare device based on the deploy image; determining services that the bare device is required to provide according to a preset bare device deploy strategy and the hardware information of the bare device; generating a system image based on the determined services, and transmitting the system image to the bare device for system deploying.

Description

裸機部署方法、電子裝置及存儲介質Bare metal deployment method, electronic device and storage medium

本申請涉及伺服器管理技術領域,尤其涉及一種裸機部署方法、電子裝置及存儲介質。The present application relates to the technical field of server management, and in particular to a bare-metal deployment method, an electronic device, and a storage medium.

隨著電腦技術的發展,邊緣計算平臺越來越多地應用在各技術領域中,例如AI識別等。OpenStack提供了邊緣計算平臺的開發和管理方案,可以根據用戶的業務需求對裸機進行部署。然而,OpenStack在對裸機進行部署時需要用戶預先對裸機的內核、記憶體檔案系統、作業系統鏡像等資訊進行配置,並且預先配置的資訊較為固定,如此導致裸機的配置效率較低,而且缺乏彈性。With the development of computer technology, edge computing platforms are increasingly used in various technical fields, such as AI recognition. OpenStack provides a development and management solution for the edge computing platform, and can deploy bare metal according to the user's business needs. However, when OpenStack deploys bare metal, users need to pre-configure bare metal kernel, memory file system, operating system image and other information, and the pre-configured information is relatively fixed, which leads to low configuration efficiency of bare metal. And lack of flexibility.

有鑒於此,有必要提供一種裸機部署方法、電子裝置及存儲介質,可以根據裸機的硬體資訊自動對裸機進行系統部署。In view of this, it is necessary to provide a bare metal deployment method, an electronic device and a storage medium, which can automatically perform system deployment on the bare metal according to the hardware information of the bare metal.

本申請提供一種裸機部署方法,所述方法包括:This application provides a bare metal deployment method, the method comprising:

開啟至少一待部署系統的裸機,給所述裸機分配IP位址;Turn on at least one bare metal of the system to be deployed, and assign an IP address to the bare metal;

基於所述IP位址將部署鏡像下載至所述裸機,並基於所述部署鏡像獲取所述裸機的硬體資訊;downloading a deployment image to the bare metal based on the IP address, and obtaining hardware information of the bare metal based on the deployment image;

根據預設的裸機部署策略及所述裸機的硬體資訊確定所述裸機需提供的服務;Determine the services to be provided by the bare metal according to the default bare metal deployment strategy and the hardware information of the bare metal;

根據所述裸機需提供的服務生成系統鏡像,並將所述系統鏡像發送至所述裸機,以供所述裸機進行系統部署。A system image is generated according to the services to be provided by the bare metal, and the system image is sent to the bare metal for system deployment on the bare metal.

可選地,所述預設的裸機部署策略包括裸機所包含的硬體類型或硬體屬性、所述裸機需提供的服務與系統鏡像設定檔之間的對應關係。Optionally, the preset bare metal deployment strategy includes a correspondence between hardware types or hardware attributes included in the bare metal, services to be provided by the bare metal, and system image configuration files.

可選地,所述硬體資訊包括所述硬體類型及/或硬體屬性,所述根據預設的裸機部署策略及所述裸機的硬體資訊確定所述裸機需提供的服務包括:Optionally, the hardware information includes the hardware type and/or hardware attributes, and the services to be provided by the bare metal are determined according to the preset bare metal deployment strategy and the hardware information of the bare metal include:

若所述裸機所包含的硬體類型至少包括AI加速晶片,根據所述預設的裸機部署策略確定與所述AI加速晶片對應的所述裸機需提供的服務至少包括深度學習的推理服務;If the hardware type contained in the bare metal includes at least an AI acceleration chip, it is determined according to the preset bare metal deployment strategy that the services to be provided by the bare metal corresponding to the AI acceleration chip include at least deep learning reasoning Serve;

若所述裸機所包含的硬體類型至少包括GPU,根據所述預設的裸機部署策略確定與所述GPU對應的所述裸機需提供的服務至少包括深度學習的訓練服務;If the hardware type contained in the bare metal includes at least a GPU, it is determined according to the preset bare metal deployment strategy that the services to be provided by the bare metal corresponding to the GPU include at least deep learning training services;

若所述裸機所包含的硬體類型至少包括感測器,根據所述預設的裸機部署策略確定與所述感測器對應的所述裸機需提供的服務至少包括傳感資料獲取服務。If the hardware type contained in the bare metal includes at least a sensor, according to the preset bare metal deployment strategy, it is determined that the services to be provided by the bare metal corresponding to the sensor include at least sensing data acquisition Serve.

可選地,所述方法還包括:Optionally, the method also includes:

即時偵測已完成系統部署的所述裸機的硬體資訊是否發生改變;Detect in real time whether the hardware information of the bare metal that has completed the system deployment has changed;

在偵測到所述裸機的硬體資訊發生改變時,重新確定所述裸機需提供的服務;When it is detected that the hardware information of the bare metal has changed, re-determining the services to be provided by the bare metal;

根據重新確定的所述裸機需提供的服務重新對所述裸機進行部署。Re-deploy the bare metal according to the re-determined services to be provided by the bare metal.

可選地,所述開啟待部署系統的裸機,給所述裸機分配IP位址包括:Optionally, said enabling the bare metal of the system to be deployed, and assigning an IP address to the bare metal includes:

藉由IPMI指令開啟所述待部署系統的裸機,基於DHCP服務獲得TFTP服務的IP位址,並將所述IP地址分配給所述裸機。The bare metal of the system to be deployed is enabled by an IPMI command, the IP address of the TFTP service is obtained based on the DHCP service, and the IP address is allocated to the bare metal.

可選地,所述方法還包括:Optionally, the method also includes:

每隔預設時間偵測是否新增與電子裝置通訊連接的至少一個裸機;Detecting whether at least one bare metal device is newly added to communicate with the electronic device every preset time;

若偵測到新增與所述電子裝置通訊連接的所述至少一個裸機時,開啟所述至少一個裸機。If it is detected that the at least one bare machine is newly added to communicate with the electronic device, the at least one bare machine is turned on.

可選地,所述基於所述IP位址將部署鏡像下載至所述裸機,並基於所述部署鏡像獲取所述裸機的硬體資訊包括:Optionally, downloading the deployment image to the bare metal based on the IP address, and obtaining hardware information of the bare metal based on the deployment image includes:

將所述部署鏡像中的硬體資訊採集程式下載至所述裸機,控制所述裸機啟動所述硬體資訊採集程式以採集所述硬體資訊。downloading the hardware information collection program in the deployment image to the bare metal, and controlling the bare metal to start the hardware information collection program to collect the hardware information.

可選地,所述根據所述裸機需提供的服務生成系統鏡像包括:Optionally, the generating a system image according to the services to be provided by the bare metal includes:

根據所述裸機需提供的服務生成服務設定檔;generating a service configuration file according to the services to be provided by the bare metal;

根據基礎設定檔及所述服務設定檔生成所述系統鏡像,其中,所述基礎設定檔至少包括內核、記憶體檔案系統及作業系統。The system image is generated according to the basic configuration file and the service configuration file, wherein the basic configuration file at least includes a kernel, a memory file system and an operating system.

本申請還提供一種電子裝置,包括:The present application also provides an electronic device, including:

處理器;以及processor; and

記憶體,所述記憶體中存儲有多個程式模組,所述多個程式模組由所述處理器載入並執行上述的裸機部署方法。A memory, wherein a plurality of program modules are stored in the memory, and the plurality of program modules are loaded by the processor to execute the above bare metal deployment method.

本申請還提供一種電腦可讀存儲介質,其上存儲有至少一條電腦指令,所述指令由處理器並載入執行上述的裸機部署方法。The present application also provides a computer-readable storage medium, on which at least one computer instruction is stored, and the instruction is loaded by a processor to execute the above bare-metal deployment method.

上述裸機部署方法、電子裝置及存儲介質可以根據裸機的硬體資訊自動對裸機進行系統部署,提高了裸機的部署效率,給裸機系統提供了彈性化設置。The above bare metal deployment method, electronic device and storage medium can automatically perform system deployment on the bare metal according to the hardware information of the bare metal, which improves the deployment efficiency of the bare metal and provides flexible settings for the bare metal system.

為了能夠更清楚地理解本申請的上述目的、特徵和優點,下面結合附圖和具體實施例對本申請進行詳細描述。需要說明的是,在不衝突的情況下,本申請的實施例及實施例中的特徵可以相互組合。In order to more clearly understand the above objects, features and advantages of the present application, the present application will be described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the case of no conflict, the embodiments of the present application and the features in the embodiments can be combined with each other.

在下面的描述中闡述了很多具體細節以便於充分理解本申請,所描述的實施例僅僅是本申請一部分實施例,而不是全部的實施例。基於本申請中的實施例,本領域普通技術人員在沒有做出創造性勞動前提下所獲得的所有其他實施例,都屬於本申請保護的範圍。A lot of specific details are set forth in the following description to facilitate a full understanding of the application, and the described embodiments are only a part of the embodiments of the application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

除非另有定義,本文所使用的所有的技術和科學術語與屬於本申請的技術領域的技術人員通常理解的含義相同。本文中在本申請的說明書中所使用的術語只是為了描述具體的實施例的目的,不是旨在於限制本申請。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs. The terms used herein in the specification of the application are only for the purpose of describing specific embodiments, and are not intended to limit the application.

請參閱圖1所示,為本申請較佳實施方式提供的裸機部署方法的應用環境架構示意圖。Please refer to FIG. 1 , which is a schematic diagram of an application environment architecture of a bare-metal deployment method provided by a preferred embodiment of the present application.

本申請中的裸機部署方法應用在電子裝置1中,所述電子裝置1與多個裸機2藉由網路建立通訊連接。所述網路可以是有線網路,例如工業匯流排,也可以是無線網路,例如無線電、無線保真(Wireless Fidelity, WIFI)、蜂窩、衛星、廣播等。蜂窩網路可以是4G網路或5G網路。The bare metal deployment method in this application is applied in an electronic device 1 , and the electronic device 1 establishes a communication connection with a plurality of bare metal 2 through a network. The network may be a wired network, such as an industrial bus, or a wireless network, such as radio, wireless fidelity (Wireless Fidelity, WIFI), cellular, satellite, broadcast, and the like. The cellular network can be a 4G network or a 5G network.

所述電子裝置1可以為安裝有裸機部署程式的電子設備,例如個人電腦、伺服器等,其中,所述伺服器可以是單一的伺服器、伺服器集群等。在一實施方式中,所述電子裝置1為基於OpenStack的雲端管理伺服器。The electronic device 1 may be an electronic device installed with a bare-metal deployment program, such as a personal computer, a server, etc., wherein the server may be a single server, a server cluster, or the like. In one embodiment, the electronic device 1 is an OpenStack-based cloud management server.

所述裸機2也可以是個人電腦、伺服器等。在一實施方式中,所述裸機2包括,但不僅限於,電源控制器201、記憶體202、硬碟203及CPU 204(如圖3所示)。The bare metal 2 can also be a personal computer, a server, and the like. In one embodiment, the bare metal 2 includes, but is not limited to, a power controller 201 , a memory 202 , a hard disk 203 and a CPU 204 (as shown in FIG. 3 ).

請參閱圖2所示,為本申請較佳實施方式提供的裸機部署方法的流程圖。根據不同的需求,所述流程圖中步驟的順序可以改變,某些步驟可以省略。Please refer to FIG. 2 , which is a flowchart of a bare-metal deployment method provided by a preferred implementation manner of this application. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.

可選地,在一實施方式中,每隔預設時間偵測是否新增與所述電子裝置1通訊連接的至少一個裸機2。在偵測到新增與所述電子裝置1通訊連接的所述至少一個裸機2時,所述流程進入S201。可選地,所述預設時間可以是一小時。Optionally, in one embodiment, it is detected whether at least one bare metal device 2 that is communicatively connected to the electronic device 1 is added every preset time. When it is detected that the at least one bare metal 2 newly added to communicate with the electronic device 1, the process enters into S201. Optionally, the preset time may be one hour.

在一實施方式中,所述電子裝置1應用在一邊緣伺服器集群,用於對多個邊緣伺服器進行管理。所述電子裝置1包括註冊表,用於記錄通訊連接的邊緣伺服器。所述裸機2在加入所述邊緣伺服器集群時,除了藉由網路與所述電子裝置1連接,還需藉由所述網路將註冊資訊存儲至所述註冊表。所述註冊資訊可以是設備標識、MAC位址等。若所述註冊表新增註冊資訊,確定偵測到新增與所述電子裝置1通訊連接的所述裸機2。In one embodiment, the electronic device 1 is applied in an edge server cluster for managing multiple edge servers. The electronic device 1 includes a registry for recording the edge server of the communication connection. When the bare metal 2 joins the edge server cluster, in addition to being connected to the electronic device 1 through the network, registration information needs to be stored in the registry through the network. The registration information may be device identification, MAC address and so on. If the registration information is newly added to the registry, it is determined that the bare metal 2 newly added to the electronic device 1 is detected.

S201,開啟待部署系統的裸機2,給所述裸機2分配IP地址。S201, turn on the bare metal 2 of the system to be deployed, and assign an IP address to the bare metal 2.

在一實施方式中,藉由IPMI(Intelligent Platform Management Interface,智慧平臺管理介面)指令開啟所述待部署系統的裸機,基於DHCP(Dynamic Host Configuration Protocol,動態主機設定通訊協定)服務獲得TFTP(Trivial File Transfer Protocol,簡單檔案傳輸通訊協定)服務分配的IP位址,並將所述IP地址分配給所述裸機2。In one embodiment, the bare metal of the system to be deployed is opened by an IPMI (Intelligent Platform Management Interface) command, and the TFTP (Trivial File Transfer Protocol, Simple File Transfer Protocol) service assigns an IP address, and assigns the IP address to the bare metal 2 .

請參閱圖3所示,在一實施方式中,所述電子裝置1為OpenStack架構,包括Ironic Conductor服務、DHCP服務、TFTP服務及部署策略服務。若所述電子裝置1為單個伺服器,上述服務可以是集成於所述電子裝置1中的模組。若所述電子裝置1為伺服器集群,上述服務分別由伺服器提供相應的服務。Please refer to FIG. 3 , in one embodiment, the electronic device 1 is an OpenStack architecture, including Ironic Conductor service, DHCP service, TFTP service and deployment policy service. If the electronic device 1 is a single server, the above services may be modules integrated in the electronic device 1 . If the electronic device 1 is a server cluster, the above-mentioned services are provided by the servers respectively.

具體地,所述電子裝置1藉由Ironic Conductor服務將所述IPMI指令發送至所述裸機2的電源控制器201,藉由所述電源控制器201開啟待部署系統的裸機2。Specifically, the electronic device 1 sends the IPMI command to the power controller 201 of the bare metal 2 through the Ironic Conductor service, and the bare metal 2 of the system to be deployed is turned on by the power controller 201 .

在一實施方式中,所述DHCP服務模組用於管理所述電子裝置1中每個服務模組及與所述電子裝置1通訊連接的電腦的IP位址。所述DHCP服務模組用於接收所述裸機2的IP位址請求消息,校驗所述裸機2的網卡MAC位址是否合法,若合法則返回所述IP地址至所述裸機2。其中,所述裸機2可以藉由所述IP位址與所述TFTP服務模組建立通訊連接。In one embodiment, the DHCP service module is used to manage the IP address of each service module in the electronic device 1 and the computer connected to the electronic device 1 in communication. The DHCP service module is used to receive the IP address request message of the bare metal 2, check whether the MAC address of the network card of the bare metal 2 is legal, and return the IP address to the bare metal 2 if legal. . Wherein, the bare metal 2 can establish a communication connection with the TFTP service module through the IP address.

在一實施方式中,所述DHCP服務模組可以藉由正則匹配法對所述裸機2的MAC位址的合法性進行校驗。例如,正則匹配法所採用的運算式為^([A-Fa-f0-9]{2}[-,:]){5}[A-Fa-f0-9]{2}$。In one embodiment, the DHCP service module can check the legitimacy of the MAC address of the bare metal 2 through a regular matching method. For example, the formula used by the regular matching method is ^([A-Fa-f0-9]{2}[-,:]){5}[A-Fa-f0-9]{2}$.

S202,基於所述IP位址將部署鏡像下載至所述裸機,並基於所述部署鏡像獲取所述裸機2的硬體資訊。S202. Download a deployment image to the bare metal based on the IP address, and acquire hardware information of the bare metal 2 based on the deployment image.

在一實施方式中,所述TFTP服務用於管理所述電子裝置1的檔,包括下載檔案、對檔進行配置、傳輸檔等。所述電子裝置1藉由所述TFTP服務接收所述裸機2發送的獲取部署鏡像的請求消息,並回應所述請求消息而向所述裸機2發送所述部署鏡像。In one embodiment, the TFTP service is used to manage files of the electronic device 1 , including downloading files, configuring files, transferring files, and so on. The electronic device 1 receives a request message for obtaining a deployment image sent by the bare metal 2 through the TFTP service, and sends the deployment image to the bare metal 2 in response to the request message.

在一實施方式中,所述電子裝置1可以藉由所述部署鏡像對所述裸機2的系統部署過程進行管理,例如監控系統部署進度和狀態等。所述部署鏡像至少包括硬體資訊採集程式。將所述部署鏡像中的硬體資訊採集程式下載至所述裸機2,控制所述裸機2啟動所述硬體資訊採集程式以採集所述裸機2所包含硬體資訊。其中,所述硬體資訊包括硬體類型及/或硬體屬性。例如,所述硬體類型包括記憶體、硬碟、CPU等,所述硬體屬性包括記憶體容量、硬碟容量、CPU核數等。在其他實施方式中,所述裸機2也可以預先安裝有硬體資訊採集程式,在部署鏡像安裝於所述裸機2時,所述裸機2自動啟動所述硬體資訊採集程式以採集硬體資訊。In one embodiment, the electronic device 1 can manage the system deployment process of the bare metal 2 through the deployment image, for example, monitor the progress and status of the system deployment. The deployment image includes at least a hardware information collection program. Download the hardware information collection program in the deployment image to the bare metal 2, and control the bare metal 2 to start the hardware information collection program to collect hardware information contained in the bare metal 2. Wherein, the hardware information includes hardware type and/or hardware attribute. For example, the hardware type includes memory, hard disk, CPU, etc., and the hardware attribute includes memory capacity, hard disk capacity, number of CPU cores, and the like. In other implementations, the bare metal 2 may also be pre-installed with a hardware information collection program, and when the deployment image is installed on the bare metal 2, the bare metal 2 automatically starts the hardware information collection program to collect Hardware information.

S203,根據預設的裸機部署策略及所述裸機2的硬體資訊確定所述裸機需提供的服務。S203. Determine the services to be provided by the bare metal according to the preset bare metal deployment strategy and the hardware information of the bare metal 2.

在一實施方式中,所述預設的裸機部署策略包括裸機所包含的硬體類型或硬體屬性、所述裸機提供的服務與系統鏡像設定檔之間的對應關係。例如,AI加速晶片對應裸機需提供的服務為深度學習的推理服務,對應的系統鏡像設定檔包括基礎設定檔及推理服務設定檔。In one embodiment, the preset bare metal deployment strategy includes the hardware type or hardware attributes contained in the bare metal, the correspondence between the services provided by the bare metal, and the system image profile. For example, the service provided by the AI accelerator chip corresponding to the bare metal is the inference service of deep learning, and the corresponding system image configuration file includes the basic configuration file and the inference service configuration file.

在一實施方式中,在所述裸機2的硬體類型至少包括AI加速晶片時,所述部署策略服務根據所述預設的裸機部署策略確定與所述AI加速晶片對應的所述裸機2需提供的服務至少包括深度學習的推理服務。在所述裸機2的硬體類型至少包括GPU時,所述部署策略服務根據所述預設的裸機部署策略確定與所述GPU對應的所述裸機2需提供的服務至少包括深度學習的訓練服務。在所述裸機2的硬體類型至少包括感測器時,所述部署策略服務根據所述預設的裸機部署策略確定與所述感測器對應的所述裸機2需提供的服務至少包括傳感資料獲取服務。In one embodiment, when the hardware type of the bare metal 2 includes at least an AI acceleration chip, the deployment strategy service determines the bare metal corresponding to the AI acceleration chip according to the preset bare metal deployment strategy. The services to be provided by machine 2 include at least the inference service of deep learning. When the hardware type of the bare metal 2 includes at least a GPU, the deployment strategy service determines that the services to be provided by the bare metal 2 corresponding to the GPU include at least deep learning according to the preset bare metal deployment strategy training services. When the hardware type of the bare metal 2 includes at least a sensor, the deployment policy service determines the service to be provided by the bare metal 2 corresponding to the sensor according to the preset bare metal deployment strategy At least including sensing data acquisition services.

S204,根據所述裸機2需提供的服務生成系統鏡像,並將所述系統鏡像發送至所述裸機2,以供所述裸機2進行系統部署。S204. Generate a system image according to the services to be provided by the bare metal 2, and send the system image to the bare metal 2 for system deployment by the bare metal 2.

在一實施方式中,根據所述裸機2需提供的服務確定服務設定檔,根據基礎設定檔及所述服務設定檔生成所述系統鏡像。其中,所述基礎設定檔包括,但不僅限於,內核、記憶體檔案系統及作業系統。例如,所述作業系統為ubuntu系統。所述服務設定檔包括深度學習框架的推理引擎和訓練引擎,以及與感測器對應的物理協定轉換程式、傳感資料的預處理程式等。In one embodiment, the service configuration file is determined according to the service to be provided by the bare metal 2, and the system image is generated according to the basic configuration file and the service configuration file. Wherein, the basic configuration file includes, but not limited to, kernel, memory file system and operating system. For example, the operating system is an ubuntu system. The service configuration file includes the reasoning engine and training engine of the deep learning framework, as well as the physical protocol conversion program corresponding to the sensor, the preprocessing program of the sensing data, and the like.

具體地,藉由所述Ironic conductor根據SSH(安全外殼)協議下發的鏡像生成指令,讀取與所述裸機2的硬體資訊相對應的設定檔(系統設定檔和服務設定檔),將設定檔配置到鏡像定製化的配置項中,獲取定製鏡像的配置資訊,根據獲取的配置資訊,讀取對應的裸機設定檔,將配置資訊寫入到kickstart(使快速重新啟動)指令檔中,將裸機2所需要的檔、安裝包放入待製作鏡像的rootfs.img中。進一步基於鏡像定製服務下發配置資訊和鏡像生成指令,根據配置資訊生成對應的系統鏡像,將系統鏡像下載到裸機2本地的硬碟,並掛載到指定目錄,修改引導項為從硬碟啟動,將所述裸機2重啟即可完成自動化安裝。Specifically, read the configuration file (system configuration file and service configuration file) corresponding to the hardware information of the bare metal 2 through the image generation command issued by the Ironic conductor according to the SSH (secure shell) protocol, Configure the configuration file to the image customization configuration item, obtain the configuration information of the customized image, read the corresponding bare-metal configuration file according to the obtained configuration information, and write the configuration information to kickstart (to enable fast restart) In the command file, put the files and installation packages required by Bare Metal 2 into the rootfs.img to be mirrored. Further deliver configuration information and image generation instructions based on the image customization service, generate the corresponding system image based on the configuration information, download the system image to the local hard disk of Bare Metal 2, and mount it to the specified directory, modify the boot item to slave Start the disk, and restart the bare metal 2 to complete the automatic installation.

進一步地,所述方法還包括:偵測完成已系統部署的所述裸機2的硬體資訊是否發生改變,在偵測到所述裸機2的硬體資訊發生改變時,基於改變的硬體資訊重新確定所述裸機2需提供的服務,基於以上方法,根據重新確定的所述裸機需提供的服務重新對所述裸機2進行部署。Further, the method further includes: detecting whether the hardware information of the bare metal 2 that has been deployed has changed, and when detecting that the hardware information of the bare metal 2 has changed, based on the changed hardware Based on the above method, redeploy the bare metal 2 according to the re-determined services to be provided by the bare metal.

本申請提供的裸機部署方法可以根據裸機的硬體資訊自動對裸機進行系統部署,提高了裸機的部署效率,給裸機系統提供了彈性化設置。The bare metal deployment method provided in this application can automatically deploy the system on the bare metal according to the hardware information of the bare metal, which improves the deployment efficiency of the bare metal and provides flexible settings for the bare metal system.

請參閱圖4所示,為本申請較佳實施方式提供的電子裝置的結構示意圖。Please refer to FIG. 4 , which is a schematic structural diagram of an electronic device provided in a preferred embodiment of the present application.

所述電子裝置1包括,但不僅限於,處理器10、記憶體20及存儲在所述記憶體20中並可在所述處理器10上運行的電腦程式30。例如,所述電腦程式30為裸機部署程式。所述處理器10執行所述電腦程式30時實現裸機部署方法中的步驟,例如圖2所示的步驟S201~S204。The electronic device 1 includes, but is not limited to, a processor 10 , a memory 20 and a computer program 30 stored in the memory 20 and capable of running on the processor 10 . For example, the computer program 30 is a bare-metal deployment program. When the processor 10 executes the computer program 30, the steps in the bare-metal deployment method are implemented, such as steps S201-S204 shown in FIG. 2 .

示例性的,所述電腦程式30可以被分割成一個或多個模組/單元,所述一個或者多個模組/單元被存儲在所述記憶體20中,並由所述處理器10執行,以完成本申請。所述一個或多個模組/單元可以是能夠完成特定功能的一系列電腦程式指令段,所述指令段用於描述所述電腦程式30在所述電子裝置1中的執行過程。Exemplarily, the computer program 30 can be divided into one or more modules/units, and the one or more modules/units are stored in the memory 20 and executed by the processor 10 , to complete this application. The one or more modules/units may be a series of computer program instruction segments capable of accomplishing specific functions, and the instruction segments are used to describe the execution process of the computer program 30 in the electronic device 1 .

本領域技術人員可以理解,所述示意圖僅僅是電子裝置1的示例,並不構成對電子裝置1的限定,可以包括比圖示更多或更少的部件,或者組合某些部件,或者不同的部件,例如所述電子裝置1還可以包括輸入輸出設備、網路接入設備、匯流排等。Those skilled in the art can understand that the schematic diagram is only an example of the electronic device 1 and does not constitute a limitation to the electronic device 1. It may include more or less components than those shown in the illustration, or combine certain components, or have different Components, for example, the electronic device 1 may also include input and output devices, network access devices, bus bars, and the like.

所稱處理器10可以是中央處理單元(Central Processing Unit,CPU),還可以是其他通用處理器、數位訊號處理器(Digital Signal Processor,DSP)、專用積體電路(Application Specific Integrated Circuit,ASIC)、現成可程式設計閘陣列(Field-Programmable Gate Array,FPGA)或者其他可程式設計邏輯器件、分立門或者電晶體邏輯器件、分立硬體元件等。通用處理器可以是微處理器或者所述處理器10也可以是任何常規的處理器等,所述處理器10是所述電子裝置1的控制中心,利用各種介面和線路連接整個電子裝置1的各個部分。The so-called processor 10 can be a central processing unit (Central Processing Unit, CPU), and can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC) , Ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor 10 can also be any conventional processor, etc., the processor 10 is the control center of the electronic device 1, and uses various interfaces and lines to connect the entire electronic device 1. various parts.

所述記憶體20可用於存儲所述電腦程式30和/或模組/單元,所述處理器10藉由運行或執行存儲在所述記憶體20內的電腦程式和/或模組/單元,以及調用存儲在記憶體20內的資料,實現所述電子裝置1的各種功能。所述記憶體20可主要包括存儲程式區和存儲資料區,其中,存儲程式區可存儲作業系統、至少一個功能所需的應用程式(比如聲音播放功能、圖像播放功能等)等;存儲資料區可存儲根據電子裝置1的使用所創建的資料(比如音訊資料、電話本等)等。此外,記憶體20可以包括易失性和非易失性記憶體,例如硬碟、記憶體、插接式硬碟,智慧存儲卡(Smart Media Card, SMC),安全數位(Secure Digital, SD)卡,快閃記憶體卡(Flash Card)、至少一個磁碟記憶體件、快閃記憶體器件、或其他記憶體件。The memory 20 can be used to store the computer program 30 and/or module/unit, and the processor 10 runs or executes the computer program and/or module/unit stored in the memory 20, And calling the data stored in the memory 20 to realize various functions of the electronic device 1 . The memory 20 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program (such as a sound playback function, an image playback function, etc.) required by at least one function, etc.; The area can store data (such as audio data, phone book, etc.) created according to the use of the electronic device 1 . In addition, the memory 20 may include volatile and non-volatile memory, such as hard disk, memory, plug-in hard disk, smart memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash memory card (Flash Card), at least one disk memory component, flash memory device, or other memory components.

所述電子裝置1集成的模組/單元如果以軟體功能單元的形式實現並作為獨立的產品銷售或使用時,可以存儲在一個電腦可讀取存儲介質中。基於這樣的理解,本申請實現上述實施例方法中的全部或部分流程,也可以藉由電腦程式來指令相關的硬體來完成,所述的電腦程式可存儲於一電腦可讀存儲介質中,所述電腦程式在被處理器執行時,可實現上述各個方法實施例的步驟。其中,所述電腦程式包括電腦程式代碼,所述電腦程式代碼可以為原始程式碼形式、物件代碼形式、可執行檔或某些中間形式等。所述電腦可讀介質可以包括:能夠攜帶所述電腦程式代碼的任何實體或裝置、記錄介質、隨身碟、移動硬碟、磁碟、光碟、電腦記憶體、唯讀記憶體(ROM,Read-Only Memory)、隨機存取記憶體(RAM,Random Access Memory)。If the integrated modules/units of the electronic device 1 are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, all or part of the processes in the methods of the above embodiments of the present application can also be completed by instructing related hardware through computer programs, and the computer programs can be stored in a computer-readable storage medium. When the computer program is executed by the processor, it can realize the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code may be in the form of original code, object code, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read- Only Memory), Random Access Memory (RAM, Random Access Memory).

本申請提供的裸機部署方法、電子裝置及存儲介質可以根據裸機的硬體資訊自動對裸機進行系統部署,提高了裸機的部署效率,給裸機系統提供了彈性化設置。The bare metal deployment method, electronic device and storage medium provided in this application can automatically deploy the bare metal system according to the hardware information of the bare metal, which improves the deployment efficiency of the bare metal and provides flexible settings for the bare metal system.

對於本領域技術人員而言,顯然本申請不限於上述示範性實施例的細節,而且在不背離本申請的精神或基本特徵的情況下,能夠以其他的具體形式實現本申請。因此,無論從哪一點來看,均應將實施例看作是示範性的,而且是非限制性的,本申請的範圍由所附申請專利範圍而不是上述說明限定,因此旨在將落在申請專利範圍的等同要件的含義和範圍內的所有變化涵括在本申請內。不應將申請專利範圍中的任何附圖標記視為限制所涉及的申請專利範圍。此外,顯然“包括”一詞不排除其他單元或步驟,單數不排除複數。裝置申請專利範圍中陳述的多個單元或裝置也可以由同一個單元或裝置藉由軟體或者硬體來實現。第一,第二等詞語用來表示名稱,而並不表示任何特定的順序。It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, but that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application. Therefore, no matter from any point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present application is defined by the appended patent scope rather than the above description, so it is intended that the scope of the application shall be All changes within the meaning and range of equivalents of the patent claims are embraced in this application. Any reference sign in a claim should not be construed as limiting the claim involved. In addition, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or devices stated in the scope of patent application for devices can also be realized by the same unit or device through software or hardware. The words first, second, etc. are used to denote names and do not imply any particular order.

綜上所述,本發明符合發明專利要件,爰依法提出專利申請。惟,以上所述者僅為本發明之較佳實施方式,舉凡熟悉本案技藝之人士,於爰依本發明精神所作之等效修飾或變化,皆應涵蓋於以下之申請專利範圍內。In summary, the present invention meets the requirements of an invention patent, and a patent application is filed according to law. However, what is described above is only a preferred embodiment of the present invention, and all equivalent modifications or changes made by those who are familiar with the technology of the present invention according to the spirit of the present invention should be covered by the scope of the following patent application.

1:電子裝置 10:處理器 20:記憶體 30:電腦程式 2:裸機 201:電源控制器 202:記憶體 203:硬碟 204:CPU S201~S204:步驟 1: Electronic device 10: Processor 20: memory 30: Computer program 2: bare metal 201: Power controller 202: memory 203: hard disk 204:CPU S201~S204: steps

圖1是本申請較佳實施方式提供的裸機部署方法的應用環境架構示意圖。 圖2是本申請較佳實施方式提供的裸機部署方法的流程圖。 圖3是本申請較佳實施方式提供的電子裝置與裸機的交互示意圖。 圖4是本申請較佳實施方式提供的電子裝置的結構示意圖。 FIG. 1 is a schematic diagram of an application environment architecture of a bare-metal deployment method provided by a preferred embodiment of the present application. Fig. 2 is a flowchart of a bare metal deployment method provided by a preferred embodiment of the present application. Fig. 3 is a schematic diagram of the interaction between the electronic device and the bare metal provided in the preferred embodiment of the present application. Fig. 4 is a schematic structural diagram of an electronic device provided in a preferred embodiment of the present application.

S201~S204:步驟 S201~S204: steps

Claims (9)

一種裸機部署方法,其中,所述方法包括:開啟至少一待部署系統的裸機,給所述裸機分配IP位址;基於所述IP位址將部署鏡像下載至所述裸機,並基於所述部署鏡像獲取所述裸機的硬體資訊;根據預設的裸機部署策略及所述裸機的硬體資訊確定所述裸機需提供的服務,其中,所述預設的裸機部署策略包括裸機所包含的硬體類型或硬體屬性、所述裸機需提供的服務與系統鏡像設定檔之間的對應關係;根據所述裸機需提供的服務生成系統鏡像,並將所述系統鏡像發送至所述裸機,以供所述裸機進行系統部署。 A bare metal deployment method, wherein the method includes: starting at least one bare metal of a system to be deployed, assigning an IP address to the bare metal; downloading a deployment image to the bare metal based on the IP address, and Obtain the hardware information of the bare metal based on the deployment image; determine the services to be provided by the bare metal according to a preset bare metal deployment strategy and the hardware information of the bare metal, wherein the default bare metal The machine deployment strategy includes the hardware type or hardware attributes contained in the bare metal, the corresponding relationship between the services to be provided by the bare metal and the system image profile; generate a system image according to the services to be provided by the bare metal, and Sending the system image to the bare metal for system deployment on the bare metal. 如請求項1所述之裸機部署方法,其中,所述硬體資訊包括所述硬體類型及/或硬體屬性,所述根據預設的裸機部署策略及所述裸機的硬體資訊確定所述裸機需提供的服務包括:若所述裸機所包含的硬體類型至少包括AI加速晶片,根據所述預設的裸機部署策略確定與所述AI加速晶片對應的所述裸機需提供的服務至少包括深度學習的推理服務;若所述裸機所包含的硬體類型至少包括GPU,根據所述預設的裸機部署策略確定與所述GPU對應的所述裸機需提供的服務至少包括深度學習的訓練服務;若所述裸機所包含的硬體類型至少包括感測器,根據所述預設的裸機部署策略確定與所述感測器對應的所述裸機需提供的服務至少包括傳感資料獲取服務。 The bare metal deployment method according to claim 1, wherein the hardware information includes the hardware type and/or hardware attributes, the bare metal deployment strategy according to the default and the hardware of the bare metal Determining the services to be provided by the bare metal includes: if the hardware type included in the bare metal includes at least an AI acceleration chip, determining the corresponding AI acceleration chip according to the preset bare metal deployment strategy The services to be provided by the bare metal include at least inference services for deep learning; if the hardware type included in the bare metal includes at least a GPU, determine the bare metal corresponding to the GPU according to the preset bare metal deployment strategy The services to be provided include at least deep learning training services; if the hardware type contained in the bare metal includes at least sensors, determine the corresponding to the sensors according to the preset bare metal deployment strategy The services to be provided by the bare metal include at least the sensing data acquisition service. 如請求項1所述之裸機部署方法,其中,所述方法還包括:即時偵測已完成系統部署的所述裸機的硬體資訊是否發生改變; 在偵測到所述裸機的硬體資訊發生改變時,重新確定所述裸機需提供的服務;根據重新確定的所述裸機需提供的服務重新對所述裸機進行部署。 The bare metal deployment method as described in claim 1, wherein the method further includes: detecting in real time whether the hardware information of the bare metal that has completed system deployment has changed; When it is detected that the hardware information of the bare metal has changed, re-determine the services to be provided by the bare metal; redeploy the bare metal according to the re-determined services to be provided by the bare metal. 如請求項1所述之裸機部署方法,其中,所述開啟待部署系統的裸機,給所述裸機分配IP位址包括:藉由IPMI指令開啟所述待部署系統的裸機,基於DHCP服務獲得TFTP服務的IP位址,並將所述IP地址分配給所述裸機。 The bare metal deployment method as described in claim 1, wherein said enabling the bare metal of the system to be deployed, and assigning an IP address to the bare metal includes: enabling the bare metal of the system to be deployed by using an IPMI command, based on The DHCP service obtains the IP address of the TFTP service, and allocates the IP address to the bare metal. 如請求項1所述之裸機部署方法,其中,所述方法還包括:每隔預設時間偵測是否新增與電子裝置通訊連接的至少一個裸機;若偵測到新增與所述電子裝置通訊連接的所述至少一個裸機時,開啟所述至少一個裸機。 The bare-metal deployment method as described in claim 1, wherein the method further includes: detecting whether at least one bare-metal communication connection with the electronic device is added every preset time; When the electronic device is connected to the at least one bare metal in communication, the at least one bare metal is turned on. 如請求項1所述之裸機部署方法,其中,所述基於所述IP地址將部署鏡像下載至所述裸機,並基於所述部署鏡像獲取所述裸機的硬體資訊包括:將所述部署鏡像中的硬體資訊採集程式下載至所述裸機,控制所述裸機啟動所述硬體資訊採集程式以採集所述硬體資訊。 The bare metal deployment method according to claim 1, wherein the downloading the deployment image to the bare metal based on the IP address, and obtaining the hardware information of the bare metal based on the deployment image includes: downloading the The hardware information collection program in the deployment image is downloaded to the bare metal, and the bare metal is controlled to start the hardware information collection program to collect the hardware information. 如請求項1所述之裸機部署方法,其中,所述根據所述裸機需提供的服務生成系統鏡像包括:根據所述裸機需提供的服務生成服務設定檔;根據基礎設定檔及所述服務設定檔生成所述系統鏡像,其中,所述基礎設定檔至少包括內核、記憶體檔案系統及作業系統。 The bare metal deployment method according to claim 1, wherein said generating the system image according to the services to be provided by the bare metal includes: generating a service configuration file according to the services to be provided by the bare metal; The service configuration file generates the system image, wherein the basic configuration file at least includes a kernel, a memory file system and an operating system. 一種電子裝置,其中,所述電子裝置包括:處理器;以及 記憶體,所述記憶體中存儲有多個程式模組,所述多個程式模組由所述處理器載入並執行如請求項1至7中任一項所述之裸機部署方法。 An electronic device, wherein the electronic device includes: a processor; and A memory, wherein a plurality of program modules are stored in the memory, and the plurality of program modules are loaded by the processor to execute the bare-metal deployment method as described in any one of claims 1 to 7. 一種電腦可讀存儲介質,其上存儲有至少一條電腦指令,其中,所述指令由處理器載入並執行如請求項1至7中任一項所述之裸機部署方法。 A computer-readable storage medium, on which at least one computer instruction is stored, wherein the instruction is loaded by a processor to execute the bare-metal deployment method as described in any one of claims 1-7.
TW110129861A 2021-08-12 2021-08-12 Bare device deploying method, electronic device, and storage medium TWI786766B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110129861A TWI786766B (en) 2021-08-12 2021-08-12 Bare device deploying method, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110129861A TWI786766B (en) 2021-08-12 2021-08-12 Bare device deploying method, electronic device, and storage medium

Publications (2)

Publication Number Publication Date
TWI786766B true TWI786766B (en) 2022-12-11
TW202308355A TW202308355A (en) 2023-02-16

Family

ID=85794908

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110129861A TWI786766B (en) 2021-08-12 2021-08-12 Bare device deploying method, electronic device, and storage medium

Country Status (1)

Country Link
TW (1) TWI786766B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103944768A (en) * 2009-03-30 2014-07-23 亚马逊技术有限公司 Providing logical networking functionality for managed computer networks
CN109684032A (en) * 2018-12-04 2019-04-26 武汉烽火信息集成技术有限公司 The OpenStack virtual machine High Availabitity calculate node device and management method of anti-fissure

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103944768A (en) * 2009-03-30 2014-07-23 亚马逊技术有限公司 Providing logical networking functionality for managed computer networks
CN109684032A (en) * 2018-12-04 2019-04-26 武汉烽火信息集成技术有限公司 The OpenStack virtual machine High Availabitity calculate node device and management method of anti-fissure

Also Published As

Publication number Publication date
TW202308355A (en) 2023-02-16

Similar Documents

Publication Publication Date Title
JP3759001B2 (en) How to override a network boot
US9418367B2 (en) Context-aware code provisioning for mobile devices
US10686755B2 (en) Assigning IP addresses and configuration parameters in hyper-converged infrastructure
CN110908753B (en) Intelligent fusion cloud desktop server, client and system
WO2021227999A1 (en) Cloud computing service system and method
CN104572372A (en) System and method for building server performance testing environment
CN106549789B (en) Method and system for realizing server installation
CN107038046B (en) Method and device for upgrading audio playing system and terminal
CN106873970B (en) Installation method and device of operating system
US20240111549A1 (en) Method and apparatus for constructing android running environment
CN111901177A (en) Bare metal server network configuration method, system and related equipment
CN105183529A (en) Method for refreshing server firmware, target server, source server and system
CN113282342A (en) Deployment method, device, system, electronic equipment and readable storage medium
JP2023051930A (en) Terminal application activation method, apparatus and system
CN105183528A (en) Server bios upgrading method and system
CN114222003A (en) Service calling method, system, device, equipment and storage medium
TWI786766B (en) Bare device deploying method, electronic device, and storage medium
CN111654539B (en) Cloud-protogenesis-based Internet of things operating system construction method and system and electronic equipment
CN115333933B (en) Automatic management method, medium and equipment for servers on machine room
CN111163167A (en) System installation method and device
CN114726905B (en) Method, device, equipment and storage medium for accessing Tbox network into Android system
CN116578316A (en) Firmware updating method, device, server and storage medium of equipment
CN114020344B (en) Bus resource reservation method, device, equipment and storage medium
CN113076171B (en) Virtual machine installation method and device
CN114363254A (en) Tenant isolation method and device and electronic equipment