[go: up one dir, main page]

CN111182033B - Method and equipment for restoring switch - Google Patents

Method and equipment for restoring switch Download PDF

Info

Publication number
CN111182033B
CN111182033B CN201911251232.3A CN201911251232A CN111182033B CN 111182033 B CN111182033 B CN 111182033B CN 201911251232 A CN201911251232 A CN 201911251232A CN 111182033 B CN111182033 B CN 111182033B
Authority
CN
China
Prior art keywords
configuration file
switch
bmc
response
time
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.)
Active
Application number
CN201911251232.3A
Other languages
Chinese (zh)
Other versions
CN111182033A (en
Inventor
张锡鑫
潘洁红
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201911251232.3A priority Critical patent/CN111182033B/en
Publication of CN111182033A publication Critical patent/CN111182033A/en
Application granted granted Critical
Publication of CN111182033B publication Critical patent/CN111182033B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0659Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities
    • H04L41/0661Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities by reconfiguring faulty entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/085Retrieval of network configuration; Tracking network configuration history
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0893Assignment of logical groups to network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Retry When Errors Occur (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明提供了一种交换机还原的方法和设备,包括以下步骤:交换机在备份配置文件时判断是否启动BMC备份;响应于启动BMC备份,将配置文件保存到交换机的同时传输至BMC中;BMC每隔阈值时间检查交换机中保存的配置文件是否发生变动;响应于发生变动,BMC将发生变动的配置文件复制到BMC中;响应于交换机重新安装或更新网络操作系统后第一次启动,交换机从BMC中获取最新保存的配置文件以完成交换机的还原。通过使用本发明的方法,能够减少故障后恢复业务所需的时间与人力,提高了数据中心白盒交换机备份便利性、灵活性以及整体运行的可靠性。

Figure 201911251232

The present invention provides a method and equipment for restoring a switch, comprising the following steps: when the switch backs up a configuration file, judging whether to start the BMC backup; in response to starting the BMC backup, the configuration file is saved to the switch and transmitted to the BMC at the same time; Check whether the configuration file saved in the switch is changed at a threshold time; in response to the change, the BMC copies the changed configuration file to the BMC; in response to the switch being restarted for the first time after reinstalling or updating the network operating system, the switch will to obtain the latest saved configuration file to complete the restore of the switch. By using the method of the present invention, the time and manpower required for business recovery after failure can be reduced, and the backup convenience, flexibility and overall operation reliability of the white box switch of the data center are improved.

Figure 201911251232

Description

一种交换机还原的方法和设备A method and device for restoring a switch

技术领域technical field

本领域涉及计算机领域,并且更具体地涉及一种交换机还原的方法和设备。The field relates to the field of computers, and more particularly to a method and device for restoring a switch.

背景技术Background technique

白盒交换机具有解耦软件的功能,可降低成本、提高使用灵活性,为厂商专门的需求构建不同的组建和模块,受到了诸多厂商及数据中心的欢迎。白牌交换机最大的亮点是其强大的开放性,因此,白牌交换机在操作系统、软件等方面都有更为丰富的选择。The white box switch has the function of decoupling software, which can reduce costs and improve the flexibility of use. It can build different components and modules for the specific needs of manufacturers, and is welcomed by many manufacturers and data centers. The biggest highlight of the white-brand switch is its strong openness. Therefore, the white-brand switch has more choices in terms of operating systems and software.

随着SONiC(Software for Open Network in the Cloud,用于云中的开放网络的软件)系统的日趋成熟,在互联网行业应用也越来越多,SONIC+白盒交换机的方式为将来数据中心主流接入交换机的发展提供了更多的可能性。由于SONIC系统本身是开源软件,而且发展历程较短,现在还存在各种各样的问题。With the maturing of SONiC (Software for Open Network in the Cloud) system and more and more applications in the Internet industry, SONIC+white box switch will be the mainstream access for future data centers The development of switches offers more possibilities. Since the SONIC system itself is open source software and has a short development history, there are still various problems.

BMC(基板管理控制器)是一种独立于交换机中其他部分(如BIOS,CPU+硬盘)的管理器,可通过IPMI工具实现对交换机各器件工作状态、电源、传感器、日志等进行管理,一般用于提高交换机工作的可靠性。由于BMC独立于交换机系统运行,因此系统的故障不会影响BMC的正常运行,因此适合用于备份系统配置文件。BMC (Baseboard Management Controller) is a manager that is independent of other parts of the switch (such as BIOS, CPU + hard disk), and can manage the working status, power supply, sensors, logs, etc. of each device of the switch through IPMI tools. To improve the reliability of switch operation. Since the BMC operates independently of the switch system, the failure of the system will not affect the normal operation of the BMC, so it is suitable for backing up system configuration files.

在数据中心交换机的正常工作过程中,有时需要对安装的SONiC系统进行更新,当SONiC系统工作不正常时也需要对系统进行重新安装的操作。而目前SONiC系统使用数据库配置文件(如config_db文件)实现各种功能的配置及配置后的保存,每次交换机重启时SONiC会通过重新加载数据库配置文件以实现配置的重新恢复。当前若SONiC系统进行更新或重新安装的操作,该配置文件将会被还原,之前的功能配置也随之丢失,造成使用上的不便,甚至可能引起交换机业务中断。During the normal operation of the data center switch, the installed SONiC system sometimes needs to be updated, and when the SONiC system does not work normally, the system also needs to be re-installed. At present, the SONiC system uses database configuration files (such as the config_db file) to configure and save various functions. Every time the switch restarts, SONiC will reload the database configuration file to restore the configuration. If the SONiC system is currently updated or re-installed, the configuration file will be restored, and the previous functional configuration will be lost, causing inconvenience in use, and may even cause switch service interruption.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本发明实施例的目的在于提出一种交换机还原的方法和设备,能够减少故障后恢复业务所需的时间与人力,提高了数据中心白盒交换机备份便利性、灵活性以及整体运行的可靠性。In view of this, the purpose of the embodiments of the present invention is to provide a method and device for restoring a switch, which can reduce the time and manpower required to restore services after a fault, and improve the convenience, flexibility, and overall operation of a data center white-box switch backup. reliability.

基于上述目的,本发明的实施例的一个方面提供了一种交换机还原的方法,包括以下步骤:Based on the above purpose, an aspect of the embodiments of the present invention provides a method for restoring a switch, including the following steps:

交换机在备份配置文件时判断是否启动BMC备份;The switch judges whether to start BMC backup when backing up the configuration file;

响应于启动BMC备份,将配置文件保存到交换机的同时传输至BMC中;In response to starting the BMC backup, the configuration file is saved to the switch and transferred to the BMC at the same time;

BMC每隔阈值时间检查交换机中保存的配置文件是否发生变动;BMC checks whether the configuration file saved in the switch has changed every threshold time;

响应于发生变动,BMC将发生变动的配置文件复制到BMC中;In response to the change, the BMC copies the changed configuration file to the BMC;

响应于交换机重新安装或更新网络操作系统后第一次启动,交换机从BMC中获取最新保存的配置文件以完成交换机的还原。In response to the switch being powered on for the first time after reinstalling or updating the network operating system, the switch obtains the latest saved configuration file from the BMC to complete the restoration of the switch.

根据本发明的一个实施例,将配置文件保存到交换机的同时传输至BMC中包括:According to an embodiment of the present invention, saving the configuration file to the switch and simultaneously transmitting it to the BMC includes:

判断BMC闪存中用于存储交换机的配置文件的空间是否能够存储本次要存储的配置文件;Determine whether the space used to store the configuration file of the switch in the BMC flash memory can store the configuration file to be stored this time;

响应于该空间不能够存储本次要存储的配置文件,删除最早存储的配置文件后将本次要存储的配置文件存入。In response to the space being unable to store the configuration file to be stored this time, the configuration file to be stored this time is stored after the earliest stored configuration file is deleted.

根据本发明的一个实施例,阈值时间与交换机备份的周期相同。According to an embodiment of the present invention, the threshold time is the same as the period of switch backup.

根据本发明的一个实施例,配置文件经由LPC总线、PCI总线和SPI总线中的一个或多个传输至BMC中。According to one embodiment of the present invention, the configuration file is transferred to the BMC via one or more of the LPC bus, the PCI bus and the SPI bus.

根据本发明的一个实施例,还包括:According to an embodiment of the present invention, it also includes:

BMC接收到配置文件后对配置文件进行校验;After the BMC receives the configuration file, it verifies the configuration file;

响应于校验失败,BMC向交换机发送指令以重新传输配置文。In response to the verification failure, the BMC sends an instruction to the switch to retransmit the configuration file.

本发明的实施例的另一个方面,还提供了一种交换机还原的设备,其特征在于,设备包括:Another aspect of the embodiments of the present invention further provides a switch restoration device, characterized in that the device includes:

至少一个处理器;和at least one processor; and

存储器,存储器存储有处理器可运行的程序代码,程序代码在被处理器运行时执行以下步骤:a memory, the memory stores program code executable by the processor, and the program code executes the following steps when executed by the processor:

交换机在备份配置文件时判断是否启动BMC备份;The switch judges whether to start BMC backup when backing up the configuration file;

响应于启动BMC备份,将配置文件保存到交换机的同时传输至BMC中;In response to starting the BMC backup, the configuration file is saved to the switch and transferred to the BMC at the same time;

BMC每隔阈值时间检查交换机中保存的配置文件是否发生变动;BMC checks whether the configuration file saved in the switch has changed every threshold time;

响应于发生变动,BMC将发生变动的配置文件复制到BMC中;In response to the change, the BMC copies the changed configuration file to the BMC;

响应于交换机重新安装或更新网络操作系统后第一次启动,交换机从BMC中获取最新保存的配置文件以完成交换机的还原。In response to the switch being powered on for the first time after reinstalling or updating the network operating system, the switch obtains the latest saved configuration file from the BMC to complete the restoration of the switch.

根据本发明的一个实施例,将配置文件保存到交换机的同时传输至BMC中包括:According to an embodiment of the present invention, saving the configuration file to the switch and simultaneously transmitting it to the BMC includes:

判断BMC闪存中用于存储交换机的配置文件的空间是否能够存储本次要存储的配置文件;Determine whether the space used to store the configuration file of the switch in the BMC flash memory can store the configuration file to be stored this time;

响应于该空间不能够存储本次要存储的配置文件,删除最早存储的配置文件后将本次要存储的配置文件存入。In response to the space being unable to store the configuration file to be stored this time, the configuration file to be stored this time is stored after the earliest stored configuration file is deleted.

根据本发明的一个实施例,阈值时间与交换机备份的周期相同。According to an embodiment of the present invention, the threshold time is the same as the period of switch backup.

根据本发明的一个实施例,配置文件经由LPC总线、PCI总线和SPI总线中的一个或多个传输至BMC中。According to one embodiment of the present invention, the configuration file is transferred to the BMC via one or more of the LPC bus, the PCI bus and the SPI bus.

根据本发明的一个实施例,程序代码在被处理器运行时还执行以下步骤:According to one embodiment of the present invention, the program code further performs the following steps when executed by the processor:

BMC接收到配置文件后对配置文件进行校验;After the BMC receives the configuration file, it verifies the configuration file;

响应于校验失败,BMC向交换机发送指令以重新传输配置文件。In response to the verification failure, the BMC sends an instruction to the switch to retransmit the configuration file.

本发明具有以下有益技术效果:本发明实施例提供的交换机还原的方法,通过在交换机在备份配置文件时判断是否启动BMC备份;响应于启动BMC备份,将配置文件保存到交换机的同时传输至BMC中;BMC每隔阈值时间检查交换机中保存的配置文件是否发生变动;响应于发生变动,BMC将发生变动的配置文件复制到BMC中;响应于交换机重新安装或更新网络操作系统后第一次启动,交换机从BMC中获取最新保存的配置文件以完成交换机的还原的技术方案,能够减少故障后恢复业务所需的时间与人力,提高了数据中心白盒交换机备份便利性、灵活性以及整体运行的可靠性。The present invention has the following beneficial technical effects: the method for restoring a switch provided by the embodiment of the present invention determines whether to start the BMC backup when the switch backs up the configuration file; in response to starting the BMC backup, the configuration file is saved to the switch and transmitted to the BMC at the same time Medium; BMC checks whether the configuration file saved in the switch has changed every threshold time; In response to the change, the BMC copies the changed configuration file to the BMC; In response to the switch restarting for the first time after reinstalling or updating the network operating system , the switch obtains the latest saved configuration file from the BMC to complete the restoration of the switch, which can reduce the time and manpower required to restore services after a fault, and improve the convenience, flexibility and overall operation of the data center white-box switch backup. reliability.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other embodiments can also be obtained according to these drawings without creative efforts.

图1为根据本发明一个实施例的交换机还原的方法的示意性流程图。FIG. 1 is a schematic flowchart of a method for restoring a switch according to an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明实施例进一步详细说明。In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention will be further described in detail below with reference to the specific embodiments and the accompanying drawings.

基于上述目的,本发明的实施例的第一个方面,提出了一种交换机还原的方法的一个实施例。图1示出的是该方法的示意性流程图。Based on the above objective, in the first aspect of the embodiments of the present invention, an embodiment of a method for restoring a switch is provided. Figure 1 shows a schematic flow chart of the method.

如图1中所示,该方法可以包括以下步骤:As shown in Figure 1, the method may include the following steps:

S1交换机在备份配置文件时判断是否启动BMC备份,可以在交换机中设置是否开启BMC备份的功能;The S1 switch determines whether to enable BMC backup when backing up the configuration file, and you can set whether to enable the BMC backup function in the switch;

S2响应于启动BMC备份,将配置文件保存到交换机的同时传输至BMC中,交换机数据库配置文件在保存到交换机的NVRAM(非易失性存储器,如硬盘)的同时,同时通过数据总线的方式传输给BMC,可以实现在BMC中备份交换机的作用;In response to starting the BMC backup, S2 saves the configuration file to the switch and transmits it to the BMC at the same time. The switch database configuration file is saved to the NVRAM (non-volatile memory, such as hard disk) of the switch and simultaneously transmitted through the data bus. For BMC, the role of backup switch in BMC can be realized;

S3BMC每隔阈值时间检查交换机中保存的配置文件是否发生变动,由于特殊原因,传输到BMC中的配置文件可能不成功,这时需要BMC定期检查交换机中备份文件是否发生变动,如果发生变动则将最新的配置文件复制到BMC中存储;S3BMC checks whether the configuration file saved in the switch has changed every threshold time. Due to special reasons, the configuration file transferred to the BMC may not be successful. In this case, the BMC needs to periodically check whether the backup file in the switch has changed. The latest configuration file is copied to the BMC for storage;

S4响应于发生变动,BMC将发生变动的配置文件复制到BMC中;In response to the change, S4 copies the changed configuration file to the BMC;

S5响应于交换机重新安装或更新网络操作系统后第一次启动,交换机从BMC中获取最新保存的配置文件以完成交换机的还原,网络操作系统进行更新或重新安装等操作,配置文件将会被还原导致交换机不能恢复到更新前的状态,造成使用上的不便,可能引起交换机业务中断,此时需要将BMC中备份的文件传输到交换机中以用于交换机的还原。S5 responds to the switch to start for the first time after reinstalling or updating the network operating system, the switch obtains the latest saved configuration file from the BMC to complete the restoration of the switch, and the network operating system is updated or reinstalled, and the configuration file will be restored. As a result, the switch cannot be restored to the state before the update, which causes inconvenience in use and may cause the service interruption of the switch. In this case, the files backed up in the BMC need to be transferred to the switch for the restoration of the switch.

本发明可应用于数据中心用白盒交换机NOS(网络操作系统)配置文件的备份以及重装或故障后的恢复,利用与NOS独立的BMC来保存NOS的配置文件,减少了故障后恢复业务所需的时间与人力,提高了数据中心白盒交换机备份便利性、灵活性以及整体运行的可靠性。The invention can be applied to the backup of the NOS (Network Operating System) configuration file of the white box switch used in the data center and the recovery after reinstallation or failure. The BMC independent from the NOS is used to save the configuration file of the NOS, which reduces the time required to restore the business after the failure. It takes time and manpower and improves the backup convenience, flexibility and overall reliability of the data center white box switch.

在本发明的一个优选实施例中,将配置文件保存到交换机的同时传输至BMC中包括:In a preferred embodiment of the present invention, saving the configuration file to the switch and transmitting it to the BMC at the same time includes:

判断BMC闪存中用于存储交换机的配置文件的空间是否能够存储本次要存储的配置文件;Determine whether the space used to store the configuration file of the switch in the BMC flash memory can store the configuration file to be stored this time;

响应于该空间不能够存储本次要存储的配置文件,删除最早存储的配置文件后将本次要存储的配置文件存入。BMC的FLASH(闪存)空间中可保存多份配置文件,以防止备份文件损坏,当配置文件的大小超出BMC FLASH限制时(默认为3份备份文件),新保存的配置文件会自动覆盖最旧的一份更新文件。In response to the space being unable to store the configuration file to be stored this time, the configuration file to be stored this time is stored after the earliest stored configuration file is deleted. Multiple configuration files can be saved in the FLASH (flash memory) space of BMC to prevent the backup file from being damaged. When the size of the configuration file exceeds the BMC FLASH limit (3 backup files by default), the newly saved configuration file will automatically overwrite the oldest configuration file. an update document.

在本发明的一个优选实施例中,阈值时间与交换机备份的周期相同,也可以设置成比交换机的备份周期短,在交换机下一次备份之前检测即可。In a preferred embodiment of the present invention, the threshold time is the same as the switch backup period, and can also be set to be shorter than the switch backup period, and can be detected before the switch next backs up.

在本发明的一个优选实施例中,配置文件经由LPC总线、PCI总线和SPI总线中的一个或多个传输至BMC中。In a preferred embodiment of the present invention, the configuration file is transmitted to the BMC via one or more of the LPC bus, the PCI bus and the SPI bus.

在本发明的一个优选实施例中,还包括:In a preferred embodiment of the present invention, it also includes:

BMC接收到配置文件后对配置文件进行校验;After the BMC receives the configuration file, it verifies the configuration file;

响应于校验失败,BMC向交换机发送指令以重新传输配置文件。该校验一般是用传输到BMC中的配置文件与同时存储到交换机中的配置文件进行对比,对比包括文件大小、文件类型、存储时间等。In response to the verification failure, the BMC sends an instruction to the switch to retransmit the configuration file. The verification generally compares the configuration file transmitted to the BMC with the configuration file stored in the switch at the same time. The comparison includes file size, file type, and storage time.

实施例Example

下面以常用的数据中心白盒交换机SONiC操作系统为例,SONiC操作系统与BMC可通过设置允许NOS配置文件保存功能的开启。当功能开启时,每次SONiC将现有配置保存入配置文件config_db时,SONiC会同时将config_db文件复制并通过数据传输总线将文件传输至BMC。BMC也会每隔一段时间对比config_db文件是否产生变动,产生变动也会自动将配置文件通过BMC备份。The following is an example of the SONiC operating system of a commonly used data center white box switch. The SONiC operating system and BMC can be set to allow the NOS configuration file saving function to be enabled. When the function is enabled, every time SONiC saves the existing configuration into the configuration file config_db, SONiC will copy the config_db file at the same time and transfer the file to the BMC through the data transfer bus. BMC will also compare whether the config_db file has changed from time to time, and the configuration file will be automatically backed up through BMC if there is a change.

若BMC允许进行NOS配置文件备份,则接收SONiC传输的配置文件并进行校验,否则SONiC将进行报错提示。校验完成后,BMC会确定本身FLASH的存储空间,若有足够的空间则将备份文件写入FLASH中,否则将替换掉FLASH中最旧的一份配置文件,默认最多可写入三份NOS配置文件。If the BMC allows NOS configuration file backup, it will receive the configuration file transmitted by SONiC and verify it; otherwise, SONiC will report an error message. After the verification is completed, the BMC will determine the storage space of its own FLASH. If there is enough space, the backup file will be written to the FLASH, otherwise the oldest configuration file in the FLASH will be replaced. By default, up to three NOS copies can be written. configuration file.

数据中心白盒交换机SONiC操作系统更新或者重新启动后,第一次启动时会首先向BMC发出传输备份配置文件config_db的请求,若BMC表示不允许保存配置文件或未备份,SONiC将加载自带的原配置文件config_db。如果BMC上保存有配置文件,BMC将首先验证配置文件的完好,之后若完好则将最新配置文件传输给SONiC,SONiC经过验证后加载该配置文件,以实现数据中心交换机配置的还原。若BMC中无完好文件,或SONiC验证不通过,则SONiC使用自带的配置文件加载配置。After the SONiC operating system of the data center white box switch is updated or restarted, it will first send a request to the BMC to transfer the backup configuration file config_db when it is started for the first time. The original configuration file config_db. If there is a configuration file saved on the BMC, the BMC will first verify that the configuration file is intact, and then transmit the latest configuration file to SONiC if it is intact, and the SONiC will load the configuration file after verification to restore the data center switch configuration. If there is no complete file in the BMC, or the SONiC verification fails, the SONiC uses the built-in configuration file to load the configuration.

通过本发明的技术方案,能够减少故障后恢复业务所需的时间与人力,提高了数据中心白盒交换机备份便利性、灵活性以及整体运行的可靠性。The technical solution of the present invention can reduce the time and manpower required for business recovery after failure, and improve the backup convenience, flexibility and overall operation reliability of the white box switch in the data center.

需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关硬件来完成,上述的程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,的存储介质可为磁碟、光盘、只读存储器(Read-Only Memory,ROM)或随机存取存储器(Random AccessMemory,RAM)等。上述计算机程序的实施例,可以达到与之对应的前述任意方法实施例相同或者相类似的效果。It should be noted that those of ordinary skill in the art can understand that all or part of the process in the method of the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it may include the flow of the embodiments of the above-mentioned methods. The storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM) or the like. The above computer program embodiments can achieve the same or similar effects as any of the foregoing method embodiments corresponding thereto.

此外,根据本发明实施例公开的方法还可以被实现为由CPU执行的计算机程序,该计算机程序可以存储在计算机可读存储介质中。在该计算机程序被CPU执行时,执行本发明实施例公开的方法中限定的上述功能。In addition, the methods disclosed according to the embodiments of the present invention may also be implemented as a computer program executed by the CPU, and the computer program may be stored in a computer-readable storage medium. When the computer program is executed by the CPU, the above-mentioned functions defined in the methods disclosed in the embodiments of the present invention are executed.

基于上述目的,本发明的实施例的第二个方面,提出了一种交换机还原的设备,其特征在于,设备包括:Based on the above purpose, in a second aspect of the embodiments of the present invention, a device for restoring a switch is provided, characterized in that the device includes:

至少一个处理器;和at least one processor; and

存储器,存储器存储有处理器可运行的程序代码,程序代码在被处理器运行时执行以下步骤:a memory, the memory stores program code executable by the processor, and the program code executes the following steps when executed by the processor:

交换机在备份配置文件时判断是否启动BMC备份;The switch judges whether to start BMC backup when backing up the configuration file;

响应于启动BMC备份,将配置文件保存到交换机的同时传输至BMC中;In response to starting the BMC backup, the configuration file is saved to the switch and transferred to the BMC at the same time;

BMC每隔阈值时间检查交换机中保存的配置文件是否发生变动;BMC checks whether the configuration file saved in the switch has changed every threshold time;

响应于发生变动,BMC将发生变动的配置文件复制到BMC中;In response to the change, the BMC copies the changed configuration file to the BMC;

响应于交换机重新安装或更新网络操作系统后第一次启动,交换机从BMC中获取最新保存的配置文件以完成交换机的还原。In response to the switch being powered on for the first time after reinstalling or updating the network operating system, the switch obtains the latest saved configuration file from the BMC to complete the restoration of the switch.

在本发明的一个优选实施例中,将配置文件保存到交换机的同时传输至BMC中包括:In a preferred embodiment of the present invention, saving the configuration file to the switch and transmitting it to the BMC at the same time includes:

判断BMC闪存中用于存储交换机的配置文件的空间是否能够存储本次要存储的配置文件;Determine whether the space used to store the configuration file of the switch in the BMC flash memory can store the configuration file to be stored this time;

响应于该空间不能够存储本次要存储的配置文件,删除最早存储的配置文件后将本次要存储的配置文件存入。In response to the space being unable to store the configuration file to be stored this time, the configuration file to be stored this time is stored after the earliest stored configuration file is deleted.

在本发明的一个优选实施例中,阈值时间与交换机备份的周期相同。In a preferred embodiment of the present invention, the threshold time is the same as the period of switch backup.

在本发明的一个优选实施例中,配置文件经由LPC总线、PCI总线和SPI总线中的一个或多个传输至BMC中。In a preferred embodiment of the present invention, the configuration file is transmitted to the BMC via one or more of the LPC bus, the PCI bus and the SPI bus.

在本发明的一个优选实施例中,程序代码在被处理器运行时还执行以下步骤:In a preferred embodiment of the present invention, the program code also performs the following steps when being run by the processor:

BMC接收到配置文件后对配置文件进行校验;After the BMC receives the configuration file, it verifies the configuration file;

响应于校验失败,BMC向交换机发送指令以重新传输配置文件。In response to the verification failure, the BMC sends an instruction to the switch to retransmit the configuration file.

需要特别指出的是,上述系统的实施例采用了上述方法的实施例来具体说明各模块的工作过程,本领域技术人员能够很容易想到,将这些模块应用到上述方法的其他实施例中。It should be particularly pointed out that the embodiments of the above system use the embodiments of the above method to specifically describe the working process of each module, and those skilled in the art can easily think of applying these modules to other embodiments of the above method.

此外,上述方法步骤以及系统单元或模块也可以利用控制器以及用于存储使得控制器实现上述步骤或单元或模块功能的计算机程序的计算机可读存储介质实现。In addition, the above-mentioned method steps and system units or modules can also be implemented by using a controller and a computer-readable storage medium for storing a computer program that enables the controller to implement the functions of the above-mentioned steps or units or modules.

本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。为了清楚地说明硬件和软件的这种可互换性,已经就各种示意性组件、方块、模块、电路和步骤的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于具体应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种具体应用以各种方式来实现的功能,但是这种实现决定不应被解释为导致脱离本发明实施例公开的范围。Those skilled in the art will also appreciate that the various exemplary logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends on the specific application and design constraints imposed on the overall system. Those skilled in the art may implement the functions in various ways for each specific application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.

上述实施例,特别是任何“优选”实施例是实现的可能示例,并且仅为了清楚地理解本发明的原理而提出。可以在不脱离本文所描述的技术的精神和原理的情况下对上述实施例进行许多变化和修改。所有修改旨在被包括在本公开的范围内并且由所附权利要求保护。The above-described embodiments, particularly any "preferred" embodiments, are possible examples of implementations, and are presented merely for a clear understanding of the principles of the invention. Numerous changes and modifications may be made to the above-described embodiments without departing from the spirit and principles of the technology described herein. All modifications are intended to be included within the scope of this disclosure and protected by the appended claims.

Claims (10)

1. A method for switch restoration, comprising the steps of:
the switch judges whether to start BMC backup when backing up the configuration file;
in response to initiating the BMC backup, transmitting the configuration file to the BMC while saving to the switch;
the BMC checks whether the configuration file stored in the switch changes every threshold time;
in response to a change, the BMC copying the changed configuration file into the BMC;
and responding to the first starting after the network operating system is reinstalled or updated by the switch, and the switch acquires the latest saved configuration file from the BMC to complete the restoration of the switch.
2. The method of claim 1, wherein saving the configuration file to the switch while transmitting to the BMC comprises:
judging whether the space for storing the configuration file of the switch in the BMC flash memory can store the configuration file to be stored at this time;
and in response to the space being incapable of storing the configuration file stored this time, deleting the configuration file stored earliest and then storing the configuration file stored this time.
3. The method of claim 1, wherein the threshold time is the same as a period of the switch backup.
4. The method of claim 1, wherein the configuration file is transmitted to the BMC via one or more of an LPC bus, a PCI bus, and an SPI bus.
5. The method of claim 1, further comprising:
after receiving the configuration file, the BMC checks the configuration file;
in response to a failure to verify, the BMC sends an instruction to the switch to re-transmit the configuration file.
6. An apparatus for switch restoration, the apparatus comprising:
at least one processor; and
a memory storing program code executable by the processor, the program code, when executed by the processor, performing the steps of:
the switch judges whether to start BMC backup when backing up the configuration file;
in response to initiating the BMC backup, transmitting the configuration file to the BMC while saving to the switch;
the BMC checks whether the configuration file stored in the switch changes every threshold time;
in response to a change, the BMC copying the changed configuration file into the BMC;
and responding to the first starting after the network operating system is reinstalled or updated by the switch, and the switch acquires the latest saved configuration file from the BMC to complete the restoration of the switch.
7. The device of claim 6, wherein the saving the configuration file to the switch while transmitting to the BMC comprises:
judging whether the space for storing the configuration file of the switch in the BMC flash memory can store the configuration file to be stored at this time;
and in response to the space being incapable of storing the configuration file stored this time, deleting the configuration file stored earliest and then storing the configuration file stored this time.
8. The apparatus of claim 6, wherein the threshold time is the same as a period of the switch backup.
9. The device of claim 6, wherein the configuration file is transmitted to the BMC via one or more of an LPC bus, a PCI bus, and an SPI bus.
10. The apparatus of claim 6, wherein the program code, when executed by the processor, further performs the steps of:
after receiving the configuration file, the BMC checks the configuration file;
in response to a failure to verify, the BMC sends an instruction to the switch to re-transmit the configuration file.
CN201911251232.3A 2019-12-09 2019-12-09 Method and equipment for restoring switch Active CN111182033B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911251232.3A CN111182033B (en) 2019-12-09 2019-12-09 Method and equipment for restoring switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911251232.3A CN111182033B (en) 2019-12-09 2019-12-09 Method and equipment for restoring switch

Publications (2)

Publication Number Publication Date
CN111182033A CN111182033A (en) 2020-05-19
CN111182033B true CN111182033B (en) 2022-05-17

Family

ID=70650160

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911251232.3A Active CN111182033B (en) 2019-12-09 2019-12-09 Method and equipment for restoring switch

Country Status (1)

Country Link
CN (1) CN111182033B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930430A (en) * 2020-07-09 2020-11-13 苏州浪潮智能科技有限公司 Backup method and system for BMC setting parameters based on Huffman coding
CN111683022B (en) * 2020-08-12 2020-11-27 广东省新一代通信与网络创新研究院 White box switch, method for upgrading forwarding function of white box switch and readable storage medium
CN112433769A (en) * 2020-11-05 2021-03-02 苏州浪潮智能科技有限公司 BMC starting method and device, computer equipment and storage medium
CN113612623B (en) * 2021-06-29 2022-10-25 苏州浪潮智能科技有限公司 A method and device for monitoring the configuration of a white box switch

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108845814A (en) * 2018-06-14 2018-11-20 郑州云海信息技术有限公司 A kind of guard method of firmware update, device and computer readable storage medium
CN109976816A (en) * 2019-03-25 2019-07-05 联想(北京)有限公司 Computer system configurations method and server
CN110008689A (en) * 2019-04-15 2019-07-12 苏州浪潮智能科技有限公司 A kind of BMC starting method, apparatus, equipment and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108845814A (en) * 2018-06-14 2018-11-20 郑州云海信息技术有限公司 A kind of guard method of firmware update, device and computer readable storage medium
CN109976816A (en) * 2019-03-25 2019-07-05 联想(北京)有限公司 Computer system configurations method and server
CN110008689A (en) * 2019-04-15 2019-07-12 苏州浪潮智能科技有限公司 A kind of BMC starting method, apparatus, equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN111182033A (en) 2020-05-19

Similar Documents

Publication Publication Date Title
CN111182033B (en) Method and equipment for restoring switch
US7484084B1 (en) Use of a baseboard management controller to facilitate installation of firmware in a processing system
CN107315656B (en) Multi-core embedded PLC software recovery method and PLC
US12265457B2 (en) Methods and systems for data resynchronization in a replication environment
CN111327467A (en) Server system, disaster recovery backup method thereof and related equipment
US8856592B2 (en) Mechanism to provide assured recovery for distributed application
CN106445577A (en) Update method, server system, and non-transitory computer-readable medium
US7657720B2 (en) Storage apparatus and method of managing data using the storage apparatus
TW201843583A (en) Method and computer system for automatically recovering the BIOS image file
CN106657167B (en) Management server, server cluster, and management method
US11429640B2 (en) Methods and systems for data resynchronization in a replication environment
CN112380062A (en) Method and system for rapidly recovering system for multiple times based on system backup point
US20180188969A1 (en) Server Management Method and Server
CN110865907B (en) Method and system for providing service redundancy between master server and slave server
US20240289243A1 (en) Server and control method therefor
CN113722155A (en) Data backup and repair method in distributed file system and related components
WO2017028375A1 (en) Version upgrading method and system
CN102891762B (en) The system and method for network data continuously
CN108737153A (en) Block chain disaster recovery and backup systems, method, server and computer readable storage medium
WO2015043155A1 (en) Method and device for network element backup and recovery based on command set
CN111209265A (en) Database switching method and terminal equipment
CN111090537B (en) Cluster starting method and device, electronic equipment and readable storage medium
CN114691304A (en) Method, device, equipment and medium for realizing high availability of cluster virtual machine
KR102033489B1 (en) Method and server for managing server cluster
CN111338847A (en) Server management method and system capable of automatically recovering and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant