Bare metal server online migration method and system
By recording and migrating memory dirty page location information on the bare metal server through hardware stuck, the online migration of the bare metal server is realized, solving the problem of online migration and ensuring that the business is not interrupted.
Patent Information
- Application Number
- CN202011337002.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-08-29
- Filing Date
- 2020-11-25
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2040-11-25
AI Technical Summary
The bare metal server cannot realize online migration, resulting in the inability to achieve early avoidance of balancing load and hardware failures without interruption of business.
Receive migration commands through the hardware card, notify the bare metal server to start the virtual machine manager to record the location information of the dirty memory pages, and migrate the dirty memory pages online to the target server, reducing the burden on the source server.
The online migration of bare metal servers is realized, reducing the consumption of source server resources and ensuring business continuity.
Smart Images

Figure CN114115703B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the server field, and in particular to a bare metal server online migration method and system. Background Art
[0002] Bare metal servers (BMS) are an upgraded version of traditional physical servers. They combine the superior performance of traditional physical servers with the convenient management platform of cloud hosts, providing tenants with superior computing performance and meeting the needs of core application scenarios, such as high-performance computing loads, big data, distributed databases, and business scenarios requiring consistent and predictable performance, with high performance and stability.
[0003] Currently, BMS cannot implement online migration. However, achieving load balancing and avoiding hardware failures in advance without interrupting business requires BMS to use online migration. Therefore, implementing online migration for BMS is of great significance. Summary of the Invention
[0004] In order to solve the above problems, the present application provides a bare metal server online migration method and system, which can realize online hot migration of BMS.
[0005] In a first aspect, a bare metal server online migration method is provided, the method comprising:
[0006] A first hardware card receives a migration command for a first bare metal server, wherein the first hardware card is inserted into the first bare metal server. The first hardware card notifies the first bare metal server to start a virtual machine manager according to the migration command. The virtual machine manager records first memory dirty page location information generated by the first bare metal server for the memory of the first bare metal server, and sends the first memory dirty page location information to the first hardware card. The first hardware card migrates the memory dirty pages of the first bare metal server online to a second bare metal server according to the first memory dirty page location information.
[0007] In the above scheme, after receiving the migration command, the first hardware card notifies the first bare metal server to start the virtual machine manager to record the first memory dirty page location information generated by the first bare metal server for the memory of the first bare metal server, thereby migrating the memory dirty page of the first bare metal server online to the second bare metal server, which can realize the online migration of BMS, and the work of online migrating the memory dirty page of the first bare metal server according to the first memory dirty page location information is undertaken by the first hardware card, which can effectively reduce the burden on the first bare metal server.
[0008] In some possible designs, after the first hardware card receives an online migration command for the first bare metal server, the method includes: the first hardware card records second memory dirty page location information of the memory of the first bare metal server generated by the first hardware card.
[0009] In the above solution, the first hardware card may further record the second memory dirty page location information generated by the first hardware card for the memory of the first bare metal server, thereby sending the second memory dirty page according to the second memory dirty page location information.
[0010] In some scenarios, the memory of the first bare metal server can be written with data by the first hardware card using Direct Memory Access (DMA). The modifications to the memory data of the first bare metal server made by this method will not be monitored by the virtual machine manager of the first bare metal server. Therefore, the first hardware card needs to record the location information of the second memory dirty page so that the first hardware card can migrate the memory data modified due to DMA online to the second bare metal server serving as the target end.
[0011] In some possible designs, the first hardware card migrates the memory dirty pages of the first bare metal server to the second bare metal server online according to the first memory dirty page location information, including: the first hardware card obtains at least one first memory page that generates dirty pages from the memory according to the first memory dirty page location information, obtains at least one second memory page that generates dirty pages from the memory according to the second memory dirty page location information, sends the at least one first memory page and the at least one second memory page to the second hardware card, wherein the second hardware card is connected to the first hardware card through a network, and the second hardware card sets the memory of the second bare metal server according to the at least one first memory page and the at least one second memory page, wherein the second hardware card is inserted into the second bare metal server.
[0012] The first hardware card obtains corresponding memory pages from the memory of the first bare metal server through the first memory dirty page location information and the second memory dirty page location information respectively. These memory pages are memory dirty pages, that is, memory pages where data is written or modified. The first hardware card sends these memory pages to the second hardware card through the network, so that the second hardware card sets the memory of the second bare metal server according to these memory pages, so that the memory changes of the first bare metal server can be synchronized to the memory of the second bare metal server in real time, thereby realizing online migration of the bare metal server.
[0013] In some possible designs, after sending the at least one first memory page and the at least one second memory page to the second hardware card, the method includes: the first hardware card obtains a first I / O device status of the I / O device of the first bare metal server, and obtains a second I / O device status of the I / O device of the first hardware card, and sends the first I / O device status and the second I / O device status to the second hardware card; the second hardware card sets the I / O device of the second hardware card according to the second I / O device status, and sends the first I / O device status to the second bare metal server, so that the second bare metal server sets the I / O device of the second bare metal server according to the first I / O device status.
[0014] In the above solution, the first hardware card can send the I / O device status to the second hardware card, so that the I / O device status is restored on the second hardware card.
[0015] In some possible designs, before the virtual machine manager records the first memory dirty page location information generated by the first bare metal server for the memory of the first bare metal server, the method also includes: the virtual machine manager sends the full memory page of the first bare metal server to the first hardware card, the first hardware card sends the full memory page to the second hardware card, and the second hardware card initializes the memory of the second bare metal server according to the full memory page.
[0016] In some possible designs, the method further includes: the second hardware card receives the migration command, the second hardware card mounts the network disk mounted by the first hardware card according to the migration command and notifies the second bare metal server to start the virtual machine manager in the second bare metal server.
[0017] In some possible designs, the method further includes: the first hardware card sending network configuration information of the source BMS to the second hardware card, and the second hardware card performing network configuration according to the network configuration information.
[0018] The network configuration information of the source BMS includes the IP address of the source BMS, a bandwidth package (used to indicate the uplink and downlink traffic speed limit configuration of the source BMS), and other network related information.
[0019] In some possible designs, after the first hardware card sends the network configuration information of the source BMS to the second hardware card, the method further includes: the first hardware card notifies the cloud management platform that the migration of the first bare metal server is complete.
[0020] In some possible designs, a shared memory is provided in the first hardware card, and the shared memory can be accessed by the virtual machine manager of the first bare metal server.
[0021] In some possible designs, the first hardware card starts the virtual machine manager according to the migration command, including: the first hardware card generates an interrupt signal according to the migration command, the first bare metal server receives the interrupt signal, and starts the virtual machine manager of the first bare metal server according to the interrupt signal.
[0022] In some possible designs, the interrupt signal is a system management interrupt of an X86 processor, or the interrupt signal is a security monitoring call SMC or security interrupt of an Arm processor.
[0023] In a second aspect, a bare metal server online migration system is provided, which includes: a first bare metal server, a first hardware card, a second bare metal server and a second hardware card, the first hardware card is used to receive a migration command for the first bare metal server, wherein the first hardware card is inserted into the first bare metal server, the first hardware card is used to notify the first bare metal server to start a virtual machine manager according to the migration command, the virtual machine manager records the first memory dirty page location information generated by the first bare metal server for the memory of the first bare metal server, and sends the first memory dirty page location information to the first hardware card, the first hardware card is used to migrate the memory dirty pages of the first bare metal server to the second bare metal server online according to the first memory dirty page location information.
[0024] In some possible designs, the first hardware card is used to record second memory dirty page location information generated by the first hardware card for the memory of the first bare metal server.
[0025] In some possible designs, the first hardware card is used to obtain at least one first memory page that generates a dirty page from the memory according to the first memory dirty page location information, obtain at least one second memory page that generates a dirty page from the memory according to the second memory dirty page location information, and send the at least one first memory page and the at least one second memory page to the second hardware card, wherein the second hardware card is connected to the first hardware card network, and the second hardware card is used to set the memory of the second bare metal server according to the at least one first memory page and the at least one second memory page, wherein the second hardware card is inserted into the second bare metal server.
[0026] In some possible designs, the first hardware card is used to obtain a first I / O device status of the I / O device of the first bare metal server, and obtain a second I / O device status of the I / O device of the first hardware card, and send the first I / O device status and the second I / O device status to the second hardware card; the second hardware card is used to set the I / O device of the second hardware card according to the second I / O device status, and send the first I / O device status to the second bare metal server, so that the second bare metal server sets the I / O device of the second bare metal server according to the first I / O device status.
[0027] In some possible designs, the first bare metal server is used to send the full memory page of the first bare metal server to the first hardware card, the first hardware card is used to send the full memory page to the second hardware card, and the second hardware card is used to initialize the memory of the second bare metal server according to the full memory page.
[0028] In some possible designs, the second hardware card receives the migration command; the second hardware card mounts the network disk mounted by the first hardware card according to the migration command and notifies the second bare metal server to start the virtual machine manager in the second bare metal server.
[0029] In some possible designs, the method further includes: the first hardware card sending network configuration information of the source BMS to the second hardware card; and the second hardware card performing network configuration according to the network configuration information.
[0030] In some possible designs, the first hardware card is used to notify the cloud management platform that the migration of the first bare metal server is complete.
[0031] In some possible designs, a shared memory is provided in the first hardware card, and the shared memory is accessed by the virtual machine manager of the first bare metal server.
[0032] In some possible designs, the first hardware card is used to generate an interrupt signal according to the migration command, and the first bare metal server is used to receive the interrupt signal and start the virtual machine manager of the first bare metal server according to the interrupt signal.
[0033] In some possible designs, the interrupt signal is a system management interrupt of an X86 processor, or the interrupt signal is a security monitoring call SMC or security interrupt of an Arm processor.
[0034] In a third aspect, a bare metal server system is provided, which includes a first bare metal server and a first hardware card. The first hardware card is used to receive a migration command for the first bare metal server, wherein the first hardware card is inserted into the first bare metal server. The first hardware card is used to notify the first bare metal server to start a virtual machine manager according to the migration command. The virtual machine manager records first memory dirty page location information generated by the first bare metal server for the memory of the first bare metal server, and sends the first memory dirty page location information to the first hardware card. The first hardware card is used to migrate the memory dirty pages of the first bare metal server online to a second bare metal server according to the first memory dirty page location information.
[0035] In some possible designs, the first hardware card is used to record second memory dirty page location information generated by the first hardware card for the memory of the first bare metal server.
[0036] In some possible designs, the first hardware card is used to notify the cloud management platform that the migration of the first bare metal server is complete.
[0037] In some possible designs, a shared memory is provided in the first hardware card, and the shared memory is accessed by the virtual machine manager of the first bare metal server.
[0038] In a fourth aspect, a hardware card is provided, comprising a dynamic configuration module and an intelligent transfer module.
[0039] The dynamic configuration module is used to receive a migration command for a first bare metal server, wherein the first hardware card is inserted into the first bare metal server, the intelligent transfer module is used to notify the first bare metal server to start a virtual machine manager according to the migration command, the virtual machine manager records first memory dirty page location information generated by the first bare metal server for the memory of the first bare metal server, and sends the first memory dirty page location information to the first hardware card, and the intelligent transfer module is used to migrate the memory dirty pages of the first bare metal server online to the second bare metal server according to the first memory dirty page location information.
[0040] In a fifth aspect, a hardware card is provided, comprising: a processor and a memory, wherein the processor executes a program in the memory, thereby executing the method as described in the first item or the second item of the first aspect.
[0041] In a sixth aspect, a computer-readable storage medium is provided, comprising instructions, which, when executed on a first hardware card, cause the first hardware card to execute the method of the first or second item of the first aspect.
[0042] In a seventh aspect, a computer-readable storage medium is provided, comprising instructions, which, when executed on a first hardware card, cause the first hardware card to execute the method according to the first or second item of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0044] Figure 1 This is a structural diagram of a BMS online migration system provided by this application;
[0045] Figure 2 Schematic diagram of the structure of the BMS in the bare metal state provided by an embodiment of the present application;
[0046] Figure 3 Schematic diagram of the structure of a virtualized BMS provided in an embodiment of the present application;
[0047] Figure 4 This is a structural diagram of a BMS online migration system provided in an embodiment of the present application;
[0048] Figure 5 This is an interactive flow chart of a method provided by the present application for a source BMS to deactivate a first VMM;
[0049] Figure 6 This is a schematic diagram of transferring online migration memory dirty pages between a source hardware card and a target hardware card provided by the present application;
[0050] Figure 7 This is an interactive flow chart of a method for a source BMS to activate a first VMM provided by this application;
[0051] Figure 8 This is an interactive flow chart of another method for activating a first VMM by a source BMS provided in this application;
[0052] Figure 9 This is a schematic diagram of the structure of a hardware card proposed in this application;
[0053] Figure 10 This is a structural diagram of a BMS proposed in this application;
[0054] Figure 11 It is a structural diagram of another BMS proposed in this application. DETAILED DESCRIPTION
[0055] Glossary:
[0056] Cloud management platform: The cloud management platform provides an access interface that lists the cloud services provided by the public cloud. Tenants can access the cloud management platform through a browser or other client and pay for the corresponding cloud services on the cloud management platform. After purchasing the cloud services, the cloud management platform provides tenants with access rights to the cloud services, allowing them to remotely access the cloud services and perform corresponding configurations.
[0057] Public cloud: Public cloud usually refers to the cloud services provided by cloud providers to tenants (such as tenants). Tenants can access the cloud management platform through the Internet and purchase and use the cloud services provided by the public cloud on the cloud management platform. The core attribute of the public cloud is shared resource services. The public cloud can be implemented through the data center of the public cloud service provider. The data center is equipped with multiple physical servers. Multiple physical servers provide the computing resources, network resources and storage resources required for public services.
[0058] Bare Metal Server (BMS): A computing service that combines the elasticity of virtual machines with the performance of physical machines. It provides dedicated physical servers on the cloud, delivering exceptional computing performance and data security for core databases, critical application systems, high-performance computing, big data, and other businesses. Tenants pay for BMS usage rights on the cloud management platform, which then allows them to remotely log in to the BMS, install the required operating system, configure applications within the operating system, and run applications to provide tenant-specific services. These services are based on the computing, network, and storage resources provided by the BMS.
[0059] Specifically, BMS is a physical server in the data center of a public cloud service provider. The physical server is equipped with a hardware card. The hardware card can communicate data with the cloud management platform on the control plane and communicate with the physical server, so that the cloud management platform can manage the physical server through the hardware card, such as installing an operating system for the physical server and opening the remote login service of the physical server to allow tenants to remotely log in to the physical server.
[0060] Among them, the control plane is implemented on the hardware card, which means that the BMS does not need to handle control plane work that is not related to the tenant's own business, so that the tenant can fully use the BMS to run their own applications, thereby further guaranteeing the tenant's consumer rights.
[0061] For example, an application can be web service software. After the web service software is installed on the BMS, tenants upload web pages to be published to the external network to the BMS. The BMS runs the web service software, which shares the tenants' web pages to the external network by opening port 80 or port 8080. Tenants on the external network can access the web pages on the BMS by accessing the domain name bound to the web service software through a browser. The BMS provides the storage space for the web pages on the BMS, the upstream and downstream network traffic involved in interacting with the browser or other devices accessing the BMS, and the CPU and memory required to run the web service software. Tenants can obtain different computing resources, network resources, and storage resources by purchasing BMSs of different specifications on the cloud management platform. The application installed on the BMS can also be database software or other applications that the tenant wants to configure, which is not limited in this embodiment of the present invention.
[0062] Dirty memory pages: Memory pages in the source BMS that need to be synchronized to the target BMS to ensure memory consistency between the source and target BMSs.
[0063] Online migration: also known as live migration or hot migration. In the embodiment of the present invention, it means that in the data center of a public cloud service provider, when the physical server serving as the source BMS needs to undergo a firmware upgrade, reboot, power outage for maintenance, or other situations that affect application operation, the cloud management platform must select another physical server in the data center as the target BMS. The specifications of this physical server are the same as those of the physical server serving as the source BMS, copy the memory pages of the source BMS to the target BMS, and mount the network disk of the source BMS to the target BMS, so that the target BMS can run the applications of the source BMS.
[0064] Specifically, during the online migration of memory pages, the memory pages of the source BMS are migrated to the target BMS in real time while ensuring the normal operation of the source BMS applications. To ensure the availability of the BMS applications during the migration process, the migration process has only a very short downtime. In the early stages of the migration, the applications run on the source BMS. When the memory page migration reaches a certain stage, the memory pages of the target BMS are completely consistent with the memory pages of the source BMS (or very close to completely consistent, such as more than 99% of the memory pages are the same). After a very short switch (such as within seconds), the cloud management platform transfers the tenant's control of the source BMS to the target BMS, and the BMS service continues to run on the target BMS. For the BMS service itself, since the switch time is very short, the tenant does not feel that the BMS has been replaced, and the migration process is transparent to the tenant. Therefore, online migration is suitable for scenarios with high requirements for business continuity.
[0065] Virtual Machine Manager (VMM): Implemented by the operating system kernel, the VMM manages and maintains the virtual machines created by the operating system.
[0066] The following is a detailed introduction to the definitions of the system management mode (SMM) and trust zone involved in this application.
[0067] SMM is an execution mode in x86 processors with the highest privilege level. Therefore, various privileged instructions and input / output (I / O) operations can be executed in SMM. A processor enters SMM when the processor's SMM interrupt pin is activated or when a system management interrupt (SMI) is received from the advanced programmable interrupt controller (APIC). After entering SMM, the processor stops the current operating system, saves the operating system's CPU register state to secure system management RAM (SMRAM), disables other interrupts and exceptions, and executes the code specified by the SMI interrupt handler in SMRAM. SMM is transparent to the operating system; that is, the operating system is unaware of when the processor enters SMM, what operations are performed in SMM mode, or when the processor exits SMM. SMIs are high-priority interrupts, for example, with a priority of 3, and therefore can mask most interrupts. The processor exits SMM upon receiving an RSM instruction. After exiting SMM, the execution of the code specified by the SMI interrupt handler in SMRAM is stopped, the CPU register state of the current operating system is read and restored from SMRAM, and other interrupts and exceptions are started.
[0068] EL3 mode is an execution mode for ARM processors with the highest privilege level. Therefore, various privileged instructions and I / O operations can be executed in EL3 mode. The processor enters EL3 mode upon receiving a secure monitorcall (SMC) or a secure interrupt. Upon entering EL3 mode, the processor halts the current operating system, saves the operating system's CPU register state to the secure memory region (SMR), disables other interrupts and exceptions, and executes the code specified by the SMC exception handling logic in the SMR. Upon receiving an ERET instruction, the processor exits EL3 mode. Upon exiting EL3 mode, the processor halts execution of the code specified by the SMC exception handler in the SMR, reads and restores the current operating system's CPU register state from the SMR, and enables other interrupts and exceptions. EL3 mode is transparent to the operating system; that is, the operating system is unaware of when the processor enters EL3 mode, what operations have occurred in EL3 mode, or when the processor exits EL3 mode.
[0069] See also Figure 1 , Figure 1 This is a schematic diagram of the structure of a BMS online migration system provided by this application. Figure 1 As shown, the online migration system of the present application includes: a cloud management platform 110 and multiple BMS systems. Among them, the BMS system may include a BMS system 120-1, a BMS system 120-2, a BMS system 120-3 and a BMS system 120-4. BMS system 120-1 may include a BMS 121-1 and a hardware card 122-1. BMS system 120-2 may include a BMS 121-2 and a hardware card 122-2. BMS system 120-3 may include a BMS 121-3 and a hardware card 122-3. BMS system 120-4 may include a BMS 121-4 and a hardware card 122-4. The cloud management platform 110 may connect to each hardware card through a network, and the hardware card may be connected to the BMS through a preset interface, for example, a high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCIE) interface. Different hardware cards may communicate with each other through the network. Among them, the online migration system may be set up in a data center of a public cloud service provider.
[0070] The cloud management platform 110 is used to manage multiple BMSs.
[0071] BMS is an independent physical server. Tenants purchase BMS on the cloud management platform 110. The cloud management platform 110 sends management information to the hardware card inserted into the purchased BMS based on the purchase information. The hardware card sets up the BMS based on the management information, for example, installing the corresponding operating system according to the tenant's needs, and opening a remote login server so that the tenant can log in to the BMS remotely and achieve complete exclusivity of the BMS's physical resources (including computing resources, network resources, and storage resources).
[0072] In the embodiment of the present invention, before and after online migration, the operating system of the BMS can be switched between a bare metal state and a virtualized state through the control of the hardware card.
[0073] Figure 2 The left portion shows a schematic diagram of the BMS in bare metal mode. The bare metal BMS may include a hardware layer and a software layer. The software layer includes a client operating system, and the hardware layer includes hardware such as a first processor 210, a first memory 220, and a root complex (RC) chip 230. In other embodiments, the number of processors 210 and the number of virtual machines may be greater or lesser.
[0074] The hardware layer may include one or more first processors 210, a first memory 220, and an RC chip 230. The first processor 210 may be a central processing unit (CPU). The CPU may adopt a complex instruction set computer (CISC) architecture (e.g., the x86 architecture), a reduced instruction set computer (RISC) architecture (e.g., the MIPS (microprocessor without interlocked piped stages) architecture), or the like.
[0075] The first memory 220 can store codes such as the operating system and the virtual machine monitor (VMM). The client operating system can be a system installed by the tenant. The VMM is optional, that is, the VMM does not work when online migration is not performed, and only works during online migration. The RC chip 230 includes one or more PCIe interfaces for connecting the subsystem consisting of the first processor 210 and the first memory 220 to a hardware card. The RC chip can be implemented in a discrete device or integrated in the first processor 210. The first processing unit also includes a digital signal processor (DSP), a graphics processing unit (GPU), a neural-network processing unit (NPU), etc. When the number of processors in the first processor 210 is multiple, the processors in the first processor 210 can adopt a homogeneous structure or a heterogeneous structure. Common heterogeneous structures can be CPU+DSP, CPU+NPU, CPU+GPU, CPU+DSP+GPU, etc.
[0076] The software layer includes: a client operating system. It is understood that before or after hot migration, there is no need to run the VMM, thereby effectively reducing the consumption of BMS resources.
[0077] The hardware card can be an application specific integrated circuit (ASIC) board, or a field programmable gate array (FPGA) board, etc. Figure 2 as well as Figure 3 As shown in the middle right, the hardware card may include: one or more second processors 311 , an endpoint (EP) chip 313 and a network card 314 .
[0078] The second processor 311 includes one or more second processors 311. For example, the second processor 311 may be a digital signal processor (DSP), a central processing unit (CPU), and / or a neural-network processing unit (NPU). The processing capability of the second processor 311 may be weaker than that of the first processor 210.
[0079] The EP chip is a hardware interface defined in the PCIe specification. As a peripheral interface of the hardware card, it is responsible for sending PCIe messages to the BMS, or it can also receive PCIe messages sent by the BMS.
[0080] The embodiments of the present application do not limit the specific implementation of the RC chip and the EP chip. Any RC chip and EP chip implemented in accordance with the PCIe specification can be used.
[0081] It should be noted that the hardware card can also be connected to the network disk through the network card, so that the hardware card can forward the IO request issued by the BMS to the network disk for processing.
[0082] The hardware card's software layer includes an I / O processing module, an intelligent transfer module, and a dynamic configuration module. The I / O processing module enables device state preservation and recovery, as well as memory dirty page tracking for data written by the hardware card to the first memory 220. The BMS's RC chip and the hardware card's EP chip are connected via a PCIE interface. The functions of the I / O processing module, intelligent transfer module, and dynamic configuration module will be described in detail later and are not detailed here.
[0083] In the bare metal state, the BMS's guest operating system runs directly on the hardware.
[0084] The first processor 210 may include one or more physical cores (sometimes referred to herein as simply "cores"). "Physical core" represents the smallest processing unit in this application. In this embodiment, each first processor 210 has two physical cores: core 0 and core 1, and multiple registers. Registers may be high-speed storage components with limited storage capacity that can be used to temporarily store OS state data such as instructions, data, and addresses, such as the instruction register (IR), program counter (PC), and accumulator (ACC). In other embodiments, the first processor 210 may include a greater or lesser number of cores, and the number of cores may vary from one first processor 210 to another. The first memory 220 is used to store instructions or data that have just been used or are being recycled by the first processor 210, such as a cache memory. If the first processor 210 needs to use the instruction or data again, it can directly access it from the first memory 220, reducing the wait time of the first processor 210 and thereby improving system efficiency. The first memory 220 may store code for the operating system and virtual machine monitor (VMM). The guest operating system may be a system installed by the tenant. The VMM is optional, that is, the VMM does not work when online migration is not performed and only works during online migration. The RC chip 230 includes one or more PCIe interfaces for connecting the subsystem consisting of the first processor 210 and the first memory 220 to a hardware card. The RC chip can be implemented as a discrete device or integrated into the first processor 210. The first processing unit also includes a digital signal processor (DSP), a graphics processing unit (GPU), a neural-network processing unit (NPU), and the like.
[0085] See below Figure 3 , Figure 3 The left part shows the structural diagram of BMS in virtualized state. Figure 3 and Figure 2Compared to adding a VMM to the BMS software, the VMM in other virtualization architectures is equivalent to a hypervisor or other type of virtual monitoring device. The VMM can be deployed within the guest operating system or separately from the guest operating system. The VMM manages the virtual machines (any number) running on it. As a virtual monitoring device, the VMM is responsible for scheduling the virtual processors of each virtual machine. For example, the kernel-based virtual machine (KVM) is a typical VMM. The VMM's scheduling of virtual processors includes swapping in and out virtual processors. First, the VMM creates and initializes a virtual machine object and then creates three virtual processors for the virtual machine. When a virtual machine contains multiple virtual processors, one is typically the master virtual processor and the others are slave virtual processors. When a virtual processor is created, it is not associated with a physical core. The VMM schedules a virtual processor to a physical core based on policy. This is called swapping in the virtual processor. The VMM suspends or migrates the virtual processor from the physical core. This is called swapping out the virtual processor. In a core-bound scenario, a virtual processor is always scheduled on the same core. In a non-core-bound scenario, the VMM may determine which core to schedule the virtual processor to based on the current operating status of the system and / or a scheduling algorithm before scheduling.
[0086] It should be noted that a virtual processor may not fall into operation immediately after being swapped in. Before the virtual processor is swapped in and falls into operation, the host machine (specifically the VMM) can also implement some configurations for the virtual processor, and then the virtual processor falls into guest mode.
[0087] Furthermore, the VMM also has a dirty page tracking function. Specifically, after the VMM is started, the client operating system of the software layer needs to access the hardware through the VMM, which is equivalent to the client operating system being managed by the VMM as an operating system of a virtual machine. When the application in the client operating system is running, the first processor 210 will write data to the first memory 220. The VMM can monitor the write action and record the address of the memory page written in the first memory 220, thereby realizing the dirty page tracking function.
[0088] In order to more clearly see the connection relationship between the source BMS121-1, the source hardware card 122-1, the target hardware card 122-4 and the target BMS121-4, please refer to Figure 4 . Figure 4It is shown that the RC chip of the source BMS121-1 can be connected to the EP chip of the source hardware card 122-1 through the PCIE interface, and the network card of the source hardware card 122-1 can be connected to the network card of the target hardware card 122-4 through the network. The EP chip of the target hardware card 122-4 is connected to the RC chip of the target BMS121-4 through PCIE. The network card of the source hardware card 122-1 can also be connected to the memory, and the memory can also be connected to the network card of the target hardware card 122-4. The above-mentioned BMS online migration system can realize the online migration of the source BMS121-1 to the target BMS121-4 with the assistance of the source hardware card 122-1 and the target hardware card 122-4. Here, online migration includes BMS online migration, online migration of storage resources, and online migration of the network environment.
[0089] Online migration between the source BMS and the target BMS requires the assistance of the first VMM of the source BMS and the second VMM of the target BMS. However, the first VMM and the second VMM need to be in a non-working state at ordinary times. When performing online migration, the first VMM and the second VMM are activated to enter the working state to reduce the consumption of resources of the source BMS and the target BMS. After the source BMS is started, the first VMM needs to be started for initialization. However, the first VMM cannot be kept in the working state all the time. Therefore, the first VMM needs to be deactivated. When online migration is required, the first VMM is activated to enter the working state. Among them, the following Figure 5 The method shown is a method in which the source BMS deactivates the first VMM.
[0090] See also Figure 5 , Figure 5 This is an interactive flow chart of a method for the source BMS to deactivate the first VMM provided by this application. Figure 5 As shown, the method for the source BMS to deactivate the first VMM includes:
[0091] S101: After the source BMS is powered on, power is supplied to the source hardware card and the BIOS of the source BMS is started.
[0092] In a specific embodiment of the present application, the BIOS is pre-set to require booting the source hardware card. After the BIOS of the source BMS is started, the BIOS boots each program into working state in a preset order. During the boot process, if the BIOS successfully boots the first program into working state, the BIOS will continue to boot the next program into working state, and so on, until the last program is booted into working state. If the program does not enter the working state smoothly when the BIOS is booting a program, then the BIOS will continue to wait until the program enters the working state or reports an error. Therefore, when the BIOS of the source BMS boots to the source hardware card, the BIOS of the source BMS enters a waiting process to wait for the configuration of the source hardware card to be completed, and sends a startup flag to the source BMS.
[0093] S102: During the BIOS waiting process of the source BMS, the source hardware card performs resource configuration and sets a first shared memory in the second internal memory of the source hardware card.
[0094] In a specific embodiment of the present application, the first shared memory may be set in the first memory of the source BMS, and the first shared memory may be accessed by the first operating system and the first VMM in the source BMS. The first shared memory may be used to store the first VMM of the source BMS.
[0095] In a specific embodiment of the present application, resource configuration of the source hardware card may include: initializing the hardware (shielding all interrupts, turning off the processor's internal instruction / data cache, etc.), preparing RAM space (for example, reading the program code into RAM and setting the first shared memory), setting up the stack, initializing the hardware devices to be used in this stage, detecting the memory mapping of the first operating system, reading the kernel image and root file system image of the first operating system from Flash to RAM, setting startup parameters for the kernel of the first operating system, and calling the kernel of the first operating system, etc.
[0096] In a specific embodiment of the present application, after the resource configuration is completed, the dynamic configuration module in the source hardware card generates a startup flag and sends the startup flag to the BIOS of the source BMS through the first shared memory or hardware register to notify the BIOS that the source hardware card has been started and the BIOS can be restarted.
[0097] It should be understood that the above example uses the second internal memory of the source hardware card as an example for setting up the first shared memory. In other embodiments, the second shared memory can also be set up on a network disk, where the second shared memory can be accessed by the first operating system and the first VMM in the source BMS. Furthermore, for bare metal server online migration, you can choose to set up only the first shared memory, only the second shared memory, or both the first and second shared memories.
[0098] S103: After receiving the startup flag, the source BMS confirms that the source hardware card is started normally and boots the source BMS to the first VMM.
[0099] In a specific embodiment of the present application, the BIOS is also pre-set to need to boot the first VMM, wherein the first VMM may be stored in the first memory of the source BMS.
[0100] S104: The first VMM of the source BMS completes the initialization of the I / O device and saves the state of the I / O device in the first shared memory.
[0101] In a specific embodiment of the present application, the status of each I / O device can be stored in a register of the I / O device. After the first VMM completes the initialization of the I / O device, the status of the I / O device can be retrieved from the register and stored in the first shared memory of the source hardware card. When the first VMM is reactivated, the status of the I / O device in the first shared memory can be retrieved and restored, thereby restoring the working state of the first VMM. It can be understood that the status of the I / O device is stored in the first shared memory of the source hardware card and does not occupy the storage resources of the source BMS, thereby reducing the consumption of resources of the source BMS.
[0102] In a specific embodiment of the present application, because the state of the I / O device is saved in the first shared memory, the state of the I / O device can be accessed by both the first operating system and the first VMM.
[0103] S105: The source BMS reads the CPU register state of the source BMS from the hardware-assisted virtualization module and saves it to the first shared memory.
[0104] S106: The source BMS adjusts page table entries of the first VMM and the first operating system kernel through a switching program.
[0105] In a specific embodiment of the present application, a switching program is responsible for switching between the first VMM and the first operating system. When it is necessary to switch from the first VMM to the first operating system, the first VMM calls the switching program to switch; when it is necessary to switch from the first operating system to the first VMM, the first operating system can call the switching program to switch. In a specific embodiment, the switching program can be a program pre-stored in the first shared memory, thereby reducing the resource consumption of the source BMS. Here, the source BMS adjusts the page table entries of the first VMM and the first operating system kernel through the switching program to avoid illegal memory access after the switch.
[0106] S107 : The source BMS loads the CPU register state to the first processor in the source BMS through a switching program, thereby deactivating the first VMM.
[0107] In a specific embodiment of the present application, after the source BMS loads the CPU register state into the first processor in the source BMS, the first VMM stops the working state, and the first operating system enters the bare metal working state.
[0108] It is worth noting that the above method is also applicable to other BMSs (including the target BMS) in the data center, which will not be described in detail in this embodiment of the present invention.
[0109] See also Figure 6 , Figure 6 This is a schematic diagram of transferring online migration memory dirty pages between a source hardware card and a target hardware card provided by this application. Specifically, in the initial state, the source hardware card is mounted with a network disk ( Figure 4 As shown in the figure), a network disk is provided to the source BMS for use. Tenants can store their data in the network disk after remotely logging into the source BMS. It is worth noting that the network disk can also be a cloud service. Tenants can purchase the network disk on the cloud management platform and mount it on the source BMS.
[0110] Specifically, the migration method of the embodiment of the present invention includes the following steps:
[0111] S201: The cloud management platform sends a migration command to the source hardware card and the target hardware card respectively. Correspondingly, the source hardware card and the target hardware card respectively receive the migration command sent by the cloud management platform.
[0112] In a specific embodiment of the present application, the migration command is used to instruct the source BMS to migrate dirty memory pages online to the target BMS. The migration command may include the IP address of the source BMS, the MAC address of the source BMS, the IP address of the target BMS, the MAC address of the target BMS, or other address information that can identify the source BMS and the target BMS.
[0113] In a specific embodiment of the present application, the migration command is issued when the migration condition is met.
[0114] Migration conditions, for example, may include the need for a firmware upgrade, restart, power outage maintenance, or other conditions that affect the normal operation of the source BMS. The cloud management platform can obtain the above conditions in advance, and select a target BMS suitable as the migration target in the data center based on the above conditions, and then send a migration command to the source hardware card and the target hardware card.
[0115] S202: The source hardware card notifies the source BMS to enable the first VMM. Furthermore, the target hardware card notifies the target BMS to enable the second VMM.
[0116] After the source hardware card notifies the source BMS to enable the first VMM, the source BMS will activate the first VMM. During the activation of the first VMM, the source BMS saves the state of the first I / O device to the first shared memory. See below for details. Figure 7 as well as Figure 8 The source BMS activates the first VMM.
[0117] S203: The source BMS sends the full memory page to the target BMS through the source hardware card and the target hardware card.
[0118] In a specific embodiment of the present application, the first VMM of the source BMS first sends a full memory page to the source hardware card. Accordingly, the source hardware card receives the full memory page sent by the source BMS. The source hardware card sends the full memory page to the target hardware card. Accordingly, the target hardware card receives the full memory page sent by the source hardware card. The target hardware card sends the full memory page to the second VMM of the target BMS. Accordingly, the second VMM of the target BMS receives the full memory page sent by the target hardware card.
[0119] The second VMM of the target BMS configures the memory of the target BMS according to the full memory page so that the memory of the target BMS is consistent with the memory of the source BMS.
[0120] Generally, after the target BMS sets the full memory, the purpose of memory page migration is achieved. However, the embodiment of the present invention must ensure that the network resources and storage resources of the target BMS are also the same as those of the source BMS. Therefore, after the full memory of the source BMS is set to the target BMS, before the network resources and storage resources are migrated from the source BMS to the target BMS, the tenant can still access the source BMS. The operating system of the source BMS will continue to write to the first memory, thereby generating memory dirty pages. At the same time, the source hardware card can also perform direct memory access write operations on the first memory, thereby generating memory dirty pages.
[0121] The purpose of the following steps is to allow the source hardware card to obtain the memory dirty pages generated in the above two situations and send them to the destination hardware card. The destination hardware card sends these memory dirty pages to the second VMM of the destination BMS. The second VMM updates the full memory based on the memory dirty pages, thereby ensuring that the memory dirty pages generated by the source BMS before the migration of network resources and storage resources is completed can be synchronized on the target BMS.
[0122] S204: The target hardware card mounts the network disk being used by the source hardware card.
[0123] In a specific embodiment of the present application, after the target BMS mounts the network disk that the source hardware card is using, the target hardware card and the source hardware card share the network disk. At this time, the target BMS can access the network disk, and the target hardware card provides the network disk to the target BMS for use. Since the target BMS can directly access the network disk, the source BMS does not need to synchronize data modifications on the network disk on the target BMS.
[0124] This step completes the migration of storage resources.
[0125] It is worth noting that in subsequent steps, after the network resource migration is completed, the source hardware card can stop mounting the network disk, so that the target hardware card can use the network disk alone after the migration is completed, thereby ensuring the data security of the tenant.
[0126] S205: The first VMM of the source BMS enables a dirty page tracking function to track dirty pages generated by the first operating system in the first memory of the source BMS, thereby generating first memory dirty page location information in the first memory of the source BMS.
[0127] The first operating system generates dirty pages in the first memory of the source BMS specifically when the first processor of the source BMS writes data to the first memory when running the first operating system, thereby involving modification of data in the memory pages. The first VMM can record which memory pages are modified in this case.
[0128] It is worth noting that in an embodiment of the present invention, the memory dirty page location information may be, for example, a memory dirty page bitmap. The memory dirty page bitmap may identify the memory page of the operating system of the source BMS by 0 and 1. When data is written to the memory page, its bitmap value is 1. When data is not written to the memory page, its bitmap value is 0. The memory dirty page bitmap records the memory page number and records 0 or 1 for different memory page numbers.
[0129] Alternatively, the memory dirty page bitmap sequentially marks multiple consecutive memory pages with 0 or 1, thereby obtaining a binary string consisting of 0 and 1.
[0130] The memory dirty page location information may also be implemented in other ways. According to the memory dirty page location information, it may be known which memory page in the source BMS is modified.
[0131] S206: The I / O processing module of the source hardware card enables a dirty page tracking function to track dirty pages generated by the I / O device in the source hardware card, thereby generating second memory dirty page location information in the source hardware card.
[0132] The I / O device of the source hardware card refers to the device provided by the source hardware card to the source BMS, such as Figure 3 The virtual function (VF) provided in the network card 314 of the source hardware card to the source BMS.
[0133] In some other examples, the source hardware card may be connected to external input devices such as a mouse and keyboard, and provide these external input devices to the source BMS. In this case, these external input devices may also be referred to as I / O devices of the source hardware card.
[0134] In an embodiment of the present invention, the I / O device of the source hardware card can write data in the first memory of the source BMS through direct memory access (DMA). In this case, since the DMA write to the first memory is performed by the source hardware card as an external device, the first VMM cannot monitor this situation. Therefore, the source hardware card needs to enable the dirty page tracking function to track the dirty pages generated by itself in the source hardware card.
[0135] S207: The intelligent transfer module of the source hardware card obtains first memory dirty page location information from the source BMS, and obtains memory dirty pages generated by the first operating system from the source BMS according to the first memory dirty page location information.
[0136] In a specific embodiment of the present application, the intelligent transfer module of the source hardware card obtains at least one first memory page generating a dirty page from the memory according to the first memory dirty page location information.
[0137] In a specific embodiment of the present application, the first memory dirty page location information can be mapped to the source hardware card by the source BMS through a memory mapping mechanism (for example, the base address register (BAR) space of the I / O device), or it can be stored in the first memory of the source BMS. Accordingly, the intelligent transfer module of the source hardware card can read the first memory dirty page location information, and then obtain the memory dirty page generated by the first operating system from the first memory of the source BMS through DMA transmission. Alternatively, the intelligent transfer module of the source hardware card can also read the first memory dirty page location information from the first memory of the source BMS through DMA transmission, and obtain the memory dirty page generated by the first operating system from the first memory of the source BMS through DMA transmission.
[0138] S208: The intelligent transfer module of the source hardware card obtains the second memory dirty page location information, and obtains the memory dirty page generated by the I / O device according to the second memory dirty page location information.
[0139] In a specific embodiment of the present application, the intelligent transfer module of the source hardware card obtains at least one second memory page generated by the I / O device of the source hardware card from the first memory according to the second memory dirty page location information.
[0140] S209: The source hardware card sends the dirty memory pages generated by the first operating system and the dirty memory pages generated by the I / O device to the target hardware card.
[0141] In a specific embodiment of the present application, the intelligent transfer module of the source hardware card sends at least one first memory page and at least one second memory page to the target hardware card.
[0142] S210: The target hardware card restores the dirty memory pages generated by the first operating system to the first memory of the target BMS.
[0143] S211: The target hardware card restores the dirty memory pages generated by the I / O device to the target hardware card.
[0144] In a specific embodiment of the present application, the target hardware card sets the memory of the second BMS according to at least one first memory page and at least one second memory page.
[0145] S212: The intelligent transfer module of the source hardware card determines whether the shutdown standard has been reached. If the shutdown standard has not been reached, return to step S207. If the shutdown standard has been reached, send notification 1 to the source hardware card.
[0146] In a specific embodiment of the present application, the shutdown criterion is that the amount of dirty memory pages generated by the first operating system in the source BMS and the dirty memory pages generated by the I / O device in the source hardware card is less than the capacity of the current network bandwidth.
[0147] If the amount of dirty memory pages generated by the first operating system in the source BMS and the dirty memory pages generated by the I / O devices in the source hardware card is greater than or equal to the capacity of the current network bandwidth, then the source hardware card cannot transmit all the dirty memory pages to the target hardware card through the current network at one time, and the source BMS does not meet the shutdown criteria. Therefore, between the time the source hardware card first obtains the dirty memory pages generated by the first operating system in the source BMS and the dirty memory pages generated by the I / O devices in the source hardware card and the time the source BMS is shut down, the first operating system in the source BMS and the I / O devices generate new dirty memory pages. Therefore, the source hardware card needs to repeatedly perform the steps of obtaining the new dirty memory pages generated by the first operating system in the source BMS and the new dirty memory pages generated by the I / O devices in the source hardware card, and sending the obtained new dirty memory pages to the target hardware card, until the amount of dirty memory pages generated by the first operating system in the source BMS and the new dirty memory pages generated by the I / O devices in the source hardware card are less than the capacity of the current network bandwidth, and the source BMS meets the shutdown criteria and shuts down.
[0148] The source BMS sends notification 1 to the source hardware card through the channel physically connected between the source BMS and the source hardware card. The channel is, for example, a PCIE channel. Notification 1 is used to notify the source hardware card that the source BMS can be shut down. At this time, the source hardware card obtains the status of the I / O device of the source hardware card (i.e., the first I / O device status) and obtains the status of the I / O device of the source BMS (i.e., the second I / O device status).
[0149] S213: The intelligent transfer module of the source hardware card obtains the first I / O device status in the first shared memory, and obtains the second I / O device status in the source hardware card.
[0150] Specifically, after the source BMS confirms that it has reached the shutdown standard in step S212, it records the status of the I / O device of the source BMS into the first shared memory, and the intelligent transfer module of the source hardware card obtains the status of the first I / O device in the first shared memory.
[0151] The I / O device of the source BMS is, for example, a driver called by the operating system of the source BMS to read and write data in the first memory through the first processor. The first VMM of the source BMS can record the status of the I / O device of the source BMS.
[0152] S214: The intelligent transfer module of the source hardware card sends the first I / O device status and the second I / O device status to the target hardware card. Correspondingly, the target hardware card receives the first I / O device status and the second I / O device status sent by the intelligent transfer module of the source hardware card.
[0153] S215: The target hardware card restores the first I / O device state to the I / O device of the target BMS.
[0154] Specifically, the target hardware card sends the first I / O device state to the second VMM of the target BMS, and the second VMM sets the first I / O device state to the I / O device of the target BMS.
[0155] The I / O device of the target BMS is, for example, the operating system of the target BMS through a third processor (such as Figure 4 As shown) in the second memory (as Figure 4 The second VMM of the target BMS may set the state of the I / O device of the target BMS to the first I / O device state, thereby making the state of the I / O device of the target BMS the same as the state of the I / O device of the source BMS.
[0156] S216: The target hardware card restores the second I / O device state to the target hardware card.
[0157] Specifically, the target hardware card sets the state of its own I / O device to the second I / O device state, so that the state of the I / O device of the target hardware card is the same as the state of the I / O device of the source hardware card.
[0158] The I / O device of the target hardware card is, for example, the VF provided by the target hardware card to the target BMS, and the VF of the target hardware card is set to the second I / O device state, so that the device state of the VF of the target hardware card is the same as that of the VF of the source hardware card.
[0159] S217: The source BMS deactivates the first VMM to enable the source BMS to operate in the bare metal state. In addition, the target BMS deactivates the second VMM and sends a notification 3 to the target hardware card, which is used to notify the target hardware card to switch the target BMS to the bare metal state.
[0160] S218: The source hardware card stops mounting the network disk.
[0161] It can be understood that the data that needs to be migrated includes data in the network disk (i.e., storage resources). Therefore, when the migration starts, the network disk is first shared to the target hardware card (step S204), so that the source hardware card and the target hardware card share the network disk. When the migration ends, the source hardware card stops mounting the network disk.
[0162] S219: The source hardware card sends the network configuration information to the target hardware card. Correspondingly, the target hardware card receives the network configuration information sent by the source hardware card.
[0163] The network configuration information includes information such as the IP address and bandwidth package configuration of the source BMS, specifically information related to network resources provided by the source hardware card to the source BMS.
[0164] S220: The source hardware card notifies the cloud management platform that the source BMS migration is complete.
[0165] S221: The target hardware card performs network configuration on itself according to the network configuration information.
[0166] In this step, the target hardware card configures the tenant-related network to be consistent with the source hardware card, and sets these network configurations as the network configuration of the target BMS. For example, the target hardware card records the IP address and bandwidth package configuration of the source BMS as the IP address and bandwidth package configuration of the target BMS.
[0167] In this step, the network resources of the source BMS are transferred to the target hardware card through processing by the source hardware card and the target hardware card.
[0168] S222: The target hardware card notifies the cloud management platform that the target BMS is ready.
[0169] In this step, after the target hardware card transfers the storage resources, computing resources and network resources of the source BMS to the target BMS, it notifies the cloud management platform that the destination BMS is ready. At this time, when the tenant remotely logs in to the source BMS according to the IP address of the source BMS, it actually logs in to the target BMS. However, since the switching process is reflected in steps S219-S221 involving network configuration information, steps S219-S221 will cause the tenant to be temporarily unable to log in to the source BMS and the destination BMS. However, the suspension of these steps can be controlled within seconds. Under normal circumstances, the tenant is not aware of this. Therefore, the above migration process can be done without tenant perception, and the tenant experience can be guaranteed under the premise of migrating the BMS.
[0170] In summary, the embodiments of the present invention can achieve tenant-unaware migration of the BMS, thereby greatly improving the tenant experience.
[0171] In the following Figure 7 The method shown is a method for activating the first VMM of the source BMS when the first processor in the source BMS is an x86 processor. Figure 8 The method shown is a method for activating the first VMM of the source BMS when the first processor in the source BMS is an ARM processor. Figure 7 , Figure 7 This is an interactive flow chart of a method for activating the first VMM by a source BMS provided in this application. Figure 7 As shown, the method for the source BMS to activate the first VMM includes:
[0172] S301: The dynamic configuration module of the source hardware card sends an SMI interruption signal to the source BMS. Correspondingly, the source BMS receives the SMI interruption signal sent by the dynamic configuration module of the source hardware card.
[0173] In a specific embodiment of the present application, after the source BMS receives the SMI interrupt sent by the dynamic configuration module of the source hardware card, the first processor of the source BMS enters the SMM mode. For details, please refer to the above introduction to SMM, which will not be described in detail here.
[0174] S302: The source BMS executes the SMI interrupt processing program to save the CPU register state in the source BMS into the SMRAM, and then saves the CPU register state into the first shared memory.
[0175] In a specific embodiment of the present application, the first shared memory may be set in the first memory of the source BMS, and the first shared memory may be accessed by the first operating system in the source BMS and the first VMM in the source BMS.
[0176] S303: The source BMS loads the first VMM into the first processor of the source BMS.
[0177] S304: The first VMM of the source BMS saves the CPU register state to the hardware-assisted virtualization module.
[0178] In a specific embodiment of the present application, the hardware-assisted virtualization module may be a virtual machine control structure (VMCS), or a virtual machine control structure block (VMCB), etc.
[0179] S305 : The first VMM of the source BMS executes the hardware-assisted virtualization instruction to complete activation of the first VMM.
[0180] In a specific embodiment of the present application, after the first VMM is activated, the first operating system in the source BMS runs on the virtual machine, and the CPU virtualization and memory virtualization functions are both turned on. At the same time, in order to avoid the degradation of the I / O performance of the source BMS, the I / O devices are presented to the virtual machine in a pass-through manner.
[0181] See also Figure 8 , Figure 8 This is another interactive flow chart of a method for activating the first VMM by the source BMS provided in this application. Figure 8 As shown, the method for the source BMS to activate the first VMM includes:
[0182] S401: The dynamic configuration module of the source hardware card sends an SMC exception to the source BMS. Correspondingly, the source BMS receives the SMC exception sent by the dynamic configuration module of the source hardware card.
[0183] In a specific embodiment of the present application, after the source BMS receives the SMC exception sent by the dynamic configuration module of the source hardware card, the first processor of the source BMS will enter EL3 mode. For details, please refer to the introduction of EL3 mode above, which will not be described in detail here.
[0184] S402: The source BMS executes the SMC exception handling program to save the CPU register state in the source BMS into the SMR, and then saves the CPU register state into the first shared memory.
[0185] In a specific embodiment of the present application, the first shared memory may be set in the first memory of the source BMS, and the first shared memory may be accessed by the first operating system in the source BMS and the first VMM in the source BMS.
[0186] S403: The source BMS loads the first VMM into the first processor of the source BMS.
[0187] S404: The first VMM of the source BMS saves the CPU register state to the hardware-assisted virtualization module.
[0188] S405 : The first VMM of the source BMS executes the hardware-assisted virtualization instruction to complete activation of the first VMM.
[0189] In a specific embodiment of the present application, after the first VMM is activated, the first operating system in the source BMS runs on the virtual machine, and the CPU virtualization and memory virtualization functions are both turned on. At the same time, in order to avoid the degradation of the I / O performance of the source BMS, the I / O devices are presented to the virtual machine in a pass-through manner.
[0190] See also Figure 9 , Figure 9 This is a schematic diagram of the structure of a hardware card proposed in this application. Figure 9 As shown, the hardware card of the present application includes: a dynamic configuration module 410 , an intelligent transfer module 420 and an I / O processing module 430 .
[0191] The dynamic configuration module 410 is configured to receive a migration command for a first bare metal server, wherein the first hardware card is inserted into the first bare metal server;
[0192] The intelligent transfer module 420 is configured to notify the first bare metal server to start a virtual machine manager in the first bare metal server according to the migration command, the virtual machine manager recording first memory dirty page location information generated by the first bare metal server for the memory of the first bare metal server, and sending the first memory dirty page location information to the first hardware card;
[0193] The intelligent transfer module 420 is configured to migrate the dirty memory pages of the first bare metal server to the second bare metal server online according to the first dirty memory page location information.
[0194] Optionally, the I / O processing module 430 is used to obtain a first I / O device status of the I / O device of the first bare metal server, and obtain a second I / O device status of the I / O device of the first hardware card, and send the first I / O device status and the second I / O device status to the second hardware card.
[0195] For the sake of simplicity, no detailed description of the hardware card is given here. Figure 2 、 Figure 3 And related descriptions. In addition, each module in the hardware card can execute Figures 5 to 8 For details on the steps performed by each module in Figure 5-Figure 8 And the related descriptions will not be repeated here.
[0196] An embodiment of the present application provides a BMS system. The BMS system of this embodiment includes a BMS and a hardware card, wherein the hardware card can be inserted into the BMS.
[0197] like Figure 10 As shown, the BMS includes one or more processors 510, a communication interface 520, and a memory 530. The processor 510, the communication interface 520, and the memory 530 may be connected via a bus 540. The bus may be a PCIE bus or other high-speed bus.
[0198] Processor 510 includes one or more general-purpose processors, where a general-purpose processor can be any type of device capable of processing electronic instructions, including a central processing unit (CPU), a microprocessor, a microcontroller, a main processor, a controller, and an ASIC (Application Specific Integrated Circuit). Processor 510 executes various types of digitally stored instructions, such as software or firmware programs stored in memory 530, which enables the BMS to provide a wide variety of services. For example, processor 510 can execute programs or process data to perform at least a portion of the methods discussed herein.
[0199] The communication interface 520 may be a wired interface (e.g., an Ethernet interface) for communicating with a client. When the communication interface 520 is a wired interface, the communication interface 520 may adopt a protocol suite above TCP / IP, such as RAAS, Remote Function Call (RFC), Simple Object Access Protocol (SOAP), Simple Network Management Protocol (SNMP), Common Object Request Broker Architecture (CORBA), and distributed protocols.
[0200] Memory 530 may include volatile memory, such as random access memory (RAM); non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD). Memory may also include a combination of the above types of memory. Memory can be used to store guest operating systems and VMMs.
[0201] It is understood that the above BMS can be used to perform the following Figures 5 to 8 The steps to be executed by the source BMS or target BMS are as follows: Figures 5 to 8 and related descriptions.
[0202] like Figure 11 As shown, the hardware card includes one or more processors 610, a communication interface 620 and a memory 630. The processor 610, the communication interface 620 and the memory 630 may be connected via a bus 640.
[0203] Processor 610 includes one or more general-purpose processors, where a general-purpose processor can be any type of device capable of processing electronic instructions, including a central processing unit (CPU), a microprocessor, a microcontroller, a main processor, a controller, and an ASIC (Application Specific Integrated Circuit). Processor 610 executes various types of digitally stored instructions, such as software or firmware programs stored in memory 630, which enables the client to provide a wide variety of services. For example, processor 610 can execute programs or process data to perform at least a portion of the methods discussed herein.
[0204] The communication interface 620 may be a wired interface (e.g., an Ethernet interface) for communicating with a server or user. When the communication interface 620 is a wired interface, the communication interface 112 may use a protocol suite above TCP / IP, such as RAAS, Remote Function Call (RFC), Simple Object Access Protocol (SOAP), Simple Network Management Protocol (SNMP), Common Object Request Broker Architecture (CORBA), and distributed protocols.
[0205] Memory 630 may include volatile memory, such as random access memory (RAM); non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD). Memory may also include a combination of the aforementioned types of memory. Memory 630 may be used to store the dynamic configuration module, the intelligent transfer module, and the I / O processing module.
[0206] It is understood that the above BMS can be used to perform the following Figures 5 to 8 For details on the steps to be performed by the source hardware card or the target hardware card, please refer to Figures 5 to 8 and related descriptions.
[0207] In the above scheme, after receiving the migration command, the source hardware card notifies the source bare metal server to start the virtual machine manager to record the first memory dirty page location information generated by the source bare metal server for the memory of the source bare metal server, thereby migrating the memory dirty pages of the source bare metal server to the target bare metal server online, which can enable BMS to achieve online migration, and the work of online migrating the memory dirty pages of the target bare metal server according to the first memory dirty page location information is undertaken by the source hardware card, which can effectively reduce the burden on the source metal server.
[0208] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can 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 application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can 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 can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital tenant line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a storage disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state storage disk Solid State Disk (SSD)).
Claims
1. A bare metal server online migration method, characterized in that: The method comprises: A first hardware card receives a migration command for a first bare metal server, wherein the first hardware card is inserted into the first bare metal server; The first hardware card notifies the first bare metal server to start a virtual machine manager in the first bare metal server according to the migration command. The virtual machine manager records first memory dirty page location information generated by the first bare metal server for the memory of the first bare metal server and sends the first memory dirty page location information to the first hardware card. The first hardware card migrates the memory dirty pages of the first bare metal server to the second bare metal server online according to the first memory dirty page location information. After the first hardware card receives an online migration command for the first bare metal server, the method includes: The first hardware card records second memory dirty page location information for the memory of the first bare metal server generated by the first hardware card; The first hardware card online migrates the dirty memory pages of the first bare metal server to the second bare metal server according to the first dirty memory page location information, including: The first hardware card obtains at least one first memory page generating a dirty page from the memory according to the first memory dirty page location information, obtains at least one second memory page generating a dirty page from the memory according to the second memory dirty page location information, and sends the at least one first memory page and the at least one second memory page to a second hardware card, wherein the second hardware card is connected to the first hardware card through a network; The second hardware card configures the memory of the second bare metal server according to the at least one first memory page and the at least one second memory page, wherein the second hardware card is inserted into the second bare metal server.
2. The method according to claim 1, characterized in that After sending the at least one first memory page and the at least one second memory page to the second hardware card, the method includes: The first hardware card obtains a first I / O device status of an I / O device of the first bare metal server, obtains a second I / O device status of an I / O device of the first hardware card, and sends the first I / O device status and the second I / O device status to the second hardware card; The second hardware card sets the I / O device of the second hardware card according to the second I / O device status, and sends the first I / O device status to the second bare metal server, so that the second bare metal server sets the I / O device of the second bare metal server according to the first I / O device status.
3. The method according to claim 1 or 2, characterized in that Before the virtual machine manager records first memory dirty page location information generated by the first bare metal server and directed to the memory of the first bare metal server, the method further includes: The virtual machine manager sends all memory pages of the first bare metal server to the first hardware card; The first hardware card sends the full memory page to the second hardware card; The second hardware card initializes the memory of the second bare metal server according to the full memory page.
4. The method according to claim 1 or 2, characterized in that The method further comprises: The second hardware card receives the migration command; The second hardware card mounts the network disk mounted by the first hardware card according to the migration command and notifies the second bare metal server to start the virtual machine manager in the second bare metal server.
5. The method according to claim 1 or 2, characterized in that The method further comprises: The first hardware card sends the network configuration information of the first bare metal server to the second hardware card; The second hardware card performs network configuration according to the network configuration information.
6. The method according to claim 5, characterized in that After the first hardware card sends the network configuration information of the first bare metal server to the second hardware card, the method further includes: The first hardware card notifies the cloud management platform that the migration of the first bare metal server is complete.
7. The method according to claim 1 or 2, characterized in that A shared memory is provided in the first hardware card, and the shared memory is accessed by the virtual machine manager of the first bare metal server.
8. The method according to claim 1 or 2, characterized in that The first hardware card starts the virtual machine manager according to the migration command, including: The first hardware card generates an interrupt signal according to the migration command, The first bare metal server receives the interrupt signal and starts the virtual machine manager of the first bare metal server according to the interrupt signal.
9. The method according to claim 8, characterized in that The interrupt signal is a system management interrupt of an X86 processor, or the interrupt signal is a security monitoring call SMC or security interrupt of an Arm processor.
10. A bare metal server online migration system, characterized in that: The bare metal server online migration system includes: a first bare metal server, a first hardware card, a second bare metal server and a second hardware card, The first hardware card is used to receive a migration command for the first bare metal server, wherein the first hardware card is inserted into the first bare metal server; The first hardware card is used to notify the first bare metal server to start a virtual machine manager according to the migration command, the virtual machine manager records first memory dirty page location information generated by the first bare metal server for the memory of the first bare metal server, and sends the first memory dirty page location information to the first hardware card; The first hardware card is used to migrate the dirty memory pages of the first bare metal server to the second bare metal server online according to the first dirty memory page location information; The first hardware card is further configured to record second memory dirty page location information generated by the first hardware card for the memory of the first bare metal server; The first hardware card is further configured to obtain at least one first memory page generating a dirty page from the memory according to the first memory dirty page location information, obtain at least one second memory page generating a dirty page from the memory according to the second memory dirty page location information, and send the at least one first memory page and the at least one second memory page to a second hardware card, wherein the second hardware card is connected to the first hardware card through a network; The second hardware card is further configured to set the memory of the second bare metal server according to the at least one first memory page and the at least one second memory page, wherein the second hardware card is inserted into the second bare metal server.
11. The system according to claim 10, wherein: The first hardware card is used to obtain a first I / O device status of an I / O device of the first bare metal server, obtain a second I / O device status of an I / O device of the first hardware card, and send the first I / O device status and the second I / O device status to the second hardware card; The second hardware card is used to set the I / O device of the second hardware card according to the second I / O device status, and send the first I / O device status to the second bare metal server, so that the second bare metal server sets the I / O device of the second bare metal server according to the first I / O device status.
12. The system according to claim 10 or 11, characterized in that The first bare metal server is used to send all memory pages of the first bare metal server to the first hardware card; The first hardware card is used to send the full memory page to the second hardware card; The second hardware card is used to initialize the memory of the second bare metal server according to the full memory page.
13. The system according to claim 10 or 11, characterized in that The second hardware card receives the migration command; The second hardware card mounts the network disk mounted by the first hardware card according to the migration command and notifies the second bare metal server to start the virtual machine manager in the second bare metal server.
14. The system according to claim 10 or 11, characterized in that The first hardware card sends the network configuration information of the first bare metal server to the second hardware card; The second hardware card performs network configuration according to the network configuration information.
15. The system according to claim 10 or 11, characterized in that The first hardware card is used to notify the cloud management platform that the migration of the first bare metal server is complete.
16. The system according to claim 10 or 11, characterized in that A shared memory is provided in the first hardware card, and the shared memory is accessed by the virtual machine manager of the first bare metal server.
17. The system according to claim 10 or 11, characterized in that The first hardware card is used to generate an interrupt signal according to the migration command, The first bare metal server is used to receive the interrupt signal and start the virtual machine manager of the first bare metal server according to the interrupt signal.
18. The system according to claim 17, wherein: The interrupt signal is a system management interrupt of an X86 processor, or the interrupt signal is a security monitoring call SMC or security interrupt of an Arm processor.
Citation Information
Patent Citations
Virtual machine memory data migration method and relevant device and cluster system
CN103530167A
Virtual machine thermal migration method and device, storage medium and processor
CN110879741A