Server system version switching method, device, electronic device and storage medium

By using snapshot interfaces and switching target storage media in a server with a hyperconverged architecture, the problem of inefficient system version switching is solved, and efficient and secure system version switching and rollback are achieved.

CN114237695BActive Publication Date: 2025-05-13BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111572008.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-21
Publication Date
2025-05-13
Estimated Expiration
2041-12-21

AI Technical Summary

Technical Problem

When using a server with a hyperconverged architecture, the system version switching is inefficient and requires frequent environmental deployment, resulting in insufficient efficiency and security.

Method used

Through the snapshot interface and switching the target storage media, the installation and deployment operations of the operating system are removed, the characteristics of distributed storage are utilized, the operating system is protected using snapshot technology, and version switching or version rollback on multiple copies of data.

Benefits of technology

It improves the efficiency and security of system version switching, avoids frequent installation and deployment operations, and achieves rapid protection and rollback of the operating system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114237695B_ABST
    Figure CN114237695B_ABST
Patent Text Reader

Abstract

The present application provides a server system version switching method, device, electronic device and storage medium, which relates to the field of server control technology, creates a startup list and startup items, generates a target system image in a system pool, creates a snapshot interface for the target system image; clones a server system image for a server based on the target system image; sends a version switching instruction to the server, so that the server obtains the target system image corresponding to the specified system version from the system pool based on the snapshot interface, or sets the startup item corresponding to the specified system version as the default startup item based on the logical unit number in the startup list corresponding to the server; sends a restart instruction to the server, so that the system version is switched to the specified system version after the server is restarted. By adopting the method provided in the embodiment of the present application, the switching efficiency of the server system version can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of server control, and in particular to a server system version switching method, device, electronic device and storage medium. Background Art

[0002] Hyper Converged Infrastructure (HCI) means that the same set of unit equipment not only has computing, networking, storage and server virtualization resources and technologies, but also includes backup software, snapshot technology, deduplication, online data compression and other elements. Multiple sets of unit equipment can be aggregated through the network to achieve modular seamless horizontal expansion and form a unified resource pool. When using a server with a hyper-converged architecture, the environment needs to be deployed every time the system version is changed, so there is a problem of low efficiency in switching system versions. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a server system version switching method, device, electronic device and storage medium to improve the efficiency of system version switching.

[0004] In a first aspect, an embodiment of the present application provides a server system version switching method, which is applied to a management terminal. The method may include:

[0005] Creating a startup list and a startup item, setting a default startup item in the startup list, wherein the startup list corresponds to a server, and the startup item corresponds to a version of a system image;

[0006] Generate a target system image in a system pool, and create a snapshot interface for the target system image;

[0007] Based on the target system image, a server system image is cloned for the server, a logical unit number is configured for the server system image, and the logical unit number is injected into the startup list;

[0008] Sending a version switching instruction to the server, so that the server obtains the target system image corresponding to the specified system version from the system pool based on the snapshot interface, or sets the startup item corresponding to the specified system version as the default startup item in the startup list corresponding to the server based on the logical unit number;

[0009] A restart instruction is sent to the server to switch the system version to the specified system version after the server is restarted.

[0010] In the above implementation process, the installation and deployment operation of the operating system is removed through the snapshot interface and the switching of the target storage medium. By utilizing the characteristics of distributed storage, the snapshot technology is used to protect the operating system and version switching or version rollback can be performed on multiple copies of data, thereby improving the efficiency and security of system version switching.

[0011] Optionally, before creating a startup list and a startup item and setting a default startup item in the startup list, the method may further include:

[0012] Create mirror pools and system pools;

[0013] Generating a target system image in the system pool may include:

[0014] Export the system disk as the base image;

[0015] Convert the base image into an original format image and import it into the image pool;

[0016] The original format image is cloned from the image pool to the system pool in a complete clone manner to serve as the target system image.

[0017] In the above implementation process, by generating a target system image and creating a snapshot interface for the target system image, the server operating system can be protected to ensure the security of the operating system, and the server system can be rolled back through the snapshot. This makes it possible to use snapshot technology to protect the operating system system disk while allowing the operating system to roll back on multiple copies of data, thereby improving the efficiency of server version switching.

[0018] Optionally, the creating a startup list and a startup item, and setting a default startup item in the startup list may include:

[0019] Create a host group and add all servers to the host group;

[0020] Binding the host group to the startup list, creating the startup items in the startup list, each of the startup items being bound to a version of the system image;

[0021] A startup list corresponding to the physical address of the host network card is created in the transmission server, so that when the transmission server receives a download request, the startup list is provided to the server.

[0022] In the above implementation process, by setting the corresponding relationship between the startup list and the startup items and the host group and the system image, the corresponding version of the operating system can be automatically obtained from the startup list when the system version is updated, thereby realizing the switching of the server operating version.

[0023] Optionally, an embodiment of the present application provides a server system version switching method applied to a server, and the method may include:

[0024] receiving a version switching instruction, acquiring a target system image corresponding to the specified system version from a system pool based on a preset snapshot interface, or setting a startup item corresponding to the specified system version as a default startup item in a startup list corresponding to the server based on a logical unit number;

[0025] A restart instruction is received to switch the system version to the specified system version after restarting.

[0026] In the above implementation process, the installation and deployment operation of the operating system is removed through the snapshot interface and the switching of the target storage medium. By utilizing the characteristics of distributed storage, the snapshot technology is used to protect the operating system and version switching or version rollback can be performed on multiple copies of data, thereby improving the efficiency and security of system version switching.

[0027] Optionally, acquiring a target system image corresponding to a specified system version from a system pool based on a preset snapshot interface, or setting a startup item corresponding to the specified system version as a default startup item based on a logical unit number in a startup list corresponding to a server includes:

[0028] When the version number difference between the current system version and the specified system version is less than a preset difference, acquiring a target system image corresponding to the specified system version from a system pool based on a preset snapshot interface;

[0029] When the version number difference between the current system version and the specified system version is not less than a preset difference, in the startup list corresponding to the server, the startup item corresponding to the specified system version is set as the default startup item based on the logical unit number.

[0030] In the above implementation process, by generating a target system image and creating a snapshot interface for the target system image, the server operating system can be protected to ensure the security of the operating system, and the server system can be rolled back through the snapshot. This makes it possible to use snapshot technology to protect the operating system system disk while allowing the operating system to roll back on multiple copies of data, thereby improving the efficiency of server version switching.

[0031] Optionally, switching the system version to the specified system version after restarting may include:

[0032] Reloading the disk application service based on the restart instruction and obtaining protocol information from the management terminal;

[0033] Acquiring the startup list from a transmission server based on the protocol information;

[0034] Reading startup information from a target storage medium based on a default startup item in the startup list;

[0035] Starting the kernel of the server based on the startup information, and connecting with the target storage medium according to the kernel startup parameters;

[0036] Partition information, device information, root file system information and driver information are loaded from the target storage medium to switch the system version to the instruction system version.

[0037] In the above implementation process, by associating the startup information with the target storage medium, the system version is switched based on distributed storage and switching the target storage medium, which can avoid the need for frequent installation and deployment of multiple system versions in the hyper-converged testing scenario and improve the efficiency of system version switching.

[0038] In a second aspect, an embodiment of the present application provides a server system version switching device, which may include:

[0039] A creation module, used to create a startup list and a startup item, set a default startup item in the startup list, the startup list corresponds to a server, and the startup item corresponds to a version of a system image; and generate a target system image in a system pool, and create a snapshot interface for the target system image;

[0040] A configuration module, configured to clone a server system image for the server based on the target system image, configure a logical unit number for the server system image, and inject the logical unit number into the startup list;

[0041] an instruction sending module, configured to send a version switching instruction to the server, so that the server obtains the target system image corresponding to the specified system version from the system pool based on the snapshot interface, or sets the startup item corresponding to the specified system version as the default startup item based on the logical unit number in the startup list corresponding to the server; and sends a restart instruction to the server, so that the system version is switched to the specified system version after the server is restarted.

[0042] In the above implementation process, the installation and deployment operation of the operating system is removed through the snapshot interface and the switching of the target storage medium. By utilizing the characteristics of distributed storage, the snapshot technology is used to protect the operating system and version switching or version rollback can be performed on multiple copies of data, thereby improving the efficiency and security of system version switching.

[0043] Optionally, the server system version switching device may further include:

[0044] The storage pool creation module is used to create mirror pools and system pools.

[0045] Create modules that can be used to:

[0046] The system disk is exported as a base image; the base image is converted into an original format image and imported into the image pool; the original format image is cloned from the image pool to the system pool in a complete clone manner to serve as the target system image.

[0047] In the above implementation process, by generating a target system image and creating a snapshot interface for the target system image, the server operating system can be protected to ensure the security of the operating system, and the server system can be rolled back through the snapshot. This makes it possible to use snapshot technology to protect the operating system system disk while allowing the operating system to roll back on multiple copies of data, thereby improving the efficiency of server version switching.

[0048] Optionally, the create module can also be used to:

[0049] Create a host group and add all servers to the host group; bind the host group to the startup list, create the startup items in the startup list, and each startup item is bound to a version of the system image; create a startup list corresponding to the physical address of the host network card in the transmission server, so that when the transmission server receives a download request, the startup list is provided to the server.

[0050] In the above implementation process, by setting the corresponding relationship between the startup list and the startup items and the host group and the system image, the corresponding version of the operating system can be automatically obtained from the startup list when the system version is updated, thereby realizing the switching of the server operating version.

[0051] Optionally, an embodiment of the present application provides a server system version switching device applied to a server, and the device may include:

[0052] A first receiving module is configured to receive a version switching instruction, obtain a target system image corresponding to a specified system version from a system pool based on a preset snapshot interface, or set a startup item corresponding to the specified system version as a default startup item in a startup list corresponding to a server based on a logical unit number, the default startup item is set in the startup list, the startup list corresponds to one of the servers, the startup item corresponds to a system image of a version, the system pool includes a target system image, the server clones a server system image based on the target system image, the server system image corresponds to a logical unit number, and the logical unit number is set in the startup list;

[0053] The second receiving module is used to receive a restart instruction to switch the system version to the specified system version after restarting.

[0054] In the above implementation process, the installation and deployment operation of the operating system is removed through the snapshot interface and the switching of the target storage medium. By utilizing the characteristics of distributed storage, the snapshot technology is used to protect the operating system and version switching or version rollback can be performed on multiple copies of data, thereby improving the efficiency and security of system version switching.

[0055] Optionally, the first receiving module may be specifically configured to:

[0056] When the version number difference between the current system version and the specified system version is less than a preset difference, the target system image corresponding to the specified system version is obtained from the system pool based on the preset snapshot interface; when the version number difference between the current system version and the specified system version is not less than the preset difference, in the startup list corresponding to the server, the startup item corresponding to the specified system version is set as the default startup item based on the logical unit number.

[0057] In the above implementation process, by generating a target system image and creating a snapshot interface for the target system image, the server operating system can be protected to ensure the security of the operating system, and the server system can be rolled back through the snapshot. This makes it possible to use snapshot technology to protect the operating system system disk while allowing the operating system to roll back on multiple copies of data, thereby improving the efficiency of server version switching.

[0058] Optionally, the second receiving module may be specifically used for:

[0059] The boot list is obtained from the transmission server based on the protocol information; the boot information is read from the target storage medium based on the default boot item in the boot list; the kernel of the server is started based on the boot information, and connected to the target storage medium according to the kernel boot parameters; partition information, device information, root file system information and driver information are loaded from the target storage medium to switch the system version to the instruction system version.

[0060] In the above implementation process, by associating the startup information with the target storage medium, the system version is switched based on distributed storage and switching the target storage medium, which can avoid the need for frequent installation and deployment of multiple system versions in the hyper-converged testing scenario and improve the efficiency of system version switching.

[0061] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores program instructions, and when the processor reads and runs the program instructions, it executes the steps in any of the above implementation methods.

[0062] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions, and when the computer program instructions are read and executed by a processor, the steps in any of the above-mentioned implementation methods are executed. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0064] Figure 1 A schematic diagram of a system version switching method applied to a management terminal provided in an embodiment of the present application;

[0065] Figure 2 A schematic diagram of the steps for generating a target system image provided in an embodiment of the present application;

[0066] Figure 3 A schematic diagram of the steps for setting a startup list provided in an embodiment of the present application;

[0067] Figure 4 A flowchart of simultaneously switching system versions of multiple servers in a hyper-converged architecture provided in an embodiment of the present application;

[0068] Figure 5 A schematic diagram of the steps of a server system version switching method applied to a server provided in an embodiment of the present application;

[0069] Figure 6 A schematic diagram of the steps for switching a specified system version provided in an embodiment of the present application;

[0070] Figure 7 A schematic diagram of a server system version switching device provided in an embodiment of the present application;

[0071] Figure 8 A schematic diagram of a server system version switching device applied to a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0072] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram may represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart, can be implemented by a dedicated hardware-based system that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part.

[0073] During the research process, the applicant found that when switching versions or rolling back servers in a hyper-converged architecture, it is necessary to install the bare metal one-to-one and create an operating system image. When the number of servers is large, it takes a long time to deploy the server architecture. At the same time, when switching versions of the server, it is not possible to switch to different storage media. There is a problem that multiple system version switching in the hyper-converged testing scenario requires frequent installation environment deployment.

[0074] Therefore, the embodiment of the present application provides a method for managing terminal server system version switching, which removes the installation and deployment operation of the operating system by means of a snapshot interface and switching the target storage medium. Figure 1 , Figure 1 A schematic diagram of a system version switching method applied to a management terminal provided in an embodiment of the present application, wherein the system version switching method applied to a management terminal may include the following steps:

[0075] In step S11, a startup list and a startup item are created, a default startup item is set in the startup list, the startup list corresponds to a server, and the startup item corresponds to a version of a system image.

[0076] In step S12, a target system image is generated in the system pool, and a snapshot interface is created for the target system image.

[0077] In step S13, a server system image is cloned for the server based on the target system image, a logical unit number is configured for the server system image, and the logical unit number is injected into the startup list.

[0078] In step S14, a version switching instruction is sent to the server so that the server obtains the target system image corresponding to the specified system version from the system pool based on the snapshot interface, or sets the startup item corresponding to the specified system version as the default startup item in the startup list corresponding to the server based on the logical unit number.

[0079] In step S15, a restart instruction is sent to the server to switch the system version to the specified system version after the server is restarted.

[0080] Before creating the startup list and startup items, you need to build a management terminal, first install the Ceph block device cluster, create a mirror pool and a system (ISCSI) pool, install the tgt and tgt-rbd modules, configure DHCP and tftp, and finally compile IPxe.

[0081] Among them, the management terminal can be an electronic device with networking function, and the electronic device can be a configuration device of engineering equipment, a mobile phone, a tablet computer, a computer, a personal digital assistant, etc. Ceph is a new generation of free software distributed file system designed by Sage Weil of the University of California, Santa Cruz for doctoral dissertations. The underlying storage of the management terminal uses Ceph, thereby realizing functions such as block device storage, thin provisioning, full cloning, linked cloning, and snapshots. Both the mirror pool and the ISCSI pool are storage pools, and the storage can be virtualized by creating virtual hard disks, creating new volumes, and configuring ISCSI target servers. Tgt is used to configure the logical unit number (Logical Unit Number, LUN) of the system mirror. DHCP (Dynamic Host Configuration Protocol) is a network protocol for a local area network. It refers to a range of IP addresses controlled by the server, and the client can automatically obtain the IP address and subnet mask assigned by the server when logging in to the server. TFTP (Trivial File Transfer Protocol) is a protocol in the TCP / IP (Transmission Control Protocol / Internet Protocol) protocol family for simple file transfer between the client and the server, providing simple and low-cost file transfer services. IPXE is an extended version of PXE (Preboot eXecute Environment) and supports multiple acquisition methods such as HTTP. IPXE has more functions than PXR and provides a mechanism to start the computer using a network interface (Network Interface), so that the computer can start without relying on local data storage devices (such as hard disks) or locally installed operating systems.

[0082] For step S13, a hyper-converged operating system can be installed in a conventional manner, multipath and ISCSI (Internet Small Computer System Interface) kernel modules can be added, and a Linux U disk boot disk can be made, and the system disk can be exported as a qcow2 image using the qemu-img convert command. The qcow2 image is a system image corresponding to a boot item.

[0083] It can be seen that the embodiment of the present application removes the installation and deployment operations of the operating system through a snapshot interface and switching the target storage medium. By utilizing the characteristics of distributed storage, the snapshot technology is used to protect the operating system and version switching or version rollback can be performed on multiple copies of data, thereby improving the efficiency and security of system version switching.

[0084] In an optional embodiment, for step S12, the present application embodiment also provides an implementation method for generating a target system image, please refer to Figure 2 , Figure 2 The schematic diagram of the steps for generating a target system image provided in the embodiment of the present application, the process of generating a target system image may be:

[0085] In step S21, a mirror pool and a system pool are created.

[0086] In step S22, the system disk is exported as a basic image.

[0087] In step S23, the base image is converted into an original format image and imported into the image pool.

[0088] In step S24, the original format image is cloned from the image pool to the system pool in a complete clone manner to serve as the target system image.

[0089] The original format image may be a RAW format image. The base image may be converted into the original format image through the Rados command, and the original format image may be imported into the image pool to obtain a thinly provisioned image. A protection snapshot may be created for the image to ensure the security of the original format image.

[0090] It can be seen that the embodiment of the present application can protect the server operating system to ensure the security of the operating system by generating a target system image and creating a snapshot interface for the target system image, and can also roll back the server system through the snapshot. This makes it possible to use the snapshot technology to protect the operating system system disk while allowing the operating system to roll back on multiple copies of data, thereby improving the efficiency of server version switching.

[0091] Optionally, with respect to step S11, the present application embodiment provides an implementation method for setting a startup list, see Figure 3 , Figure 3 A schematic diagram of the steps for setting a startup list provided in an embodiment of the present application, the implementation method may include the following steps:

[0092] In step S31, a host group is created, and all servers are added to the host group.

[0093] In step S32, the host group is bound to the startup list, the startup items are created in the startup list, and each startup item is bound to a version of the system image.

[0094] In step S33, a startup list corresponding to the physical address of the host network card is created in the transmission server, so that when the transmission server receives a download request, the startup list is provided to the server.

[0095] For example, first add the out-of-band management IP, port, username, password and MAC address of the PXE network card of the hyper-converged server to test the connectivity of the out-of-band management, so as to centrally integrate and manage the network equipment, server equipment and power system through a dedicated management channel independent of the data network.

[0096] It can be seen that the embodiment of the present application can automatically obtain the corresponding version of the operating system from the startup list when the system version is updated by setting the correspondence between the startup list and the startup items and the host group and the system image, thereby realizing the switching of the server operating version.

[0097] For details, please see Figure 4 , Figure 4 A flowchart of simultaneously switching system versions of multiple servers in a hyper-converged architecture provided in an embodiment of the present application.

[0098] Among them, switching versions of multiple bare metal servers at the same time can be divided into four parts, namely, making images, configuring management terminals, starting hyper-converged servers, and version switching.

[0099] In image making, first install the hyper-converged operating system in the usual way, add multipath and ISCSI kernel modules, shut down the server and make a Linux USB boot disk, and use the qemu-img convert command to export the system disk into a qcow2 image.

[0100] In the configuration management terminal, first build the management terminal, install the Ceph block device cluster, create the image pool and ISCSI pool, install the tgt and tgt-rbd modules, configure DHCP and tftp, and finally compile IPxe. After the compilation is completed, based on the Rados command, convert the base image to a RAW format image and import it into the image pool as the target system image. Create a startup list corresponding to the host group and a startup item corresponding to the target system image. Use the target system image in the ISCSI pool as a linked clone to clone the image corresponding to the number of hyper-converged servers. The number of hyper-converged servers can be obtained through the startup item. Based on Tgt, configure all target system images as LUNs, mount these target system images by using rbd map, and inject LUN information into Grub. Finally, update the LUN information of the corresponding startup item in the startup list.

[0101] There are two types of switching in version switching, namely minor version switching and major version switching. Taking the initial system version as 1.5 as an example, switching the version to 1.51 is a minor version switch, and switching the version to 2.0 is a major version switch. The current minor version switch or major version switch can be determined based on the version number difference between the current system version and the specified system version. When it is a minor version switch, the management terminal sends a shutdown command to the server, and the server disconnects the iSCSI target connection; the management terminal rolls back the corresponding server image to the specified snapshot, reloads the iSCSI service; and starts the hyper-converged server startup step. When the startup step is completed, the version switch is completed.

[0102] When switching to a major version, the management terminal sends a shutdown command to the server, and the server disconnects the iSCSI target connection; the management terminal shuts down the iSCSI server and creates an iSCSI target using the corresponding image file; the iSCSI service is reloaded, and the hyper-converged server startup steps are started. When the startup steps are completed, the version switch is completed.

[0103] During the process of starting a hyper-converged server, the management terminal uses out-of-band management to switch the server boot mode to network boot; assigns a corresponding IP address to the server; and checks whether the LUN is ready and whether the boot list is ready.

[0104] There are multiple hyper-converged servers in a host group, and the startup process of multiple hyper-converged servers is the same. Take a single server as an example. Specifically, the management terminal sends a network boot setting instruction to the hyper-converged server, and the management terminal sends a power-on instruction to the server. Before initiating the power-on instruction, it will check the boot list startup item configuration and DHCP network IP allocation configuration, and inject kernel startup parameters into the corresponding image; boot and start booting from the network; the server network card enters PXE boot, and initiates a DHCP request to the management terminal to obtain an IP address; the management terminal determines that the client type is PXE and pushes the IPxe client, and sends a DHCPrespond packet to the server, carrying IP address information, subnet mask information, gateway information, routing information, mtu information, transmission server information, etc., where the transmission server can be a tftp server.

[0105] After the server obtains the IP, it downloads the IPXE client from the transmission server and runs the IPXE client; after the server runs the IPXE client, it re-obtains the network configuration and sends a DHCP request to the management terminal again; the management terminal determines that the client type is IPXE and pushes the IPxe startup script (startup list), sends a DHCP respond packet to the server, and carries the IP address information, subnet mask information, gateway information, routing information, mtu information, transmission server information, etc.; after the server IPXE obtains the IP, it downloads the IPXE startup script (startup list) from the transmission server. Each PXE network card has a fixed directory on the transmission server, and the corresponding IPXE startup script is downloaded according to the corresponding directory; after the server runs the IPXE startup script, it enters the startup list, which has one or more startup items, and there is only one default startup item, which enters the default startup item by default; the default startup item in the startup list records the corresponding ISCSI target device that this server needs to connect to. If there is no manual operation within 3 seconds, it will automatically enter the default startup item and connect to the corresponding ISCSI target; the server enters the default startup item, and the IPXE client initiates a connection request to ISCSI. After the connection is successful, it enters the sanboot stage; after the server enters the sanbbot stage, it will read the grub information from the ISCSItarget to obtain the partition information, boot information and kernel information; after the server loads the kernel from the ISCSI target into the memory, it disconnects the ISCSI connection and runs the kernel; after the server runs the kernel, it connects to the corresponding ISCSI target according to the kernel startup parameters; when the server kernel successfully connects to the ISCSI target, it will load partition, device, rootfs, driver and other information according to the startup parameters; when the server has loaded the rootfs, the ISCSI connection will continue to remain connected, and the kernel will officially enter the final operating system through chroot, thus completing the server version switch.

[0106] It can be seen that in the above implementation process, using linked cloning to clone images corresponding to the number of hyper-converged servers can save storage resources, protect the operating system through the snapshot interface, improve the security of the operating system, and remove the installation and deployment operations of the operating system through the snapshot interface and switching the target storage medium, which can improve the efficiency of server system version switching.

[0107] Based on the same inventive concept, the present application embodiment also provides a server system version switching method applied to the server, please refer to Figure 5 , Figure 5 A schematic diagram of the steps of a server system version switching method applied to a server provided in an embodiment of the present application, the method may include:

[0108] In step S51, a version switching instruction is received, and a target system image corresponding to a specified system version is obtained from a system pool based on a preset snapshot interface, or in a startup list corresponding to a server, a startup item corresponding to the specified system version is set as a default startup item based on a logical unit number, and the default startup item is set in the startup list, the startup list corresponds to one of the servers, the startup item corresponds to a version of a system image, the system pool contains a target system image, the server clones a server system image based on the target system image, the server system image corresponds to a logical unit number, and the logical unit number is set in the startup list.

[0109] In step S52, a restart instruction is received to switch the system version to the specified system version after restarting.

[0110] It can be seen that the embodiment of the present application removes the installation and deployment operations of the operating system through a snapshot interface and switching the target storage medium. By utilizing the characteristics of distributed storage, the snapshot technology is used to protect the operating system and version switching or version rollback can be performed on multiple copies of data, thereby improving the efficiency and security of system version switching.

[0111] Optionally, for step S52, when the version number difference between the current system version and the specified system version is less than a preset difference, a target system image corresponding to the specified system version is obtained from the system pool based on a preset snapshot interface; when the version number difference between the current system version and the specified system version is not less than a preset difference, in the startup list corresponding to the server, the startup item corresponding to the specified system version is set as the default startup item based on the logical unit number.

[0112] The specific steps of the server system version switching method applied to the server can refer to the implementation steps applied to the management terminal embodiment, which will not be repeated here.

[0113] It can be seen that the embodiment of the present application can protect the server operating system to ensure the security of the operating system by generating a target system image and creating a snapshot interface for the target system image, and can also roll back the server system through the snapshot. This makes it possible to use the snapshot technology to protect the operating system system disk while allowing the operating system to roll back on multiple copies of data, thereby improving the efficiency of server version switching.

[0114] In an optional embodiment, for step S52, the present application embodiment also provides an implementation method for switching the specified system version, please refer to Figure 6 , Figure 6 A schematic diagram of a step of switching a specified system version provided in an embodiment of the present application, wherein the method of switching the specified system version may include:

[0115] In step S61, the disk application service is reloaded based on the restart instruction, and protocol information is obtained from the management terminal.

[0116] In step S62, the startup list is obtained from the transmission server based on the protocol information.

[0117] In step S63, the startup information is read from the target storage medium based on the default startup item in the startup list.

[0118] In step S64, the kernel of the server is started based on the startup information, and connected to the target storage medium according to the kernel startup parameters.

[0119] In step S65, partition information, device information, root file system information and driver information are loaded from the target storage medium to switch the system version to the instruction system version.

[0120] It can be seen that the embodiment of the present application achieves switching of system versions based on distributed storage and switching of target storage media by associating startup information with the target storage medium, which can avoid the need for frequent installation and deployment of multiple system versions in a hyper-converged testing scenario and improve the efficiency of system version switching.

[0121] Based on the same inventive concept, the present application embodiment also provides a server system version switching device 70, please refer to Figure 7 , Figure 7 A schematic diagram of a server system version switching device provided in an embodiment of the present application, the server system version switching device 70 may include:

[0122] A creation module 71 is used to create a startup list and a startup item, set a default startup item in the startup list, the startup list corresponds to a server, and the startup item corresponds to a version of a system image; and generate a target system image in a system pool, and create a snapshot interface for the target system image;

[0123] The configuration module 72 is used to clone a server system image for the server based on the target system image, configure a logical unit number for the server system image, and inject the logical unit number into the startup list.

[0124] The instruction sending module 73 is used to send a version switching instruction to the server so that the server obtains the target system image corresponding to the specified system version from the system pool based on the snapshot interface, or sets the startup item corresponding to the specified system version as the default startup item based on the logical unit number in the startup list corresponding to the server; and sends a restart instruction to the server to switch the system version to the specified system version after the server is restarted.

[0125] Optionally, the server system version switching device 70 may further include:

[0126] The storage pool creation module is used to create mirror pools and system pools.

[0127] The creation module 71 may be used to:

[0128] The system disk is exported as a base image; the base image is converted into an original format image and imported into the image pool; the original format image is cloned from the image pool to the system pool in a complete clone manner to serve as the target system image.

[0129] Optionally, the creation module 71 may also be used to:

[0130] Create a host group and add all servers to the host group; bind the host group to the startup list, create the startup items in the startup list, and each startup item is bound to a version of the system image; create a startup list corresponding to the physical address of the host network card in the transmission server, so that when the transmission server receives a download request, the startup list is provided to the server.

[0131] Based on the same inventive concept, the present application embodiment also provides a server system version switching device 80, please refer to Figure 8 , Figure 8 A schematic diagram of a server system version switching device applied to a server provided in an embodiment of the present application, wherein the server system version switching device 80 may include:

[0132] The first receiving module 81 is used to receive a version switching instruction, obtain a target system image corresponding to the specified system version from a system pool based on a preset snapshot interface, or set the startup item corresponding to the specified system version as the default startup item based on the logical unit number in the startup list corresponding to the server.

[0133] The second receiving module 82 is used to receive a restart instruction to switch the system version to the specified system version after restarting.

[0134] Optionally, the first receiving module 81 may be specifically used for:

[0135] When the difference between the version numbers of the current system version and the specified system version is less than a preset difference, a target system image corresponding to the specified system version is obtained from a system pool based on a preset snapshot interface; when the difference between the version numbers of the current system version and the specified system version is not less than the preset difference, in a startup list corresponding to a server, a startup item corresponding to the specified system version is set as a default startup item based on a logical unit number, the default startup item is set in the startup list, the startup list corresponds to one of the servers, the startup item corresponds to a version of a system image, the system pool contains a target system image, the server clones a server system image based on the target system image, the server system image corresponds to a logical unit number, and the logical unit number is set in the startup list.

[0136] Optionally, the second receiving module 82 may be specifically configured to:

[0137] The boot list is obtained from the transmission server based on the protocol information; the boot information is read from the target storage medium based on the default boot item in the boot list; the kernel of the server is started based on the boot information, and connected to the target storage medium according to the kernel boot parameters; partition information, device information, root file system information and driver information are loaded from the target storage medium to switch the system version to the instruction system version.

[0138] Based on the same inventive concept, an embodiment of the present application further provides an electronic device, which includes a memory and a processor, wherein program instructions are stored in the memory, and when the processor reads and runs the program instructions, the steps in any of the above implementation methods are executed.

[0139] Based on the same inventive concept, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions, and when the computer program instructions are read and executed by a processor, the steps in any of the above implementation methods are executed.

[0140] The computer-readable storage medium may be a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or any other medium that can store program codes. The storage medium is used to store the program, and the processor executes the program after receiving the execution instruction. The method executed by the electronic terminal of the process definition disclosed in any embodiment of the present invention can be applied to the processor or implemented by the processor.

[0141] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0142] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0143] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0144] Alternatively, the present invention may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, the present invention may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part.

[0145] The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0146] In this article, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0147] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A server system version switching method, characterized in that: Applicable to management terminals, including: Creating a startup list and a startup item, setting a default startup item in the startup list, wherein the startup list corresponds to a server, and the startup item corresponds to a version of a system image; Generate a target system image in a system pool, and create a snapshot interface for the target system image; Based on the target system image, a server system image is cloned for the server, a logical unit number is configured for the server system image, and the logical unit number is injected into the startup list; Sending a version switching instruction to the server, so that the server obtains the target system image corresponding to the specified system version from the system pool based on the snapshot interface, or sets the startup item corresponding to the specified system version as the default startup item in the startup list corresponding to the server based on the logical unit number; A restart instruction is sent to the server to switch the system version to the specified system version after the server is restarted.

2. The method according to claim 1, characterized in that Before creating the startup list and the startup item and setting the default startup item in the startup list, the method further includes: Create mirror pools and system pools; Generating a target system image in the system pool includes: Export the system disk as the base image; Convert the base image into an original format image and import it into the image pool; The original format image is cloned from the image pool to the system pool in a complete clone manner to serve as the target system image.

3. The method according to claim 1, characterized in that: The step of creating a startup list and a startup item, and setting a default startup item in the startup list comprises: Create a host group and add all servers to the host group; Binding the host group to the startup list, creating the startup items in the startup list, each of the startup items being bound to a version of the system image; A startup list corresponding to the physical address of the host network card is created in the transmission server, so that when the transmission server receives a download request, the startup list is provided to the server.

4. A server system version switching method, characterized in that: Applicable to servers, including: receiving a version switching instruction, acquiring a target system image corresponding to a specified system version from a system pool based on a preset snapshot interface, or setting a startup item corresponding to the specified system version as a default startup item in a startup list corresponding to a server based on a logical unit number, wherein the default startup item is set in the startup list, the startup list corresponds to one of the servers, the startup item corresponds to a system image of a version, the system pool includes a target system image, the server clones a server system image based on the target system image, the server system image corresponds to a logical unit number, and the logical unit number is set in the startup list; A restart instruction is received to switch the system version to the specified system version after restarting.

5. The method according to claim 4, characterized in that The step of acquiring a target system image corresponding to a specified system version from a system pool based on a preset snapshot interface, or setting a startup item corresponding to the specified system version as a default startup item based on a logical unit number in a startup list corresponding to a server includes: When the version number difference between the current system version and the specified system version is less than a preset difference, acquiring a target system image corresponding to the specified system version from a system pool based on a preset snapshot interface; When the version number difference between the current system version and the specified system version is not less than a preset difference, in the startup list corresponding to the server, the startup item corresponding to the specified system version is set as the default startup item based on the logical unit number.

6. The method according to claim 4, characterized in that The step of switching the system version to the specified system version after restarting includes: Reloading the disk application service based on the restart instruction and obtaining protocol information from the management terminal; Acquiring the startup list from a transmission server based on the protocol information; Reading startup information from a target storage medium based on a default startup item in the startup list; Starting the kernel of the server based on the startup information, and connecting with the target storage medium according to the kernel startup parameters; Partition information, device information, root file system information and driver information are loaded from the target storage medium to switch the system version to the instruction system version.

7. A server system version switching device, characterized in that: Applicable to management terminals, including: A creation module, used to create a startup list and a startup item, set a default startup item in the startup list, the startup list corresponds to a server, and the startup item corresponds to a version of a system image; and generate a target system image in a system pool, and create a snapshot interface for the target system image; A configuration module, configured to clone a server system image for the server based on the target system image, configure a logical unit number for the server system image, and inject the logical unit number into the startup list; an instruction sending module, configured to send a version switching instruction to the server, so that the server obtains the target system image corresponding to the specified system version from the system pool based on the snapshot interface, or sets the startup item corresponding to the specified system version as the default startup item based on the logical unit number in the startup list corresponding to the server; and sends a restart instruction to the server, so that the system version is switched to the specified system version after the server is restarted.

8. A server system version switching device, characterized in that: Applicable to servers, including: A first receiving module is configured to receive a version switching instruction, obtain a target system image corresponding to a specified system version from a system pool based on a preset snapshot interface, or set a startup item corresponding to the specified system version as a default startup item in a startup list corresponding to a server based on a logical unit number, the default startup item is set in the startup list, the startup list corresponds to one of the servers, the startup item corresponds to a system image of a version, the system pool includes a target system image, the server clones a server system image based on the target system image, the server system image corresponds to a logical unit number, and the logical unit number is set in the startup list; The second receiving module is used to receive a restart instruction to switch the system version to the specified system version after restarting.

9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory stores program instructions, and when the processor runs the program instructions, the steps in the method according to any one of claims 1 to 7 are executed.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the steps in the method according to any one of claims 1 to 7 are executed.

Citation Information

Patent Citations

  • Computer data processing system

    CN106502925A

  • XWIKI system configuration method and system and computer equipment

    CN110673923A