Virtual machine starting method and device, computer device and storage medium
By performing compatibility checks and corrections on the virtual hardware version information of virtual machines, the compatibility issues between the VMware vSphere suite and C86 processor servers were resolved, ensuring that virtual machines start normally and improving the stability and security of the virtualization platform.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DAWNING INFORMATION IND (BEIJING) CO LTD
- Filing Date
- 2022-12-29
- Publication Date
- 2026-06-26
AI Technical Summary
Some versions of the VMware vSphere suite have poor compatibility with servers equipped with C86 processors, causing virtual machines to fail to start, which in turn leads to ESXi host restarts or crashes, affecting the stability and security of the virtualization platform.
By obtaining the virtual hardware version information of the virtual machines installed on the server, the target virtual machine that does not meet the preset version conditions is identified, and its virtual hardware version information is corrected to match the version information of the virtualization platform program suite running on the server, ensuring that the virtual machine can start normally.
It improves the overall environmental stability and security of the virtualization platform, avoiding server restarts or crashes caused by virtual machines failing to start.
Smart Images

Figure CN116339908B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a virtual machine startup method, apparatus, computer equipment, storage medium, and computer program product. Background Technology
[0002] VMware vSphere is a widely used virtualization platform suite that allows users to build virtualization platforms. Specifically, the VMware vSphere suite mainly includes the ESXi component and the vCenter Server component. By installing and running the ESXi component on a server, the server can be deployed as an ESXi host, serving as a virtualization platform for creating and running virtual machines. Multiple ESXi hosts can form a virtualization platform cluster (vSphere cluster), which can be managed by a management node deployed based on the vCenter Server component.
[0003] However, some versions of VMware vSphere suite (such as versions 7.0 and 8.0) have poor compatibility with ESXi hosts equipped with C86 processors. Therefore, when starting virtual machines on such ESXi hosts, virtual machines may fail to start, leading to ESXi host restarts or crashes. Summary of the Invention
[0004] Therefore, it is necessary to provide a virtual machine startup method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can address the above-mentioned technical problems by avoiding the problem of virtual machines failing to start due to poor compatibility between virtualization platform program suites (such as VMware vSphere program suite) and servers equipped with C86 processors, thereby leading to server restarts or crashes, and thus improving the overall stability and security of the virtualization platform environment.
[0005] Firstly, this application provides a method for starting a virtual machine. The method is applied to a server, the server having deployed a plurality of virtual machines, and the method includes:
[0006] In response to the server's startup command, obtain the virtual hardware version information of each of the virtual machines installed on the server;
[0007] Among the virtual machines, the target virtual machine whose virtual hardware version information does not meet the preset version conditions is identified;
[0008] The virtual hardware version information contained in the configuration file of the target virtual machine is corrected to the first target virtual hardware version information; the first target virtual hardware version information is the virtual hardware version information that matches the version information of the virtualization platform program suite running on the server.
[0009] The corrected virtual machines are then started.
[0010] In this embodiment, by automatically performing compatibility checks on the virtual hardware version information of each virtual machine installed on the server, the virtual hardware version information of target virtual machines that do not meet the preset version conditions is corrected to virtual hardware version information that matches the version information of the virtualization platform program suite running on the server (i.e., the first target virtual hardware version information). This allows each corrected virtual machine to start normally. In this way, even if the server has poor compatibility with the running virtualization platform program suite, there will be no problem of server restart or crash due to virtual machines failing to start, thus improving the stability and security of the overall virtualization platform environment.
[0011] In one embodiment, correcting the virtual hardware version information contained in the configuration file of the target virtual machine to the first target virtual hardware version information includes:
[0012] The original format of the target virtual machine configuration file is converted to a first format to obtain a target format configuration file, and the virtual hardware version information contained in the target format configuration file is corrected to the first target virtual hardware version information.
[0013] The modified target format configuration file is then converted to a second format to obtain the modified original format configuration file.
[0014] In this embodiment, for the original format of the target virtual machine's configuration file, which the server cannot directly read and modify, the virtual hardware version information of the target virtual machine can be successfully modified through format conversion. Thus, when starting the modified virtual machine, the problem of the virtual machine failing to start due to poor compatibility between the server and the virtualization platform program suite, which in turn leads to server restart or crash, can be avoided.
[0015] In one embodiment, determining the target virtual machine whose virtual hardware version information does not meet the preset version conditions in each of the virtual machines includes:
[0016] The virtual hardware version information of each virtual machine is matched with the second target virtual hardware version information contained in the preset version information set; the second target virtual hardware version information is the virtual hardware version information that does not match the version information of the virtualization platform program suite running on the server.
[0017] If there is virtual hardware version information that successfully matches the second target virtual hardware version information, the virtual machine corresponding to the successfully matched virtual hardware version information is determined as the target virtual machine that does not meet the preset version conditions.
[0018] In this embodiment, the target virtual machine that does not meet the preset version conditions is determined by matching the virtual hardware version information of each virtual machine with the second target virtual hardware version information (the second target virtual hardware version information is the virtual hardware version information that does not match or is unqualified with the virtualization platform program suite). Compared with comparing the version number of each virtual hardware version information with the lowest qualified virtual hardware version information, this method is more efficient and can quickly determine the target virtual machine and make corrections.
[0019] In one embodiment, the step of obtaining the virtual hardware version information of each of the virtual machines installed on the server in response to the server's startup command includes:
[0020] In response to the server's startup command, the virtual hardware version information of each of the installed virtual machines is retrieved from the server at a preset period.
[0021] In this embodiment, after the server starts, it can obtain the virtual hardware version information of each virtual machine installed on the server according to a preset period, so as to check and correct the virtual hardware version information of each virtual machine on the server in a timely manner, avoiding compatibility problems such as virtual machines failing to start due to untimely correction, which may lead to server restart or crash. This can improve the stability and security of the overall virtualization platform environment.
[0022] In one embodiment, prior to the startup process of each of the modified virtual machines, the method further includes:
[0023] When the virtual machine is a vCLS agent virtual machine, the CPU parameter detection value contained in the configuration file of the vCLS agent virtual machine is corrected to the target parameter value. The target parameter value is used to instruct the vCLS agent virtual machine not to perform the CPU parameter reading step when it starts up.
[0024] In this embodiment, by correcting the CPU parameter detection value in the configuration file of the vCLS agent virtual machine to the target parameter value, the CPU parameter reading step will not be executed when the vCLS agent virtual machine is started based on the corrected configuration file. This allows the vCLS agent virtual machine to be successfully started on a server equipped with a C86 processor, thus ensuring the activation of the DRS function of the virtualization platform cluster.
[0025] In one embodiment, prior to the startup process of each of the modified virtual machines, the method further includes:
[0026] When the virtual machine is a vCLS proxy virtual machine, the virtual identity information is obtained from the configuration file of the vCLS proxy virtual machine;
[0027] Based on the virtual identifier information, the vCLS agent virtual machine is unregistered.
[0028] In this embodiment, by obtaining the virtual ID of the vCLS proxy virtual machine, the vCLS proxy virtual machine is unregistered, so that the server does not generate the vCLS proxy virtual machine, thereby achieving the effect of not generating alarm information.
[0029] Secondly, this application also provides a virtual machine startup device. The device includes:
[0030] The first acquisition module is used to acquire the virtual hardware version information of each virtual machine installed on the server in response to the server's startup command;
[0031] The determining module is used to determine, among the virtual machines, the target virtual machine whose virtual hardware version information does not meet the preset version conditions;
[0032] The first correction module is used to correct the virtual hardware version information contained in the configuration file of the target virtual machine to the first target virtual hardware version information; the first target virtual hardware version information is the virtual hardware version information that matches the version information of the virtualization platform program suite running on the server.
[0033] The startup module is used to perform startup processing on each of the modified virtual machines.
[0034] In one embodiment, the first correction module is specifically used for:
[0035] The original format configuration file of the target virtual machine is converted to a first format to obtain a target format configuration file, and the virtual hardware version information contained in the target format configuration file is corrected to the first target virtual hardware version information; the corrected target format configuration file is converted to a second format to obtain the corrected original format configuration file.
[0036] In one embodiment, the determining module is specifically used for:
[0037] The virtual hardware version information of each virtual machine is matched with the second target virtual hardware version information contained in the preset version information set; the second target virtual hardware version information is the virtual hardware version information that does not match the version information of the virtualization platform program suite running on the server; if there is a virtual hardware version information that successfully matches the second target virtual hardware version information, the virtual machine corresponding to the successfully matched virtual hardware version information is determined as the target virtual machine that does not meet the preset version conditions.
[0038] In one embodiment, the first acquisition module is specifically used for:
[0039] In response to the server's startup command, the virtual hardware version information of each of the installed virtual machines is retrieved from the server at a preset period.
[0040] In one embodiment, the device further includes:
[0041] The second correction module is used to correct the CPU parameter detection value contained in the configuration file of the vCLS agent virtual machine to a target parameter value when the virtual machine is a vCLS agent virtual machine. The target parameter value is used to instruct the vCLS agent virtual machine not to perform the CPU parameter reading step when it starts up.
[0042] In one embodiment, the device further includes:
[0043] The second acquisition module is used to acquire virtual identifier information from the configuration file of the vCLS proxy virtual machine when the virtual machine is a vCLS proxy virtual machine.
[0044] The unregistration module is used to perform unregistration processing on the vCLS agent virtual machine based on the virtual identifier information.
[0045] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described in the first aspect.
[0046] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.
[0047] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.
[0048] The aforementioned virtual machine startup method, apparatus, computer equipment, storage medium, and computer program product, after starting the server (i.e., an ESXi host deployed based on the VMware vSphere application suite), obtains the virtual hardware version information of all virtual machines installed on the server, identifies target virtual machines whose virtual hardware version information does not meet preset version conditions, and then corrects the virtual hardware version information contained in the configuration file of the target virtual machine to the first target virtual hardware version information. Finally, it starts each corrected virtual machine. This method automatically performs compatibility checks on the virtual hardware version information of each virtual machine installed on the server, correcting the virtual hardware version information of virtual machines that do not meet preset version conditions to match the version information of the virtualization platform application suite running on the server. This allows each corrected virtual machine to start normally. Therefore, even if the server has poor compatibility with the running virtualization platform application suite, it will not cause server restarts or crashes due to virtual machines failing to start, improving the overall stability and security of the virtualization platform environment. Attached Figure Description
[0049] Figure 1 This is a flowchart illustrating a virtual machine startup method in one embodiment;
[0050] Figure 2 This is a schematic diagram of the process for correcting virtual hardware version information in one embodiment;
[0051] Figure 3 This is a schematic diagram of the process for determining the target virtual machine in one embodiment;
[0052] Figure 4 This is a structural block diagram of a virtual machine startup device in one embodiment;
[0053] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0055] First, before introducing the technical solutions of the embodiments of this application in detail, we will first introduce the technical background or technical evolution on which the embodiments of this application are based.
[0056] VMware vSphere is a widely used virtualization platform suite that includes multiple components, primarily the ESXi component and the vCenter Server component. Users can build virtualization platforms based on the VMware vSphere suite. Specifically, by installing the ESXi component on a server, the server can be deployed as an ESXi host, serving as a virtualization platform for creating and running virtual machines. A group of ESXi hosts and related virtual machines with shared resources and a shared management interface constitutes a virtualization platform cluster (vSphere cluster). Based on the vCenter Server component, one ESXi host in the vSphere cluster can be deployed as a management node, providing vCenter Server services to centrally manage the various ESXi hosts and the virtual machines installed on each ESXi host within the vSphere cluster. The management node can be deployed on virtual machines installed on an ESXi host; the virtual machine deployed as a management node can be called a vCenter virtual appliance.
[0057] Currently, the VMware vSphere suite has been released in multiple versions, including the newer VMware vSphere 7.0 (including U1, U2, and U3) and version 8.0. The newer versions introduce several new features. For example, vSphere Clustering Service (vCLS), introduced in vSphere 7.0, is used to maintain the resources and health of workloads running in a vSphere cluster. When an ESXi host is added to a cluster, vCLS agent virtual machines are automatically created within the cluster (up to three vCLS agent virtual machines run per vSphere cluster) to provide vSphere cluster services. vSphere DRS (vSphere Distributed Resource Scheduler) is an important feature of VMware vSphere used to maintain the proper functioning of workloads within a vSphere cluster; the availability of DRS depends on the availability of vCLS agent virtual machines.
[0058] However, some versions of VMware vSphere suite have poor compatibility with domestically produced C86 processors, especially the newer versions 7.0 and 8.0, which exhibit significant compatibility issues. The main compatibility problem manifests as follows: when deploying a server with a C86 processor as an ESXi host using VMware vSphere suite version 7.0 or 8.0, virtual machines on that ESXi host often fail to start, leading to ESXi host restarts or crashes. Due to vSphere cluster's High Availability (HA) mechanism, this compatibility issue can cause large-scale crashes or restarts of all ESXi hosts within the vSphere cluster to which the affected ESXi host belongs, severely impacting the overall stability and security of the virtualization platform environment.
[0059] Against this backdrop, the applicant, through long-term research and development and experimental verification, proposed the virtual machine startup method of this application. This method can automatically perform compatibility checks on the virtual hardware version information of each virtual machine installed on a server (such as an ESXi host). The virtual hardware version information of virtual machines that do not meet the preset version conditions is corrected to match the version information of the virtualization platform program suite (such as VMware vSphere program suite) running on the server. This allows the corrected virtual machines to start normally. In this way, even if the server (such as a server with a C86 processor) has poor compatibility with the VMware vSphere program suite (such as version 7.0 or 8.0), there will be no problem of ESXi host restarting or crashing due to virtual machine startup failure. This improves the overall stability and security of the virtualization platform environment built on VMware vSphere program suite and a server with a C86 processor.
[0060] In addition, it should be noted that the applicant has devoted a great deal of creative effort to discovering the technical problems of this application and to developing the technical solutions described in the following embodiments.
[0061] In one embodiment, such as Figure 1As shown, a virtual machine startup method is provided. This method can be applied to a server (such as a server equipped with a C86 processor), which can be deployed as a virtualization platform (such as an ESXi host, i.e., a server with ESXi components installed and running) based on a virtualization platform suite (such as the VMware vSphere suite). The server can deploy several virtual machines, including a vCenter virtual device deployed as a management node and other virtual devices. It is understood that this method can be applied to each ESXi host in a virtualization platform cluster (vSphere cluster). In this embodiment, the method specifically includes the following steps:
[0062] Step 101: In response to the server's startup command, obtain the virtual hardware version information of each virtual machine installed on the server.
[0063] In implementation, users can trigger the startup operation of the server (i.e., the ESXi host) by sending a startup command. For example, users can remotely access the ESXi host's console interface via a terminal and trigger the startup operation from the console interface, or users can trigger the startup operation via the physical power button on the ESXi host. The server can then respond to this startup command and obtain the virtual hardware version information of each virtual machine installed locally. This virtual hardware version information is the virtual machine's attribute information, used to indicate the virtual hardware functions supported by the virtual machine, the number of virtual slots, the maximum number of CPUs, the maximum memory configuration, and other hardware characteristics. Optionally, the virtual hardware version information of each virtual machine installed on the ESXi host can be obtained by accessing a preset interface of the ESXi host. For example, the preset interface could be the vSphere API (Application Programming Interface). Virtual machines include newly created virtual machines on the ESXi host by the user, virtual machines (or virtual devices) generated by importing templates, or virtual machines automatically generated by the ESXi host (such as vCLS agent virtual machines). Understandably, virtual machines installed on an ESXi host may include vCenter virtual appliances deployed as management nodes and other virtual appliances (such as NSX virtual appliances deployed as network virtualization platforms).
[0064] Step 102: In each virtual machine, identify the target virtual machine whose virtual hardware version information does not meet the preset version conditions.
[0065] In implementation, after the server obtains the virtual hardware version information of each virtual machine installed locally, it can filter out target virtual machines whose virtual hardware version information does not meet the preset version conditions. For example, the preset version condition can be that the version number of the virtual hardware version information is greater than or equal to the version number of the first target virtual hardware version information. For example, the version number of the first target virtual hardware version information can be 13. If there are virtual machines with a virtual hardware version number less than 13 (such as 10 or 11) installed on the ESXi host, it can be determined that the virtual machine does not meet the preset version condition and is identified as the target virtual machine.
[0066] The first target virtual hardware version information is the version number of the virtual hardware information that matches the version information of the virtualization platform program suite (such as VMware vSphere program suite) running on the server. A mapping relationship between each version of VMware vSphere program suite and the version number of the virtual hardware information can be established in advance, allowing the determination of the virtual hardware version number that matches the version information of the VMware vSphere program suite running on the server. Specifically, after deploying a server with a C86 processor as an ESXi host to build a vSphere cluster based on VMware vSphere program suite, when starting each virtual machine installed on the ESXi host, the ESXi host checks whether the virtual hardware version information of each virtual machine meets the requirements. If the virtual hardware version information does not meet the requirements, the virtual machine will fail to start, and the ESXi host will restart or crash. Different versions of VMware vSphere program suite have different requirements for the virtual hardware version information of virtual machines installed on ESXi hosts with C86 processors. For example, for VMware vSphere suite versions 7.0 and 8.0, if the virtual hardware version information (version number) of a virtual machine installed on an ESXi host with a C86 processor is below 13 (10 or 11), starting the virtual machine will cause the host to restart or crash. However, if the virtual hardware version information is 13 or above, the virtual machine can be started successfully without causing the host to restart or crash.
[0067] Step 103: Correct the virtual hardware version information contained in the configuration file of the target virtual machine to the first target virtual hardware version information.
[0068] In implementation, once the server identifies a target virtual machine that does not meet the preset version conditions, it can modify the virtual hardware version information in the target virtual machine's configuration file to match the first target virtual hardware version information. The first target virtual hardware version information is the virtual hardware version information that matches the version information of the virtualization platform program suite running on the server. It is understood that there can be multiple matching virtual hardware version information options. The server can randomly select from these options or select the first target virtual hardware version information according to other selection criteria. For example, if the VMware vSphere program suite running on the ESXi host is version 7.0 or 8.0, then according to the pre-established correspondence between program suite version information and virtual hardware version information, the matching virtual hardware version information is 13 or higher. Therefore, the server can randomly select one virtual hardware version information from the matching options as the first target virtual hardware version information, or the server can select the virtual hardware version information with the smallest version number (i.e., "13") as the first target virtual hardware version information.
[0069] Step 104: Start up each of the corrected virtual machines.
[0070] In practice, after the server corrects the virtual hardware version information of locally installed target virtual machines that do not meet the preset version conditions, it can start the corrected virtual machines. For example, the ESXi host can start the virtual machine in response to a user-triggered startup operation. The ESXi host can also automatically start locally installed virtual machines based on other preset trigger conditions (such as automatically starting the vCLS agent virtual machine).
[0071] The virtual machine startup method described above can automatically perform compatibility checks on the virtual hardware version information of each virtual machine installed on the server. It corrects the virtual hardware version information of target virtual machines that do not meet the preset version conditions to match the version information of the virtualization platform program suite running on the server (i.e., the first target virtual hardware version information). This allows the corrected virtual machines to start normally. Therefore, even if the server (such as a server equipped with a C86 processor) has poor compatibility with the running virtualization platform program suite (such as VMware vSphere program suite version 7.0 or 8.0), there will be no problem of server restart or crash due to virtual machines failing to start, thus improving the overall stability and security of the virtualization platform environment.
[0072] In one embodiment, such as Figure 2 As shown, the process of correcting the virtual hardware version information in step 103 specifically includes the following steps:
[0073] Step 201: Convert the original format of the target virtual machine configuration file into a first format to obtain a target format configuration file, and correct the virtual hardware version information contained in the target format configuration file to the first target virtual hardware version information.
[0074] In implementation, some virtual machine configuration files installed on the server may contain content that the server cannot directly read or modify. For example, some virtual machines have OVA files as their configuration files (i.e., the original format of the configuration file is OVA), and the server cannot directly read or modify the content of OVA files. The server can identify the format of the target virtual machine's configuration file (i.e., the original format). If the server determines that the target virtual machine's configuration file is in a preset format (i.e., a format that cannot be directly read or modified), it can perform a first format conversion on the original format of the target virtual machine's configuration file to obtain the target format configuration file. The target format is a file format that the server can directly read and modify. Specifically, the server can use a format conversion tool corresponding to the original and target formats to convert the original format configuration file to obtain the target format configuration file. The server can then modify the virtual hardware version information contained in the target format configuration file to the first target virtual hardware version information.
[0075] For example, for a configuration file whose original format is OVA, the server can use a format conversion tool (such as ovftool) to convert the OVA configuration file to an OVA format (target format) configuration file (i.e., OVA file) whose content can be read and modified by the server. Thus, the server can read and modify the virtual hardware version information contained in the OVA file and modify it to the first target virtual hardware version information.
[0076] Understandably, if the target virtual machine's configuration file is a file that the server can directly read and modify, such as a vmx format configuration file, then the server does not need to convert its format.
[0077] Step 202: Perform a second format conversion on the corrected target format configuration file to obtain the corrected original format configuration file.
[0078] In implementation, after the server modifies the target format configuration file, it can perform a second format conversion to return it to the original format, resulting in a modified original format configuration file. This allows the server to successfully run the modified virtual machine based on the original format configuration file.
[0079] For example, for a configuration file originally in OVA format, the server uses a format conversion tool (such as ovftool) to convert the OVA configuration file into an OVA file. After correcting the virtual hardware version information contained in the OVA file, the server can use another format conversion tool (such as ovftool) to convert the corrected OVA file back into an OVA file. Understandably, after using ovftool to convert the OVA file, not only is an OVA file obtained, but also other files including an MF file. After correcting the OVA file, the corrected OVA file and other files converted from the original OVA file can be converted together to obtain a corrected OVA file. Furthermore, to ensure successful import of the corrected original configuration file (the corrected OVA file), after correcting the OVA file, a SHA1 (Secure Hash Algorithm 1) value can be generated for the corrected OVA file, and the SHA1 value can be written into the MF file to ensure consistent verification values. This allows the corrected OVA file, obtained by converting the corrected OVA file, the corrected MF file, and other related files, to be successfully imported into the virtualization platform.
[0080] In this embodiment, for the target virtual machine's configuration file in its original format that the server cannot directly read and modify, the server can convert the configuration file to a target format configuration file that can be read and modified. This allows the server to modify the target format configuration file and restore its original format after modification. This enables the successful modification of the virtual hardware version information of the target virtual machine, ensuring that the modified virtual hardware version information of each virtual machine meets the preset version conditions. This allows the modified virtual machine to start normally, avoiding the problem of virtual machines failing to start due to poor compatibility between the server and the virtualization platform program suite, which could lead to server restarts or crashes.
[0081] In one embodiment, such as Figure 3 As shown, the process of determining the target virtual machine in step 102 specifically includes the following steps:
[0082] Step 301: Match the virtual hardware version information of each virtual machine with the second target virtual hardware version information contained in the preset version information set.
[0083] The second target virtual hardware version information refers to the virtual hardware version information that does not match the version information of the virtualization platform program suite running on the server. There can be multiple second target virtual hardware version information sets. For example, for VMware vSphere program suite versions 7.0 and 8.0, if the virtual hardware version information (version number) of a virtual machine installed on an ESXi host with a C86 processor is below 13 (10 or 11), starting the virtual machine will cause the host to restart or crash. However, if the virtual hardware version information is 13 or higher, the virtual machine can be started successfully without causing a host restart or crash. Since most mainstream virtual machines currently use versions "10" and "11" for virtual hardware version information below "13" (versions below "10" are basically deprecated), virtual hardware version information "10" and "11" that do not match the version information of the virtualization platform program suite running on the server can be used as the second target virtual hardware version information sets to construct a preset version information set. The server can then match the virtual hardware version information of each virtual machine with the second target virtual hardware version information contained in the preset version information set.
[0084] Step 302: If there is virtual hardware version information that successfully matches the second target virtual hardware version information, the virtual machine corresponding to the successfully matched virtual hardware version information is determined as the target virtual machine that does not meet the preset version conditions.
[0085] In implementation, the server matches the virtual hardware version information of each virtual machine with the second target virtual hardware version information. If any virtual hardware version information in the virtual hardware version information of a virtual machine successfully matches the second target virtual hardware version information, the server can determine the virtual machine corresponding to the successfully matched virtual hardware version information as the target virtual machine that does not meet the preset version conditions. For example, the second target virtual hardware version information can be version numbers "10" and "11", and version numbers "10" and "11" can be matched with the virtual hardware version information of each virtual machine respectively. If a virtual hardware version information successfully matches any of the second target virtual hardware version information, that is, the version number of the virtual hardware version information is "10" or "11", then the virtual machine corresponding to that virtual hardware version information is the target virtual machine that does not meet the preset version conditions.
[0086] In this embodiment, by matching the virtual hardware version information of each virtual machine with the second target virtual hardware version information (the second target virtual hardware version information is the virtual hardware version information that does not match or is unqualified with the virtualization platform program suite), and determining the virtual machine corresponding to the successfully matched virtual hardware version information as the target virtual machine that does not meet the preset version conditions, this method is more efficient than comparing the version number of each virtual hardware version information with the lowest qualified virtual hardware version information. It can quickly identify the target virtual machine and make corrections, thereby improving the stability and security of the overall virtualization platform environment.
[0087] In one embodiment, the process of obtaining the virtual hardware version information of each virtual machine in step 101 specifically includes the following steps: in response to the server's startup command, obtaining the virtual hardware version information of each installed virtual machine from the server at a preset period.
[0088] In implementation, after a user triggers the server's startup command, the server can respond by retrieving the virtual hardware version information of each installed virtual machine from the server at a preset period. That is, after the server starts, it retrieves the virtual hardware version information of the virtual machines and performs subsequent compatibility checks and corrections, which can be executed at a preset period, such as 1 minute.
[0089] In this embodiment, since users may create or import new virtual machines or virtual devices on the server (ESXi host) at any time, after the server starts, it can obtain the virtual hardware version information of each virtual machine installed on the server according to a preset period. This allows for timely checking and correction of the virtual hardware version information of each virtual machine on the server, avoiding compatibility issues such as virtual machines failing to start due to untimely correction, which could lead to server restarts or crashes. This improves the overall stability and security of the virtualization platform environment.
[0090] In one embodiment, before starting each virtual machine in step 104, the method further includes the following step: if the virtual machine is a vCLS agent virtual machine, the CPU parameter detection value contained in the configuration file of the vCLS agent virtual machine is corrected to a target parameter value, the target parameter value being used to instruct that the CPU parameter reading step is not performed when the vCLS agent virtual machine starts.
[0091] In implementation, the server can identify the locally installed vCLS agent virtual machine. For example, the server can match the name of the vCLS agent virtual machine with the names of all virtual machines; the virtual machine whose name matches successfully is the vCLS agent virtual machine. Then, the server can modify the CPU parameter detection value in the vCLS agent virtual machine's configuration file to a target parameter value. The target parameter value is used to instruct the vCLS agent virtual machine not to perform the CPU parameter reading step when it starts. The target parameter value can be obtained in advance based on experimental analysis.
[0092] The vCLS agent virtual machine is a virtual machine automatically generated by the ESXi host in the vSphere cluster. The vCLS agent virtual machine uses a default configuration file, which includes CPU parameter detection values. When starting the vCLS agent virtual machine according to this default configuration file, it performs a step of reading the CPUID (CPUID opcode) from the CPU's EAX register (Extended accumulator register) to identify the CPU type. Only if the CPU type is identified as valid can the vCLS agent virtual machine start successfully. However, for C86 processors, the return value when reading the EAX register is zero, causing the vCLS agent virtual machine to be unable to determine the CPU type used, thus failing to start and issuing an alarm message. In other words, servers and virtualization platform suites equipped with C86 processors (such as VMware vSphere versions 7.0 and 8.0) have another compatibility issue: they cannot start the vCLS agent virtual machine on ESXi hosts equipped with C86 processors. The most direct impact of this compatibility issue is that the DRS (Distributed Resource Scheduler) function of the virtualization platform cluster (vSphere cluster) that relies on the vCLS agent virtual machine is unusable. This prevents the vSphere cluster from automatically balancing resource load, potentially causing some hosts within the cluster to have excessively low resource utilization, resulting in resource waste, while other hosts have excessively high resource utilization, severely affecting the stability and efficiency of the overall virtualization platform environment. This embodiment can solve the problem of the inability to start the vCLS agent virtual machine due to poor compatibility between the virtualization platform program suite and servers equipped with C86 processors.
[0093] In this embodiment, by correcting the CPU parameter detection value in the configuration file of the vCLS agent virtual machine to the target parameter value, when the vCLS agent virtual machine is started based on the corrected configuration file, the CPU parameter reading and CPU type identification steps will not be performed. Instead, it will be started directly with a general processor configuration. This allows the vCLS agent virtual machine to be successfully started on an ESXi host equipped with a C86 processor, thus ensuring the activation of the DRS function of the virtualization platform cluster.
[0094] In one embodiment, before starting each virtual machine in step 104, the method further includes the following steps: if the virtual machine is a vCLS proxy virtual machine, obtain virtual identification information from the configuration file of the vCLS proxy virtual machine; and perform unregistration processing on the vCLS proxy virtual machine based on the virtual identification information.
[0095] In practice, if the server can identify the vCLS proxy virtual machine in each virtual machine, it can obtain the virtual identification information (i.e., virtual ID) from the configuration file of the vCLS proxy virtual machine. Then, the server can perform unregistration processing on the vCLS proxy virtual machine based on the virtual identification information of the vCLS proxy virtual machine, that is, unregister the vCLS proxy virtual machine.
[0096] In this embodiment, due to poor compatibility between servers equipped with C86 processors and virtualization platform software suites (such as VMware vSphere versions 7.0 and 8.0), the vCLS agent virtual machine fails to start on the virtualization platform host (ESXi host) equipped with a C86 processor, causing the virtualization platform to issue an alarm message and affecting the user experience. This embodiment obtains the virtual ID of the vCLS agent virtual machine and then performs unregistration processing on the vCLS agent virtual machine, preventing the server from generating the vCLS agent virtual machine, thereby achieving the effect of not generating alarm messages.
[0097] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0098] Based on the same inventive concept, this application also provides a virtual machine startup apparatus for implementing the virtual machine startup method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more virtual machine startup apparatus embodiments provided below can be found in the limitations of the virtual machine startup method described above, and will not be repeated here.
[0099] In one embodiment, such as Figure 4 As shown, a virtual machine startup device 400 is provided, including: a first acquisition module 401, a determination module 402, a first correction module 403, and a startup module 404, wherein:
[0100] The first acquisition module 401 is used to acquire the virtual hardware version information of each virtual machine installed on the server in response to the server's startup command.
[0101] The determination module 402 is used to determine, among the virtual machines, the target virtual machine whose virtual hardware version information does not meet the preset version conditions.
[0102] The first correction module 403 is used to correct the virtual hardware version information contained in the configuration file of the target virtual machine to the first target virtual hardware version information; the first target virtual hardware version information is the virtual hardware version information that matches the version information of the virtualization platform program suite running on the server.
[0103] The startup module 404 is used to perform startup processing on each of the modified virtual machines.
[0104] In one embodiment, the first correction module 403 is specifically configured to: convert the original format configuration file of the target virtual machine into a first format to obtain a target format configuration file, and correct the virtual hardware version information contained in the target format configuration file to a first target virtual hardware version information; and convert the corrected target format configuration file into a second format to obtain a corrected original format configuration file.
[0105] In one embodiment, the determining module 402 is specifically used to: match the virtual hardware version information of each virtual machine with the second target virtual hardware version information contained in a preset version information set; the second target virtual hardware version information is virtual hardware version information that does not match the version information of the virtualization platform program suite running on the server; if there is virtual hardware version information that successfully matches the second target virtual hardware version information, determine the virtual machine corresponding to the successfully matched virtual hardware version information as the target virtual machine that does not meet the preset version conditions.
[0106] In one embodiment, the first acquisition module 401 is specifically configured to: in response to the server's startup command, acquire virtual hardware version information of each of the installed virtual machines from the server at a preset period.
[0107] In one embodiment, the device further includes a second correction module, configured to correct the CPU parameter detection value contained in the configuration file of the vCLS agent virtual machine to a target parameter value when the virtual machine is a vCLS agent virtual machine, the target parameter value being used to instruct the vCLS agent virtual machine not to perform the CPU parameter reading step when it starts.
[0108] In one embodiment, the device further includes a second acquisition module and an anti-registration module, wherein:
[0109] The second acquisition module is used to acquire virtual identifier information from the configuration file of the vCLS proxy virtual machine when the virtual machine is a vCLS proxy virtual machine.
[0110] The unregistration module is used to perform unregistration processing on the vCLS agent virtual machine based on the virtual identifier information.
[0111] Each module in the aforementioned virtual machine boot device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0112] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores data required or generated for executing the virtual machine startup method described above. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a virtual machine startup method.
[0113] Those skilled in the art will understand that Figure 5The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0114] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0115] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0116] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0117] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0118] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0119] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0120] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A virtual machine startup method, characterized in that, The method is applied to a server, the server having deployed several virtual machines, and the method includes: In response to the server's startup command, the virtual hardware version information of each virtual machine installed on the server is obtained, wherein the virtual hardware version information is the hardware attribute information of the virtual machine; In each of the virtual machines, a target virtual machine whose virtual hardware version information does not meet the preset version condition is determined. The preset version condition is that the version number of the virtual hardware version information is greater than or equal to the version number of the first target virtual hardware version information. The virtual hardware version information contained in the configuration file of the target virtual machine is corrected to the first target virtual hardware version information; the first target virtual hardware version information is the virtual hardware version information that matches the version information of the virtualization platform program suite running on the server. The corrected virtual machines are then started.
2. The method according to claim 1, characterized in that, The step of correcting the virtual hardware version information contained in the configuration file of the target virtual machine to the first target virtual hardware version information includes: The original format configuration file of the target virtual machine is converted to a first format to obtain a configuration file in the target format, and the virtual hardware version information contained in the configuration file in the target format is corrected to the first target virtual hardware version information. The modified target format configuration file is then converted to a second format to obtain the modified original format configuration file.
3. The method according to claim 1, characterized in that, The step of determining, among the virtual machines, the target virtual machine whose virtual hardware version information does not meet the preset version conditions includes: The virtual hardware version information of each virtual machine is matched with the second target virtual hardware version information contained in the preset version information set; the second target virtual hardware version information is the virtual hardware version information that does not match the version information of the virtualization platform program suite running on the server. If there is virtual hardware version information that successfully matches the second target virtual hardware version information, the virtual machine corresponding to the successfully matched virtual hardware version information is determined as the target virtual machine that does not meet the preset version conditions.
4. The method according to claim 1, characterized in that, The step of responding to the server's startup command by obtaining the virtual hardware version information of each of the virtual machines installed on the server includes: In response to the server's startup command, the virtual hardware version information of each of the installed virtual machines is retrieved from the server at a preset period.
5. The method according to claim 1, characterized in that, Before starting the corrected virtual machines, the process further includes: When the virtual machine is a vCLS agent virtual machine, the CPU parameter detection value contained in the configuration file of the vCLS agent virtual machine is corrected to the target parameter value. The target parameter value is used to instruct the vCLS agent virtual machine not to perform the CPU parameter reading step when it starts.
6. The method according to claim 1, characterized in that, Before starting the corrected virtual machines, the process further includes: When the virtual machine is a vCLS proxy virtual machine, the virtual identity information is obtained from the configuration file of the vCLS proxy virtual machine; Based on the virtual identifier information, the vCLS agent virtual machine is unregistered.
7. A virtual machine startup device, characterized in that, The device includes: The first acquisition module is used to acquire the virtual hardware version information of each virtual machine installed on the server in response to the server's startup command. The virtual hardware version information is the hardware attribute information of the virtual machine. The determining module is used to determine, among the virtual machines, a target virtual machine whose virtual hardware version information does not meet a preset version condition, wherein the preset version condition is that the version number of the virtual hardware version information is greater than or equal to the version number of the first target virtual hardware version information. The first correction module is used to correct the virtual hardware version information contained in the configuration file of the target virtual machine to the first target virtual hardware version information; the first target virtual hardware version information is the virtual hardware version information that matches the version information of the virtualization platform program suite running on the server. The startup module is used to perform startup processing on each of the modified virtual machines.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.