Virtual machine migration method and system and computer readable storage medium
By migrating data from confidential virtual machines to backup virtual machines in the TrustZone technology of ARM architecture, the business interruption problem caused by computing device restart is solved, and business continuity and data secure transmission is achieved.
Patent Information
- Application Number
- CN202311341378.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-13
- Publication Date
- 2025-04-15
AI Technical Summary
In a confidential virtual airport scenario implemented by TrustZone technology based on ARM architecture, computing devices need to be restarted during capacity expansion, system upgrade, load adjustment or fault repair, resulting in the confidential virtual machine being shut down, business interruption, and affecting the tenant experience.
A virtual machine migration method and system is provided to continue running services using the backup virtual machine on the second computing device when the first computing device is expanded, system upgraded, load adjustment or fault repair.
It ensures the continuity of confidential virtual machine services when computing equipment expands capacity, upgrades the system, adjusts loads or repairs the fault, avoids business interruptions, and ensures the security of data during transmission.
Smart Images

Figure CN119829190A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of virtualization technology, and in particular to a virtual machine migration method, system and computer-readable storage medium. Background Art
[0002] Confidential virtual machines (CVMs) are an important application scenario in virtual machine technology and are a security technology that isolates and protects virtual machine data. Confidential virtual machines use hardware encryption technology and secure boot technology to ensure the security of virtual machine data during transmission, use, and storage. The current mainstream confidential virtual machine technology is the TrustZone technology based on the advanced RISC machines (ARM) architecture. TrustZone technology divides the hardware resources of the computing device into a rich execution environment (REE) side and a trusted execution environment (TEE) side, and creates and runs confidential virtual machines on the TEE side, thereby protecting virtual machine data from being stolen by physical attackers.
[0003] At present, in the confidential virtual machine scenario implemented by TrustZone technology based on the ARM architecture, if the computing device (such as a server) used to implement the confidential virtual machine needs to be expanded / upgraded / loaded / repaired, the computing device is usually restarted once or multiple times during the process of expanding / upgrading / loaded / repairing the computing device, which will cause the confidential virtual machine on the computing device to be shut down, and the business running on the confidential virtual machine to be interrupted, affecting the tenant experience. Therefore, it is urgent to provide a method to solve the above problems. Summary of the invention
[0004] The present application provides a virtual machine migration method, system and computer-readable storage medium, which can realize the migration of confidential virtual machines in an ARM architecture and ensure that the business running on the confidential virtual machines is not interrupted.
[0005] In a first aspect, a virtual machine migration system is provided, which includes a first computing device and a second computing device, the hardware resources of the first computing device are divided into a first REE side and a first TEE side, the hardware resources of the second computing device are divided into a second REE side and a second TEE side, the first TEE side includes a first virtual machine, the second TEE side includes a standby virtual machine, the processor of the first computing device is used to send encrypted data of data in the first virtual machine to the second computing device, the processor of the second computing device is used to decrypt the encrypted data to obtain data in the first virtual machine, and load the data in the first virtual machine to the standby virtual machine.
[0006] The data in the first virtual machine includes business data running on the first virtual machine.
[0007] In the above scheme, since the first computing device migrates the data in the first virtual machine to the backup virtual machine in the second computing device, during the process of capacity expansion / system upgrade / load adjustment / fault repair of the first computing device, the second computing device can run the backup virtual machine to continue to run the business based on the data in the migrated first virtual machine. Even if the first computing device is restarted and the first virtual machine is shut down, the business will not be interrupted. In addition, since the backup virtual machine is located on the TEE side of the second computing device, the security of the TEE side is higher, and the business data security can be protected by continuing to run the business through this virtual machine.
[0008] It can also be seen that, since the first computing device encrypts the data in the first virtual machine and then transmits it to the second computing device, the above solution can also protect the security of the data in the first virtual machine during the transmission process.
[0009] In one possible implementation, the processor of the first computing device is used to encrypt data in the first virtual machine on the first TEE side to obtain encrypted data; the processor of the first computing device is used to call the first communication interface on the first REE side to send encrypted data to the second communication interface, the first communication interface is the communication interface of the first computing device, and the second communication interface is the communication interface of the second computing device; the processor of the second computing device is used to obtain the encrypted data on the second REE side; the processor of the second computing device is used to decrypt the encrypted data on the second TEE side to obtain the data in the first virtual machine; the processor of the second computing device is used to load the data in the first virtual machine to the standby virtual machine on the second TEE side.
[0010] By implementing the above implementation method, since the data in the first virtual machine is encrypted on the first TEE side with higher security, decrypted on the second TEE side with higher security and loaded to the backup virtual machine, the encrypted data is transmitted on the first REE side with lower security and the second REE side with lower security, the data security in the first virtual machine can be well protected.
[0011] In a possible implementation, the encrypted data is obtained by encrypting data in the first virtual machine using an encryption key, the encryption key is negotiated between the processor of the first computing device and the processor of the second computing device, and the encryption key is also used to decrypt the encrypted data.
[0012] In implementing the above implementation method, since the encryption key is a symmetric key negotiated by the processor of the first computing device and the processor of the second computing device, the first computing device only needs to transmit the encrypted data to the second computing device, and there is no need to transmit the encryption key to the second computing device. Even if the encrypted data is stolen during the transmission process, the thief cannot decrypt the stolen encrypted data because he cannot steal the encryption key. Therefore, the above implementation method can further improve the security of the data in the first virtual machine during the transmission process.
[0013] In one possible implementation, the processor of the second computing device is used to obtain authentication information of the standby virtual machine on the second TEE side; the processor of the second computing device is used to call the second communication interface on the second REE side to send the authentication information of the standby virtual machine to the first communication interface; the processor of the first computing device is used to obtain the authentication information of the standby virtual machine on the first REE side; the processor of the first computing device is used to negotiate with the processor of the second computing device to obtain an encryption key when the standby virtual machine is authenticated according to the authentication information of the standby virtual machine on the first TEE side.
[0014] In the implementation method described above, since the processor of the first computing device negotiates with the processor of the second computing device to obtain the encryption key only after the backup virtual machine has been authenticated according to the authentication information of the backup virtual machine, this can avoid migrating the data in the first virtual machine to the backup virtual machine when the backup virtual machine is an untrusted virtual machine, thereby protecting the security of the data in the first virtual machine.
[0015] In one possible implementation, the authentication information of the standby virtual machine includes the current measurement value of the configuration of the standby virtual machine and the historical measurement value of the configuration of the standby virtual machine; the processor of the first computing device is used to authenticate the standby virtual machine when it is determined on the first TEE side that the current measurement value of the configuration of the standby virtual machine and the historical measurement value of the configuration of the standby virtual machine are the same.
[0016] Optionally, the authentication information of the above-mentioned standby virtual machine may include the certificate of the standby virtual machine (or a certificate chain), and the historical measurement value of the configuration of the above-mentioned standby virtual machine may be carried in the certificate of the standby virtual machine. Among them, the configuration of the standby virtual machine may include the virtual processor core type, the number of virtual processor cores, the memory address, the name and version of the application (application, APP) installed on the standby virtual machine, and the image of the standby virtual machine, etc.; the measurement value of the configuration is used to measure whether the configuration has been tampered with, for example, the current number of virtual processor cores is compared with the historical number of virtual processor cores recorded in the certificate. If they are the same, it means that the number of virtual processor cores has not been tampered with, otherwise, it means that the number of virtual processor cores has been tampered with (increased or decreased). For example, the current hash value of the image of the standby virtual machine is compared with the historical hash value of the image of the standby virtual machine recorded in the certificate. If they are the same, it means that the image has not been tampered with, otherwise, it means that the image has been tampered with. In this application, the configuration of the standby virtual machine has been tampered with, which can be understood as the standby virtual machine is incomplete and is an untrusted virtual machine.
[0017] In one possible implementation, the processor of the first computing device is used to obtain authentication information of the first virtual machine on the first TEE side; the processor of the first computing device is used to call the first communication interface on the first REE side and send the authentication information of the first virtual machine to the second communication interface; the processor of the second computing device is used to obtain the authentication information of the first virtual machine on the second REE side; the processor of the second computing device is used to negotiate with the processor of the first computing device to obtain an encryption key when the first virtual machine is authenticated successfully on the second TEE side according to the authentication information of the first virtual machine.
[0018] By implementing the above implementation method, since the processor of the second computing device negotiates with the processor of the first computing device to obtain the encryption key only after the first virtual machine has been authenticated according to the authentication information of the first virtual machine, this can avoid the situation where the data in the first virtual machine is migrated to the backup virtual machine when the first virtual machine is an untrusted virtual machine, causing security risks to the second computing device and the backup virtual machine, thereby protecting the security of the second computing device and the backup virtual machine.
[0019] In one possible implementation, the authentication information of the first virtual machine includes a current measurement value of the configuration of the first virtual machine and a historical measurement value of the configuration of the first virtual machine; the processor of the second computing device is used to authenticate the first virtual machine when determining on the second TEE side that the current measurement value of the configuration of the first virtual machine and the historical measurement value of the configuration of the first virtual machine are the same.
[0020] Optionally, the authentication information of the first virtual machine may include the certificate of the first virtual machine (or a certificate chain), and the historical measurement value of the configuration of the first virtual machine may be carried in the certificate of the first virtual machine. Among them, the configuration of the first virtual machine may include the virtual processor core type, the number of virtual processor cores, the memory address, the name and version of the APP installed on the first virtual machine, and the image of the first virtual machine. The measurement value of the configuration is used to measure whether the configuration has been tampered with. For example, the current number of virtual processor cores is compared with the historical number of virtual processor cores recorded in the certificate. If they are the same, it means that the number of virtual processor cores has not been tampered with. Otherwise, it means that the number of virtual processor cores has been tampered with (increased or decreased). For example, the current hash value of the image of the first virtual machine is compared with the historical hash value of the image of the first virtual machine recorded in the certificate. If they are the same, it means that the image has not been tampered with. Otherwise, it means that the image has been tampered with. In this application, the configuration of the first virtual machine has been tampered with, which can be understood as the first virtual machine is incomplete and is an untrusted virtual machine.
[0021] In one possible implementation, the processor of the second computing device is used to generate a message authentication code based on the encryption key and the first message on the second TEE side; the processor of the second computing device is used to call the second communication interface on the second REE side to send the first message and the message authentication code to the first communication interface; the processor of the first computing device is used to obtain the first message and the message authentication code on the first REE side; the processor of the first computing device is used to encrypt data in the first virtual machine using the encryption key when the first TEE side determines that the encryption key is a valid key based on the first message and the message authentication code.
[0022] In the implementation method described above, since the processor of the first computing device uses the encryption key to encrypt the data in the first virtual machine only when it determines that the encryption key is a valid key based on the message authentication code from the second computing device and the first message, it can avoid migrating the data in the first virtual machine to the backup virtual machine when the encryption key is an invalid key, so as to ensure the accurate migration process of the first virtual machine. In addition, the processor of the second computing device generates a message authentication code based on the encryption key and the first message on the second TEE side, and the processor of the first computing device authenticates whether the encryption key is valid based on the first message and the message authentication code on the first TEE side, and uses the encryption key to encrypt on the first TEE side. Since the security of the TEE side is relatively high, the encryption key can be well protected, thereby protecting the data security in the first virtual machine encrypted using the encryption key.
[0023] In one possible implementation, the processor of the first computing device is used to call the first communication interface on the first REE side and send the public key of the first computing device to the second communication interface; the processor of the second computing device is used to obtain the public key of the first computing device on the second REE side; the processor of the second computing device is used to generate an encryption key on the second TEE side based on the private key of the second computing device and the public key of the first computing device; the processor of the second computing device is used to call the second communication interface on the second REE side and send the public key of the second computing device to the first communication interface; the processor of the first computing device is used to obtain the public key of the second computing device on the first REE side; the processor of the first computing device is used to generate an encryption key on the first TEE side based on the private key of the first computing device and the public key of the second computing device.
[0024] It can be seen that in the above implementation, the processor of the first computing device and the processor of the second computing device generate encryption keys based on public information (i.e., the other party's public key) and private information held by each (i.e., private key). Private information is not transmitted between the two. Even if the public information is stolen during the transmission process, since the private information is not leaked, the thief cannot steal the encryption key, thereby protecting the security of the data in the first virtual machine that is subsequently encrypted using the encryption key during the transmission process. In addition, the processor of the first computing device and the processor of the second computing device generate the encryption key on the TEE side. Since the security of the TEE side is relatively high, the encryption key security can be well protected.
[0025] In one possible implementation, the private key of the second computing device is stored on the second TEE side, and the private key of the first computing device is stored on the first TEE side.
[0026] In the above implementation, since the private key of the second computing device is stored on the second TEE side and the private key of the first computing device is stored on the first TEE side, the security of the TEE side is relatively high, so the security of the private key can be well protected. It can be understood that when the private key is relatively secure, the encryption key generated based on the private key will also be more secure, and thus the data in the first virtual machine encrypted using the encryption key will also be more secure.
[0027] In a possible implementation, the first computing device is further used to send the state information of the first virtual machine to the second computing device; the second computing device is further used to synchronize the state of the standby virtual machine with the first virtual machine based on the state information of the first virtual machine. In this way, the standby virtual machine can continue to run the service from the state before the first virtual machine was suspended, and the user will not perceive the change of the virtual machine running the service.
[0028] In one possible implementation, before the first computing device is used to send encrypted data of the data in the first virtual machine to the second computing device, the first computing device is also used to suspend the operation of the first virtual machine; after the second computing device is also used to load the data in the first virtual machine to the backup virtual machine, the second computing device is also used to run the backup virtual machine based on the data in the first virtual machine.
[0029] In a possible implementation, the processor of the first computing device is the first processor among the multiple processors included in the first computing device. In this way, the operations performed by the processor of the first computing device can be performed by the first processor. Compared with the operations performed by the processor of the first computing device being performed by multiple processors in the first computing device in cooperation, the multiple processors need to spend time to communicate with each other, which can improve the migration efficiency of the first virtual machine.
[0030] In a possible implementation manner, the processor of the second computing device is a second processor among a plurality of processors included in the second computing device.
[0031] In this way, the operations performed by the processor of the second computing device can all be performed by the second processor. Compared with the operations performed by the processor of the second computing device being performed by multiple processors in the second computing device, which require time to communicate between multiple processors, the migration efficiency of the second virtual machine can be improved.
[0032] In a second aspect, a virtual machine migration method is provided, which can be applied to a second computing device, wherein the hardware resources of the second computing device are divided into a second REE side and a second TEE side, wherein the second TEE side includes a backup virtual machine, and the method includes: the second computing device obtains encrypted data of data in a first virtual machine, wherein the first virtual machine is deployed on a first TEE side, and the first TEE side is the TEE side of the first computing device; the second computing device decrypts the encrypted data to obtain data in the first virtual machine; and the second computing device loads the data in the first virtual machine to the backup virtual machine.
[0033] In a possible implementation, the second computing device obtains encrypted data of data in the first virtual machine, including:
[0034] The processor of the second computing device obtains, at the second REE side, encrypted data of the data in the first virtual machine;
[0035] The second computing device decrypts the encrypted data to obtain data in the first virtual machine, including:
[0036] The processor of the second computing device decrypts the encrypted data on the second TEE side to obtain data in the first virtual machine;
[0037] The second computing device loads the data in the first virtual machine to the standby virtual machine, including:
[0038] The processor of the second computing device loads the data in the first virtual machine to the standby virtual machine on the second TEE side.
[0039] In a possible implementation, the encrypted data is obtained by encrypting data in the first virtual machine using an encryption key, the encryption key is negotiated between the processor of the second computing device and the processor of the first computing device, and the encryption key is also used to decrypt the encrypted data.
[0040] In a possible implementation, the method also includes: the processor of the second computing device obtains authentication information of the first virtual machine on the second REE side; when the processor of the second computing device authenticates the first virtual machine according to the authentication information of the first virtual machine on the second TEE side, the processor of the second computing device negotiates with the processor of the first computing device to obtain the encryption key.
[0041] In one possible implementation, the authentication information of the first virtual machine includes a current measurement value of the configuration of the first virtual machine and a historical measurement value of the configuration of the first virtual machine; the method also includes: when the processor of the second computing device determines on the second TEE side that the current measurement value of the configuration of the first virtual machine and the historical measurement value of the configuration of the first virtual machine are the same, the authentication of the first virtual machine is successful.
[0042] In one possible implementation, before the processor of the second computing device and the processor of the first computing device negotiate to obtain the encryption key, the method also includes: the processor of the second computing device calls a second communication interface on the second REE side to send authentication information of the standby virtual machine to the first communication interface, the second communication interface is the communication interface of the second computing device, and the first communication interface is the communication interface of the first computing device.
[0043] In a possible implementation manner, the authentication information of the standby virtual machine includes a current measurement value of the configuration of the standby virtual machine and a historical measurement value of the configuration of the standby virtual machine.
[0044] In one possible implementation, before the second computing device obtains the encrypted data of the data in the first virtual machine, the method also includes: the processor of the second computing device generates a message authentication code based on the encryption key and the first message on the second TEE side; the processor of the second computing device calls the second communication interface on the second REE side, and sends the message authentication code and the first message to the first communication interface, the second communication interface is the communication interface of the second computing device, and the first communication interface is the communication interface of the first computing device.
[0045] In a possible implementation, the processor of the second computing device and the processor of the first computing device negotiate to obtain the encryption key, including: the processor of the second computing device calls the second communication interface on the second REE side, sends the public key of the second computing device to the first communication interface, the public key of the second computing device is used to generate the encryption key, the second communication interface is the communication interface of the second computing device, and the first communication interface is the communication interface of the first computing device; the processor of the second computing device obtains the public key of the first computing device on the second REE side; the processor of the second computing device generates the encryption key on the second TEE side according to the private key of the second computing device and the public key of the first computing device.
[0046] In a possible implementation, the private key of the second computing device is stored on the second TEE side.
[0047] In a possible implementation, the method further includes: the second computing device obtains the status information of the first virtual machine; and the second computing device synchronizes the status of the standby virtual machine with the first virtual machine according to the status information of the first virtual machine.
[0048] In one possible implementation, after the second computing device loads the data in the first virtual machine into the standby virtual machine, the method further includes: the second computing device runs the standby virtual machine according to the data in the first virtual machine. In one possible implementation, the processor of the first computing device is a first processor among a plurality of processors included in the first computing device.
[0049] In a third aspect, a virtual machine migration method is provided, which can be applied to a first computing device, wherein hardware resources of the first computing device are divided into a first REE side and a first TEE side, and the first TEE side includes a first virtual machine, and the method includes:
[0050] The processor of the first computing device encrypts the data in the first virtual machine at the first TEE side to obtain encrypted data;
[0051] The processor of the first computing device calls the communication interface of the first computing device on the first REE side, and sends the encrypted data to the second computing device, where the encrypted data is used to migrate the data in the first virtual machine to a backup virtual machine, and the backup virtual machine is deployed on the second TEE side, which is the TEE side of the second computing device.
[0052] In one possible implementation, the encrypted data is obtained by encrypting data in the first virtual machine using an encryption key, the encryption key is negotiated between a processor of the first computing device and a processor of the second computing device, and the encryption key is also used to decrypt the encrypted data.
[0053] In a possible implementation manner, the processor of the second computing device is a second processor among a plurality of processors included in the second computing device.
[0054] In a fourth aspect, a virtual machine migration apparatus is provided, which can be applied to a second computing device, wherein hardware resources of the second computing device are divided into a second REE side and a second TEE side, wherein the second TEE side includes a backup virtual machine, and the apparatus includes:
[0055] An acquisition module, configured to acquire encrypted data of data in a first virtual machine, where the first virtual machine is deployed on a first TEE side, where the first TEE side is a TEE side of the first computing device;
[0056] A decryption module, used for decrypting the encrypted data to obtain data in the first virtual machine;
[0057] A loading module is used to load the data in the first virtual machine to the standby virtual machine.
[0058] In a fifth aspect, a virtual machine migration apparatus is provided, which can be applied to a first computing device, wherein hardware resources of the first computing device are divided into a first REE side and a first TEE side, wherein the first TEE side includes a first virtual machine, and the apparatus includes:
[0059] an encryption module, configured to encrypt data in the first virtual machine on the first TEE side to obtain encrypted data;
[0060] A sending module is used to call the communication interface of the first computing device on the first REE side to send the encrypted data to the second computing device, wherein the encrypted data is used to migrate the data in the first virtual machine to the standby virtual machine, and the standby virtual machine is deployed on the second TEE side, and the second TEE side is the TEE side of the second computing device.
[0061] Regarding the relevant beneficial effects and descriptions of the virtual machine migration method provided in the second / third aspect and any implementation of the second / third aspect, and the relevant beneficial effects and descriptions of the virtual machine migration device provided in the fourth / fifth aspect and any implementation of the fourth / fifth aspect, please refer to the relevant beneficial effects and descriptions of the virtual machine migration system provided in the first aspect and any implementation of the first aspect, and no further details will be given here.
[0062] In a sixth aspect, a computing device is provided, comprising a processor and a memory; the processor is used to execute instructions stored in the memory, so that the computing device implements the method provided by any one of the second to third aspects above, and any one of the implementations of any one of the aspects.
[0063] In a seventh aspect, a virtual machine migration system is provided, comprising the virtual machine migration device described in the fourth aspect and the virtual machine migration device described in the fifth aspect.
[0064] In an eighth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, wherein the instructions are used to implement the method provided by any one of the second to third aspects above, and any one of the implementations of any one of the aspects.
[0065] In a ninth aspect, a computer program product is provided, comprising a computer program. When the computer program is read and executed by a computing device, the computing device executes a method provided by any one of the second to third aspects above, and any one of the implementations of any one of the aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 It is a schematic diagram of the hardware architecture of an ARM processor provided in an embodiment of the present application;
[0067] Figure 2 It is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0068] Figure 3 It is a structural diagram of a virtual machine migration system provided in an embodiment of the present application;
[0069] Figure 4 It is a flowchart of a virtual machine migration method provided in an embodiment of the present application;
[0070] Figure 5A It is a schematic diagram of a specific embodiment of a virtual machine migration method provided in an embodiment of the present application;
[0071] Figure 5B This is a schematic diagram of a process for obtaining an encryption key through negotiation provided by an embodiment of the present application;
[0072] Figure 6 is a schematic diagram of the structure of a possible first computing device and a second computing device provided in an embodiment of the present application;
[0073] Figure 7 is an interactive schematic diagram of a virtual machine migration method provided in an embodiment of the present application;
[0074] Figure 8 It is a structural schematic diagram of a virtual machine migration device provided in an embodiment of the present application;
[0075] Fig. 9 It is a structural schematic diagram of another virtual machine migration device provided in an embodiment of the present application;
[0076] Fig.10 It is a structural diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0077] The technical solution provided by this application will be described below in conjunction with the accompanying drawings.
[0078] In order to make the technical solution provided by this application clearer, the relevant terms are first explained.
[0079] (1) A virtual machine (VM) is a complete computer system that is simulated by software and has complete hardware system functions and runs in a completely isolated environment. Any work that can be done in a computing device (such as a server) can also be done in a virtual machine. When creating a virtual machine in a computing device, part of the hard disk and memory capacity of the physical machine is used as the hard disk and memory capacity of the virtual machine. Each virtual machine has an independent hard disk and operating system, and the user of the virtual machine can operate the virtual machine just like using a computing device.
[0080] (2) Confidential virtual machines are an important application scenario in virtual machine technology and are a security technology that isolates and protects virtual machine data. Confidential virtual machines use hardware encryption technology and secure boot technology to ensure the security of virtual machine data during transmission, use and storage. The current mainstream confidential virtual machine technology is the TrustZone technology based on the ARM architecture. TrustZone technology divides the hardware resources of the computing device into a rich execution environment (REE) side and a trusted execution environment (TEE) side, and creates and runs virtual machines on the TEE side, thereby protecting virtual machine data from being stolen by physical attackers. The virtual machine on the TEE side is a confidential virtual machine. For the sake of distinction, in TrustZone technology, the virtual machine on the REE side can be called a normal virtual machine.
[0081] (3) TrustZone technology was first introduced in the ARMv6 version as a security extension. It divides the hardware resources of computing devices into two worlds, the REE side (also called the normal world) and the TEE side (also called the secure world). TrustZone, as a hardware security feature, works on the TEE side.
[0082] The REE side does not mean that the operating system (OS) or software running in it is malicious, but that the security of the environment it is in is lower than that of the TEE side. Because when the processor works on the REE side, the resources on the TEE side (such as registers, memory, cache, peripherals, etc.) are prohibited from access. Once the processor tries to access these resources, the system will crash directly. For example, TrustZone can set sensitive memory as secure memory by configuring the trustzoneaddress space contoller (TZASC) register and the trustzone memory adapter (TZMA) register, so that the REE side cannot access this memory. When the processor works on the TEE side, it can access resources on both the TEE side and the REE side. It is precisely because the TEE side has higher permissions than the operating system on the REE side that TrustZone can provide a higher level of security protection for the operating system on the REE side as a trusted root.
[0083] Taking ARMv8.4 as an example, Figure 1The hardware architecture of ARM is described. The left side is the architecture of the REE side, and the right side is the architecture of the TEE side. The REE side includes four working permissions: exception level 0 (EL0), EL1, EL2, and EL3, and the TEE side includes three / four working permissions: secure exception level 0 (SEL0), SEL1, SEL2, and EL3. Among them, EL0 (SEL0) can also be called the user mode layer, EL1 (SEL1) can also be called the kernel mode layer, EL2 (SEL2) can also be called the virtual machine manager layer, and EL3 can also be called the secure monitor layer. The higher the level, the higher the level authority, and the smaller the level, the lower the level authority. The exception level can be understood as the privilege level.
[0084] User applications run at EL0, such as ordinary user applications (such as user applications on ordinary virtual machines) running at EL0 on the REE side, confidential user applications (referring to user applications on confidential virtual machines) running at SEL0 on the TEE side, operating systems or some privileged functions running at EL1, such as the operating system of ordinary virtual machines running at EL1 on the REE side, and the operating system of confidential virtual machines running at SEL1 on the TEE side. Virtual machine managers run at EL2, such as virtual machine monitors (VMMs) located on the REE side and used to manage ordinary virtual machines, such as the quick emulator (QUME), running at EL2 on the REE side, and virtual machine managers located on the TEE side and used to manage confidential virtual machines, such as the trustzone management monitor (TMM), running at SEL2 on the TEE side. ARM trusted firmware (ATF) runs under EL3. It is the first component that runs when the processor starts. It is the underlying firmware officially provided by ARM. This firmware unifies the ARM underlying interface standards, such as the power status control interface (PSCI), trusted boardboot requirements (TBBR), and the secure monitor call (SMC) operation for switching between the secure world state and the normal world state.
[0085] Under EL3, the processor has the highest privilege level and can access not only all resources on the TEE side, but also all resources on the REE side.
[0086] Next, the application scenarios involved in this application are introduced.
[0087] See also Figure 2 , Figure 2 is a schematic diagram of an application scenario provided by an embodiment of the present application, such as Figure 2 As shown, the scene includes a first computing device 100 .
[0088] The first computing device 100 is a computing device running an ARM processor (which may be a processor of ARMv8.4 or other versions), such as a personal computer (PC), a tablet computer, a physical server or a cloud server, etc. Figure 2 In the example, the processor version of the first computing device 100 is ARMv8.4.
[0089] like Figure 2 As shown, the hardware resources of the first computing device 100 are divided into a REE side and a TEE side. The TEE side of the first computing device 100 includes one or more confidential virtual machines. Figure 2 In the example, a confidential virtual machine is included. Optionally, the REE side of the first computing device 100 may include one or more common virtual machines. Figure 2 Not shown.
[0090] The functions of the above-mentioned confidential virtual machine are the same as those of an ordinary virtual machine. Any work that can be completed in an ordinary virtual machine can also be achieved in a confidential virtual machine.
[0091] Tenants can remotely log in to the confidential virtual machine and operate the confidential virtual machine to install, configure, and uninstall applications in the confidential virtual machine operating system environment.
[0092] like Figure 2 As shown, the TEE side of the first computing device 100 may include a virtual machine manager for managing the confidential virtual machine, that is, Figure 2 The first virtual machine manager shown in the figure, the REE side of the first computing device 100 may also include a virtual machine manager for managing ordinary virtual machines, that is, Figure 2 A third virtual machine manager is shown.
[0093] The first virtual machine manager can achieve logical isolation between different confidential virtual machines on the TEE side in the first computing device 100 and manage confidential virtual machines, such as creating confidential virtual machines, simulating virtual hardware for confidential virtual machines according to the hardware layer (hardware simulation function), deleting confidential virtual machines, forwarding and / or processing network packets between all confidential virtual machines (such as confidential virtual machine 1 and confidential virtual machine 2) running on the computing device or forwarding network packets between the confidential virtual machines on the computing device and the external network (virtual switching function), processing input / output (I / O) generated by confidential virtual machines, etc.
[0094] The management operations performed by the first virtual machine manager on the confidential virtual machine are performed in collaboration with the third virtual machine manager. In other words, in order to protect the security of the confidential virtual machine, when the tenant needs to manage the confidential virtual machine, the third virtual machine manager obtains the tenant's management instructions and sends the management instructions to the first virtual machine manager, and the first virtual machine manager performs management operations according to the management instructions.
[0095] When the confidential virtual machine needs to communicate with the outside world, in order to protect the security of the confidential virtual machine, it communicates with the external network through the first virtual machine manager and the third virtual machine manager as a bridge. For example, the confidential virtual machine sends a message to the first virtual machine manager, which is forwarded by the first virtual machine manager to the third virtual machine manager, and then forwarded to the external network by the third virtual machine manager. The external network sends a message to the confidential virtual machine, which is forwarded by the third virtual machine manager to the first virtual machine manager, and then forwarded to the confidential virtual machine by the first virtual machine manager.
[0096] The third virtual machine manager stores the state information of the confidential virtual machine, such as the instruction information executed by the confidential virtual machine and the operation information of the confidential virtual machine on the hardware device, etc. In some possible embodiments, the state information of the confidential virtual machine is stored in the disk file of the confidential virtual machine.
[0097] In a specific implementation, during the use of the first computing device 100, there may be insufficient resources (such as memory) and the need for expansion, or the need for system upgrade, or the need for load adjustment, or the need for fault repair, etc. In the process of capacity expansion / system upgrade / load adjustment / fault repair of the first computing device 100, the first computing device 100 is usually restarted once or multiple times, which will cause the confidential virtual machine on the first computing device 100 to be shut down, and the business running on the confidential virtual machine to be interrupted, affecting the tenant experience. Therefore, it is urgent to provide a method to solve the above problems.
[0098] It should be understood that Figure 2 The application scenario shown is only an example provided by the embodiment of the present application. For example, in a specific implementation, Figure 2 The application scenario shown may include more computing devices, and the more computing devices may belong to the same data center or different data centers.
[0099] In response to the above-mentioned problems, the present application provides a virtual machine migration method and system, by which the data in the confidential virtual machine on the first computing device 100 is migrated to a backup confidential virtual machine on another computing device before the first computing device 100 is expanded / system upgraded / load adjusted / fault repaired. Thus, during the process of expanding / system upgraded / load adjusted / fault repaired on the first computing device 100, the backup confidential virtual machine is used on another computing device, and the business is continued to run according to the data in the migrated confidential virtual machine, thereby ensuring that the business is not interrupted.
[0100] First, see Figure 3 , Figure 3 is a structural diagram of a virtual machine migration system provided in an embodiment of the present application, such as Figure 3 As shown, the scenario includes a first computing device 100 and a second computing device 200 .
[0101] For the first computing device 100, see Figure 2 For the sake of brevity, the related description will not be elaborated here.
[0102] exist Figure 3 In the present invention, the first computing device 100 can be regarded as a virtual machine migration device (also called a source host), and the second computing device 200 can be regarded as a virtual machine migration device (also called a target host). That is to say, when the confidential virtual machine on the first computing device 100 needs to be migrated, it can be migrated to the second computing device 200.
[0103] The second computing device 200 is also a computing device running an ARM processor (which may be a processor of ARMv8.4 or other versions), such as a personal computer, a tablet computer, a physical server or a cloud server. Figure 3 In the example, the processor version of the second computing device 200 is ARMv8.4. Figure 3 As shown, the hardware resources of the second computing device 200 are divided into the REE side and the TEE side. Figure 3 In the embodiments and the following embodiments, the REE side and TEE side of the first computing device 100 are respectively referred to as the first REE side and the first TEE side, and the REE side and TEE side of the second computing device 200 are respectively referred to as the second REE side and the second TEE side.
[0104] The second TEE side may include one or more confidential virtual machines. Figure 3In the example of including a confidential virtual machine, the second REE side may also include one or more common virtual machines. Figure 3 Not shown.
[0105] In this application, in order to ensure the security of the confidential virtual machine in the first computing device 100 after it is migrated to the second computing device 200, when the confidential virtual machine is migrated, the data in the confidential virtual machine can be migrated to the backup confidential virtual machine on the second TEE side, such as Figure 3 As indicated by the arrow in .
[0106] In a possible embodiment, in order to further ensure data security, the first computing device 100 can encrypt the data in the confidential virtual machine and then transmit the encrypted data to the second computing device 200. After receiving the encrypted data, the second computing device 200 can decrypt the encrypted data to obtain the data in the confidential virtual machine.
[0107] In a possible embodiment, Figure 3 As shown, the TEE side of the second computing device 200 may include a virtual machine manager for managing the confidential virtual machine in the second computing device 200, that is, Figure 3 The second virtual machine manager shown, the REE side of the second computing device 200 may include a virtual machine manager for managing ordinary virtual machines in the second computing device 200, that is, Figure 3 A fourth virtual machine manager is shown.
[0108] The management operation of the second virtual machine manager on the confidential virtual machine in the second computing device 200 is Figure 2 The first virtual machine manager shown in FIG. 1 is the same as the management operation of the confidential virtual machine in the first computing device 100. The function of the fourth virtual machine manager in the second computing device 200 is the same as Figure 2 The third virtual machine manager shown has the same function as in the first computing device 100, see Figure 2 For the sake of brevity, the related description will not be elaborated here.
[0109] The first computing device 100 and the second computing device 200 may transmit data via a communication network of any communication mechanism / communication standard. The communication network may be a wide area network, a local area network, a point-to-point connection, or any combination thereof. The first computing device 100 and the second computing device 200 may belong to the same data center or to different data centers.
[0110] It should be understood that Figure 3 The virtual machine migration system shown is only an example provided in the embodiment of the present application. For example, in a specific implementation, Figure 3The illustrated system may include more computing devices, which may belong to the same data center or different data centers.
[0111] exist Figure 3 In the embodiment, after migrating the data in the confidential virtual machine in the first computing device 100 to the backup confidential virtual machine in the second computing device 200, the second computing device 200 can run the backup confidential virtual machine and continue to process the business according to the data in the migrated confidential virtual machine, thereby ensuring that the business is not interrupted.
[0112] To facilitate a clearer understanding Figure 3 The process of performing confidential virtual machine migration by the virtual machine migration system shown in FIG. Figure 4 An interactive schematic diagram of a virtual machine migration method provided in an embodiment of the present application is shown for detailed introduction.
[0113] S401: The first computing device 100 encrypts data in a first virtual machine to obtain encrypted data, where the first virtual machine refers to a confidential virtual machine to be migrated in the first computing device 100.
[0114] The first virtual machine may also be understood as a virtual machine whose service is required not to be interrupted.
[0115] S402: The first computing device 100 sends encrypted data to the second computing device, and correspondingly, the second computing device 200 receives the encrypted data.
[0116] S403: The second computing device 200 decrypts the encrypted data to obtain the data in the first virtual machine.
[0117] The data in the first virtual machine includes the business data run by the first virtual machine. Optionally, the data in the first virtual machine may also include information such as logs and events of the first virtual machine, such as information about the start, stop, error and warning of the first virtual machine, which are helpful for troubleshooting and monitoring the behavior of the first virtual machine.
[0118] S404: The second computing device 200 loads the data in the first virtual machine to the standby virtual machine, where the standby virtual machine refers to the standby confidential virtual machine in the second computing device 200.
[0119] It can be understood that after the second computing device 200 loads the data in the first virtual machine to the backup virtual machine, the backup virtual machine can be run according to the data in the first virtual machine. Since the data in the first virtual machine includes the business data run by the first virtual machine, the backup virtual machine can continue to run the business.
[0120] The algorithms used for encryption and decryption performed by the first computing device 100 and the second computing device 200 may be symmetric encryption algorithms, such as advanced encryption standard (AES), data encryption standard (DES), triple data encryption standard (3DES), etc., or may be asymmetric encryption algorithms, such as RSA, elliptic curve cryptography (ECC), digital signature algorithm (DSA), which is not specifically limited in this application.
[0121] The following is a more specific embodiment. Figure 4 The virtual machine migration method provided by the present application is shown as Figure 5A As shown, this embodiment includes the following steps:
[0122] S501: The processor of the first computing device 100 suspends the operation of the first virtual machine on the first TEE side.
[0123] The processor of the first computing device 100 suspends the operation of the first virtual machine. It can be understood that the first virtual machine is only in a suspended state and is not shut down.
[0124] Optionally, the processor of the first computing device 100 may also execute steps S502 to S504 when the first virtual machine is in a "running" state or the like.
[0125] S502: The processor of the first computing device 100 and the processor of the second computing device 200 negotiate to obtain an encryption key.
[0126] For the process of obtaining the encryption key through negotiation between the processor of the first computing device 100 and the processor of the second computing device 200, see Figure 5B and related descriptions.
[0127] S503: The processor of the first computing device 100 uses the encryption key on the first TEE side to encrypt the data in the first virtual machine to obtain encrypted data.
[0128] Optionally, the processor of the first computing device 100 may also encrypt the data in the first virtual machine using the encryption key on the first REE side.
[0129] S504: The processor of the first computing device 100 calls the first communication interface on the first REE side to send encrypted data to the second communication interface, where the first communication interface is the communication interface of the first computing device 100 and the second communication interface is the communication interface of the second computing device 200.
[0130] The communication interface may be a transceiver, or an input / output interface. Optionally, the transceiver may include a transmitter (transmitter) and a receiver (receiver). Optionally, the transceiver may be a transceiver circuit. Optionally, the input / output interface may be an input / output circuit.
[0131] S505: After receiving the encrypted data at the second communication interface, the processor of the second computing device 200 obtains the encrypted data at the second REE side.
[0132] Specifically, after receiving the encrypted data, the second communication interface may store the encrypted data in the memory on the second REE side, and subsequently, the processor of the second computing device 200 may obtain the encrypted data from the memory on the second REE side.
[0133] S506: The processor of the second computing device 200 uses the encryption key on the second TEE side to decrypt the encrypted data to obtain the data in the first virtual machine.
[0134] Optionally, the processor of the second computing device 200 may also decrypt the encrypted data using the encryption key at the second REE side.
[0135] S507: The processor of the second computing device 200 loads the data in the first virtual machine to the standby virtual machine on the second TEE side.
[0136] S508: The processor of the second computing device 200 runs the backup virtual machine according to the data in the first virtual machine on the second TEE side.
[0137] It can be understood that the processor of the first computing device 100 performs encryption operations on the first TEE side, and the processor of the second computing device 200 performs decryption operations on the second TEE side. In comparison, the processor of the first computing device 100 performs encryption operations on the first REE side, and the processor of the second computing device 200 performs decryption operations on the second REE side. Since the security of the first TEE side is higher than the security of the first REE side, and the security of the second TEE side is higher than the security of the second REE side, the former implementation method can better protect the data security in the first virtual machine and reduce the risk of data leakage in the first virtual machine.
[0138] Next, combine Figure 5B The flowchart shown introduces the specific implementation process of step S502.
[0139] S510: The processor of the first computing device 100 obtains a first public key and a first private key.
[0140] The first public key and the first private key may be generated by the processor of the first computing device 100, or may be generated by other key management devices and then sent to the first computing device 100. When the first public key and the first private key are generated by the processor of the first computing device 100, they may be generated by the processor of the first computing device 100 on the first REE side or on the first TEE side, and this application does not specifically limit this.
[0141] After the processor of the first computing device 100 obtains the first public key and the first private key, the first public key and the first private key can be stored in the memory on the first REE side, or in the memory on the first TEE side. It can be understood that since the security of the first TEE side is higher than the security of the first REE side, the first private key is stored in the memory on the first TEE side compared to being stored in the memory on the first REE side, and the former storage method is more secure.
[0142] S520: The processor of the second computing device 200 obtains a second public key and a second private key.
[0143] The second public key and the second private key may be generated by the processor of the second computing device 200, or may be generated by other key management devices and then sent to the second computing device 200. When the second public key and the second private key are generated by the processor of the second computing device 200, they may be generated by the processor of the second computing device 200 on the second REE side or on the second TEE side, and this application does not specifically limit this.
[0144] After the processor of the second computing device 200 obtains the second public key and the second private key, the second public key and the second private key can be stored in the memory on the second REE side, or in the memory on the second TEE side. It can be understood that since the security of the second TEE side is higher than the security of the second REE side, the second private key is stored in the memory on the second TEE side compared to being stored in the memory on the second REE side, and the former storage method is more secure.
[0145] S530: The processor of the first computing device 100 calls the first communication interface on the first REE side and sends the first public key to the second communication interface.
[0146] S540: The processor of the second computing device 200 calls the second communication interface on the second REE side and sends the second public key to the first communication interface.
[0147] S550: After receiving the second public key at the first communication interface, the processor of the first computing device 100 obtains the second public key at the first REE side.
[0148] Specifically, after receiving the second public key, the first communication interface may store the second public key in the memory on the first REE side, and subsequently, the processor of the first computing device 100 may obtain the second public key from the memory on the first REE side.
[0149] S560: After receiving the first public key at the second communication interface, the processor of the second computing device 200 obtains the first public key at the second REE side.
[0150] Specifically, after receiving the first public key, the second communication interface may store the first public key in the memory on the second REE side, and subsequently, the processor of the second computing device 200 may obtain the first public key from the memory on the second REE side.
[0151] S570: The processor of the first computing device 100 generates an encryption key based on the first private key and the second public key on the first TEE side.
[0152] Optionally, the processor of the first computing device 100 may also generate an encryption key based on the first private key and the second public key at the first REE side.
[0153] After generating the encryption key, the processor of the first computing device 100 may store the encryption key in the memory on the first REE side or the memory on the first TEE side.
[0154] S580: The processor of the second computing device 200 generates an encryption key based on the second private key and the first public key on the second TEE side.
[0155] Optionally, the processor of the second computing device 200 may also generate an encryption key based on the second private key and the first public key at the second REE side.
[0156] After generating the encryption key, the processor of the second computing device 200 may store the encryption key in the memory on the second REE side or the memory on the second TEE side.
[0157] It can be understood that the processor of the first computing device 100 generates an encryption key based on the first private key and the second public key on the first TEE side, and the processor of the second computing device 200 generates an encryption key based on the second private key and the first public key on the second TEE side. The processor of the first computing device 100 stores the encryption key in the memory of the first TEE side, and the processor of the second computing device 200 stores the encryption key in the memory of the second TEE side. In comparison, the processor of the first computing device 100 generates an encryption key based on the first private key and the second public key on the first REE side, and the processor of the second computing device 200 generates an encryption key based on the second private key and the first public key on the second REE side, and the processor of the first computing device 100 stores the encryption key in the memory of the first REE side, and the processor of the second computing device 200 stores the encryption key in the memory of the second REE side. Since the security of the first TEE side is higher than that of the first REE side, and the security of the second TEE side is higher than that of the second REE side, the former implementation method can better protect the security of the encryption key, thereby better protecting the data security in the first virtual machine and reducing the risk of data leakage in the first virtual machine.
[0158] The following two specific examples are introduced Figure 5B The steps shown.
[0159] Example 1: In S510, the first private key generated by the processor of the first computing device 100 on the first TEE side is a random number a, and the first public key is A=g^a(mod p). In S520, the second private key generated by the processor of the second computing device 200 on the second TEE side is a random number b, and the second public key is B=g^b(mod p), wherein g and p may be preset in the processor of the first computing device 100 and the processor of the second computing device 200, or may be pre-negotiated by the processor of the first computing device 100 and the processor of the second computing device 200. Then, in S530-S540, the first computing device 100 and the second computing device 200 exchange public keys. Next, in S550, the processor of the first computing device 100 may obtain an encryption key S=B^a(mod p) based on B, a and p on the first TEE side. In S560, the processor of the second computing device 200 may obtain an encryption key S=A^b(mod p) based on A, b and p on the second TEE side.
[0160] Example 2: In S510, the first private key generated by the processor of the first computing device 100 on the first TEE side is a random number a, and the first public key is A=a*Q(x,y). In S520, the second private key generated by the processor of the second computing device 200 on the second TEE side is a random number b, and the second public key is B=b*Q(x,y), where Q(x,y) may be pre-negotiated by the processor of the first computing device 100 and the processor of the second computing device 200, such as a pre-negotiated base point G on a certain elliptic curve. Then, in S530-S540, the first computing device 100 and the second computing device 200 exchange public keys. Next, in S550, the processor of the first computing device 100 can calculate the encryption key S=a*B=a*b*Q(x,y) on the first TEE side based on the first private key a and the second public key B. In S560, the processor of the second computing device 200 can calculate the encryption key S=b*A=b*a*Q(x,y) on the second TEE side based on the second private key b and the first public key A.
[0161] It should be understood that the above-mentioned Example 1 and Example 2 are merely examples of implementation methods in which the processor of the first computing device 100 and the processor of the second computing device 200 negotiate to obtain an encryption key, and should not be regarded as specific limitations.
[0162] It can be seen that in the above-mentioned Example 1 and Example 2, the processor of the first computing device 100 and the processor of the second computing device 200 calculate the encryption key based on public information (such as a public key) and private information held by each of them (such as a private key), and the private information is not transmitted between the two. Even if the public information is stolen during the transmission process, the thief cannot steal the encryption key because the private information is not leaked. Therefore, the security of the data in the first virtual machine that is subsequently encrypted using the encryption key during the transmission process can be protected.
[0163] In order to further protect the security of the data in the first virtual machine, in a possible embodiment, before the processor of the first computing device 100 and the processor of the second computing device 200 negotiate to obtain the encryption key, the first computing device 100 may send an authentication request to the second computing device 200, requesting to obtain the authentication information of the backup virtual machine, so as to authenticate the backup virtual machine based on the authentication information, and if the authentication is successful, negotiate with the second computing device 200 to obtain the encryption key, otherwise, no key negotiation is performed.
[0164] Specifically, the processor of the first computing device 100 can generate an authentication request on the first TEE side, and then call the first communication interface on the first REE side to send an authentication request to the second communication interface. After the second communication interface receives the authentication request, the processor of the second computing device 200 obtains the authentication information of the standby virtual machine according to the authentication request on the second TEE side, and then calls the second communication interface on the second REE side to return the authentication information of the standby virtual machine to the first communication interface. After receiving the authentication information of the standby virtual machine, the first communication interface can store the authentication information of the standby virtual machine in the memory on the first REE side. Subsequently, the processor of the first computing device 100 can obtain the authentication information of the standby virtual machine from the memory on the first REE side, and authenticate the standby virtual machine on the first TEE side according to the authentication information of the standby virtual machine.
[0165] The authentication information of the above-mentioned standby virtual machine may include the current measurement value of the configuration of the standby virtual machine and the historical measurement value of the configuration of the standby virtual machine. Optionally, the authentication information of the above-mentioned standby virtual machine may include the certificate of the standby virtual machine (or a certificate chain), and the historical measurement value of the configuration of the above-mentioned standby virtual machine may be carried in the certificate of the standby virtual machine. Among them, the configuration of the standby virtual machine may include the virtual processor core type, the number of virtual processor cores, the memory address, the name and version of the APP installed on the standby virtual machine, and the image of the standby virtual machine, etc.; the measurement value of the configuration is used to measure whether the configuration has been tampered with, for example, the current number of virtual processor cores is compared with the historical number of virtual processor cores recorded in the certificate. If they are the same, it means that the number of virtual processor cores has not been tampered with, otherwise, it means that the number of virtual processor cores has been tampered with (increased or decreased), and for example, the current hash value of the image of the standby virtual machine is compared with the historical hash value of the image of the standby virtual machine recorded in the certificate. If they are the same, it means that the image has not been tampered with, otherwise, it means that the image has been tampered with. In this application, the configuration of the standby virtual machine has been tampered with, which can be understood as the standby virtual machine is incomplete and is an untrusted virtual machine.
[0166] Optionally, the authentication information of the above-mentioned standby virtual machine may include the identity information of the standby virtual machine, and the identity information is used to uniquely identify and recognize the standby virtual machine. The identity information of the standby virtual machine may include the name of the standby virtual machine, a universally unique identifier (UUID), a media access control address (MAC address), operating system information (such as operating system type, version number), and virtual hardware information (such as the number of CPU cores, memory size, disk capacity, device configuration, etc.). It can be understood that the processor of the first computing device 100 can authenticate the identity of the standby virtual machine through the identity information of the standby virtual machine. If the identity authentication is passed, the standby virtual machine is determined to be a trusted virtual machine. Otherwise, the standby virtual machine is determined to be an untrusted virtual machine. Optionally, the certificate of the above-mentioned standby virtual machine also includes the identity information provided by the standby virtual machine when applying for the certificate, the validity period of the certificate, the issuing authority of the certificate, the digital signature of the certificate, etc.
[0167] Specifically, the processor of the first computing device 100 can first authenticate the legitimacy and integrity of the certificate of the backup virtual machine, such as determining whether the certificate is valid based on the validity period of the certificate, determining whether the issuing authority of the certificate is a legal authority, and determining whether the certificate has been tampered with based on the digital signature of the certificate. When it is determined that the certificate is legal and complete, determine whether the backup virtual machine is a trusted virtual machine by checking the current measurement value of the configuration of the backup virtual machine and the certificate, and / or by checking whether the identity information of the backup virtual machine matches the identity information recorded in the certificate.
[0168] In order to protect the security of the second computing device 200 and the backup virtual machine in the second computing device 200, in a possible embodiment, before the processor of the second computing device 200 and the processor of the first computing device 100 negotiate to obtain the encryption key, the first computing device 100 may also send the authentication information of the first virtual machine to the second computing device 200, so that the second computing device 200 authenticates the first virtual machine based on the authentication information, and if the authentication is successful, negotiates with the first computing device 100 to obtain the encryption key, otherwise, no key negotiation is performed.
[0169] Specifically, the processor of the second computing device 200 can obtain the authentication information of the first virtual machine on the first TEE side, and then call the first communication interface on the first REE side to send the authentication information of the first virtual machine to the second communication interface. After receiving the authentication information of the first virtual machine, the second communication interface can store the authentication information of the first virtual machine in the memory on the second REE side. Subsequently, the processor of the second computing device 200 can obtain the authentication information of the first virtual machine from the memory on the second REE side, and authenticate the first virtual machine on the second TEE side based on the authentication information of the first virtual machine.
[0170] The authentication information of the first virtual machine may include the current measurement value of the configuration of the first virtual machine and the historical measurement value of the configuration of the first virtual machine. Optionally, the authentication information of the first virtual machine may include the certificate of the first virtual machine (or a certificate chain), and the historical measurement value of the configuration of the first virtual machine may be carried in the certificate of the first virtual machine. Among them, the configuration of the first virtual machine may include the type of virtual processor core, the number of virtual processor cores, the memory address, the name and version of the APP installed on the first virtual machine, and the image of the first virtual machine. The measurement value of the configuration is used to measure whether the configuration has been tampered with, for example, the current number of virtual processor cores is compared with the historical number of virtual processor cores recorded in the certificate. If they are the same, it means that the number of virtual processor cores has not been tampered with, otherwise, it means that the number of virtual processor cores has been tampered with (increased or decreased), and for example, the current hash value of the image of the first virtual machine is compared with the historical hash value of the image of the first virtual machine recorded in the certificate. If they are the same, it means that the image has not been tampered with, otherwise, it means that the image has been tampered with. In this application, the configuration of the first virtual machine is tampered with, which can be understood as the first virtual machine is incomplete and is an untrusted virtual machine.
[0171] Optionally, the authentication information of the first virtual machine may include the identity information of the first virtual machine, and the identity information is used to uniquely identify and recognize the first virtual machine. The identity information of the first virtual machine may include the name of the first virtual machine, a universally unique identifier (UUID), a media access control address (MAC address), operating system information (such as operating system type, version number), and virtual hardware information (such as the number of CPU cores, memory size, disk capacity, device configuration, etc.). It can be understood that the processor of the second computing device 200 can authenticate the identity of the first virtual machine through the identity information of the first virtual machine. If the identity authentication is passed, the first virtual machine is determined to be a trusted virtual machine. Otherwise, the first virtual machine is determined to be an untrusted virtual machine. Optionally, the certificate of the first virtual machine also includes the identity information provided by the first virtual machine when applying for the certificate, the validity period of the certificate, the issuing authority of the certificate, the digital signature of the certificate, etc.
[0172] Specifically, the processor of the second computing device 200 can first authenticate the legitimacy and integrity of the certificate of the first virtual machine, such as determining whether the certificate is valid based on the validity period of the certificate, determining whether the issuing authority of the certificate is a legal authority, and determining whether the certificate has been tampered with based on the digital signature of the certificate. When it is determined that the certificate is legal and complete, determine whether the first virtual machine is a trusted virtual machine by checking whether the current measurement value of the configuration of the first virtual machine and the historical measurement value of the configuration of the first virtual machine recorded in the certificate are consistent (the same), and / or determine whether the first virtual machine is a trusted virtual machine by checking whether the identity information of the first virtual machine matches the identity information recorded in the certificate.
[0173] In a possible embodiment, after the processor of the first computing device 100 and the processor of the second computing device 200 negotiate to obtain the encryption key, and before the processor of the first computing device 100 uses the encryption key to encrypt data in the first virtual machine, the processor of the first computing device 100 may also verify the validity of the encryption key, that is, verify whether the encryption key held by the processor of the first computing device 100 is the same as the encryption key held by the processor of the second computing device 200, so as to ensure the accurate migration process of the first virtual machine.
[0174] Specifically, the processor of the first computing device 100 can verify the validity of the encryption key in the following manner:
[0175] After the processor of the first computing device 100 and the processor of the second computing device 200 negotiate to obtain the encryption key, the processor of the second computing device 200 can generate a message authentication code on the second REE side / second TEE side according to the encryption key and the first message (in order to distinguish it from the message authentication code generated by the processor of the first computing device 100 below, the message authentication code generated by the processor of the second computing device 200 is referred to as the second message authentication code, and the message authentication code generated by the processor of the first computing device 100 is referred to as the first message authentication code below), and call the second communication interface on the second REE side to send the second message authentication code and the first message to the first communication interface. After receiving the second message authentication code and the first message, the first communication interface can store the second message authentication code and the first message in the memory of the first REE side. Subsequently, the processor of the first computing device 100 can obtain the second message authentication code and the first message from the memory of the first REE side, and generate the first message authentication code on the first REE side / first TEE side according to the encryption key held by itself and the first message, and then compare the first message authentication code and the second message authentication code. When it is determined that the two are the same, it is determined that the encryption key held by itself is valid. Otherwise, it is determined that the encryption key held by itself is invalid.
[0176] It can be understood that the processor of the second computing device 200 generates a second message authentication code on the second TEE side, and the processor of the first computing device 100 generates a first message authentication code on the first TEE side. In comparison, the processor of the second computing device 200 generates a second message authentication code on the second REE side, and the processor of the first computing device 100 generates a first message authentication code on the first REE side. Since the security of the first TEE side is higher than the security of the first REE side, and the security of the second TEE side is higher than the security of the second REE side, the former implementation method can better protect the security of the encryption key, thereby better protecting the data security in the first virtual machine and reducing the risk of data leakage in the first virtual machine.
[0177] In a specific implementation, the second computing device 200 generates the second message authentication code on the second TEE side based on the encryption key held by itself and the first message, and the first computing device 100 generates the first message authentication code on the first TEE side based on the encryption key held by itself and the first message, and the encryption key and the first message are signed using the same signature algorithm, and the obtained signature information is the message authentication code. The signature algorithm includes but is not limited to RSA, DSA, etc.
[0178] Depend on Figure 3 It can be seen that the first TEE side (i.e., the TEE side of the first computing device 100) is deployed with a first virtual machine manager, the second TEE side (i.e., the TEE side of the second computing device 200) is deployed with a second virtual machine manager, the first REE side (i.e., the REE side of the first computing device 100) is deployed with a third virtual machine manager, and the second REE side (i.e., the REE side of the second computing device 200) is deployed with a fourth virtual machine manager. In a possible embodiment, the above-mentioned operation performed by the processor of the first computing device 100 on the first TEE side can be executed by the processor of the first computing device 100 running the first virtual machine manager, the above-mentioned operation of calling the first communication interface performed by the processor of the first computing device 100 on the first REE side can be executed by the processor of the first computing device 100 running the third virtual machine manager, and the above-mentioned operation of calling the second communication interface performed by the processor of the second computing device 200 on the second REE side can be executed by the processor of the second computing device 200 running the fourth virtual machine manager.
[0179] In the present application, before the processor of the second computing device 200 runs the backup virtual machine based on the data in the first virtual machine on the second TEE side, the first computing device 100 may also send the status information of the first virtual machine to the second computing device 200. After receiving the status information of the first virtual machine, the second computing device 200 synchronizes the status of the backup virtual machine and the first virtual machine based on the status information of the first virtual machine, so that the backup virtual machine continues to run from the state before the first virtual machine was suspended, and the user will not perceive that the state of the virtual machine running the business has changed.
[0180] Specifically, the processor of the first computing device 100 can call the first communication interface on the first REE side and send the status information of the first virtual machine to the second communication interface. After receiving the status information of the first virtual machine, the second communication interface stores the status information of the first virtual machine in the memory on the second REE side. Subsequently, the processor of the second computing device 200 can obtain the status information of the first virtual machine from the memory on the second REE side, and realize the status synchronization of the standby virtual machine and the first virtual machine based on the status information of the first virtual machine on the second TEE side.
[0181] In a more specific embodiment, the first computing device 100 sends to the second computing device 200 the status information of the first virtual machine stored in the third virtual machine manager. After receiving the status information of the first virtual machine, the processor of the second computing device 200 loads the status information of the first virtual machine to the fourth virtual machine manager. Subsequently, the processor of the second computing device 200 runs the fourth virtual machine manager to synchronize the status of the standby virtual machine and the first virtual machine according to the status information of the first virtual machine.
[0182] In a specific implementation, the first computing device 100 may include multiple processors. When the first computing device 100 includes multiple processors, the operations performed by the processor of the first computing device 100 in the above embodiment may be performed by two or more processors in cooperation, or all performed by the first processor in the first computing device 100, and the first processor is any one of the multiple processors included in the first computing device 100. Figure 5AIn the embodiment shown, and the first computing device 100 includes two processors, processor 101 and processor 102, for example, in one possible embodiment, S501-S503 are executed by processor 101, and S504 is executed by processor 102. After processor 101 executes S503, processor 101 needs to communicate with processor 102 to transmit the encrypted data to processor 102. In another possible embodiment, S501-S504 are all executed by processor 101 or processor 102, and there is no need to transmit the encrypted data. It can be seen that the latter embodiment takes less time and is more efficient than the former embodiment in the migration process of the first virtual machine.
[0183] Similarly, when the second computing device 200 includes multiple processors, the operations performed by the processor of the second computing device 200 in the above embodiment can be performed by two / more processors in cooperation, or all performed by the second processor in the second computing device 200, and the second processor can be any one of the multiple processors included in the second computing device 200. Compared with the former, the latter requires less time for the migration process of the first virtual machine and is more efficient.
[0184] It can be understood that the operations performed by the processor of the first computing device 100 in the above embodiment are actually implemented by the processor of the first computing device 100 executing the corresponding process / thread. In a specific implementation, the process / thread that the processor of the first computing device 100 needs to execute can be affinity bound to the first processor, so that the operations performed by the processor of the first computing device 100 in the above embodiment are all executed by the first processor. Similarly, the operations performed by the processor of the second computing device 200 in the above embodiment are actually implemented by the processor of the second computing device 200 executing the corresponding process / thread. In a specific implementation, the process / thread that the processor of the second computing device 200 needs to execute can be affinity bound to the second processor, so that the operations performed by the processor of the second computing device 200 in the above embodiment are all executed by the second processor.
[0185] Next, see Figure 6 , Figure 6 is a schematic diagram of a possible structure of a first computing device 100 and a second computing device 200 provided in an embodiment of the present application, such as Figure 6As shown, the REE side of the first computing device 100 includes a migration daemon process, and the host kernel includes a migration driver. The REE side of the second computing device 200 also includes a migration daemon process, and the host kernel also includes a migration driver. The first virtual machine manager and the second virtual machine manager both include a key negotiation module (interface), each virtual machine manager also includes an encryption module, and the second virtual machine manager also includes a decryption module.
[0186] The migration daemon is a process for communicating between the first computing device 100 and the second computing device 200. The process is used to monitor the network connection between the first computing device 100 and the second computing device 200, and coordinate the migration process of the first virtual machine.
[0187] Specifically, during the migration process:
[0188] The migration daemon in the first computing device 100 is used to instruct the first virtual machine manager to negotiate with the key negotiation module in the second virtual machine manager through the key negotiation module included in the first virtual machine manager to obtain an encryption key, such as Figure 6 As shown by the arrow corresponding to step ①. After the key negotiation is completed, the first virtual machine manager will use the encryption key obtained through the above negotiation to encrypt the data in the first virtual machine through the encryption module included in it. After obtaining the encrypted data, the first virtual machine manager calls the third virtual machine manager, and the third virtual machine manager calls the first communication interface to send the encrypted data to the fourth virtual machine manager, as shown in FIG. Figure 6 The corresponding arrows of steps ②-③ are shown.
[0189] After monitoring that the second computing device 200 receives the encrypted data, the migration daemon in the second computing device 200 calls the fourth virtual machine manager to obtain the encrypted data, and then the fourth virtual machine manager calls the decryption module in the second virtual machine manager, such as Figure 6 As shown by the arrow corresponding to step ④, the encrypted data is decrypted using the encryption key obtained through the above negotiation to obtain the data in the first virtual machine, and then the second virtual machine manager can load the data in the first virtual machine into the standby virtual machine.
[0190] The function of the migration driver in the first computing device 100 is to implement the migration daemon in the first computing device 100 to call the third virtual machine manager, such as implementing the migration daemon by calling the migration driver, and the migration driver calls the third virtual machine manager to transmit encrypted data to the fourth virtual machine manager.
[0191] The function of the migration driver in the second computing device 200 is to implement the migration daemon in the second computing device 200 to call the fourth virtual machine manager, such as implementing the migration daemon to call the migration driver, and the migration driver calls the fourth virtual machine manager to transmit encrypted data to the second virtual machine manager.
[0192] To facilitate a clearer understanding Figure 6 The process of each module performing confidential virtual machine migration is shown below. Figure 7 The interaction diagram shown describes the above process from the perspective of the migration daemon in the first computing device 100 and the migration daemon in the second computing device 200.
[0193] S701: The migration daemon in the first computing device 100 calls the key negotiation module in the first virtual machine manager and sends an authentication request to the second computing device 200. The authentication request carries the current measurement value of the configuration of the first virtual machine and the certificate of the first virtual machine.
[0194] S702: The migration daemon in the second computing device 200 calls the key negotiation module in the second virtual machine manager to authenticate the first virtual machine based on the authentication request.
[0195] S703: When the first virtual machine is authenticated successfully, the migration daemon in the second computing device 200 calls the key negotiation module in the second virtual machine manager to send the current measurement value of the configuration of the standby virtual machine and the certificate of the standby virtual machine to the first computing device 100.
[0196] S704: The migration daemon in the first computing device 100 calls the key negotiation module in the first virtual machine manager to authenticate the standby virtual machine based on the current measurement value of the configuration of the standby virtual machine and the certificate of the standby virtual machine.
[0197] S705: When the authentication of the standby virtual machine is successful, the migration daemon in the first computing device 100 calls the key negotiation module in the first virtual machine manager and negotiates with the key negotiation module in the second virtual machine manager to obtain an encryption key.
[0198] S706: The migration daemon in the first computing device 100 calls the first virtual machine manager to suspend the running of the first virtual machine, and marks all the memory of the first virtual machine as dirty pages.
[0199] S707: The migration daemon in the first computing device 100 calls the encryption module in the first virtual machine manager, and uses the encryption key to encrypt the data in the first virtual machine to obtain encrypted data.
[0200] S708: The migration daemon in the first computing device 100 calls the encryption module in the first virtual machine manager to send encrypted data to the second computing device 200.
[0201] S709: The migration daemon in the second computing device 200 calls the decryption module of the second virtual machine manager, uses the encryption key to decrypt the encrypted data, and obtains the data in the first virtual machine.
[0202] S710: The migration daemon in the second computing device 200 calls the decryption module of the second virtual machine manager to load the data in the first virtual machine into the standby virtual machine, thereby synchronizing the data in the standby virtual machine with the first virtual machine.
[0203] S711: The migration daemon in the first computing device 100 calls the third virtual machine manager to send the status information of the first virtual machine stored in the third virtual machine manager to the second computing device 200. Correspondingly, the second computing device 200 receives the status information of the first virtual machine.
[0204] S712: The migration daemon process in the second computing device 200 calls the fourth virtual machine manager to synchronize the status of the standby virtual machine and the first virtual machine according to the status information of the first virtual machine.
[0205] exist Figure 7 In the embodiment, the migration daemon in the first computing device 100 calls the first virtual machine manager, which can be implemented by calling the migration driver in the first computing device 100, the migration driver calls the third virtual machine manager, and then the third virtual machine manager calls the first virtual machine manager. The migration daemon in the second computing device 200 calls the second virtual machine manager, which can be implemented by calling the migration driver in the second computing device 200, the migration driver calls the fourth virtual machine manager, and then the fourth virtual machine manager calls the second virtual machine manager.
[0206] The above steps have been introduced in the previous embodiments, such as the process of negotiating the encryption key, the process of authenticating the virtual machine based on the current measurement value of the virtual machine configuration and the certificate. Please refer to the relevant description above. For the sake of brevity of the specification, they will not be elaborated here.
[0207] It should also be understood that the above-mentioned migration daemon, key negotiation module, encryption module, decryption module, etc. are merely example names of various functional modules in the first computing device 100 and the second computing device 200, and should not be regarded as specific limitations on the various functional modules.
[0208] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0209] The above text has elaborated in detail the virtual machine migration method and system provided by the present application. Based on the same inventive concept, the following text will continue to introduce the virtual machine migration apparatus and computing device provided by the present application.
[0210] It should be understood that the unit modules within the virtual machine migration device may also be divided into multiple types, and each module may be a software module, a hardware module, or partly a software module and partly a hardware module, and this application does not limit this.
[0211] See also Figure 8 , Figure 8 is a schematic diagram of a virtual machine migration device 800 provided in an embodiment of the present application, which can be applied to Figure 3 The first computing device 100 shown, Figure 8 As shown, the device 800 includes: a sending module 810 and an encryption module 820.
[0212] The functions of each module of the virtual machine migration device 800 are introduced exemplarily below. It should be understood that the functions of each module described below are only functions that the virtual machine migration device 800 may have in some embodiments of the present application, and the present application does not limit the functions of each module.
[0213] The encryption module 820 is used to encrypt the data in the first virtual machine on the first TEE side to obtain encrypted data.
[0214] The sending module 810 is used to call the first communication interface on the first REE side and send encrypted data to the second computing device 200. The encrypted data is used to migrate the data in the first virtual machine to the backup virtual machine. The backup virtual machine is deployed on the second TEE side. The second TEE side is the TEE side of the second computing device 200. The first communication interface is the communication interface of the first computing device 100.
[0215] In some possible embodiments, the apparatus 800 further includes a key negotiation module 830, which is used to negotiate with the processor of the second computing device 200 to obtain an encryption key. The encrypted data is obtained by encrypting the data in the first virtual machine using the encryption key, and the encryption key is also used to decrypt the encrypted data.
[0216] In some possible embodiments, the above-mentioned device 800 also includes: an acquisition module 840, which is used to obtain the authentication information of the standby virtual machine on the first REE side; an authentication module 850, which is used to authenticate the standby virtual machine on the first TEE side according to the authentication information of the standby virtual machine; a key negotiation module 830, which is used to negotiate with the processor of the second computing device 200 to obtain an encryption key when the authentication module 850 authenticates the standby virtual machine according to the authentication information of the standby virtual machine.
[0217] In some possible embodiments, the authentication information of the standby virtual machine includes the current measurement value of the configuration of the standby virtual machine and the historical measurement value of the configuration of the standby virtual machine; the above-mentioned authentication module 850 is used to authenticate the standby virtual machine when it is determined that the current measurement value of the configuration of the standby virtual machine and the historical measurement value of the configuration of the standby virtual machine are the same.
[0218] In some possible embodiments, before the key negotiation module 830 is used to negotiate with the processor of the second computing device 200 to obtain the encryption key, the sending module 810 is also used to call the first communication interface to send the authentication information of the first virtual machine to the second computing device 200.
[0219] In some possible embodiments, the authentication information of the first virtual machine includes a current measurement value of the configuration of the first virtual machine and a historical measurement value of the configuration of the first virtual machine.
[0220] In some possible embodiments, the acquisition module 840 is further used to acquire a first message authentication code and a first message on the first REE side, where the first message authentication code is generated based on an encryption key and the first message; the authentication module 850 is further used to determine the validity of the encryption key based on the first message authentication code and the first message; when the authentication module 850 determines that the encryption key is a valid key based on the first message authentication code and the first message, the encryption module 820 is used to encrypt data in the first virtual machine using the encryption key.
[0221] In some possible embodiments, the sending module 810 is also used to call the first communication interface on the first REE side to send the public key of the first computing device 100 (i.e., the first public key) to the second computing device 200, and the first public key is used to generate an encryption key; the acquisition module 840 is also used to acquire the public key (second public key) of the second computing device 200 on the first REE side; the key negotiation module 830 is used to generate an encryption key based on the first private key and the second public key.
[0222] In some possible embodiments, the sending module 810 is further used to send the state information of the first virtual machine to the second computing device 200, and the state information of the first virtual machine is used to achieve state synchronization between the standby virtual machine and the first virtual machine.
[0223] In some possible embodiments, some or all of the sending module 810, encryption module 820, key negotiation module 830, acquisition module 840, and authentication module 850 are software modules, and these software modules are bound to the first processor among the multiple processors included in the first computing device 100. That is, these software modules are all run by the first processor when used to implement corresponding operations.
[0224] See also Fig. 9 , Fig. 9 is a structural diagram of another virtual machine migration device 900 provided in an embodiment of the present application, which can be applied to Figure 3 The second computing device 200 shown, Fig. 9 As shown, the device 900 includes: an acquisition module 910 , a decryption module 920 and a loading module 930 .
[0225] The functions of each module of the virtual machine migration device 900 are introduced exemplarily below. It should be understood that the functions of each module described below are only functions that the virtual machine migration device 900 may have in some embodiments of the present application, and the present application does not limit the functions of each module.
[0226] An acquisition module 910 is used to acquire encrypted data of data in the first virtual machine;
[0227] A decryption module 920, used for decrypting the encrypted data to obtain data in the first virtual machine;
[0228] The loading module 930 is used to load the data in the first virtual machine to the standby virtual machine.
[0229] In some possible embodiments, the acquisition module 910 is specifically used to obtain encrypted data of the data in the first virtual machine on the second REE side; the decryption module 920 is specifically used to decrypt the encrypted data on the second TEE side to obtain the data in the first virtual machine; the loading module 930 is specifically used to load the data in the first virtual machine to the backup virtual machine on the second TEE side.
[0230] In some possible embodiments, Fig. 9 As shown, the apparatus 900 further includes a key negotiation module 940. The encrypted data is obtained by encrypting the data in the first virtual machine using an encryption key. The encryption key is negotiated between the key negotiation module 940 and the processor of the first computing device 100. The encryption key is also used to decrypt the encrypted data.
[0231] In some possible embodiments, Fig. 9 As shown, the device 900 also includes an authentication module 950; the acquisition module 910 is also used to obtain the authentication information of the first virtual machine on the second REE side; the authentication module 950 is used to authenticate the first virtual machine on the second TEE side according to the authentication information of the first virtual machine; the key negotiation module 940 is used to negotiate with the processor of the first computing device 100 to obtain an encryption key when the authentication module 950 authenticates the first virtual machine successfully.
[0232] In some possible embodiments, the authentication information of the first virtual machine includes the current measurement value of the configuration of the first virtual machine and the historical measurement value of the configuration of the first virtual machine; the authentication module 950 is specifically used to authenticate the first virtual machine when it is determined on the second TEE side that the current measurement value of the configuration of the first virtual machine and the historical measurement value of the configuration of the first virtual machine are the same.
[0233] In some possible embodiments, Fig. 9 As shown, the apparatus 900 further includes a sending module 960, which is used to call the second communication interface on the second REE side and send authentication information of the standby virtual machine to the first communication interface before the key negotiation module 940 and the processor of the first computing device 100 negotiate to obtain the encryption key.
[0234] In some possible embodiments, the authentication information of the standby virtual machine includes a current measurement value of the configuration of the standby virtual machine and a historical measurement value of the configuration of the standby virtual machine.
[0235] In some possible embodiments, before the acquisition module 910 acquires the encrypted data of the data in the first virtual machine, the authentication module 950 is also used to generate a message authentication code based on the encryption key and the first message on the second TEE side; the sending module 960 is also used to call the second communication interface on the second REE side and send the message authentication code and the first message to the first communication interface.
[0236] In some possible embodiments, the sending module 960 is used to call the second communication interface on the second REE side, send the public key of the second computing device 200 to the first communication interface, and the public key of the second computing device 200 is used to generate an encryption key; the acquisition module 910 is used to obtain the public key of the first computing device 100 on the second REE side; the key negotiation module 940 is used to generate an encryption key on the second TEE side based on the private key of the second computing device 200 and the public key of the first computing device 100.
[0237] In some possible embodiments, the private key of the second computing device 200 is stored on the second TEE side.
[0238] In some possible embodiments, Fig. 9 As shown, the device 900 also includes a synchronization module 970; the acquisition module 910 is also used to obtain the state information of the first virtual machine; the synchronization module 970 is used to synchronize the state of the standby virtual machine and the first virtual machine according to the state information of the first virtual machine.
[0239] In some possible embodiments, some or all of the above-mentioned acquisition module 910, decryption module 920, loading module 930, key negotiation module 940, authentication module 950, sending module 960 and synchronization module 970 are software modules, and these software modules are bound to the second processor among the multiple processors included in the second computing device 200, that is, these software modules are run by the second processor when used to implement corresponding operations.
[0240] Specifically, the specific implementation of various operations performed by the virtual machine migration devices 800 and 900 can refer to the description in the relevant content of the virtual machine migration method embodiment, and for the sake of brevity of the specification, it will not be repeated here.
[0241] See also Fig.10 , Fig.10 1 is a schematic diagram of the structure of a computing device 1000 provided in an embodiment of the present application. The computing device 1000 includes: a processor 1010, a memory unit 1020, a communication interface 1030, a storage 1040, an input device 1050, and an output device 1060. The processor 1010, the memory unit 1020, the communication interface 1030, the storage 1040, the input device 1050, and the output device 1060 can be interconnected through a bus 1070.
[0242] The processor 1010 can read the program code (including instructions) stored in the memory unit 1020 and execute the program code stored in the memory unit 1020, so that the computing device 1000 executes the steps performed by the first computing device 100 or the second computing device 200 in the virtual machine migration method provided by the above method embodiment.
[0243] The processor 1010 may have a variety of specific implementation forms. For example, the processor 1010 may be at least one central processing unit (CPU), such as Fig.10As shown, including CPU0 and CPU1, processor 1010 can also be a graphics processing unit (GPU), etc., and processor 1010 can also be a single-core processor or a multi-core processor. Processor 1010 can be a combination of a CPU and a hardware chip. The above-mentioned hardware chip can be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The above-mentioned PLD can be a complex programmable logical device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. Processor 1010 can also be implemented by a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (DSP).
[0244] The memory unit 1020 is used to store the kernel, program codes, and program data generated when the processor 1010 executes the program codes stored in the memory unit 1020 .
[0245] When the computing device 1000 is used to execute the steps performed by the first computing device 100 in the virtual machine migration method provided by the above-mentioned method embodiment, the program code stored in the memory unit 1020 includes: the code of the sending module 810, the code of the encryption module 820, the code of the key negotiation module 830, the code of the acquisition module 840 and the code of the authentication module 850, etc., and the program data stored in the memory unit 1020 includes: encryption keys, data in the first virtual machine, encrypted data, etc.
[0246] When the computing device 1000 is used to execute the steps performed by the second computing device 200 in the virtual machine migration method provided by the above-mentioned method embodiment, the program code stored in the memory unit 1020 includes: code of the acquisition module 910, code of the decryption module 920, code of the loading module 930, code of the key negotiation module 940, code of the authentication module 950, code of the sending module 960 and code of the synchronization module 970, etc., and the program data stored in the memory unit 1020 includes: encryption keys, data in the first virtual machine, encrypted data, etc.
[0247] The communication interface 1030 may be a wired interface (e.g., an Ethernet interface, a fiber optic interface, other types of interfaces (e.g., an InfiniBand (IB) interface)) or a wireless interface (e.g., a cellular network interface or a wireless local area network interface) for communicating with other computing devices or apparatuses. When the communication interface 1030 is a wired interface, the communication interface 1030 may adopt a protocol family above the transmission control protocol / internet protocol (TCP / IP), such as a remote function call (RFC) protocol, a simple object access protocol (SOAP) protocol, a simple network management protocol (SNMP) protocol, a common object request broker architecture (CORBA) protocol, and a distributed protocol, etc.
[0248] The memory 1040 may be a non-volatile memory, such as a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The memory 1040 may also be a volatile memory, which may be a random access memory (RAM) used as an external cache.
[0249] The input device 1050 may include a mouse and a keyboard, etc. The user may input data or instructions to the computing device 1000 through the input device 1050, such as inputting a virtual machine migration instruction (the instruction indicates the migration of the first virtual machine), etc.
[0250] The output device 1060 may include a display, and the computing device 1000 may provide data to the user through the display, such as displaying a migration completion notification to the user after completing the migration of the first virtual machine, etc. The display may include a cathode ray tube display (CRT), a plasma display panel (PDP), a liquid crystal display (LCD), etc. Taking the display as an LCD as an example, the liquid crystal display includes a liquid crystal panel and a backlight module, wherein the liquid crystal display panel includes a polarizing film, a glass substrate, a black matrix, a color filter, a protective film, a common electrode, a calibration layer, a liquid crystal layer (liquid crystal, a spacer, a sealant), a capacitor, a display electrode, a prism layer, and a light diffusion layer. The backlight module includes: an illumination light source, a reflector, a light guide plate, a diffuser, a brightness enhancement film (prism sheet) and a frame, etc.
[0251] The bus 1070 may be a PCIE or an extended industry standard architecture (EISA) bus, etc. The bus 1070 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0252] It should be understood that the computing device 1000 of the embodiment of the present application may correspond to the computing device including the virtual machine migration apparatus 800 or 900 in the embodiment of the present application, and may correspond to the computing device executing the virtual machine migration apparatus 800 or 900 in the embodiment of the present application. Figure 4 , Figure 5A , Figure 5B , Figure 7 The corresponding subjects in the method shown, and the operations and / or functions of each module in the computing device 1000 are respectively to implement Figure 4 , Figure 5A , Figure 5B , Figure 7 For the sake of brevity, the corresponding process of the method shown will not be repeated here.
[0253] It should be understood that the computing device 1000 is only an example provided in the embodiment of the present application, and the computing device 1000 may have more Fig.10 The components shown may be more or less than the components, may be combined with two or more components, or may be implemented with a different configuration of components.
[0254] The embodiment of the present application further provides a virtual machine migration system, which may include the virtual machine migration device 800 and the virtual machine migration device 900 described above.
[0255] An embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed, some or all of the steps of the virtual machine implementation method recorded in the above embodiment can be implemented.
[0256] The embodiment of the present application also provides a computer program product. When the computer program product is read and executed by a computer, it can implement some or all of the steps of the virtual machine implementation method recorded in the above method embodiment.
[0257] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0258] In the above embodiments, it can be implemented in whole or in part by software, hardware 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 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 a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may 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 integration. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium, or a semiconductor medium, etc.
[0259] The above is only a specific implementation of the present application. Those skilled in the art may conceive of changes or substitutions based on the specific implementation provided by the present application, which should all be included in the protection scope of the present application.
Claims
1. A virtual machine migration system, characterized in that: The system includes a first computing device and a second computing device, the hardware resources of the first computing device are divided into a first rich execution environment (REE) side and a first trusted execution environment (TEE) side, the hardware resources of the second computing device are divided into a second REE side and a second TEE side, the first TEE side includes a first virtual machine, and the second TEE side includes a backup virtual machine; The first computing device is used to send encrypted data of the data in the first virtual machine to the second computing device; The second computing device is used to receive and decrypt the encrypted data to obtain the data in the first virtual machine; The second computing device is further configured to load data in the first virtual machine to the standby virtual machine.
2. The system according to claim 1, characterized in that The processor of the first computing device is used to encrypt the data in the first virtual machine on the first TEE side to obtain the encrypted data; The processor of the first computing device is used to call a first communication interface on the first REE side to send the encrypted data to a second communication interface, the first communication interface is the communication interface of the first computing device, and the second communication interface is the communication interface of the second computing device; The processor of the second computing device is used to obtain the encrypted data at the second REE side; The processor of the second computing device is used to decrypt the encrypted data on the second TEE side to obtain the data in the first virtual machine; The processor of the second computing device is used to load the data in the first virtual machine to the standby virtual machine on the second TEE side.
3. The system according to claim 2, characterized in that The encrypted data is obtained by encrypting data in the first virtual machine using an encryption key, the encryption key is negotiated between the processor of the first computing device and the processor of the second computing device, and the encryption key is also used to decrypt the encrypted data.
4. The system according to claim 3, characterized in that The processor of the second computing device is used to obtain authentication information of the standby virtual machine on the second TEE side; The processor of the second computing device is used to call the second communication interface on the second REE side and send the authentication information of the standby virtual machine to the first communication interface; The processor of the first computing device is used to obtain authentication information of the standby virtual machine on the first REE side; The processor of the first computing device is used to negotiate with the processor of the second computing device to obtain the encryption key when the first TEE side authenticates the standby virtual machine according to the authentication information of the standby virtual machine.
5. The system according to claim 4, characterized in that The authentication information of the standby virtual machine includes a current measurement value of the configuration of the standby virtual machine and a historical measurement value of the configuration of the standby virtual machine; The processor of the first computing device is used to authenticate the standby virtual machine when the first TEE side determines that the current measurement value of the configuration of the standby virtual machine is the same as the historical measurement value of the configuration of the standby virtual machine.
6. The system according to any one of claims 3 to 5, characterized in that: The processor of the first computing device is used to obtain authentication information of the first virtual machine on the first TEE side; The processor of the first computing device is used to call the first communication interface on the first REE side and send the authentication information of the first virtual machine to the second communication interface; The processor of the second computing device is used to obtain authentication information of the first virtual machine on the second REE side; The processor of the second computing device is used to negotiate with the processor of the first computing device to obtain the encryption key when the second TEE side authenticates the first virtual machine according to the authentication information of the first virtual machine.
7. The system according to claim 6, characterized in that The authentication information of the first virtual machine includes a current measurement value of a configuration of the first virtual machine and a historical measurement value of a configuration of the first virtual machine; The processor of the second computing device is used to authenticate the first virtual machine when it is determined on the second TEE side that the current measurement value of the configuration of the first virtual machine is the same as the historical measurement value of the configuration of the first virtual machine.
8. The system according to any one of claims 3 to 7, characterized in that: The processor of the second computing device is used to generate a message authentication code based on the encryption key and the first message on the second TEE side; The processor of the second computing device is used to call the second communication interface on the second REE side and send the first message and the message authentication code to the first communication interface; The processor of the first computing device is used to obtain the first message and the message authentication code at the first REE side; The processor of the first computing device is used to encrypt data in the first virtual machine using the encryption key when the first TEE side determines that the encryption key is a valid key based on the first message and the message authentication code.
9. The system according to any one of claims 3 to 8, characterized in that: The processor of the first computing device is used to call the first communication interface on the first REE side to send a public key of the first computing device to the second communication interface; The processor of the second computing device is used to obtain the public key of the first computing device on the second REE side; The processor of the second computing device is used to generate the encryption key according to the private key of the second computing device and the public key of the first computing device on the second TEE side; The processor of the second computing device is used to call the second communication interface on the second REE side and send the public key of the second computing device to the first communication interface; The processor of the first computing device is used to obtain the public key of the second computing device on the first REE side; The processor of the first computing device is used to generate the encryption key on the first TEE side according to the private key of the first computing device and the public key of the second computing device.
10. The system according to claim 9, characterized in that The private key of the second computing device is stored on the second TEE side, and the private key of the first computing device is stored on the first TEE side.
11. The system according to any one of claims 1 to 10, characterized in that: The first computing device is further configured to send state information of the first virtual machine to the second computing device; The second computing device is further configured to synchronize the status of the standby virtual machine with the first virtual machine according to the status information of the first virtual machine.
12. The system according to any one of claims 1 to 11, characterized in that: Before the first computing device is used to send encrypted data of the data in the first virtual machine to the second computing device, the first computing device is also used to suspend the operation of the first virtual machine; After the second computing device is used to load the data in the first virtual machine into the standby virtual machine, the second computing device is further used to run the standby virtual machine according to the data in the first virtual machine.
13. A virtual machine migration method, characterized in that: Applied to a second computing device, the hardware resources of the second computing device are divided into a second REE side and a second TEE side, the second TEE side includes a backup virtual machine, and the method includes: The second computing device obtains encrypted data of data in a first virtual machine, where the first virtual machine is deployed on a first TEE side, and the first TEE side is a TEE side of the first computing device; The second computing device decrypts the encrypted data to obtain data in the first virtual machine; The second computing device loads the data in the first virtual machine to the standby virtual machine.
14. The method according to claim 13, characterized in that The second computing device obtains encrypted data of data in the first virtual machine, including: The processor of the second computing device obtains, at the second REE side, encrypted data of the data in the first virtual machine; The second computing device decrypts the encrypted data to obtain data in the first virtual machine, including: The processor of the second computing device decrypts the encrypted data on the second TEE side to obtain data in the first virtual machine; The second computing device loads the data in the first virtual machine to the standby virtual machine, including: The processor of the second computing device loads the data in the first virtual machine to the standby virtual machine on the second TEE side.
15. The method according to claim 14, characterized in that The encrypted data is obtained by encrypting data in the first virtual machine using an encryption key, the encryption key is negotiated between the processor of the second computing device and the processor of the first computing device, and the encryption key is also used to decrypt the encrypted data.
16. The method according to claim 15, characterized in that The method further comprises: The processor of the second computing device obtains authentication information of the first virtual machine on the second REE side; When the processor of the second computing device authenticates the first virtual machine according to the authentication information of the first virtual machine on the second TEE side and passes, the processor of the second computing device negotiates with the processor of the first computing device to obtain the encryption key.
17. The method according to claim 16, characterized in that The authentication information of the first virtual machine includes a current measurement value of a configuration of the first virtual machine and a historical measurement value of a configuration of the first virtual machine; The method further comprises: When the processor of the second computing device determines on the second TEE side that the current measurement value of the configuration of the first virtual machine is the same as the historical measurement value of the configuration of the first virtual machine, the authentication of the first virtual machine is successful.
18. The method according to claim 16 or 17, characterized in that Before the processor of the second computing device negotiates with the processor of the first computing device to obtain the encryption key, the method further includes: The processor of the second computing device calls the second communication interface on the second REE side to send the authentication information of the standby virtual machine to the first communication interface, the second communication interface is the communication interface of the second computing device, and the first communication interface is the communication interface of the first computing device.
19. The method according to claim 18, characterized in that The authentication information of the standby virtual machine includes a current measurement value of the configuration of the standby virtual machine and a historical measurement value of the configuration of the standby virtual machine.
20. The method according to any one of claims 15 to 19, characterized in that Before the second computing device obtains the encrypted data of the data in the first virtual machine, the method further includes: The processor of the second computing device generates a message authentication code based on the encryption key and the first message on the second TEE side; The processor of the second computing device calls a second communication interface on the second REE side to send the message authentication code and the first message to a first communication interface, where the second communication interface is the communication interface of the second computing device and the first communication interface is the communication interface of the first computing device.
21. The method according to any one of claims 16 to 20, characterized in that The processor of the second computing device negotiates with the processor of the first computing device to obtain the encryption key, including: The processor of the second computing device calls the second communication interface on the second REE side, and sends the public key of the second computing device to the first communication interface, where the public key of the second computing device is used to generate the encryption key, the second communication interface is the communication interface of the second computing device, and the first communication interface is the communication interface of the first computing device; The processor of the second computing device obtains the public key of the first computing device at the second REE side; The processor of the second computing device generates the encryption key on the second TEE side according to the private key of the second computing device and the public key of the first computing device.
22. The method according to claim 21, characterized in that The private key of the second computing device is stored on the second TEE side.
23. The method according to any one of claims 13 to 22, characterized in that The method further comprises: The second computing device obtains state information of the first virtual machine; The second computing device synchronizes the status of the standby virtual machine with the first virtual machine according to the status information of the first virtual machine.
24. A virtual machine migration method, characterized in that: Applied to a first computing device, the hardware resources of the first computing device are divided into a first REE side and a first TEE side, the first TEE side includes a first virtual machine, and the method includes: The processor of the first computing device encrypts the data in the first virtual machine at the first TEE side to obtain encrypted data; The processor of the first computing device calls the communication interface of the first computing device on the first REE side, and sends the encrypted data to the second computing device, where the encrypted data is used to migrate the data in the first virtual machine to a backup virtual machine, and the backup virtual machine is deployed on the second TEE side, which is the TEE side of the second computing device.
25. The method according to claim 24, characterized in that The encrypted data is obtained by encrypting data in the first virtual machine using an encryption key, the encryption key is negotiated between the processor of the first computing device and the processor of the second computing device, and the encryption key is also used to decrypt the encrypted data.
26. A virtual machine migration device, characterized in that: Applied to a second computing device, the hardware resources of the second computing device are divided into a second REE side and a second TEE side, the second TEE side includes a backup virtual machine, and the apparatus includes: An acquisition module, configured to acquire encrypted data of data in a first virtual machine, where the first virtual machine is deployed on a first TEE side, where the first TEE side is a TEE side of the first computing device; A decryption module, used for decrypting the encrypted data to obtain data in the first virtual machine; A loading module is used to load the data in the first virtual machine to the standby virtual machine.
27. A virtual machine migration device, characterized in that: Applied to a first computing device, the hardware resources of the first computing device are divided into a first REE side and a first TEE side, the first TEE side includes a first virtual machine, and the apparatus includes: an encryption module, configured to encrypt data in the first virtual machine on the first TEE side to obtain encrypted data; A sending module is used to call the communication interface of the first computing device on the first REE side to send the encrypted data to the second computing device, wherein the encrypted data is used to migrate the data in the first virtual machine to the standby virtual machine, and the standby virtual machine is deployed on the second TEE side, and the second TEE side is the TEE side of the second computing device.
28. A computing device, characterized in that The computing device comprises a processor and a memory; the processor of the computing device is used to execute instructions stored in the memory of the computing device, so that the computing device executes the method according to any one of claims 13 to 25.
29. A computer-readable storage medium, characterized in that: The method comprises computer program instructions, and when the computer program instructions are executed by a computing device, the computing device performs the method according to any one of claims 13 to 25.