Cross-platform virtual machine cloning method
By determining the source virtual machine, selecting cloning type, building prediction models, setting error handling mechanisms and analyzing logs during the virtual machine cloning process, the problems of low efficiency and low degree of automation in the existing technology are solved, and an efficient and automated virtual machine cloning process is achieved.
Patent Information
- Application Number
- CN202510378674.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-03-28
AI Technical Summary
The existing virtual machine cloning technology has shortcomings in resource allocation efficiency, error handling and optimization analysis, and it relies on a simple error recovery mechanism that relies on manual intervention, and urgently needs intelligent and automated solutions.
By determining the source virtual machine, selecting cloning types, building a prediction model to estimate resource requirements, requesting resources from the target platform and allocating it; starting the cloning process and setting up an error handling mechanism; finally verifying the cloning results and analyzing the logs, optimizing cloning efficiency, reducing manual intervention, and improving the automation level of the cloning process.
The intelligence and automation of resource allocation have been realized, cloning efficiency has been improved, manual intervention has been reduced, and the automation level of the cloning process has been improved.
Smart Images

Figure CN119883523A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of virtualization, and in particular to a cross-platform virtual machine cloning method. Background Art
[0002] With the expansion of cloud computing and data center scale, virtual machine cloning has become a key technology for rapid deployment and resource expansion. However, existing cloning technology has shortcomings in resource allocation efficiency, error handling and optimization analysis, and relies on a simple error recovery mechanism of manual intervention, which urgently needs intelligent and automated solutions.
[0003] Therefore, the present invention provides a cross-platform virtual machine cloning method. Summary of the invention
[0004] The present invention provides a cross-platform virtual machine cloning method, which determines the source virtual machine, selects the cloning type, builds a prediction model to estimate resource requirements, requests resources from the target platform and allocates them; starts the cloning process and sets an error handling mechanism; finally verifies the cloning results and analyzes the logs, optimizes the cloning efficiency, reduces manual intervention, and improves the automation level of the cloning process.
[0005] The present invention provides a cross-platform virtual machine cloning method, comprising: Step 1: Determine the source virtual machine to be cloned, the virtualization platform where the source virtual machine is located, and the target virtualization platform for cloning, and select the cloning type; Step 2: Select a cloning method based on the cloning type, determine the cloning process, build a prediction model to estimate the resources required for the cloning process, make a resource request to the target virtualization platform, and derive a resource allocation plan based on the request result; Step 3: Based on the resource allocation scheme, start the cloning process and set an error handling mechanism for the cloning process; Step 4: Verify the integrity of the cloning results, analyze the logs during the cloning process, and find potential optimization points for the cloning process.
[0006] The present invention provides a cross-platform virtual machine cloning method, which determines a source virtual machine to be cloned, a virtualization platform where the source virtual machine is located, and a target virtualization platform for cloning, and selects a cloning type, including: Determine a source virtual machine to be cloned, confirm the state of the source virtual machine, obtain a state confirmation result, and record the virtual machine configuration information; Determine the virtualization platform where the source virtual machine is located according to the virtual machine information; Obtain user requirements, perform matching analysis between the user requirements and the source virtual machine, and determine the target virtualization platform; A screening condition is determined according to the status confirmation result and the user's expected target virtualization platform, and a clone type is selected based on the screening condition.
[0007] The present invention provides a cross-platform virtual machine cloning method, which determines a screening condition according to the state confirmation result, the user demand and the estimated target virtualization platform, and selects a cloning type based on the screening condition, including: Determine the storage space of the target virtualization platform to obtain a first screening condition, decompose the user demand to obtain a cloning time limit, obtain a second screening condition based on the cloning time limit, and obtain a third screening condition based on the status confirmation result; Performing a compatibility judgment on the virtualization platform where the source virtual machine is located and the target virtualization platform, and obtaining a fourth screening condition according to the compatibility judgment result; The clone type is selected based on the first screening condition, the second screening condition, the third screening condition and the fourth screening condition.
[0008] The present invention provides a cross-platform virtual machine cloning method, which selects a cloning method according to a cloning type, determines a cloning process, constructs a prediction model to estimate the resources required for the cloning process, makes a resource request to a target virtualization platform, and obtains a resource allocation plan according to the request result, including: Determine a cloning method from a cloning type-method table according to the cloning type, and determine a cloning process; Collect historical clone data of the source virtual machine and parameter information of the current clone task, build a prediction model, and predict the resources required for cloning; The required resources are requested from the target virtualization platform, and the operation information of the target virtualization platform is obtained at the same time. The task priority is calculated in combination with the operation information, the required resources and the parameter information of the current clone task to obtain a resource allocation plan.
[0009] The present invention provides a cross-platform virtual machine cloning method, which requests the required resources from a target virtualization platform, obtains the operation information of the target virtualization platform, calculates the task priority by combining the operation information, the required resources and the parameter information of the current cloned task, and intelligently allocates the required resources, including: ,in, represents the task priority that changes with space x and time t; represents the propagation function of task priority in space; v represents the propagation speed; Dynamic weight coefficient representing resource demand; The fuzzy variable representing the resource requirement of the i-th task; The fuzzy variable representing the platform state of the i-th task; Dynamic weight coefficient representing the platform status; Represents the dynamic weight coefficient of the task parameters; fuzzy variables representing the task parameters of the i-th task; represents random noise; , , Indicates the total resource limit; n indicates the total number of tasks; i indicates the index of the task; Based on the required resources and the calculated task priority, resources are requested from the virtualization platform, and the required resources are intelligently allocated according to the resource allocation plan formulated according to the request results.
[0010] The present invention provides a cross-platform virtual machine cloning method, which starts a cloning process based on the resource allocation scheme to obtain a virtual machine, and sets an error handling mechanism for the cloning process, including: Before starting the cloning, confirm again whether the resources to be allocated corresponding to the target virtualization platform obtained by the resource allocation plan are sufficient, and check whether the resource status of the resources to be allocated is normal, and execute the cloning process according to the confirmation result to obtain the virtual machine; Based on the cloning process and the virtual machine, the monitoring index is determined, and the error type and processing strategy corresponding to each monitoring index are matched from the index-processing strategy table, thereby forming an error processing mechanism.
[0011] The present invention provides a cross-platform virtual machine cloning method, which determines monitoring indicators based on the cloning process and the virtual machine, matches the error type and processing strategy corresponding to each monitoring indicator from the indicator-processing strategy table, and then forms an error handling mechanism, including: Performing a first monitoring of resource consumption during the cloning process, performing a second monitoring of the progress of the cloning process, and performing a third monitoring of the health status and operating status of the underlying infrastructure corresponding to the virtual machine; A first monitoring indicator is obtained according to the first monitoring, a second monitoring indicator is obtained according to the second monitoring, and a third monitoring indicator is obtained according to the third monitoring; Match the error type and processing strategy corresponding to each monitoring indicator from the indicator-processing strategy table; Performing correlation analysis on the first monitoring indicator, the second monitoring indicator, and the third monitoring indicator to obtain a correlation analysis result; Based on the association analysis result, the error type and the corresponding processing strategy are adjusted to form an error processing mechanism.
[0012] The present invention provides a cross-platform virtual machine cloning method, which verifies the integrity of the cloning result, analyzes the logs in the cloning process, and finds out the potential optimization points of the cloning process, including: Confirm that the cloned virtual machine can start and run normally, determine whether the resource allocation of the virtual machine is consistent with the preset resource allocation plan, and compare it with the source virtual machine to obtain a first verification result; Use a file system check tool to check whether there is an error in the file system of the cloned virtual machine, and obtain a second verification result; Based on the target virtualization platform and the virtualization platform where the source virtual machine is located, verify the integrity of the virtual disk file itself to obtain a third verification result; Determine the integrity verification result of the virtual machine by combining the first verification result, the second verification result and the third verification result; The logs in the cloning process are analyzed based on the integrity verification results to identify potential optimization points.
[0013] Compared with the prior art, the beneficial effects of the present application are as follows: by determining the source virtual machine, selecting the clone type, building a prediction model to estimate resource requirements, requesting resources from the target platform and allocating them; starting the cloning process and setting an error handling mechanism; finally verifying the cloning results and analyzing the logs, optimizing the cloning efficiency, reducing manual intervention, and improving the automation level of the cloning process.
[0014] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0015] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings: Figure 1 The present invention is a flowchart of a cross-platform virtual machine cloning method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0017] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0018] Embodiment 1: The embodiment of the present invention provides a cross-platform virtual machine cloning method, such as Figure 1 As shown, including: Step 1: Determine the source virtual machine to be cloned, the virtualization platform where the source virtual machine is located, and the target virtualization platform for cloning, and select the cloning type; Step 2: Select a cloning method based on the cloning type, determine the cloning process, build a prediction model to estimate the resources required for the cloning process, make a resource request to the target virtualization platform, and derive a resource allocation plan based on the request result; Step 3: Based on the resource allocation scheme, start the cloning process and set an error handling mechanism for the cloning process; Step 4: Verify the integrity of the cloning results, analyze the logs during the cloning process, and find potential optimization points for the cloning process.
[0019] In this embodiment, the source virtual machine is the virtual machine to be cloned, which is an existing virtual machine instance, including an operating system, application software and data, for example, a virtual machine named "WebServer_01" runs a CentOS 7 operating system and hosts a website application.
[0020] In this embodiment, the virtualization platform is a software or hardware platform for running and managing virtual machines, such as VMware vSphere, Microsoft Hyper-V, Oracle VirtualBox, KVM, etc. For example, "WebServer_01" runs on the VMware vSphere 7.0 platform.
[0021] In this embodiment, the target virtualization platform is the virtualization platform to which the user wishes to deploy the cloned virtual machine, for example, the target virtualization platform is AWS EC2.
[0022] In this embodiment, the clone types include full clone, which creates a copy that is exactly the same as the source virtual machine, including all data and configurations. It takes a long time and occupies a large storage space. Incremental clone, which clones only the changes of the source virtual machine since the last snapshot, takes a short time and occupies a small storage space. Linked clone, the cloned virtual machine shares some disk space with the source virtual machine, saving storage space, but depends on the source virtual machine. If the source virtual machine is deleted, the linked clone will also be affected. Snapshot clone, which creates a clone based on the snapshot of the source virtual machine. Since "WebServer_01" has been shut down and the target platform AWSEC2 supports snapshot clones, "Snapshot clone" is selected as the clone type.
[0023] In this embodiment, by collecting the status, configuration and user needs of the source virtual machine and performing matching analysis, the appropriate clone type and target platform are determined to ensure that the cloning process is efficient and reliable and meets user needs, which helps to reduce IT operating costs, quickly deploy new virtual machines, and enhance business continuity.
[0024] In this embodiment, the cloning method is a specific cloning technology determined from the cloning type-method table according to the cloning type. For example, if the cloning type is "snapshot cloning", the cloning method is "snapshot-based copying".
[0025] In this embodiment, the cloning process is the specific steps of executing the cloning method, such as creating a snapshot, copying a disk, configuring a network, etc. For example, for the "snapshot-based copy" cloning method, the cloning process includes: 1. Creating a snapshot of the source virtual machine; 2. Creating a new virtual disk based on the snapshot; 3. Creating a new virtual machine configuration and associating the new virtual disk; 4. Starting the new virtual machine.
[0026] In this embodiment, the prediction model input is the input data of the model used to predict the resources required for cloning, which usually includes parameter information of the current cloning task and historical cloning data. For example, the input data includes: source virtual machine disk size, operating system type, clone type, time consumption and resource consumption of historical clones of the same type, etc. The prediction model output is the result predicted by the prediction model, including the time, CPU, memory, storage space and other resources required for cloning. For example, the prediction result is: cloning time: 5 minutes, CPU: 2 vCPU, memory: 4GB, storage space: 10GB.
[0027] In this embodiment, the required resources are resources required for the cloning process determined according to the output of the prediction model, for example, the required resources include: 2 vCPUs, 4 GB of memory, and 10 GB of storage space.
[0028] In this embodiment, the resource allocation scheme is a scheme for allocating resources to the clone task according to the task priority and available resources. For example, the resource allocation scheme is: allocating 2 vCPUs, 4 GB of memory, and 10 GB of storage space to the clone task.
[0029] In this embodiment, the cloning method and process are determined by looking up a table based on the cloning type, and then a prediction model is constructed using historical data and current parameters to estimate resource requirements. A resource allocation plan is formulated in combination with target platform operation information and task priority calculation.
[0030] In this embodiment, the error handling mechanism is a mechanism for automatically detecting and handling errors that occur during the cloning process and the virtual machine operation process based on monitoring indicators and indicator-handling strategy tables, involving functions such as alarms, automatic recovery, and log recording. For example, when the CPU utilization rate exceeds 90%, the system will automatically send an alarm email to the administrator and record an error log. If the virtual machine is shut down unexpectedly, the system will try to automatically restart the virtual machine.
[0031] In this embodiment, before starting the cloning, the feasibility of the resource allocation scheme is verified first to confirm that the resources of the target platform are sufficient and in a normal state. Only after the resource verification is passed, the cloning process is executed and the virtual machine is created. At the same time, a complete monitoring and error handling mechanism is established.
[0032] In this embodiment, the integrity verification result is a combination of the first, second, and third verification results to determine whether the cloned virtual machine completely and accurately copies the source virtual machine. For example, the first verification result: resource allocation is correct; the second verification result: the file system is complete; the third verification result: the virtual disk file is complete. Integrity verification result: the cloned virtual machine is complete. Another example: the file system detects an error, and the integrity verification result: the cloned virtual machine is incomplete.
[0033] In this embodiment, potential optimization points are to analyze bottlenecks and areas for improvement in the cloning process based on integrity verification results and logs during the cloning process. For example, if the log shows that disk copying takes too long, potential optimization points include considering using faster storage devices or optimizing disk I / O operations. If the log shows that multiple small errors occurred but were eventually automatically repaired, potential optimization points include checking the error handling mechanism and improving the error handling strategy.
[0034] The working principle and beneficial effects of the above technical solution are: by determining the source virtual machine, selecting the clone type, building a prediction model to estimate resource requirements, requesting resources from the target platform and allocating them; starting the cloning process and setting an error handling mechanism; finally verifying the cloning results and analyzing the logs, optimizing the cloning efficiency, reducing manual intervention, and improving the automation level of the cloning process.
[0035] Embodiment 2: The embodiment of the present invention provides a cross-platform virtual machine cloning method, which determines a source virtual machine to be cloned, a virtualization platform where the source virtual machine is located, and a target virtualization platform for cloning, and selects a cloning type, including: Determine a source virtual machine to be cloned, confirm the state of the source virtual machine, obtain a state confirmation result, and record the virtual machine configuration information; Determine the virtualization platform where the source virtual machine is located according to the virtual machine information; Obtain user requirements, perform matching analysis between the user requirements and the source virtual machine, and determine the target virtualization platform; A screening condition is determined according to the status confirmation result and the user's expected target virtualization platform, and a clone type is selected based on the screening condition.
[0036] In this embodiment, status confirmation is to check the running status of the source virtual machine to ensure that the cloning process proceeds smoothly, including checking whether the virtual machine is running, whether it is in a shutdown state, or a paused state, and whether there are any errors or warnings. For example, check the status of "WebServer_01" through the virtualization platform management interface to confirm that it is in a "shutdown" state.
[0037] In this embodiment, the status confirmation result is the result of the status confirmation, which is usually a simple description, such as "shutdown", "running", "paused", etc., and possible error information, for example, WebServer_01 status: shut down, no error.
[0038] In this embodiment, the configuration information is the hardware and software configuration of the source virtual machine, such as the number of CPUs, memory size, hard disk capacity, operating system version, network configuration, etc. For example, "WebServer_01 configuration information: CPU is 2 cores, memory is 4GB, hard disk is 50GB, operating system is CentOS 7.9, network is 192.168.1.100".
[0039] In this embodiment, the user requirement is the target environment that the user wants to clone the virtual machine, including the target virtualization platform, resource requirements (CPU, memory, storage, etc.), network configuration, etc. For example, the user needs to clone "WebServer_01" to the AWS cloud platform and keep the same configuration.
[0040] In this embodiment, the matching analysis is to compare the user requirements with the configuration of the source virtual machine to determine whether the target platform meets the requirements and whether adjustments are needed. For example, the analysis finds that the AWS cloud platform can meet the resource requirements of "WebServer_01" and can be configured with the same network as the source virtual machine.
[0041] In this embodiment, the screening condition is to determine the conditions of the clone type according to the status confirmation result, user requirements and the target virtualization platform. For example, the source virtual machine state must be in a shutdown state, and the target platform supports snapshot cloning, etc. For example, the screening conditions are: the source virtual machine must be in a shutdown state; the target platform must support snapshot-based cloning; the target platform must have sufficient resources.
[0042] The working principle and beneficial effects of the above technical solution are: by collecting the status, configuration and user needs of the source virtual machine, matching analysis is performed to determine the appropriate clone type and target platform, ensuring that the cloning process is efficient and reliable and meets user needs, which helps to reduce IT operating costs, quickly deploy new virtual machines, and enhance business continuity.
[0043] Embodiment 3: The embodiment of the present invention provides a cross-platform virtual machine cloning method, which determines a screening condition according to the status confirmation result, the user's demand and the estimated target virtualization platform, and selects a cloning type based on the screening condition, including: Determine the storage space of the target virtualization platform to obtain a first screening condition, decompose the user demand to obtain a cloning time limit, obtain a second screening condition based on the cloning time limit, and obtain a third screening condition based on the status confirmation result; Performing a compatibility judgment on the virtualization platform where the source virtual machine is located and the target virtualization platform, and obtaining a fourth screening condition according to the compatibility judgment result; The clone type is selected based on the first screening condition, the second screening condition, the third screening condition and the fourth screening condition.
[0044] In this embodiment, the storage space determination is to evaluate whether the available storage space on the target virtualization platform is sufficient to accommodate the cloned virtual machine, and the disk size of the source virtual machine and potential incremental data need to be considered. For example, the EBS volume of the target AWS EC2 instance has 100GB of available space, while the disk size of the source virtual machine is 50GB. Determination result: The target platform has sufficient storage space.
[0045] In this embodiment, the first screening condition is to determine whether the clone type is feasible based on the result of the storage space determination. If the space is insufficient, some clone types (such as full clone) may be excluded, for example, the first screening condition: available storage space ≥ 50GB (source virtual machine disk size).
[0046] In this embodiment, the cloning time limit is determined by decomposing user requirements and clarifying the maximum time allowed for the cloning process, which may be determined by business continuity requirements or maintenance windows. For example, after user requirements are decomposed, it is determined that cloning must be completed within 30 minutes, otherwise it will affect business operations.
[0047] In this embodiment, the requirement decomposition is to refine the user requirements into specific indicators, such as time limit, resource limit, etc., so as to better guide the selection of cloning type. For example, the user requirements are decomposed into: cloning time ≤ 30 minutes, and resource consumption is minimized.
[0048] In this embodiment, the second screening condition is based on the cloning time limit to exclude those clone types with too long cloning time. For example, if the time limit is very short, it may be necessary to exclude complete clones, such as the second screening condition: cloning time ≤ 30 minutes.
[0049] In this embodiment, the third screening condition is based on the status confirmation result of the source virtual machine. If the source virtual machine is in a running state, some clone types (such as snapshot-based clones) may not be available or require additional steps, for example, the status confirmation result: the source virtual machine is powered off. Third screening condition: the source virtual machine must be in a powered off state.
[0050] In this embodiment, compatibility judgment is to judge whether the virtualization platform where the source virtual machine is located is compatible with the target virtualization platform, including compatibility in terms of operating system, virtualization technology, storage format, etc. Incompatibility may require virtual machine conversion or data migration, which increases complexity. For example, the source virtual machine runs on VMware vSphere and the target platform is AWS EC2. Compatibility judgment: It is necessary to consider the conversion of VMware virtual disk format to a format supported by AWS, which may require additional conversion steps.
[0051] In this embodiment, the fourth screening condition is to determine whether an additional data conversion step is required based on the result of the compatibility judgment, and select the corresponding clone type. For example, the fourth screening condition: the conversion from VMware virtual disk format to AWS EBS volume needs to be supported.
[0052] The working principle and beneficial effects of the above technical solution are: according to the target platform storage space, user cloning time limit, source virtual machine status and source and target platform compatibility, multi-dimensional screening conditions are used to intelligently select the cloning type (full clone or incremental clone). If the storage space is insufficient, incremental cloning is given priority; if the time limit is tight, incremental cloning is given priority; if the source virtual machine status is not good, full cloning is given priority; if the platform is incompatible, only full cloning is allowed, which improves cloning efficiency and reliability and reduces storage consumption and time costs.
[0053] Embodiment 4: The embodiment of the present invention provides a cross-platform virtual machine cloning method, which selects a cloning method according to a cloning type, determines a cloning process, builds a prediction model to estimate the resources required for the cloning process, makes a resource request to a target virtualization platform, and obtains a resource allocation plan according to the request result, including: Determine a cloning method from a cloning type-method table according to the cloning type, and determine a cloning process; Collect historical clone data of the source virtual machine and parameter information of the current clone task, build a prediction model, and predict the resources required for cloning; The required resources are requested from the target virtualization platform, and the operation information of the target virtualization platform is obtained at the same time. The task priority is calculated in combination with the operation information, the required resources and the parameter information of the current clone task to obtain a resource allocation plan.
[0054] In this embodiment, the clone type-method table is a predefined table that maps different clone types to specific clone methods and defines the technology and steps used for each clone type. For example, if the clone type is snapshot clone and the clone method is snapshot-based replication, the corresponding method is to create a clone using a snapshot of the virtual machine.
[0055] In this embodiment, the parameter information of the current cloning task describes various parameters of the current cloning task, such as the disk size of the source virtual machine, the operating system type, the target virtualization platform, etc. For example, the disk size of the source virtual machine: 50GB, the operating system: CentOS 7, the target platform: AWS EC2, the cloning type: incremental cloning.
[0056] In this embodiment, the operation information is the current operation status of the target virtualization platform, such as CPU utilization, memory utilization, storage space usage, etc. For example, CPU utilization: 60%, memory utilization: 70%, available storage space: 200GB.
[0057] In this embodiment, the task priority is calculated based on the operation information of the target virtualization platform, the required resources, and the parameter information of the current clone task, and determines the priority of the clone task relative to other tasks. Some algorithms can be used for calculation, such as considering the resource scarcity and task importance. For example, according to the resource utilization and the priority defined by the user, the priority of the clone task is set to "high".
[0058] The working principle and beneficial effects of the above technical solution are: determine the cloning method and process according to the cloning type table, then use historical data and current parameters to build a prediction model, estimate resource requirements, combine the target platform operation information and task priority calculation, and formulate a resource allocation plan. The prediction model is used to improve the accuracy of resource estimation, optimize resource allocation, reduce resource waste and cloning time, and improve cloning efficiency and success rate.
[0059] Embodiment 5: The embodiment of the present invention provides a cross-platform virtual machine cloning method, which requests the required resources from a target virtualization platform, obtains the operation information of the target virtualization platform, calculates the task priority by combining the operation information, the required resources and the parameter information of the current cloned task, and intelligently allocates the required resources, including: ,in, represents the task priority that changes with space x and time t; represents the propagation function of task priority in space; v represents the propagation speed; Dynamic weight coefficient representing resource demand; The fuzzy variable representing the resource requirement of the i-th task; The fuzzy variable representing the platform state of the i-th task; Dynamic weight coefficient representing the platform status; Represents the dynamic weight coefficient of the task parameters; fuzzy variables representing the task parameters of the i-th task; represents random noise; , , Indicates the total resource limit; n indicates the total number of tasks; i indicates the index of the task; Based on the required resources and the calculated task priority, resources are requested from the virtualization platform, and the required resources are intelligently allocated according to the resource allocation plan formulated according to the request results.
[0060] The working principle and beneficial effects of the above technical solution are: through a dynamic priority calculation model that considers space, time, resource requirements, platform status and task parameters, the virtualization platform resources are intelligently allocated. The model integrates multiple factors and adds random noise to simulate uncertainty, and finally determines the task priority and performs resource request and allocation, which improves resource utilization, shortens task waiting time, and enhances the dynamic and adaptable nature of resource allocation.
[0061] Embodiment 6: The embodiment of the present invention provides a cross-platform virtual machine cloning method, which starts a cloning process based on the resource allocation scheme to obtain a virtual machine, and sets an error handling mechanism for the cloning process, including: Before starting the cloning, confirm again whether the resources to be allocated corresponding to the target virtualization platform obtained by the resource allocation plan are sufficient, and check whether the resource status of the resources to be allocated is normal, and execute the cloning process according to the confirmation result to obtain the virtual machine; Based on the cloning process and the virtual machine, the monitoring index is determined, and the error type and processing strategy corresponding to each monitoring index are matched from the index-processing strategy table, thereby forming an error processing mechanism.
[0062] In this embodiment, the resources to be allocated are resources on the target virtualization platform to be allocated to the cloning task, including CPU, memory, storage space, etc. For example, the resources to be allocated include: 2 vCPUs, 4 GB memory, and 10 GB storage space.
[0063] In this embodiment, the resource status is the operating status of the resource to be allocated, such as whether it is available, healthy, etc. For example, resource status: all resources are available and in normal status. Or, resource status: part of the storage space is unavailable due to disk failure.
[0064] In this embodiment, the virtual machine is a new virtual machine instance generated after the cloning process is completed. For example, after the cloning is completed, a new virtual machine named "WebServer_02" is generated.
[0065] In this embodiment, the monitoring indicators are indicators used to monitor the cloning process and the running status of the new virtual machine, including CPU utilization, memory utilization, disk I / O, network traffic, virtual machine status, etc.
[0066] In this embodiment, the indicator-processing strategy table is a predefined table that associates monitoring indicators with possible error types and corresponding processing strategies, and defines the actions that should be taken when an indicator is abnormal. For example, the monitoring indicator is CPU utilization, the error type is CPU utilization exceeding 90%, and the processing strategy is to send an alarm email and consider increasing CPU resources.
[0067] The working principle and beneficial effects of the above technical solution are as follows: before starting the cloning, first verify the feasibility of the resource allocation solution, confirm that the resources of the target platform are sufficient and in normal state, and only after the resource verification is passed, execute the cloning process and create a virtual machine. At the same time, establish a complete monitoring and error handling mechanism, monitor the cloning process in real time and handle exceptions according to preset strategies, ensure the reliability and resource utilization of the cloning process, and reduce cloning failures caused by insufficient resources or exceptions.
[0068] Embodiment 7: The embodiment of the present invention provides a cross-platform virtual machine cloning method, which determines monitoring indicators based on the cloning process and the virtual machine, matches the error type and processing strategy corresponding to each monitoring indicator from the indicator-processing strategy table, and then forms an error handling mechanism, including: Performing a first monitoring of resource consumption during the cloning process, performing a second monitoring of the progress of the cloning process, and performing a third monitoring of the health status and operating status of the underlying infrastructure corresponding to the virtual machine; A first monitoring indicator is obtained according to the first monitoring, a second monitoring indicator is obtained according to the second monitoring, and a third monitoring indicator is obtained according to the third monitoring; Match the error type and processing strategy corresponding to each monitoring indicator from the indicator-processing strategy table; Performing correlation analysis on the first monitoring indicator, the second monitoring indicator, and the third monitoring indicator to obtain a correlation analysis result; Based on the association analysis result, the error type and the corresponding processing strategy are adjusted to form an error processing mechanism.
[0069] In this embodiment, resource consumption refers to the usage of resources such as CPU, memory, storage I / O, network bandwidth, etc. during the cloning process; the first monitoring is real-time monitoring of resource consumption during the cloning process; the progress is the progress of the cloning process, such as the completion percentage, remaining time, etc.; the second monitoring is real-time monitoring of the progress of the cloning process; the health status and operating status are the health status and operating status of the underlying infrastructure (such as physical servers, network devices, storage devices) where the target virtual machine is located; the third monitoring is to monitor the health status and operating status of the underlying infrastructure of the virtual machine.
[0070] In this embodiment, the first monitoring indicator is the data collected from the first monitoring, such as average CPU utilization, peak memory usage, disk I / O throughput, etc., for example, average CPU utilization: 75%, peak memory usage: 3.8GB, disk I / O average waiting time: 10ms.
[0071] In this embodiment, the second monitoring indicator is data collected from the second monitoring, such as the cloning completion percentage, the remaining time estimate, the time consumed in each stage, etc. For example, the cloning completion percentage: 80%, the remaining time estimate: 2 minutes, and the disk copying time: 3 minutes.
[0072] In this embodiment, the third monitoring indicator is data collected from the third monitoring, such as server CPU utilization, memory usage, network delay, storage device status, etc. For example, server CPU utilization: 60%, server memory usage: 50%, network delay: 5ms, storage device status: normal.
[0073] In this embodiment, the correlation analysis is to analyze the first, second, and third monitoring indicators to find out the relationship and potential dependencies between them, in order to identify potential bottlenecks and problems.
[0074] The correlation analysis result is the output result of the correlation analysis. For example, the correlation analysis found that when the server CPU utilization exceeds 70%, the progress of the cloning process will drop significantly and the disk I / O waiting time will increase, indicating that the server CPU becomes the bottleneck of the cloning process and the I / O performance of the storage device decreases, resulting in longer cloning time.
[0075] In this embodiment, the adjustment is to adjust the error type and processing strategy in the indicator-processing strategy table according to the association analysis result to optimize the error handling mechanism. For example, according to the association analysis result, the indicator-processing strategy table is adjusted: the original strategy: when the CPU utilization exceeds 90%, an alarm email is sent; the adjusted strategy: when the server CPU utilization exceeds 70%, an alarm email is sent, and it is recommended to adjust the priority of the clone task or increase server resources.
[0076] In this embodiment, the error handling mechanism is an improved error handling mechanism, which can more effectively detect and handle problems in the cloning process, and can more accurately identify the root cause of the problem and take more effective measures based on the correlation analysis results.
[0077] The working principle and beneficial effects of the above technical solution are: through multi-dimensional monitoring of the resource consumption, progress and underlying infrastructure of the cloning process, collecting the first, second and third monitoring indicators, matching the error type and processing strategy according to the indicator-processing strategy table, and dynamically adjusting the strategy based on the correlation analysis results between the monitoring indicators, real-time monitoring and intelligent error handling of the cloning process are achieved, thereby improving the reliability and efficiency of cloning.
[0078] Embodiment 8: The embodiment of the present invention provides a cross-platform virtual machine cloning method, which verifies the integrity of the cloning result, analyzes the logs in the cloning process, and finds out the potential optimization points of the cloning process, including: Confirm that the cloned virtual machine can start and run normally, determine whether the resource allocation of the virtual machine is consistent with the preset resource allocation plan, and compare it with the source virtual machine to obtain a first verification result; Use a file system check tool to check whether there is an error in the file system of the cloned virtual machine, and obtain a second verification result; Based on the target virtualization platform and the virtualization platform where the source virtual machine is located, verify the integrity of the virtual disk file itself to obtain a third verification result; Determine the integrity verification result of the virtual machine by combining the first verification result, the second verification result and the third verification result; The logs in the cloning process are analyzed based on the integrity verification results to identify potential optimization points.
[0079] In this embodiment, the resource allocation status refers to the resources such as CPU, memory, storage space, etc. actually allocated to the virtual machine after cloning.
[0080] In this embodiment, the first verification result is to compare whether the resource allocation of the virtual machine after cloning is consistent with the preset resource allocation scheme, and compare it with the resource configuration of the source virtual machine. For example, the preset resource allocation scheme is: 2 vCPUs, 4GB of memory, and 50GB of storage space. The actual resource allocation of the virtual machine after cloning: 2 vCPUs, 4GB of memory, and 50GB of storage space. The resource configuration of the source virtual machine: 2 vCPUs, 4GB of memory, and 50GB of storage space. The first verification result: the resource allocation is consistent with the preset scheme and the source virtual machine. Another example: after cloning, the virtual machine is only allocated 1 vCPU, and other resources are consistent. The first verification result: the resource allocation is inconsistent with the preset scheme.
[0081] In this embodiment, the third verification result is to verify the integrity of the virtual disk file of the cloned virtual machine itself, which usually involves checking the checksum or hash value of the virtual disk file to ensure that the file is not damaged during the cloning process. The verification needs to consider the virtual disk format of the source virtual machine and the target virtualization platform. For example, the integrity of the VMDK file or VHDX file (Hyper-V) of the cloned virtual machine is checked using a checksum tool. Third verification result: The virtual disk file integrity check passed. Another example: The checksum does not match, indicating that the file is damaged during the cloning process.
[0082] In this embodiment, the log in the cloning process is a log file recorded during the execution of the cloning process, including a timestamp, operation steps, error information, etc.
[0083] In this embodiment, the second verification result is to use a file system check tool (such as fsck) to check whether there are errors in the file system of the cloned virtual machine, such as missing inodes, damaged data blocks, etc. For example, the fsck-y / dev / sda1 command is used to check the ext4 file system. Second verification result: The file system check found no errors. Another example: The file system check found errors and has been repaired.
[0084] The working principle and beneficial effects of the above technical solution are: verifying the integrity of the cloned virtual machine through multiple dimensions: checking the virtual machine startup status, file system integrity and virtual disk integrity, and finally obtaining the integrity verification result. Based on the verification result and the cloning process log, analyze and identify potential optimization points in the cloning process to ensure the reliability of the cloned virtual machine, and provide data support for the subsequent optimization of the cloning process, thereby improving cloning efficiency and resource utilization.
[0085] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A cross-platform virtual machine cloning method, characterized in that: include: Step 1: Determine the source virtual machine to be cloned, the virtualization platform where the source virtual machine is located, and the target virtualization platform for cloning, and select the cloning type; Step 2: Select a cloning method based on the cloning type, determine the cloning process, build a prediction model to estimate the resources required for the cloning process, make a resource request to the target virtualization platform, and derive a resource allocation plan based on the request result; Step 3: Based on the resource allocation scheme, start the cloning process and set an error handling mechanism for the cloning process; Step 4: Verify the integrity of the cloning results, analyze the logs during the cloning process, and find potential optimization points for the cloning process.
2. A cross-platform virtual machine cloning method according to claim 1, characterized in that: Determine the source virtual machine to be cloned, the virtualization platform where the source virtual machine is located, and the target virtualization platform for cloning, and select the cloning type, including: Determine a source virtual machine to be cloned, confirm the state of the source virtual machine, obtain a state confirmation result, and record the virtual machine configuration information; Determine the virtualization platform where the source virtual machine is located according to the virtual machine information; Obtain user requirements, perform matching analysis between the user requirements and the source virtual machine, and determine the target virtualization platform; A screening condition is determined according to the status confirmation result and the user's expected target virtualization platform, and a clone type is selected based on the screening condition.
3. A cross-platform virtual machine cloning method according to claim 2, characterized in that: Determining a screening condition according to the status confirmation result and the target virtualization platform predicted by the user, and selecting a clone type based on the screening condition, including: Determine the storage space of the target virtualization platform to obtain a first screening condition, decompose the user demand to obtain a cloning time limit, obtain a second screening condition based on the cloning time limit, and obtain a third screening condition based on the status confirmation result; Performing a compatibility judgment on the virtualization platform where the source virtual machine is located and the target virtualization platform, and obtaining a fourth screening condition according to the compatibility judgment result; The clone type is selected based on the first screening condition, the second screening condition, the third screening condition and the fourth screening condition.
4. The cross-platform virtual machine cloning method according to claim 1, characterized in that: Select the cloning method according to the cloning type, determine the cloning process, build a prediction model to estimate the resources required for the cloning process, make resource requests to the target virtualization platform, and derive a resource allocation plan based on the request results, including: Determine a cloning method from a cloning type-method table according to the cloning type, and determine a cloning process; Collect historical clone data of the source virtual machine and parameter information of the current clone task, build a prediction model, and predict the resources required for cloning; The required resources are requested from the target virtualization platform, and the operation information of the target virtualization platform is obtained at the same time. The task priority is calculated in combination with the operation information, the required resources and the parameter information of the current clone task to obtain a resource allocation plan.
5. A cross-platform virtual machine cloning method according to claim 4, characterized in that: Requesting the required resources from the target virtualization platform, obtaining the operation information of the target virtualization platform, calculating the task priority in combination with the operation information, the required resources and the parameter information of the current clone task, and intelligently allocating the required resources, including: ,in, represents the task priority that changes with space x and time t; represents the propagation function of task priority in space; v represents the propagation speed; Dynamic weight coefficient representing resource demand; The fuzzy variable representing the resource requirement of the i-th task; The fuzzy variable representing the platform state of the i-th task; Dynamic weight coefficient representing the platform status; Represents the dynamic weight coefficient of the task parameters; fuzzy variables representing the task parameters of the i-th task; represents random noise; , , Indicates the total resource limit; n indicates the total number of tasks; i indicates the index of the task; Based on the required resources and the calculated task priority, resources are requested from the virtualization platform, and the required resources are intelligently allocated according to the resource allocation plan formulated according to the request results.
6. A cross-platform virtual machine cloning method according to claim 1, characterized in that: Based on the resource allocation scheme, a cloning process is started to obtain a virtual machine, and an error handling mechanism is set for the cloning process, including: Before starting the cloning, confirm again whether the resources to be allocated corresponding to the target virtualization platform obtained by the resource allocation plan are sufficient, and check whether the resource status of the resources to be allocated is normal, and execute the cloning process according to the confirmation result to obtain the virtual machine; Based on the cloning process and the virtual machine, the monitoring index is determined, and the error type and processing strategy corresponding to each monitoring index are matched from the index-processing strategy table, thereby forming an error processing mechanism.
7. The cross-platform virtual machine cloning method according to claim 1, characterized in that: Based on the cloning process and the virtual machine, the monitoring indicators are determined, and the error type and processing strategy corresponding to each monitoring indicator are matched from the indicator-processing strategy table, thereby forming an error handling mechanism, including: Performing a first monitoring of resource consumption during the cloning process, performing a second monitoring of the progress of the cloning process, and performing a third monitoring of the health status and operating status of the underlying infrastructure corresponding to the virtual machine; A first monitoring indicator is obtained according to the first monitoring, a second monitoring indicator is obtained according to the second monitoring, and a third monitoring indicator is obtained according to the third monitoring; Match the error type and processing strategy corresponding to each monitoring indicator from the indicator-processing strategy table; Performing correlation analysis on the first monitoring indicator, the second monitoring indicator, and the third monitoring indicator to obtain a correlation analysis result; Based on the association analysis result, the error type and the corresponding processing strategy are adjusted to form an error processing mechanism.
8. The cross-platform virtual machine cloning method according to claim 1, characterized in that: Verify the integrity of the cloning results, analyze the logs during the cloning process, and find potential optimization points for the cloning process, including: Confirm that the cloned virtual machine can start and run normally, determine whether the resource allocation of the virtual machine is consistent with the preset resource allocation plan, and compare it with the source virtual machine to obtain a first verification result; Use a file system check tool to check whether there is an error in the file system of the cloned virtual machine, and obtain a second verification result; Based on the target virtualization platform and the virtualization platform where the source virtual machine is located, verify the integrity of the virtual disk file itself to obtain a third verification result; Determine the integrity verification result of the virtual machine by combining the first verification result, the second verification result and the third verification result; The logs in the cloning process are analyzed based on the integrity verification results to identify potential optimization points.
Citation Information
Patent Citations
Virtual computing resource dynamic management system of cloud computing service platform
CN102681899A
Cross-virtual platform virtual machine migration method and apparatus
CN107656797A
A cluster resource allocation method based on cloud computing platform
CN109271232A
Method and system for cross-storage disk fast and secure cloning, equipment and medium
CN112286626A
Implementation method and device for virtual machine cloning
CN117093332A