Hardware configuration method and device for virtual machine on virtualization platform and storage medium
By obtaining the source hardware type before the virtual machine data migration and comparing and configuring it on the target side, the problem of inaccurate virtual machine hardware configuration is solved, and the operation performance and stability of the virtual machine on the target side is improved.
Patent Information
- Application Number
- CN202412000506.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-27
AI Technical Summary
During the virtual machine data migration process, due to the difference in hardware types, the hardware configuration of the virtual machine is inaccurate on the target virtualization platform, which affects the stability and performance of the virtual machine.
By obtaining the virtual machine hardware type information on the source virtualization platform before the virtual machine data migration, and comparing the hardware types of the source and target ends after the data migration, if the data is different, the corresponding hardware is configured for the target end virtual machine based on the source end hardware type to ensure that the virtual machine is operating normally on the target end.
It improves the hardware configuration accuracy of the virtual machine on the target side, enhances the operating performance and stability of the virtual machine, and solves the problem of inaccurate hardware configuration.
Smart Images

Figure CN120045275A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of cloud computing, and more particularly, to a method, apparatus, and storage medium for configuring the hardware of a virtual machine on a virtualization platform. Background Art
[0002] Currently, when migrating virtual machine data between two virtualization platforms, since each virtualization platform has a corresponding hardware type, the operating system within the virtual machine needs to be compatible with a specific hardware type. When there are differences in the hardware types, it will lead to significant differences in the hardware configurations between the two virtualization platforms, affecting the stability and performance of the virtual machine.
[0003] In the related art, a large number of hardware configuration adjustments are made to the virtual machine before migrating the virtual machine data, making the virtual machine data migration process complex. Moreover, since the hardware configuration adjustments involve many hardware types, the operations are cumbersome, and manual configuration of the hardware types is required. Manually configuring the hardware types for the source virtualization platform lacks a standardized process, which may increase the risk of incorrect configuration of the hardware types on the source virtualization platform, affecting the normal startup and operation of the virtual machine to be run on the target virtualization platform. Therefore, there is still the technical problem of low accuracy in configuring the hardware of the virtual machine.
[0004] Regarding the technical problem of low accuracy in configuring the hardware of the virtual machine, no effective solution has been proposed yet. Summary of the Invention
[0005] The embodiments of the present application provide a method, apparatus, and storage medium for configuring the hardware of a virtual machine on a virtualization platform to at least solve the technical problem of low accuracy in configuring the hardware of the virtual machine in the related art.
[0006] According to an embodiment of the present application, there is provided a method for configuring the hardware of a virtual machine, including: in response to obtaining the source hardware type of a virtual machine running on a source virtualization platform, controlling the source virtualization platform to migrate the virtual machine data of the virtual machine to a corresponding target virtualization platform; in response to completing the migration of the virtual machine data to the target virtualization platform, comparing the source hardware type with the target hardware type of the virtual machine to be run on the target virtualization platform to obtain a comparison result; in response to the comparison result indicating that the source hardware type is different from the target hardware type, configuring the hardware for the virtual machine to be run on the target virtualization platform based on the source hardware type so that the virtual machine is in a normal running state on the target virtualization platform.
[0007] In an exemplary embodiment, in response to the comparison result indicating that the source hardware type is different from the target hardware type, based on the source hardware type, configure the hardware for the virtual machine to be run on the target virtualization platform so that the virtual machine is in a normal running state on the target virtualization platform, including: in response to the comparison result indicating that the source hardware type is different from the target hardware type, obtain the configuration instruction of the target account that logs in to the virtual machine, where the configuration instruction is used to indicate whether the target account has a performance requirement for the performance of the virtual machine's hardware running on the target virtualization; detect the source hardware type and the target hardware type to obtain a first detection result, where the first detection result is used to indicate whether the source hardware type and the target hardware type allow adjustment to be consistent; based on the configuration instruction, the first detection result, and the source hardware type, configure the hardware for the virtual machine to be run on the target virtualization platform so that the virtual machine is in a normal running state on the virtualization platform at the virtual end.
[0008] In an exemplary embodiment, based on the configuration instruction, the first detection result, and the source hardware type, configure the hardware for the virtual machine to be run on the target virtualization platform so that the virtual machine is in a normal running state on the virtualization platform at the virtual end, including: in response to the configuration instruction indicating that the target account has no performance requirement, and the first detection result indicating that the source hardware type and the target hardware type do not allow adjustment to be consistent, obtain the first source hardware type in the source hardware type, where the virtual machine configured with the hardware of the first source hardware type has a running performance index less than the performance index threshold on the target virtualization platform, and the hardware configured with the first source hardware type has a running performance index greater than or equal to the performance index threshold and less than the performance index threshold on the source virtualization platform, and the running performance index less than the performance index threshold is used to indicate that the virtual machine is in an abnormal running state, and the performance index greater than or equal to the performance index threshold is used to indicate that the virtual machine is in a normal running state; determine the target hardware type corresponding to the first source hardware type, where the hardware of the target hardware type has a running performance index greater than or equal to the performance index threshold on the target virtualization platform; configure the hardware of the target hardware type for the virtual machine to be run in the target virtualization platform so that the virtual machine configured with the hardware of the first source hardware type is in a normal running state on the target virtualization platform.
[0009] In an exemplary embodiment, based on a configuration instruction, a first detection result, and a source hardware type, hardware is configured for a virtual machine to be run on a target virtualization platform so that the virtual machine is in a normal running state on the target virtualization platform, including: in response to the configuration instruction indicating that there is no performance requirement for the target account and the first detection result indicating that the source hardware type and the target hardware type allow consistent adjustment, obtaining a second source hardware type in the source hardware type, wherein the virtual machine configured with the hardware of the second source hardware type has a running performance index greater than or equal to a performance index threshold on the target virtualization platform, and the virtual machine configured with the hardware of the second source hardware type has a running performance index greater than or equal to a performance index threshold on the source virtualization platform; configuring the hardware of the second source hardware type for the virtual machine to be run in the target virtualization platform so that the virtual machine configured with the hardware of the second source hardware type is in a normal running state on the target virtualization platform.
[0010] In an exemplary embodiment, based on a configuration instruction, a first detection result, and a source hardware type, hardware is configured for a virtual machine to be run on a target virtualization platform so that the virtual machine is in a normal running state on the target virtualization platform, including: in response to the configuration instruction indicating that the target account has a performance requirement, obtaining the hardware type in the configuration instruction; configuring the hardware of the detected hardware type in the configuration instruction for the virtual machine to be run in the target virtualization platform so that the virtual machine configured with the hardware of the hardware type is in a normal running state on the target virtualization platform.
[0011] In an exemplary embodiment, the hardware includes a network card, and the target hardware type includes a network card type. Wherein, the method further includes: in response to completing the configuration of the hardware for the virtual machine running in the target virtualization platform, detecting the network card type to obtain a second detection result; in response to the second detection result indicating that the network card type of the target virtualization platform before the virtual machine data migration is different from the network card type of the target virtualization platform after the virtual machine data migration, detecting the source network card configuration information of the source virtualization platform to obtain a third detection result; in response to the third detection result indicating that there is source network card configuration information in the source virtualization platform, adjusting the target network card configuration information of the target virtualization platform to the source network card configuration information.
[0012] In an exemplary embodiment, the hardware includes a disk, and the target - end hardware type includes a disk type. Wherein, the method further includes: in response to completing the configuration of the hardware of the virtual machine running in the target - end virtualization platform, obtaining the virtual machine type of the virtual machine and the source - end disk configuration information of the source - end virtualization platform; in response to the virtual machine type being the first virtual machine type, adjusting the target - end disk configuration information of the target - end virtualization platform so that the adjusted target - end disk configuration information is the same as the source - end disk configuration information; in response to the virtual machine type being the second virtual machine type, adjusting the disk type to the target disk type to configure the target disk type driver, where the running performance index of the disk of the target disk type on the target - end virtualization platform is greater than or equal to the performance index threshold.
[0013] In an exemplary embodiment, the method further includes: in response to completing the configuration of the hardware of the virtual machine on the target - end virtualization platform, controlling the virtual machine to start up so that the virtual machine runs normally.
[0014] According to another embodiment of the present application, there is provided a hardware configuration device for a virtual machine on a virtualization platform, including: a control unit, configured to control the source - end virtualization platform to migrate the virtual machine data of the virtual machine running on the source - end virtualization platform to the corresponding target - end virtualization platform in response to obtaining the source - end hardware type of the virtual machine; a comparison unit, configured to compare the source - end hardware type with the target - end hardware type of the virtual machine to be run on the target - end virtualization platform to obtain a comparison result in response to completing the migration of the virtual machine data to the target - end virtualization platform; a configuration unit, configured to configure the hardware for the virtual machine to be run on the target - end virtualization platform based on the source - end hardware type in response to the comparison result indicating that the source - end hardware type is different from the target - end hardware type, so that the virtual machine is in a normal running state on the target - end virtualization platform.
[0015] According to still another embodiment of the present application, there is also provided a computer - readable storage medium, in which a computer program is stored. Wherein, the computer program is set to execute the steps in any one of the above - mentioned method embodiments when running.
[0016] According to still another embodiment of the present application, there is also provided an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is set to run the computer program to execute the steps in any one of the above - mentioned method embodiments.
[0017] According to still another embodiment of the present application, there is also provided a computer program product, including a computer program, and the computer program implements the steps in any one of the above - mentioned method embodiments when executed by a processor.
[0018] Before the virtual machine data migration of the virtual machine, the hardware type information of the virtual machine running on the source virtualization platform (source side) is obtained in advance. After the virtual machine data of the virtual machine is migrated from the source side to the target virtualization platform (target side) and completed, the hardware type of the source side is compared with the hardware type of the target side to obtain a comparison result. Based on the comparison result, the hardware type on the target virtualization platform is configured according to the hardware type adaptability on the source virtualization platform. In the embodiment of the present application, if there is a difference between the hardware type of the source side and the hardware type of the target side, based on the hardware type information of the source side, the corresponding hardware is configured for the virtual machine on the target side, which can ensure that the virtual machine can run normally on the target side and enhance the running performance of the virtual machine on the target side. Thus, the technical problem of low accuracy of the hardware configuration of the virtual machine is solved, and the technical effect of improving the accuracy of the hardware configuration of the virtual machine is achieved. Description of the Drawings
[0019] Figure 1 is a hardware structure block diagram of a server device for a method of configuring the hardware of a virtual machine on a virtualization platform according to an embodiment of the present application;
[0020] Figure 2 is a flowchart of a method for configuring the hardware of a virtual machine on a virtualization platform according to an embodiment of the present application;
[0021] Figure 3 is a flowchart of a method for configuring custom hardware compatibility for cross-cloud migration according to an embodiment of the present application;
[0022] Figure 4 is a block diagram of the structure of a device for configuring the hardware of a virtual machine on a virtualization platform according to an embodiment of the present application. Detailed Embodiments
[0023] In the following, embodiments of the present application will be described in detail with reference to the drawings and in conjunction with the embodiments.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence.
[0025] The method embodiments provided in the embodiments of the present application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 is a hardware structure block diagram of a server device for a method of configuring the hardware of a virtual machine on a virtualization platform according to an embodiment of the present application. As Figure 1 shown, the server device may include one or more ( Figure 1Only one processor 102 is shown (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a field-programmable gate array FPGA), and a memory 104 for storing data. Among them, the above server device may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 The structure shown is only schematic and does not limit the structure of the above server device. For example, the server device may further include more or fewer components than Figure 1 shown in, or have a different configuration from Figure 1 shown.
[0026] The memory 104 can be used to store computer programs. For example, software programs and modules of application software, such as the computer program corresponding to the hardware configuration method of virtual machines on the virtualization platform in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, implements the above method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely provided relative to the processor 102, and these remote memories can be connected to the server device through a network. Examples of the above network include, but are not limited to, the Internet, enterprise intranets, local area networks, mobile communication networks, and combinations thereof.
[0027] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by the communication provider of the server device. In one instance, the transmission device 106 includes a network adapter (abbreviated as NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0028] In this embodiment, a method for hardware configuration of a virtual machine on a virtualization platform is provided. Figure 2 is a flowchart of the method for hardware configuration of a virtual machine on the virtualization platform according to the embodiments of the present application, as Figure 2 shown, and the process includes the following steps:
[0029] Step S202, in response to obtaining the source-side hardware type of the virtual machine running on the source-side virtualization platform, control the source-side virtualization platform to migrate the virtual machine data of the virtual machine to the corresponding target-side virtualization platform.
[0030] In the technical solution provided in step S202 of the embodiment of the present application, if the source hardware type of the virtual machine running on the source virtualization platform is obtained, the source virtualization platform can be controlled to migrate the virtual machine data of the virtual machine to the corresponding target virtualization platform. The source virtualization platform can be VMware. The source hardware type can be the type of hardware configured on the virtual machine in the operating environment of the source end virtualization platform, such as the types of virtual machine network cards, disks, etc. The target virtualization platform can be a Kernel-based Virtual Machine (KVM) platform. The virtual machine data can be the running state of the virtual machine, user data, personalized settings and configuration files, and saved snapshot information, etc.
[0031] In this embodiment, before the virtual machine data is migrated from the VMware platform to the KVM platform, the source hardware type of the hardware configured on the virtual machine currently running in the VMware operating environment can be obtained in advance, such as the virtual machine network card type and disk type. Through the above source hardware type, a basis can be provided for the hardware required to be configured for the virtual machine running in the operating environment of the target virtualization platform. After obtaining the hardware type information of the source virtual machine, the virtual machine data can be migrated from the source virtualization platform to the target virtualization platform.
[0032] Optionally, since different virtualization platforms may support different hardware types, obtaining the source hardware type can configure matching hardware at the target end to ensure hardware compatibility. Before migrating the virtual machine data, if the hardware type of the source end can be obtained and configured, the hardware compatibility of the virtual machine after the virtual machine data is migrated can be ensured.
[0033] For example, the source hardware type of the virtual machine, including the Central Processing Unit (CPU) model, memory size, disk controller type, network card type, etc., can be obtained by calling the Application Programming Interface (API) provided by VMware.
[0034] It should be noted that the above method for obtaining the source hardware type and the specific source hardware type are only for illustrative purposes and are not specifically limited here. As long as it can be used to obtain the source hardware type, it is within the protection scope of the embodiment of the present application.
[0035] Step S204: In response to the completion of migrating the virtual machine data to the target virtualization platform, compare the source hardware type with the target hardware type of the virtual machine to be run on the target virtualization platform to obtain a comparison result.
[0036] In the technical solution provided in step S204 of the embodiment of the present application, after the virtual machine data of the virtual machine is migrated from the source virtualization platform to the corresponding target virtualization platform, the source hardware type can be compared with the target hardware type of the virtual machine to be run on the target virtualization platform to obtain a comparison result. Among them, the comparison result can indicate whether the hardware types of the corresponding hardware on the source virtualization platform and the target virtualization platform are the same.
[0037] In this embodiment, after the virtual machine data migration is completed, the source hardware type of the virtual machine running on the source virtualization platform can be compared with the target hardware type of the virtual machine to be run on the target virtualization platform. Through the comparison, it can be identified whether the target hardware type is consistent with the source hardware type, providing a basis for the subsequent hardware configuration on the target virtualization platform, so as to ensure that the virtual machine can run normally in the operating environment of the target virtualization platform.
[0038] For example, if the virtual machine on the source end uses a virtual network adapter vmxnet3 network card, while on the target end, the default may be a para-virtualized device driver virtio network card, then this difference can be recorded to obtain a comparison result. vmxnet3 is a high-performance virtual network card driver specifically designed for the VMware virtualization environment, with better network performance and lower CPU usage, especially suitable for application scenarios that require high network bandwidth and low latency. Virtio is a para-virtualized input / output (I / O) framework for virtualization environments.
[0039] In the embodiment of the present application, since the hardware type is directly related to the driver program and operating system configuration inside the virtual machine, incorrect hardware type configuration may cause the virtual machine to fail to start, performance degradation, or applications to fail to run properly. By comparing the source hardware type with the target hardware type of the virtual machine to be run on the target virtualization platform, the above problems can be prevented and repaired before the virtual machine is officially powered on. It provides key input information for the subsequent adjustment of the target hardware type and optimization of the driver program of the virtual machine to be run on the target virtualization platform, ensuring hardware compatibility and performance optimization in the cross-platform virtual machine data migration process.
[0040] Step S206: In response to the comparison result indicating that the source - side hardware type is different from the target - side hardware type, configure the hardware for the virtual machine to be run on the target - side virtualization platform based on the source - side hardware type, so that the virtual machine is in a normal running state on the target - side virtualization platform.
[0041] In the technical solution provided in step S206 of the embodiments of the present application, if the comparison result shows that the source - side hardware type is different from the target - side hardware type, the hardware for the virtual machine to be run on the target - side virtualization platform can be configured based on the source - side hardware type, so that the virtual machine is in a normal running state on the target - side virtualization platform.
[0042] In this embodiment, if the comparison result shows that the source - side hardware type is different from the target - side hardware type, the hardware type of the target - side virtual machine can be dynamically configured based on the source - side hardware type.
[0043] Optionally, if the hardware type in the source - side virtualization platform is also supported on the target - side virtualization platform, and configuring the hardware type of the source - side virtualization platform on the target - side virtualization platform can meet the running requirements of the virtual machine, then it can be kept consistent with the hardware type on the target - side virtualization platform.
[0044] For example, the above - mentioned hardware type can be e1000 or vmxnet3 type. If the network card type in the source - side virtualization platform is e1000 or vmxnet3 type, then it can be kept consistent with the network card type on the KVM platform. That is, the network card type on the target - side virtualization platform can also be set to e1000 or vmxnet3 type.
[0045] Optionally, if the hardware type of the virtual machine on the source - side virtualization platform is not supported on the target - side virtualization platform, or the virtual machine cannot run normally when using the same hardware type on the target - side virtualization platform. For example, when the virtual machine encounters problems such as a blue screen or a mounting error during startup, then other hardware types with higher performance can be selected.
[0046] In the embodiments of the present application, by configuring the hardware type corresponding to the source - side hardware type on the target - side virtual machine, the success rate of migrating virtual machine data across platforms can be increased, and the failure of virtual machine data migration caused by hardware incompatibility can be reduced. Adjusting the target - side hardware configuration based on the source - side hardware type not only solves the compatibility problem but also optimizes the performance and stability of the virtual machine on the target - side platform.
[0047] In the above steps S202 to S206 of the embodiments of the present application, before migrating the virtual machine data of the virtual machine, the hardware type information of the virtual machine running on the source virtualization platform (source side) is obtained in advance. After the virtual machine data of the virtual machine is migrated from the source side to the target virtualization platform (target side), a comparison is made between the source side hardware type and the target side hardware type to obtain a comparison result. Based on the comparison result, the hardware type on the target virtualization platform is adaptively configured according to the hardware type on the source virtualization platform. In the embodiments of the present application, if there are differences between the source side hardware type and the target side hardware type, based on the hardware type information of the source side, the corresponding hardware is configured for the virtual machine on the target side, which can ensure that the virtual machine can run normally on the target side and enhance the running performance of the virtual machine on the target side. Thus, the technical problem of low accuracy of the hardware configuration of the virtual machine is solved, and the technical effect of improving the accuracy of the hardware configuration of the virtual machine is achieved.
[0048] The embodiments of the present invention will be described in detail below in conjunction with the above steps.
[0049] In an exemplary embodiment, in step S206, in response to the comparison result that the source side hardware type is different from the target side hardware type, based on the source side hardware type, the hardware is configured for the virtual machine to be run on the target virtualization platform, so that the virtual machine is in a normal running state on the target virtualization platform, including: in response to the comparison result that the source side hardware type is different from the target side hardware type, obtaining the configuration instruction of the target account logging in to the virtual machine, where the configuration instruction is used to indicate whether the target account has a performance requirement for the performance of the hardware of the virtual machine running on the target virtualization; detecting the source side hardware type and the target side hardware type to obtain a first detection result, where the first detection result is used to indicate whether the source side hardware type and the target side hardware type allow adjustment to be consistent; based on the configuration instruction, the first detection result and the source side hardware type, configuring the hardware for the virtual machine to be run on the target virtualization platform, so that the virtual machine is in a normal running state on the virtualization platform of the virtual machine.
[0050] In this embodiment, in the case where the comparison result is that the source side hardware type is different from the target side hardware type, the configuration instruction of the target account logging in to the virtual machine can be obtained. The source side hardware type and the target side hardware type can be detected to obtain a first detection result. The hardware can be configured for the virtual machine to be run on the target virtualization platform based on the configuration instruction, the first detection result and the source side hardware type. Among them, the configuration instruction can be used to indicate whether the target account has a performance requirement for the performance of the hardware of the virtual machine running on the target virtualization. The first detection result can be used to indicate whether the source side hardware type and the target side hardware type allow adjustment to be consistent.
[0051] Optionally, the configuration instructions may reflect the user's performance requirements for the virtual machine on the target virtualization platform after the virtual machine data migration. The configuration instructions may include, but are not limited to, specific requirements for CPU, memory, disk I / O, and network bandwidth, as well as whether specific hardware types (such as high-performance network cards or disk controllers) are required to meet the normal operation needs of the virtual machine on the virtualization platform at the virtual end. Only for illustrative purposes, no specific limitations are made here.
[0052] Optionally, by detecting the source-side hardware type and the target-side hardware type, it can be determined whether the source-side hardware type can be directly implemented on the target virtualization platform or whether it needs to be converted into a compatible type. For example, the vmxnet3 network card of VMware may need to be converted into a virtio type network card on the KVM platform.
[0053] Optionally, if the detection result shows that the source-side hardware type can be directly used on the target side and the user configuration instructions indicate that no additional performance optimization is required, the hardware type of the virtual machine is set to be the same as that of the source side.
[0054] In the embodiments of the present application, by introducing user performance requirements and consistency detection, the user experience can be improved, the configuration rationality can be ensured, the operating system compatibility and scalability can be enhanced, and the resource utilization can be optimized. It jointly promotes the maturity and application of the virtual machine data cross-virtualization platform migration technology, making it more intelligent and adaptable.
[0055] In an exemplary embodiment, based on the configuration instructions, the first detection result, and the source-side hardware type, hardware is configured for the virtual machine to be run on the target virtualization platform so that the virtual machine is in a normal running state on the virtualization platform at the virtual end, including: in response to the configuration instructions indicating that there is no performance requirement for the target account and the first detection result indicating that the source-side hardware type and the target-side hardware type do not allow adjustment to be consistent, obtaining the first source-side hardware type in the source-side hardware type, where the virtual machine configured with the hardware of the first source-side hardware type has a running performance index on the target virtualization platform less than the performance index threshold, and the hardware configured with the first source-side hardware type has a running performance index on the source virtualization platform greater than or equal to the performance index threshold. The running performance index less than the performance index threshold is used to indicate that the virtual machine is in an abnormal running state, and the performance index greater than or equal to the performance index threshold is used to indicate that the virtual machine is in a normal running state; determining the target-side hardware type corresponding to the first source-side hardware type, where the hardware of the target-side hardware type has a running performance index on the target virtualization platform greater than or equal to the performance index threshold; and configuring the hardware of the target-side hardware type for the virtual machine to be run in the target virtualization platform so that the virtual machine configured with the hardware of the first source-side hardware type is in a normal running state on the target virtualization platform.
[0056] In this embodiment, during the process of configuring the hardware for the virtual machine to be run on the target virtualization platform based on the configuration instruction, the first detection result, and the source-side hardware type, so that the virtual machine is in a normal running state on the virtualization platform at the target end, when the configuration instruction indicates that the target account has no performance requirement and the first detection result shows that the source-side hardware type and the target-side hardware type do not allow adjustment to be the same, the first source-side hardware type in the source-side hardware type can be obtained. The target-side hardware type corresponding to the first source-side hardware type can be determined, and the hardware of the target-side hardware type can be configured for the virtual machine to be run on the target virtualization platform, so that the virtual machine configured with the hardware of the first source-side hardware type is in a normal running state on the target virtualization platform. Among them, the running performance index of the virtual machine configured with the hardware of the first source-side hardware type is less than the performance index threshold on the target virtualization platform, and the running performance index of the hardware configured with the first source-side hardware type is greater than or equal to the performance index threshold on the source virtualization platform. The running performance index less than the performance index threshold is used to indicate that the virtual machine is in an abnormal running state, and the performance index greater than or equal to the performance index threshold is used to indicate that the virtual machine is in a normal running state. The hardware of the target-side hardware type can be virtio, and its running performance index on the target virtualization platform is greater than or equal to the performance index threshold.
[0057] Optionally, the running performance index may include, but is not limited to, disk I / O speed, network throughput, CPU utilization, etc., which are used to measure the running performance of the virtual machine on the target virtualization platform. This is only for illustrative purposes and is not specifically limited here.
[0058] Optionally, if the user has specific performance requirements, but the hardware type on the source side is not directly supported on the target side, that is, some disk and network card types of the virtual machine cannot be kept the same as those on the VMware side. The hardware type that is close to or suitable can be selected according to the characteristics of the target virtualization platform for configuration, and different driver programs can be injected into the virtual machine. For example, if the user needs high-performance disk I / O, and the source side uses a Small Computer System Interface (SCSI) disk, but the target side defaults to an Integrated Drive Electronics (IDE) disk, the disk type can be converted to a high-performance type supported by the target side, and the corresponding driver program can be injected.
[0059] In the embodiment of the present application, by introducing a performance threshold for automatic hardware type conversion, the success rate of virtual machine data migration can be improved, the performance of the virtual machine can be optimized, the burden on the user can be reduced, and the intelligence of the operating system can be enhanced, which can provide a more intelligent, accurate, and stable solution for the migration of virtual machine data across virtualization platforms.
[0060] In an exemplary embodiment, based on configuration instructions, a first detection result, and a source-side hardware type, hardware is configured for a virtual machine to be run on a target-side virtualization platform so that the virtual machine is in a normal running state on the virtual-side virtualization platform, including: in response to the configuration instructions indicating that there is no performance requirement for the target account and the first detection result indicating that the source-side hardware type and the target-side hardware type allow for consistent adjustment, obtaining a second source-side hardware type from the source-side hardware type, where the virtual machine configured with the hardware of the second source-side hardware type has a running performance metric on the target-side virtualization platform that is greater than or equal to a performance metric threshold, and the virtual machine configured with the hardware of the second source-side hardware type has a running performance metric on the source-side virtualization platform that is greater than or equal to a performance metric threshold; configuring the hardware of the second source-side hardware type for the virtual machine to be run in the target-side virtualization platform so that the virtual machine configured with the hardware of the second source-side hardware type is in a normal running state on the target-side virtualization platform.
[0061] In this embodiment, if it is necessary to configure hardware for a virtual machine to be run on a target-side virtualization platform based on configuration instructions, a first detection result, and a source-side hardware type so that the virtual machine is in a normal running state on the virtual-side virtualization platform, the second source-side hardware type in the source-side hardware type can be obtained when the configuration instructions indicate that there is no performance requirement for the target account and the first detection result indicates that the source-side hardware type and the target-side hardware type allow for consistent adjustment. The hardware of the second source-side hardware type can be configured for the virtual machine to be run in the target-side virtualization platform so that the virtual machine configured with the hardware of the second source-side hardware type is in a normal running state on the target-side virtualization platform. Among them, the virtual machine configured with the hardware of the second source-side hardware type has a running performance metric on the target-side virtualization platform that is greater than or equal to a performance metric threshold, and the virtual machine configured with the hardware of the second source-side hardware type has a running performance metric on the source-side virtualization platform that is greater than or equal to a performance metric threshold.
[0062] Optionally, by analyzing the configuration instructions of the target account, it is confirmed that the user has not put forward additional performance optimization requirements. According to the first detection result, it is confirmed that the hardware type on the source side and the hardware type on the target side allow for direct adjustment or conversion, that is, the hardware configuration on the source side can run on the target side with basically no change, then the second source-side hardware type in the source-side hardware type can be obtained. It is ensured that even if the user does not put forward performance requirements, the virtual machine hardware configuration after virtual machine data migration can provide sufficient and stable operation.
[0063] In the embodiments of the present application, by maintaining the consistency of the hardware type under specific conditions, it is possible to improve and ensure basic performance and promote resource optimization. Together, it enhances the user experience of virtual machine data migration across virtualization platforms and the operating system performance.
[0064] In an exemplary embodiment, based on configuration instructions, a first detection result, and the source-side hardware type, hardware is configured for a virtual machine to be run on a target-side virtualization platform so that the virtual machine is in a normal running state on the virtual-side virtualization platform, including: in response to the configuration instructions indicating that the target account has performance requirements, obtaining the hardware type in the configuration instructions; configuring, for the virtual machine to be run in the target-side virtualization platform, the hardware of the hardware type detected in the configuration instructions so that the virtual machine configured with the hardware of the hardware type is in a normal running state on the target virtualization platform.
[0065] In this embodiment, in the process of configuring hardware for a virtual machine to be run on a target-side virtualization platform based on configuration instructions, a first detection result, and the source-side hardware type so that the virtual machine is in a normal running state on the virtual-side virtualization platform, when the configuration instructions indicate that the target account has performance requirements, the hardware type in the configuration instructions can be obtained. The hardware of the hardware type detected in the configuration instructions can be configured for the virtual machine running in the target-side virtualization platform so that the virtual machine configured with the hardware of the hardware type is in a normal running state on the target virtualization platform.
[0066] Optionally, if the user has custom hardware requirements, when the virtual machine configuration is issued, different drivers can be injected into the virtual machine according to the types of different hardware.
[0067] In the embodiment of the present application, by directly responding to the performance requirements of the target account for hardware configuration, the performance of the virtual machine can be improved, user satisfaction can be enhanced, performance bottlenecks can be reduced, resource allocation can be optimized, and the personalized development of technology can be promoted, jointly providing a more powerful and accurate solution for the migration of virtual machine data across virtualization platforms.
[0068] In an exemplary embodiment, the hardware includes a network card, and the target-side hardware type includes a network card type. Wherein, the method further includes: in response to completing the configuration of the hardware for the virtual machine running in the target-side virtualization platform, detecting the network card type to obtain a second detection result; in response to the second detection result indicating that the network card type of the target-side virtualization platform before the virtual machine data migration is different from the network card type of the target-side virtualization platform after the virtual machine data migration, detecting the source-side network card configuration information of the source-side virtualization platform to obtain a third detection result; in response to the third detection result indicating that there is source-side network card configuration information in the source-side virtualization platform, adjusting the target-side network card configuration information of the target-side virtualization platform to the source-side network card configuration information.
[0069] In this embodiment, the hardware may include a network card, and the target-end hardware type may include the network card type. When configuring the hardware of the virtual machine running in the target-end virtualization platform is completed, the network card type may be detected to obtain a second detection result. When the second detection result indicates that the network card type of the target-end virtualization platform before virtual machine data migration is different from the network card type of the target-end virtualization platform after virtual machine data migration, the source-end network card configuration information of the source-end virtualization platform may be detected to obtain a third detection result. When the third detection result indicates that the source-end virtualization platform has source-end network card configuration information, the target-end network card configuration information of the target-end virtualization platform may be adjusted to the source-end network card configuration information.
[0070] Optionally, if there is a change in the network card type, it may be determined whether there is network card configuration information in the source-end hardware type, that is, Internet Protocol (IP) configuration information. If it exists, the virtualization platform needs to reissue the IP configuration information so that after the virtual machine is powered on, the IP configuration information can be automatically restored to ensure the normal operation of the applications inside the virtual machine after virtual machine data migration.
[0071] In the embodiments of the present application, by detecting the change in the network card type and adjusting the configuration based on the source-end information, the consistency of network configuration can be ensured, the network failure rate can be reduced, the service continuity can be improved, the operation and maintenance burden can be alleviated, and the platform intelligence and adaptive ability can be enhanced. It jointly promotes the progress of the virtual machine data cross-virtualization platform migration technology in network configuration management and improves the reliability of the virtual machine data migration process.
[0072] In an exemplary embodiment, the hardware includes a disk, and the target-end hardware type includes the disk type. Wherein, the method further includes: in response to completing the configuration of the hardware of the virtual machine running in the target-end virtualization platform, obtaining the virtual machine type of the virtual machine and the source-end disk configuration information of the source-end virtualization platform; in response to the virtual machine type being the first virtual machine type, adjusting the target-end disk configuration information of the target-end virtualization platform so that the adjusted target-end disk configuration information is the same as the source-end disk configuration information; in response to the virtual machine type being the second virtual machine type, adjusting the disk type to the target disk type to configure the target disk type driver, where the running performance index of the disk of the target disk type on the target-end virtualization platform is greater than or equal to the performance index threshold.
[0073] In this embodiment, the hardware may include disks, and the target - end hardware type may include disk types. When configuring the hardware of a virtual machine running on the target - end virtualization platform, the virtual machine type of the virtual machine and the source - end disk configuration information of the source - end virtualization platform can be obtained. When the virtual machine type is the first virtual machine type, the target - end disk configuration information of the target - end virtualization platform can be adjusted so that the adjusted target - end disk configuration information is the same as the source - end disk configuration information. When the virtual machine type is the second virtual machine type, the disk type can be adjusted to the target disk type to configure the target disk type driver. Among them, the running performance index of the disk of the target disk type on the target - end virtualization platform is greater than or equal to the performance index threshold. The first virtual machine type can be a Linux virtual machine. The second virtual machine type can be a Windows virtual machine.
[0074] Optionally, if there is a change in the disk type, different processing for virtual machines with different operating systems is started. If it is a Linux virtual machine, modify the disk configuration to keep the virtual machine disk drive letter consistent with the virtual machine drive letter on the VMware side. If it is a Windows virtual machine, an additional virtio driver needs to be configured to solve the problem of the blue screen when starting up after the system disk is converted to the virtio type.
[0075] In the embodiment of the present application, adjusting the disk configuration information or converting the disk type according to the virtual machine type can improve disk compatibility, ensure virtual machine performance, reduce the risk of configuration errors, optimize disk resource utilization, and improve the automation degree of virtual machine data migration. It jointly promotes the progress of the virtual machine data cross - virtualization platform migration technology in the field of disk configuration management, and enhances the practicality and user - friendliness of the virtualization technology.
[0076] In an exemplary embodiment, the method further includes: in response to completing the configuration of the hardware of the virtual machine on the target - end virtualization platform, controlling the virtual machine to start up so that the virtual machine runs normally.
[0077] In this embodiment, when completing the configuration of the hardware of the virtual machine on the target - end virtualization platform, the virtual machine can be controlled to start up so that the virtual machine runs normally.
[0078] Optionally, when the virtual machine is started up and all network cards and disks run normally, the internal services of the virtual machine are normally restored, and it can be considered that the hardware configuration process is successfully completed and the virtual machine is ready for regular business operations.
[0079] Before the virtual machine data migration of the virtual machine, this application pre-gets the hardware type information of the virtual machine running on the source virtualization platform (source). After the virtual machine data of the virtual machine is migrated from the source to the target virtualization platform (target) and completed, a comparison is made between the source hardware type and the target hardware type to obtain a comparison result. Based on the comparison result, the hardware type on the target virtualization platform is adaptively configured according to the hardware type on the source virtualization platform. In the embodiment of this application, if there are differences between the source hardware type and the target hardware type, based on the hardware type information of the source, the corresponding hardware is configured for the virtual machine on the target, which can ensure that the virtual machine can run normally on the target and enhance the running performance of the virtual machine on the target. Thus, the technical problem of low accuracy of the hardware configuration of the virtual machine is solved, and the technical effect of improving the accuracy of the hardware configuration of the virtual machine is achieved.
[0080] The following uses preferred implementation manners to illustrate the technical solutions of the embodiments of this application by way of examples.
[0081] Currently, the cross-cloud migration method is to gradually copy the virtual machine data in the form of backup at the VMware side to the KVM virtualization platform. After the copying is completed, the virtual machine can be used normally. However, due to the differences in the underlying virtualization technologies, the virtual machine cannot achieve complete consistency in terms of disk and network card configurations. Therefore, there are differences in performance levels, which will also cause a series of problems. To ensure that each hardware device can run normally and the performance is not affected after cross-cloud migration, various modifications and optimizations need to be made to the hardware configuration after migration. In the related technologies, a fixed network card and disk type configuration are adopted for the virtual machine migrated to the KVM side, so as to inject fixed drivers to enable the virtual machine to run normally after startup. However, this method ignores the user's requirements for the diversity of hardware devices and the problems that may occur after converting the disk interface type of the virtual machine system disk, such as the virtual machine blue screening when starting up and applications depending on the drive letter cannot be started.
[0082] This application proposes a new hardware compatibility solution for the virtual machine after cross-cloud migration from VMware to the KVM virtualization platform for the above two problems. By optimizing the driver injection logic and providing more detailed compatibility configurations, the cross-cloud migration function is made more perfect, and the problems generated after the modification of the network card and disk types are repaired, reducing the incidence of problems with the virtual machine after cross-cloud migration. Thus, the technical problem of low accuracy of the hardware configuration of the virtual machine is solved, and the technical effect of improving the accuracy of the hardware configuration of the virtual machine is achieved.
[0083] Figure 3 is a flowchart of the cross-cloud migration custom hardware compatibility configuration method according to the embodiment of this application, as Figure 3 shown, including the following steps:
[0084] Step S301: Query the network card and disk information to be migrated through the VMware side.
[0085] In this embodiment, before the cross-cloud migration of the virtual machine, the KVM virtualization platform side can query the network card and disk types of the virtual machine to be migrated by calling the API provided by VMware. If the VMware tool is installed inside the virtual machine and the IP is configured, the IP configuration information (network card configuration information) can be saved for subsequent use.
[0086] Step S302: Start data migration.
[0087] In this embodiment, after querying the network card and disk types of the virtual machine to be migrated, the cross-cloud migration can be started.
[0088] Step S303: Configure the virtual machine compatibility.
[0089] In this embodiment, after the data migration is completed, the virtual machine compatibility can be configured on the KVM virtualization platform. If the user has no custom hardware requirements, the disk and network card types of the virtual machine are consistent with the configuration on the VMware side.
[0090] Optionally, according to the network card and disk types obtained in the first step, if the KVM virtualization platform also supports the corresponding hardware types, they are consistent with the hardware configuration on the VMware side. If there are network card and disk types that are incompatible with the KVM virtualization platform, such as vmxnet2 type network cards and SCSI type disks, they need to be converted to virtio types.
[0091] Step S304: Inject drivers.
[0092] In this embodiment, if the user has custom hardware requirements, or some disk and network card types of the virtual machine cannot be consistent with the VMware side, different drivers can be injected into the virtual machine according to the types of different hardware when the virtual machine configuration is issued. For example, inject the modified network card and disk drivers into the virtual machine system disk, such as virtio disk drivers and Realtek RTL81903 (rt1903) series wireless network card drivers.
[0093] Step S305: Restore the network card IP configuration.
[0094] In this embodiment, if the network card IP is obtained in step S301, due to the change of the network card driver, the internal IP of the virtual machine needs to be reconfigured so that the IP can be automatically restored after the virtual machine is powered on, ensuring the normal operation of the applications inside the virtual machine after migration.
[0095] Step S306: Issue tasks according to the source IP information.
[0096] In this embodiment, if the internal IP of the virtual machine needs to be reconfigured, at this time, the KVM virtualization platform needs to issue a network card IP configuration task, and the guest agent inside the virtual machine is used to reconfigure the IP, so that after the virtual machine is powered on, the applications dependent on the IP can be restored normally.
[0097] Step S307, restore the disk configuration.
[0098] In this embodiment, if the disk type of the virtual machine changes, it can be repaired according to the type of the virtual machine operating system.
[0099] Step S308, restore the disk blessing and drivers according to the operating system type.
[0100] In this embodiment, if it is a Linux virtual machine, modify the disk configuration to keep the virtual machine disk drive letter consistent with the virtual machine drive letter on the VMware side. If it is a Windows virtual machine, an additional virtio driver needs to be configured to solve the problem of the blue screen when the system disk is converted to the virtio type and powered on.
[0101] For example, if it is a Linux virtual machine and the disk type is modified to the virtio type, the drive letters of this type of disk inside the virtual machine are displayed as the first disk device of the Virtio type (Virtio Disk a, simply referred to as vda), the second disk device of the Virtio type (Virtio Disk b, simply referred to as vdb). Since all disk types of the virtual machine on the VMware side are displayed as the first SCSI disk device (SCSI Disk a, simply referred to as sda), the second SCSI disk device (SCSI Disk b, simply referred to as sdb), etc. inside the virtual machine operating system, the virtual machine on the KVM side needs to modify the drive letter naming rule of the userspace daemon (simply referred to as udev) inside the virtual machine to change the drive letters such as vda and vdb inside the virtual machine to sda and sdb to ensure that the applications dependent on the drive letter inside the virtual machine can still run normally after the virtual machine migrates across clouds. If it is a Windows virtual machine and the disk type of the system disk is modified to virtio, it is necessary to offline modify the loading method of the virtio driver in the virtual machine system disk registry to prevent the blue screen problem caused by the change of the disk driver after the virtual machine is powered on.
[0102] Step S309, control the virtual machine to run normally in the KVM virtualization platform.
[0103] In this embodiment, after completing the above steps S301 to S308, the virtual machine is powered on and all services are restored to normal.
[0104] In the embodiment of the present application, considering the user's requirements for the diversity of virtual machine disk and network card device types after cross-cloud migration, and to prevent some problems caused by changing the types of hardware devices, the network card and disk types of the virtual machine before cross-cloud migration are queried by calling the interface on the VMware side. After the data migration is completed, by comparing the original configuration, the disk and network card types supported by the KVM virtualization platform are kept consistent with those of the source side, such as network cards of types e1000 and vmxnet3, and disks of types IDE, Serial ATA (abbreviated as SATA), and Virtual Machine Provider Virtual SCSI (abbreviated as VMpvSCSI). If there are network cards and disks of other types, network cards and disks of the virtio type are used for replacement because virtio belongs to para-virtualization technology and can cooperate with the KVM virtualization layer management software to obtain better performance. If the user needs to customize the network card and disk types of the virtual machine after migration, such as pursuing higher performance, different network card and disk drivers can be injected into the virtual machine according to different requirements. And at this time, if the network card and disk types change, especially if the disk type of the system disk changes, the driver configuration can be further adjusted to ensure the normal operation of the virtual machine and its internal applications. Thus, the technical problem of low accuracy of the hardware configuration of the virtual machine is solved, and the technical effect of improving the accuracy of the hardware configuration of the virtual machine is achieved.
[0105] In this embodiment, a hardware configuration device for a virtual machine on a virtualization platform is also provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "unit" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0106] Figure 4 is a structural block diagram of a hardware configuration device for a virtual machine on a virtualization platform according to an embodiment of the present application, as Figure 4 shown. The hardware configuration device 400 of this virtual machine includes: a control unit 402, a comparison unit 404, and a configuration unit 406.
[0107] The control unit 402 is configured to control the virtual machine data of the virtual machine to be migrated from the source-side virtualization platform to the corresponding target-side virtualization platform in response to obtaining the source-side hardware type of the virtual machine running on the source-side virtualization platform.
[0108] A comparison unit 404, configured to compare a source hardware type with a target hardware type of a virtual machine to be run on a target virtualization platform in response to completion of migrating virtual machine data to the target virtualization platform, so as to obtain a comparison result.
[0109] A configuration unit 406, configured to configure hardware for the virtual machine to be run on the target virtualization platform based on the source hardware type in response to the comparison result indicating that the source hardware type is different from the target hardware type, so that the virtual machine is in a normal running state on the target virtualization platform.
[0110] The hardware configuration device for a virtual machine provided in an embodiment of the present application controls, through a control unit 402, a source virtualization platform to migrate virtual machine data of a virtual machine running on the source virtualization platform to a corresponding target virtualization platform in response to obtaining the source hardware type of the virtual machine; the comparison unit 404 compares the source hardware type with the target hardware type of the virtual machine to be run on the target virtualization platform in response to completion of migrating the virtual machine data to the target virtualization platform, so as to obtain a comparison result; and the configuration unit 406 configures hardware for the virtual machine to be run on the target virtualization platform based on the source hardware type in response to the comparison result indicating that the source hardware type is different from the target hardware type, so that the virtual machine is in a normal running state on the target virtualization platform. Thereby, the technical problem of low accuracy of hardware configuration of a virtual machine is solved, and the technical effect of improving the accuracy of hardware configuration of a virtual machine is achieved.
[0111] It should be noted that the above-mentioned each unit can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited thereto: all the above-mentioned units are located in the same processor; or, the above-mentioned each unit is located in different processors in any combination form.
[0112] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above method embodiments when running.
[0113] In an exemplary embodiment, the above-mentioned computer-readable storage medium may include, but is not limited to: a USB flash drive, a read-only memory (ROM for short), a random access memory (RAM for short), a mobile hard disk, a magnetic disk, or an optical disc, etc., various media that can store a computer program.
[0114] An embodiment of the present application further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0115] In an exemplary embodiment, the above-mentioned electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the above-mentioned processor, and the input / output device is connected to the above-mentioned processor.
[0116] An embodiment of the present application also provides a computer program product. The above-mentioned computer program product includes a computer program, and when the computer program is executed by a processor, the steps in any one of the above-mentioned method embodiments are implemented.
[0117] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any one of the above-mentioned method embodiments are implemented.
[0118] An embodiment of the present application also provides a computer program. The computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in any one of the above-mentioned method embodiments.
[0119] Specific examples in this embodiment may refer to the examples described in the above-mentioned embodiments and exemplary embodiments, and will not be repeated here.
[0120] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present application can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order from here, or they can be separately made into individual integrated circuit modules, or multiple modules or steps among them can be made into a single integrated circuit module to implement. In this way, the present application is not limited to any specific combination of hardware and software.
[0121] The above are only the preferred embodiments of the present application and are not used to limit the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for hardware configuration of a virtual machine on a virtualization platform, characterized in that: include: In response to obtaining the source hardware type of the virtual machine running on the source virtualization platform, controlling the source virtualization platform to migrate virtual machine data of the virtual machine to the corresponding target virtualization platform; In response to completing the migration of the virtual machine data to the target virtualization platform, the source hardware type is compared with the target hardware type of the virtual machine to be run on the target virtualization platform to obtain a comparison result; in response to the comparison result being that the source hardware type is different from the target hardware type, hardware is configured for the virtual machine to be run on the target virtualization platform based on the source hardware type, so that the virtual machine is in normal operating state on the target virtualization platform.
2. The method according to claim 1, characterized in that In response to the comparison result that the source-end hardware type is different from the target-end hardware type, configuring hardware for the virtual machine to be run on the target-end virtualization platform based on the source-end hardware type so that the virtual machine is in a normal operating state on the target-end virtualization platform, including: In response to the comparison result being that the source-side hardware type is different from the target-side hardware type, obtaining a configuration instruction for the target account that logs into the virtual machine, wherein the configuration instruction is used to indicate whether the target account has a performance requirement for the performance of the hardware of the virtual machine running on the target-side virtualization; Detecting the source-end hardware type and the target-end hardware type to obtain a first detection result, wherein the first detection result is used to indicate whether the source-end hardware type and the target-end hardware type are allowed to be adjusted to be consistent; Based on the configuration instruction, the first detection result and the source-side hardware type, hardware is configured for the virtual machine to be run on the target-side virtualization platform, so that the virtual machine is in the normal operating state on the virtual-side virtualization platform.
3. The method according to claim 2, characterized in that The configuring hardware for the virtual machine to be run on the target-side virtualization platform based on the configuration instruction, the first detection result, and the source-side hardware type, so that the virtual machine is in the normal operating state on the virtual-side virtualization platform, includes: In response to the configuration instruction that the target account does not have the performance requirement, and the first detection result is that the source-end hardware type and the target-end hardware type are not allowed to be adjusted to be consistent, a first source-end hardware type among the source-end hardware types is obtained, wherein the virtual machine configured with the hardware of the first source-end hardware type has an operating performance indicator on the target-end virtualization platform that is less than a performance indicator threshold, and the hardware configured with the first source-end hardware type has an operating performance indicator on the source-end virtualization platform that is greater than or equal to the performance indicator threshold, the operating performance indicator less than the performance indicator threshold is used to indicate that the virtual machine is in an abnormal operating state, and the performance indicator greater than or equal to the performance indicator threshold is used to indicate that the virtual machine is in the normal operating state; Determining a target-side hardware type corresponding to the first source-side hardware type, wherein an operating performance index of the hardware of the target-side hardware type on the target-side virtualization platform is greater than or equal to the performance index threshold; The hardware of the target hardware type is configured for the virtual machine to be run in the target virtualization platform, so that the virtual machine configured with the hardware of the first source hardware type is in the normal operating state on the target virtualization platform.
4. The method according to claim 2, characterized in that: The configuring hardware for the virtual machine to be run on the target-side virtualization platform based on the configuration instruction, the first detection result, and the source-side hardware type, so that the virtual machine is in the normal operating state on the virtual-side virtualization platform, includes: In response to the configuration instruction that the target account does not have the performance requirement, and the first detection result that the source hardware type and the target hardware type are allowed to be adjusted to be consistent, a second source hardware type among the source hardware types is obtained, wherein the virtual machine configured with the hardware of the second source hardware type has a running performance index on the target virtualization platform that is greater than or equal to a performance index threshold, and the virtual machine configured with the hardware of the second source hardware type has a running performance index on the source virtualization platform that is greater than or equal to the performance index threshold; The hardware of the second source hardware type is configured for the virtual machine to be run in the target virtualization platform, so that the virtual machine configured with the hardware of the second source hardware type is in the normal operating state on the target virtualization platform.
5. The method according to claim 2, characterized in that: The configuring hardware for the virtual machine to be run on the target-side virtualization platform based on the configuration instruction, the first detection result, and the source-side hardware type, so that the virtual machine is in the normal operating state on the virtual-side virtualization platform, includes: In response to the configuration instruction having the performance requirement for the target account, obtaining a hardware type in the configuration instruction; The hardware of the hardware type in the configuration instruction is configured for the virtual machine to be run in the target virtualization platform, so that the virtual machine configured with the hardware of the hardware type is in the normal operating state on the target virtualization platform.
6. The method according to claim 1, characterized in that The hardware includes a network card, and the target end hardware type includes a network card type, wherein the method further includes: In response to completing the configuration of the hardware for the virtual machine running in the target virtualization platform, detecting the type of the network card to obtain a second detection result; In response to the second detection result that the network card type of the target virtualization platform before the virtual machine data migration is different from the network card type of the target virtualization platform after the virtual machine data migration, detecting the source network card configuration information of the source virtualization platform to obtain a third detection result; In response to the third detection result that the source-end network card configuration information exists on the source-end virtualization platform, the target-end network card configuration information of the target-end virtualization platform is adjusted to the source-end network card configuration information.
7. The method according to claim 1, characterized in that The hardware includes a disk, and the target end hardware type includes a disk type, wherein the method further includes: In response to completing the hardware configuration of the virtual machine running in the target virtualization platform, obtaining the virtual machine type of the virtual machine and source disk configuration information of the source virtualization platform; In response to the virtual machine type being the first virtual machine type, adjusting the target-side disk configuration information of the target-side virtualization platform so that the adjusted target-side disk configuration information is the same as the source-side disk configuration information; In response to the virtual machine type being the second virtual machine type, the disk type is adjusted to a target disk type to configure the target disk type driver, wherein an operating performance index of the disk of the target disk type on the target-end virtualization platform is greater than or equal to a performance index threshold.
8. The method according to claim 1, characterized in that The method further comprises: In response to completing the configuration of the hardware of the virtual machine on the target virtualization platform, the virtual machine is controlled to start up so that the virtual machine runs normally.
9. A hardware configuration device for a virtual machine on a virtualization platform, characterized in that: include: A control unit, configured to, in response to obtaining a source-side hardware type of a virtual machine running on a source-side virtualization platform, control the source-side virtualization platform to migrate virtual machine data of the virtual machine to a corresponding target-side virtualization platform; a comparison unit, configured to, in response to completing the migration of the virtual machine data to the target-side virtualization platform, compare the source-side hardware type with the target-side hardware type of the virtual machine to be run on the target-side virtualization platform to obtain a comparison result; A configuration unit is used to configure hardware for the virtual machine to be run on the target virtualization platform in response to the comparison result that the source hardware type is different from the target hardware type, based on the source hardware type, so that the virtual machine is in a normal operating state on the target virtualization platform.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the hardware configuration method of a virtual machine on a virtualization platform as described in any one of claims 1 to 8.
Citation Information
Cited By
Virtualization method and device of virtual machine, equipment and storage medium
CN121934960A