CN116846761A - OpenBMC batch upgrading method, device, equipment and storage medium - Google Patents
OpenBMC batch upgrading method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN116846761A CN116846761A CN202310797027.7A CN202310797027A CN116846761A CN 116846761 A CN116846761 A CN 116846761A CN 202310797027 A CN202310797027 A CN 202310797027A CN 116846761 A CN116846761 A CN 116846761A
- Authority
- CN
- China
- Prior art keywords
- openbmc
- upgraded
- addresses
- current
- upgrade
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 67
- 230000015654 memory Effects 0.000 claims description 28
- 230000008569 process Effects 0.000 claims description 24
- 230000009471 action Effects 0.000 claims description 19
- 238000004891 communication Methods 0.000 claims description 6
- 239000000284 extract Substances 0.000 claims description 3
- 230000003993 interaction Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 238000001514 detection method Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 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/0803—Configuration setting
- H04L41/0813—Configuration setting characterised by the conditions triggering a change of settings
- H04L41/082—Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
-
- 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/0803—Configuration setting
- H04L41/084—Configuration by using pre-existing information, e.g. using templates or copying from other elements
- H04L41/0846—Configuration by using pre-existing information, e.g. using templates or copying from other elements based on copy from other elements
-
- 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
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Automation & Control Theory (AREA)
- Stored Programmes (AREA)
Abstract
The application relates to the technical field of version upgrading and discloses a method, a device, equipment and a storage medium for carrying out OpenBMC batch upgrading, wherein the method comprises the steps of obtaining IP addresses by reading documents which are stored with all IP addresses of the OpenBMC to be upgraded in advance, recording total number values of the IP addresses in the documents, sequentially and automatically transmitting the current IP addresses to a single upgrading tool, so that the single upgrading tool carries out version upgrading on the current OpenBMC to be upgraded corresponding to the current IP addresses until the number of times of transmitting the IP addresses to the single upgrading tool reaches the total number values, and can automatically and remotely upgrade the OpenBMC in a large scale, thereby reducing the labor and time cost required by upgrading the OpenBMC and improving the upgrading efficiency.
Description
Technical Field
The application relates to the technical field of version upgrading, in particular to an OpenBMC batch upgrading method, device, equipment and storage medium.
Background
In the related technology for upgrading a single OpenBMC, a new version of OpenBMC image file needs to be manually copied to a specified directory of a system corresponding to the OpenBMC to be upgraded, a ssh command is manually executed to log in the system of the OpenBMC to be upgraded, and a reboot restarting command is executed to complete the updating operation.
If a large number of OpenBMC versions wait for updating, a single OpenBMC upgrading operation is manually performed, so that time and labor cost are high, and manual operation efficiency is extremely low.
Disclosure of Invention
In view of the above, the application provides an OpenBMC batch upgrade method to solve the problems of high time consumption, high labor cost and low efficiency of manually performing a single OpenBMC upgrade operation.
In a first aspect, the present application provides an OpenBMC batch upgrade method, where the method includes: reading IP addresses in documents which prestore all IP addresses of the OpenBMC to be upgraded, and recording the total number value of the IP addresses; and sequentially transmitting the current IP address to a single upgrade tool, so that the single upgrade tool carries out version upgrade on the current OpenBMC to be upgraded corresponding to the current IP address until the number of times of transmitting the IP address to the single upgrade tool reaches the total number of the IP addresses.
According to the OpenBMC batch upgrading method provided by the application, through reading the documents of the IP addresses of all the OpenBMCs to be upgraded in advance, acquiring the IP addresses, recording the total number value of the IP addresses in the documents, sequentially and automatically transmitting the current IP addresses to the single upgrading tool, the single upgrading tool carries out version upgrading on the current OpenBMC to be upgraded corresponding to the current IP addresses until the number of times of transmitting the IP addresses to the single upgrading tool reaches the total number value, the OpenBMC batch automatic remote upgrading method can be realized, the labor and time cost required by the OpenBMC upgrading is reduced, and the upgrading efficiency is improved.
In an optional implementation manner, the documents pre-storing all IP addresses corresponding to the OpenBMC to be upgraded are obtained through the following steps: acquiring an IP address corresponding to the OpenBMC to be upgraded; and storing all IP addresses corresponding to the OpenBMC to be upgraded into a pre-created document.
According to the method, all the IP addresses corresponding to the OpenBMC to be updated are acquired first, all the IP addresses are stored in the document, data loss is prevented, and subsequent reading of the IP addresses of the OpenBMC to be updated is facilitated.
In an optional implementation manner, the storing, in a pre-created document, all IP addresses corresponding to the OpenBMC to be upgraded includes: and storing all IP addresses corresponding to the OpenBMC to be upgraded into a pre-created document based on a storage rule that each IP address is in a line independently.
According to the application, based on the storage rule that each IP address is formed into a line independently, all the IP addresses corresponding to the OpenBMC to be upgraded are stored in the pre-created document, the current IP addresses can be sequentially transmitted to the single upgrading tool from top to bottom according to the sequence of each line, the condition that the transmitted IP addresses are disordered with other IP addresses is avoided, and the accuracy and efficiency of data transmission are improved.
In an alternative embodiment, the total number of IP addresses is obtained by: and counting the number of lines occupied by all the IP addresses in the document, and taking the number of lines as the total number value of the IP addresses.
The application counts the number of lines occupied by all IP addresses in the document as the total number value of the IP addresses, thereby more conveniently and accurately counting the total number value of the IP addresses.
In an optional implementation manner, the single upgrade tool performs version upgrade on the current OpenBMC to be upgraded corresponding to the current IP address, including: the single upgrade tool deletes the know_hosts file in the local system; the single upgrade tool extracts a new version of OpenBMC image file from a local system; copying the OpenBMC image file of the new version to a specified path of the current OpenBMC to be upgraded corresponding to the current IP address by a single upgrade tool; the single upgrade tool remotely logs in the current OpenBMC system to be upgraded, and executes a system restarting command; a single upgrade tool remotely logs out the current OpenBMC system to be upgraded, so that the current OpenBMC to be upgraded detects whether the OpenBMC image file with the new version exists in the appointed path; if the OpenBMC image file with the new version exists in the appointed path, enabling the OpenBMC to be updated to update the version in the restarting process; and in the process of copying the OpenBMC image file of the new version to the OpenBMC to be upgraded to update the version in the restarting process by executing the single upgrade tool, the single upgrade tool records the action and the result of executing the action when the current OpenBMC to be upgraded is upgraded and stores the action and the result of executing the action in a log file named by the current IP address.
According to the application, the OpenBMC image file to be upgraded can be automatically copied to the appointed path of the OpenBMC system to be upgraded corresponding to the current IP address by calling the expect interaction script, and the system restarting command is automatically and remotely logged in to the OpenBMC system to be upgraded, so that the firmware version of the OpenBMC to be upgraded is updated in the restarting process.
The application deletes the know_hosts file in the local system in advance, because the public key of the accessed computer is stored in the know_hosts file, when a single upgrade tool needs to log in any computer, the password is prompted to be input, and when the password is input correctly, the login of the computer is successful, but the password needs to be wrong, the password also needs to be input again, even the password is reported wrong, and deleting the know_hosts file can prevent the single upgrade tool from logging in the OpenBMC to be upgraded currently, thereby saving the upgrade time.
The application stores the action and the execution result of the current OpenBMC to be upgraded in the log file named by the current IP address, can record the running process of the system, and can provide detailed information for rapidly positioning the problems in the running process of the system and the program debugging problems in the development process if abnormal information exists.
In an alternative embodiment, the know_hosts file, the new version of the OpenBMC image file, and the log file named by the IP address are stored under a unified path of the local system.
According to the application, all files needed by a single upgrade tool in an upgrade project are stored in the same path, so that the files can be quickly and conveniently extracted in the upgrade process, and the upgrade efficiency is improved.
In an alternative embodiment, the local system is a linux system.
In the embodiment of the application, the linux system is deployed with a ssh (Secure Shell Protocol ) remote communication environment for remotely logging in an OpenBMC system to be upgraded, and an expect tool is installed on the linux system, so that an interaction task can be automatically completed by calling the compiled expect script.
In a second aspect, the present application provides an OpenBMC batch upgrade apparatus, where the apparatus includes: the IP address reading module is used for reading the IP addresses in the documents which prestore the IP addresses of all the OpenBMCs to be upgraded and recording the total number value of the IP addresses; and the batch upgrading module is used for sequentially transmitting the current IP address to the single upgrading tool, so that the single upgrading tool carries out version upgrading on the current OpenBMC to be upgraded corresponding to the current IP address until the number of times of the IP address transmitted to the single upgrading tool reaches the total number value.
In a third aspect, the present application provides a computer device comprising: the OpenBMC batch upgrading method comprises a memory and a processor, wherein the memory and the processor are in communication connection, computer instructions are stored in the memory, and the processor executes the computer instructions, so that the OpenBMC batch upgrading method of the first aspect or any corresponding implementation mode is executed.
In a fourth aspect, the present application provides a computer readable storage medium, where computer instructions are stored on the computer readable storage medium, where the computer instructions are configured to cause a computer to execute the OpenBMC batch upgrade method according to the first aspect or any implementation manner corresponding to the first aspect.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present application, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an OpenBMC batch upgrade method according to an embodiment of the present application;
FIG. 2 is a flowchart of a method corresponding to an OpenBMC batch upgrade method according to an embodiment of the present application;
FIG. 3 is a flowchart of another OpenBMC batch upgrade method according to an embodiment of the present application;
FIG. 4 is a block diagram of an OpenBMC batch upgrade apparatus according to an embodiment of the present application;
fig. 5 is a schematic diagram of a hardware structure of a computer device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In the related technology for upgrading a single OpenBMC, a new version of OpenBMC image file needs to be manually copied to a specified directory of a system corresponding to the OpenBMC to be upgraded, a ssh command is manually executed to log in the system of the OpenBMC to be upgraded, and a reboot restarting command is executed to complete the updating operation.
If a large number of OpenBMC versions wait for updating, a single OpenBMC upgrading operation is manually performed, so that time and labor cost are high, and manual operation efficiency is extremely low.
The application provides a method, a device, equipment and a storage medium for batch upgrade of OpenBMC, which are characterized in that through reading documents which are pre-stored with IP addresses of all OpenBMCs to be upgraded, obtaining the IP addresses, recording total number values of the IP addresses in the documents, sequentially and automatically transmitting the current IP addresses to a single upgrade tool, the single upgrade tool carries out version upgrade on the current OpenBMC to be upgraded corresponding to the current IP addresses until the number of times of transmitting the IP addresses to the single upgrade tool reaches the total number values, the method for automatically and remotely upgrading the OpenBMC in a large scale is realized, the labor and time cost required for upgrading the OpenBMC is reduced, and the upgrade efficiency is improved.
According to an embodiment of the present application, an OpenBMC batch upgrade method embodiment is provided, and it should be noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order different from that illustrated herein.
In this embodiment, an OpenBMC batch upgrade method is provided, which may be used in a linux system, where the linux system has deployed an ssh (Secure Shell Protocol ) remote communication environment, is used to remotely log in to an OpenBMC system to be upgraded, and an expect tool has been installed on the linux system, and an interaction task may be automatically completed by calling the written expect script, such as automatically copying a new version of an OpenBMC firmware image file to a specified path of the OpenBMC system with a current IP address, which is merely used as an example. Fig. 1 is a flowchart of an OpenBMC batch upgrade method according to an embodiment of the present application, as shown in fig. 1, the flowchart includes the following steps:
step S101, reading IP addresses in a document which stores all IP addresses of the OpenBMC to be upgraded in advance, and recording the total number value of the IP addresses.
In the embodiment of the application, all IP addresses of the OpenBMC to be upgraded are stored in advance, the document can be named as OpenBMCIPAddr. Txt, only by way of example, a batch upgrading tool in a linux system reads and analyzes the IP addresses in the OpenBMCIPAddr. Txt document, after one IP address is read, the IP addresses can be stored in a cache corresponding to the batch upgrading tool, all the IP addresses are sequentially stored in the cache, the total number of the IP addresses can be recorded according to the read IP addresses or the stored times, only by way of example, the batch upgrading tool can read the IP addresses in the OpenBMCIPAddr. Txt document, the read times can be recorded, and after the batch upgrading is completed, all the IP addresses can be directly stored in the cache corresponding to the batch upgrading tool, only by way of example.
Step S102, the current IP address is sequentially transmitted to a single upgrade tool, so that the single upgrade tool carries out version upgrade on the current OpenBMC to be upgraded corresponding to the current IP address until the number of times of the IP address transmitted to the single upgrade tool reaches the total number value.
According to the embodiment of the application, a first IP address can be transferred to a single upgrade tool according to the sequence of the buffer memory, as shown in fig. 2, the single upgrade tool is called to upgrade the version of the current OpenBMC to be upgraded corresponding to the current IP address, when the OpenBMC corresponding to the first IP address is upgraded, the upgrade number is 1, after the single upgrade tool is upgraded, the upgrade number is added with 1, the current OpenBMC to be upgraded corresponding to the IP address is sequentially upgraded by taking as an example only, the size of the total number value of the upgrade number and the IP address is judged, if the upgrade number is smaller than or equal to the total number value of the IP address, the single upgrade tool continues the upgrade operation, if the upgrade number is larger than the total number value of the IP address, the single upgrade tool can preset the initial upgrade number to be 0, and after the single upgrade tool completes the upgrade, the upgrade number is added with 1 until the upgrade number is consistent with the total number value of the IP address, the upgrade operation is ended, and the single upgrade tool can be set by itself according to practical conditions.
According to the embodiment of the application, when the IP addresses are stored in the pre-created document, an index is created for each IP address according to the storage sequence of the IP addresses, the batch upgrading tool can firstly transmit the IP address corresponding to the first index to the single upgrading tool, so that the single upgrading tool carries out version upgrading on the current OpenBMC to be upgraded corresponding to the current IP address, after the single upgrading tool finishes upgrading, the batch upgrading tool sequentially transmits the IP address corresponding to the next index to the single upgrading tool according to the index, and when the corresponding index value in upgrading is consistent with the total number of the recorded IP addresses, the single upgrading tool can finish upgrading.
According to the OpenBMC batch upgrading method provided by the application, through reading the documents of the IP addresses of all the OpenBMCs to be upgraded in advance, acquiring the IP addresses, recording the total number value of the IP addresses in the documents, sequentially and automatically transmitting the current IP addresses to the single upgrading tool, the single upgrading tool carries out version upgrading on the current OpenBMC to be upgraded corresponding to the current IP addresses until the number of times of transmitting the IP addresses to the single upgrading tool reaches the total number value, the OpenBMC batch automatic remote upgrading method can be realized, the labor and time cost required by the OpenBMC upgrading is reduced, and the upgrading efficiency is improved.
According to an embodiment of the present application, an OpenBMC batch upgrade method embodiment is provided, and it should be noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order different from that illustrated herein.
In this embodiment, an OpenBMC batch upgrade method is provided, which may be used in the above-mentioned linux system, and fig. 3 is a flowchart of the OpenBMC batch upgrade method according to an embodiment of the present application, as shown in fig. 3, where the flowchart includes the following steps:
step S301, reads the IP addresses in the documents that prestore the IP addresses of all openbmcs to be upgraded, and records the total number of the IP addresses.
Specifically, the step S301 includes:
step S3011, obtaining an IP address corresponding to the OpenBMC to be upgraded.
Step S3012, storing all IP addresses corresponding to the OpenBMC to be upgraded in a pre-created document.
According to the embodiment of the application, instructions can be input into the ssh console to check the IP addresses corresponding to all OpenBMCs, the IP addresses corresponding to the OpenBMCs to be upgraded are extracted, a document can be created in the linux system in advance, and after the IP addresses corresponding to the OpenBMCs to be upgraded are acquired, all the IP addresses are stored in the created document.
According to the method and the device, the IP addresses corresponding to all the OpenBMCs to be upgraded are obtained in advance, all the IP addresses are stored in the document, data loss is prevented, and subsequent reading of the IP addresses of the OpenBMCs to be upgraded is facilitated.
In some optional embodiments, step S3012 includes:
and a step a1, based on a storage rule that each IP address is independently in a row, storing all IP addresses corresponding to the OpenBMC to be upgraded into a pre-created document.
The IP address storage rule of the embodiment of the application can be set according to the actual situation, and each IP address of the embodiment of the application is stored in a pre-created document by a rule of a single line, which is only used as an example.
According to the application, based on the storage rule that each IP address is formed into a line independently, all the IP addresses corresponding to the OpenBMC to be upgraded are stored in the pre-created document, the current IP addresses can be sequentially transmitted to the single upgrading tool from top to bottom according to the sequence of each line, the condition that the transmitted IP addresses are disordered with other IP addresses is avoided, and the accuracy and efficiency of data transmission are improved.
And a2, counting the number of lines occupied by all the IP addresses in the document, and taking the number of lines as the total number of the IP addresses.
According to the embodiment of the application, each IP address is stored in a pre-created document in a single line, so that the number of lines occupied by all the IP addresses in the document can be directly counted as the total number of the IP addresses.
The application counts the number of lines occupied by all IP addresses in the document as the total number value of the IP addresses, thereby more conveniently and accurately counting the total number value of the IP addresses.
Step S302, the current IP address is sequentially transmitted to a single upgrade tool, so that the single upgrade tool carries out version upgrade on the current OpenBMC to be upgraded corresponding to the current IP address until the number of times of the IP address transmitted to the single upgrade tool reaches the total number value.
Specifically, the step S302 includes:
in step S3021, the single upgrade tool deletes the know_hosts file in the local system.
Before the single upgrade tool of the embodiment of the application upgrades the current upgraded OpenBMC, the current IP address is input, and the know_hosts file in the local system can be deleted first, wherein the local system is a linux system.
The application deletes the know_hosts file in the local system in advance, because the public key of the accessed computer is stored in the know_hosts file, when a single upgrade tool needs to log in any computer, the password is prompted to be input, and when the password is input correctly, the login of the computer is successful, but the password needs to be wrong, the password also needs to be input again, even the password is reported wrong, and deleting the know_hosts file can prevent the single upgrade tool from logging in the OpenBMC to be upgraded currently, thereby saving the upgrade time.
In step S3022, the single upgrade tool extracts the new version of OpenBMC image file from the local system.
In the embodiment of the application, the OpenBMC image file of the new version is stored in advance under the same path of the linux system corresponding to the know_hosts file, and the Openbmc image file of the new version is extracted when the single upgrade tool performs upgrade operation.
In step S3023, the single upgrade tool copies the new version of the OpenBMC image file to the specified path of the current OpenBMC to be upgraded corresponding to the current IP address.
In the embodiment of the present application, as shown in fig. 2, a scp 2r.exp script in the same path may be called, and based on the user name and the password of the OpenBMC, the OpenBMC image file may be automatically copied to the specified path of the current OpenBMC to be upgraded corresponding to the remote current IP address, and the image file may be renamed to bmc-image, which is only used as an example.
In step S3024, the single upgrade tool remotely logs in to the OpenBMC system to be upgraded, and executes a system restart command.
In step S3025, the single upgrade tool remotely logs out the OpenBMC system to be upgraded, so that the OpenBMC to be upgraded detects whether the new version of the OpenBMC image file exists in the specified path.
Step S3026, if the new version of the OpenBMC image file exists in the specified path, enabling the OpenBMC to be updated to update the version in the restarting process.
In the embodiment of the application, as shown in fig. 2, a single upgrade tool invokes a bmc_reboot.exp script in the same path, can automatically log in to the current OpenBMC system to be upgraded remotely, execute a reboot (restart) command in the OpenBMC system, and then log out the current OpenBMC system automatically, at this time, the OpenBMC system will detect a bmc-image file in the restarting process, if the existence of the file is detected, the own burning tool software is invoked to update the firmware, if the existence of the file is not detected, it means that the single upgrade tool does not successfully put the OpenBMC image file of a new version in the specified path of the IP address, at this time, it can be judged whether to put in other paths, if the image file can be moved to the specified path, or the single upgrade tool can put the OpenBMC image file of the new version in the specified path again, which is merely used as an example.
According to the application, the OpenBMC image file to be upgraded can be automatically copied to the appointed path of the OpenBMC system to be upgraded corresponding to the current IP address by calling the expect interaction script, and the system restarting command is automatically and remotely logged in to the OpenBMC system to be upgraded, so that the firmware version of the OpenBMC to be upgraded is updated in the restarting process.
In step S3027, during executing the single upgrade tool to copy the new version of the OpenBMC image file to the OpenBMC to be upgraded to update the version in the restarting process, the single upgrade tool records the action and the result of executing the action when the current OpenBMC to be upgraded is upgraded, and stores the action and the result of executing the action in a log file named by the current IP address.
In the embodiment of the present application, as shown in fig. 2, in the process that a single upgrade tool copies a new version of OpenBMC image file to be upgraded to OpenBMC, the operation action and the execution result of the upgrade tool, such as whether the image file is copied to OpenBMC to be upgraded successfully, and may be stored in a log file named by the current IP address, or the operation action and the operation result of the process that the single upgrade tool calls a script to remotely log in to the OpenBMC system and execute a reboot command, such as whether the reboot command is executed successfully, or whether the operation result is logged in to OpenBMC system successfully, or the like, may also be stored in the log file named by the current IP address, which is merely taken as an example.
The application stores the action and the execution result of the current OpenBMC to be upgraded in the log file named by the current IP address, can record the running process of the system, and can provide detailed information for rapidly positioning the problems in the running process of the system and the program debugging problems in the development process if abnormal information exists.
Specifically, step S2027 includes:
and a step a1, storing the know_hosts file, the OpenBMC image file of the new version and the log file named by the IP address under a unified path of a local system.
In the embodiment of the application, the known_hosts file, the scpl2r.exp script, the OpenBMC image file of the new version, the bmc_reboot.exp script and the log file named by the IP address are all under a unified path in the linux system.
According to the application, all files needed by a single upgrade tool in an upgrade project are stored in the same path, so that the files can be quickly and conveniently extracted in the upgrade process, and the upgrade efficiency is improved.
The OpenBMC batch upgrading method provided by the embodiment of the application can be applied to any server room needing batch upgrading, and is not limited.
In this embodiment, an OpenBMC batch upgrade device is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, which are not described herein. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The embodiment provides an OpenBMC batch upgrade device, as shown in fig. 4, where the OpenBMC batch upgrade device includes:
the IP address reading module 401 is configured to read IP addresses in a document that stores all IP addresses of the OpenBMC to be upgraded in advance, and record the total number of the IP addresses.
And the batch upgrading module 402 is configured to sequentially transmit the current IP address to a single upgrading tool, so that the single upgrading tool performs version upgrading on the current OpenBMC to be upgraded corresponding to the current IP address until the number of times of the IP address transmitted to the single upgrading tool reaches the total number value.
According to the OpenBMC batch upgrading device, the documents of the IP addresses of all the OpenBMCs to be upgraded are read in advance, the IP addresses are obtained, the total number value of the IP addresses in the documents is recorded, the current IP addresses are sequentially and automatically transmitted to the single upgrading tool, so that the single upgrading tool carries out version upgrading on the current OpenBMC to be upgraded corresponding to the current IP addresses until the number of times of transmitting the IP addresses to the single upgrading tool reaches the total number value, the OpenBMC batch automatic remote upgrading method can be realized, the labor and time cost required by the OpenBMC upgrading is reduced, and the upgrading efficiency is improved.
In some alternative embodiments, batch upgrade module 402 includes:
and the file deleting unit is used for deleting the know_hosts file in the local system by the single upgrade tool.
The image file copying unit is used for copying the OpenBMC image file of the new version to the appointed path of the current OpenBMC to be updated corresponding to the current IP address by the single upgrading tool.
And the remote command execution unit is used for remotely logging in the current OpenBMC to be upgraded by the single upgrade tool and executing a system restarting command.
The file detection unit is used for remotely logging out the current OpenBMC system to be upgraded by the single upgrade tool, so that the current OpenBMC to be upgraded detects whether the OpenBMC image file with the new version exists in the appointed path.
The version updating unit is used for enabling the OpenBMC to be updated to update the version in the restarting process if the OpenBMC image file of the new version exists in the appointed path;
the log recording unit is used for recording the action and the execution result of the action when the current OpenBMC to be upgraded is upgraded by the single upgrade tool, and storing the action and the execution result in a log file named by the current IP address.
In some alternative embodiments, the know_hosts file, the new version of the OpenBMC image file, and the log file named by the IP address are maintained under a unified path of the local system.
In some alternative embodiments, the local system is a linux system.
In some alternative embodiments, the IP address reading module 401 includes:
the IP address acquisition unit is used for acquiring an IP address corresponding to the OpenBMC to be upgraded;
and the IP address storage unit is used for storing all the IP addresses corresponding to the OpenBMC to be upgraded into a pre-created document.
In some alternative embodiments, the IP address storage unit includes:
and the IP address storage subunit is used for storing all the IP addresses corresponding to the OpenBMC to be upgraded into a pre-created document based on the storage rule that each IP address is in a line independently.
In some alternative embodiments, the IP address reading module 401 includes:
and the total number value determining unit is used for counting the number of lines occupied by all the IP addresses in the document and taking the number of lines as the total number value of the IP addresses.
Further functional descriptions of the above respective modules and units are the same as those of the above corresponding embodiments, and are not repeated here.
The OpenBMC batch upgrade apparatus in this embodiment is presented in the form of functional units, where the units refer to ASIC (Application Specific Integrated Circuit ) circuits, processors and memories that execute one or more software or firmware programs, and/or other devices that may provide the above-described functionality.
The embodiment of the application also provides computer equipment, which is provided with the OpenBMC batch upgrading device shown in the figure 5.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a computer device according to an alternative embodiment of the present application, as shown in fig. 5, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are communicatively coupled to each other using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the computer device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple computer devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 10 is illustrated in fig. 5.
The processor 10 may be a central processor, a network processor, or a combination thereof. The processor 10 may further include a hardware chip, among others. The hardware chip may be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general-purpose array logic, or any combination thereof.
Wherein the memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform the methods shown in implementing the above embodiments.
The memory 20 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, memory 20 may optionally include memory located remotely from processor 10, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk, or solid state disk; the memory 20 may also comprise a combination of the above types of memories.
The computer device also includes a communication interface 30 for the computer device to communicate with other devices or communication networks.
The embodiments of the present application also provide a computer readable storage medium, and the method according to the embodiments of the present application described above may be implemented in hardware, firmware, or as a computer code which may be recorded on a storage medium, or as original stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored on such software process on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, a solid state disk or the like; further, the storage medium may also comprise a combination of memories of the kind described above. It will be appreciated that a computer, processor, microprocessor controller or programmable hardware includes a storage element that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the methods illustrated by the above embodiments.
Although the embodiments of the present application have been described with reference to the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the application, and such modifications and variations fall within the scope defined by the appended claims.
Claims (10)
1. The OpenBMC batch upgrading method is characterized by comprising the following steps of:
reading IP addresses in documents which prestore all IP addresses of the OpenBMC to be upgraded, and recording the total number value of the IP addresses;
and sequentially transmitting the current IP address to a single upgrade tool, so that the single upgrade tool carries out version upgrade on the current OpenBMC to be upgraded corresponding to the current IP address until the number of times of transmitting the IP address to the single upgrade tool reaches the total number value.
2. The OpenBMC batch upgrade method according to claim 1, wherein the documents pre-storing all IP addresses corresponding to the OpenBMC to be upgraded are obtained by:
acquiring an IP address corresponding to the OpenBMC to be upgraded;
and storing all IP addresses corresponding to the OpenBMC to be upgraded into a pre-created document.
3. The OpenBMC batch upgrade method according to claim 2, wherein storing IP addresses corresponding to all openbmcs to be upgraded in a pre-created document comprises:
and storing all IP addresses corresponding to the OpenBMC to be upgraded into a pre-created document based on a storage rule that each IP address is in a line independently.
4. The OpenBMC batch upgrade method of claim 3, wherein the total number of IP addresses is obtained by:
and counting the number of lines occupied by all the IP addresses in the document, and taking the number of lines as the total number value of the IP addresses.
5. The OpenBMC batch upgrade method according to claim 1, wherein the single upgrade tool performs version upgrade on a current OpenBMC to be upgraded corresponding to the current IP address, including:
the single upgrade tool deletes the know_hosts file in the local system;
the single upgrade tool extracts a new version of OpenBMC image file from a local system;
copying the OpenBMC image file of the new version to a specified path of the current OpenBMC to be upgraded corresponding to the current IP address by a single upgrade tool;
the single upgrade tool remotely logs in the current OpenBMC system to be upgraded, and executes a system restarting command;
a single upgrade tool remotely logs out the current OpenBMC system to be upgraded, and controls the current OpenBMC to be upgraded to detect whether the OpenBMC image file with the new version exists in the specified path;
if the OpenBMC image file with the new version exists in the specified path, controlling the OpenBMC to be updated to update the version in the restarting process;
and in the process of copying the OpenBMC image file of the new version to the OpenBMC to be upgraded to update the version in the restarting process by executing the single upgrade tool, the single upgrade tool records the action and the result of executing the action when the current OpenBMC to be upgraded is upgraded and stores the action and the result of executing the action in a log file named by the current IP address.
6. The OpenBMC batch upgrade method of claim 5, wherein the know_hosts file, the new version of the OpenBMC image file, and the log file named by the IP address are stored under a unified path of the local system.
7. The OpenBMC batch upgrade method of claim 6, wherein the local system is a linux system.
8. An OpenBMC batch upgrade apparatus, wherein the apparatus includes:
the IP address reading module is used for reading the IP addresses in the documents which prestore the IP addresses of all the OpenBMCs to be upgraded and recording the total number value of the IP addresses;
and the batch upgrading module is used for sequentially transmitting the current IP address to the single upgrading tool, so that the single upgrading tool carries out version upgrading on the current OpenBMC to be upgraded corresponding to the current IP address until the number of times of the IP address transmitted to the single upgrading tool reaches the total number value.
9. A computer device, comprising:
the system comprises a memory and a processor, wherein the memory and the processor are in communication connection, the memory stores computer instructions, and the processor executes the computer instructions, so that the OpenBMC batch upgrading method of any one of claims 1 to 7 is executed.
10. A computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the OpenBMC batch upgrade method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310797027.7A CN116846761A (en) | 2023-06-30 | 2023-06-30 | OpenBMC batch upgrading method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310797027.7A CN116846761A (en) | 2023-06-30 | 2023-06-30 | OpenBMC batch upgrading method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116846761A true CN116846761A (en) | 2023-10-03 |
Family
ID=88159347
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310797027.7A Pending CN116846761A (en) | 2023-06-30 | 2023-06-30 | OpenBMC batch upgrading method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116846761A (en) |
-
2023
- 2023-06-30 CN CN202310797027.7A patent/CN116846761A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8146060B2 (en) | Data processing system and method for execution of a test routine in connection with an operating system | |
US8037198B2 (en) | Firmware upgrade for thin clients using one or more servers | |
CN107171833B (en) | Method for realizing batch upgrading of BMC and BIOS of server through BMC | |
US6789215B1 (en) | System and method for remediating a computer | |
US10635428B2 (en) | System and method for in-service update of software | |
CN108431781B (en) | Self-diagnosis and automatic diagnostic data collection of device driver detected errors | |
CN110968477B (en) | Method, device and medium for acquiring backup BMC version information | |
CN110119280A (en) | The method and device of more firmware upgrades | |
CN114024853B (en) | Hardware information collection method and system of bare metal node and related components | |
CN113590595A (en) | Database multi-writing method and device and related equipment | |
CN113900693A (en) | Firmware upgrading method, device and system, electronic equipment and storage medium | |
CN108572847B (en) | Method for upgrading single chip microcomputer software version through USB port | |
CN114115917A (en) | Operating system installation method and device | |
US8464273B2 (en) | Information processing apparatus, information processing method, and computer-readable program | |
CN116846761A (en) | OpenBMC batch upgrading method, device, equipment and storage medium | |
CN116302738A (en) | Method, system, equipment and storage medium for testing chip | |
US20150331772A1 (en) | Methods for updating diagnostic tools on a hardware device and devices thereof | |
CN116244186A (en) | Operating system test management method and device and computing equipment | |
CN113821264A (en) | Operating system installation control method, installation control system and computing equipment | |
CN113553110A (en) | Automatic correction method, device and system for hardware baseline of server | |
CN114860336B (en) | System auditing mode implementation method based on PXE and electronic equipment | |
CN117591490A (en) | Audit log data processing method, audit log data processing device, audit log data processing equipment and storage medium | |
KR920003279B1 (en) | Method for loading os & nos in data processing device | |
CN118276903A (en) | Application programming interface API management method, device, equipment and medium | |
CN115576584A (en) | BIOS upgrading method and device, BMC and readable storage medium |
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 |