Virtualization environment fault prediction method, device, equipment, medium and product
Through the ARIMA model, the problem of poor timeliness of virtualized clusters in the existing technology is solved, and the automatic migration and resource adjustment of virtual machines and hosts are realized, ensuring high system availability and stability.
Patent Information
- Application Number
- CN202411020311.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-11-29
AI Technical Summary
Existing virtualized clusters have poor timeliness when hardware failures are encountered, and cannot detect and deal with host performance degradation or resource bottlenecks in time, affecting the continuity and business availability of virtual machines.
The ARIMA model is used to predict faults based on the status data of virtual machines and hosts. By collecting historical parameter sequences, an autoregressive comprehensive moving average model is established to predict future failure trends, and virtual machine migration, host migration and resources are carried out based on the prediction results. Adjust to ensure high system availability.
It realizes comprehensive and timely prediction and handling of faults in virtualized environments, improves timeliness and resource utilization, reduces the need for manual intervention, and ensures the stable operation and high availability of the system.
Smart Images

Figure CN119045944A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of virtualization technology, and in particular, relates to a method, device, equipment, medium and product for predicting faults in a virtualized environment. Background Art
[0002] In modern computing environments, virtualization technology has become a key infrastructure that allows multiple virtual machine instances to run on a single physical host, thereby improving resource utilization, flexibility, and manageability. However, as the number of virtual machines increases, it becomes increasingly important to ensure high availability (HA) of the entire virtualization cluster. In order to ensure service continuity in the event of hardware failures or other problems, many virtualization clusters enable high availability features. This means that the individual hosts in the cluster need to communicate with each other to monitor each other's status and take appropriate measures to keep the service available when necessary.
[0003] However, the current solution usually triggers the virtual machine escape mechanism only when the host machine is determined to be no longer alive based on known conditions. This method is single in form and has poor timeliness. Summary of the invention
[0004] The embodiments of the present application provide a virtualized environment fault prediction method, apparatus, device, medium and product, which can comprehensively and timely determine the faults existing in the virtualized environment.
[0005] On the one hand, an embodiment of the present application provides a virtualization environment fault prediction method, including:
[0006] Collecting a target virtualization environment parameter sequence within a preset historical time period; the target virtualization environment parameters include: virtual machine state data, host machine state data, and a corresponding relationship between the virtual machine and the host machine;
[0007] Inputting the target virtualization environment parameter sequence into a fault prediction model to obtain a change trend of the target virtualization environment parameter sequence based on a time series relationship of the target virtualization environment parameter sequence; the fault prediction model is trained by a target virtualization environment parameter training set;
[0008] According to the change trend of the target virtualization environment parameter sequence, the failure result of the virtualization environment in the future target time period is predicted.
[0009] On the other hand, the fault prediction model includes an AutoRegressive Integrated Moving Average (ARIMA) model;
[0010] Before collecting the target virtualization environment parameter sequence within the preset historical time period, the method further includes:
[0011] Obtaining the target virtualization environment parameter training set;
[0012] Constructing an initial ARIMA model according to the target virtualization environment parameter training set; the parameters of the initial ARIMA model include autoregressive coefficients and moving average coefficients;
[0013] Based on the autoregressive coefficient and the moving average coefficient, a likelihood function is established;
[0014] Taking the logarithm of the likelihood function to obtain a log-likelihood function;
[0015] For the log-likelihood function, obtaining a first target value when the partial derivative of the autoregressive coefficient is zero, and obtaining a second target value when the partial derivative of the moving average coefficient is zero;
[0016] The ARIMA model is determined based on the first target value, the second target value, and the initial ARIMA model.
[0017] On the other hand, before constructing the initial ARIMA model according to the target virtualized environment parameter training set, the method further includes:
[0018] Obtaining the target virtualization environment parameter training set;
[0019] Based on the target virtualization environment parameter training set, determining the usage change trend of the processor usage and memory usage of the virtual machine and the host machine;
[0020] When the usage rate variation trend meets a preset condition, a differential operation is performed on the target virtualization environment parameter training set to update the target virtualization environment parameter training set.
[0021] On the other hand, after determining the ARIMA model based on the first target value, the second target value and the initial ARIMA model, the method further includes:
[0022] Obtaining a target virtualization environment parameter test set and a real trend corresponding to the target virtualization environment parameter test set;
[0023] Inputting the target virtualization environment parameter test set into the ARIMA model for trend prediction to obtain a predicted trend;
[0024] determining a difference indicator between the predicted trend and the actual trend;
[0025] When the difference index exceeds a preset threshold, it is determined that the performance of the ARIMA model does not meet the preset requirements.
[0026] On the other hand, the virtual machine state data includes at least one of the following: virtual machine operation state, virtual machine resource utilization, virtual machine network traffic data, and virtual machine disk usage;
[0027] The host machine status data includes at least one of the following: host machine operation status, host machine resource utilization, host machine storage status, and host machine network load status.
[0028] On the other hand, after predicting the failure result of the virtualized environment in a future target time period according to the change trend of the target virtualized environment parameter sequence, the method further includes:
[0029] When the fault result indicates that a target fault exists in the virtualization environment, the virtual machine and / or the host machine is processed based on the target fault.
[0030] On the other hand, when the fault result indicates that the virtualization environment has a target fault, processing the virtual machine and / or the host machine based on the target fault includes:
[0031] When the fault result indicates that the first duration exceeds a first preset value, the corresponding virtual machine is migrated; the first duration is the duration during which the processor usage of the virtual machine exceeds a first usage threshold;
[0032] When the fault result indicates that the second duration exceeds the second preset value, the virtual machine on the corresponding host machine is migrated; the second duration is the duration during which the memory usage of the host machine exceeds the second usage threshold;
[0033] If the fault result indicates a change in network traffic, adjusting the number of virtual machines;
[0034] When the fault result indicates that the third duration exceeds a third preset value, the corresponding host machine is shut down; the third duration is the duration during which the processor usage and memory usage of the host machine are lower than a third usage threshold.
[0035] On the other hand, an embodiment of the present application provides a virtualized environment fault prediction device, the device comprising:
[0036] The acquisition module is used to acquire a target virtualization environment parameter sequence within a preset historical time period; the target virtualization environment parameters include: virtual machine state data, host machine state data, and the corresponding relationship between the virtual machine and the host machine;
[0037] An input module, used to input the target virtualization environment parameter sequence into a fault prediction model, so as to obtain a change trend of the target virtualization environment parameter sequence based on a time series relationship of the target virtualization environment parameter sequence; the fault prediction model is trained by a target virtualization environment parameter training set;
[0038] The prediction module is used to predict the failure result of the virtualization environment within a future target time period according to the change trend of the target virtualization environment parameter sequence.
[0039] In yet another aspect, an embodiment of the present application provides a virtualized environment fault prediction device, the device comprising: a processor and a memory storing computer program instructions;
[0040] When the processor executes the computer program instructions, the virtualization environment fault prediction method as described above is implemented.
[0041] On the other hand, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the virtualization environment fault prediction method as described above is implemented.
[0042] On the other hand, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the virtualization environment fault prediction method as described above.
[0043] A virtualization environment fault prediction method of an embodiment of the present application first collects a target virtualization environment parameter sequence within a preset historical time period; such as virtual machine state data, host machine state data, and the corresponding relationship between the virtual machine and the host machine. Then the target virtualization environment parameter sequence is input into the fault prediction model to obtain the change trend of the target virtualization environment parameter sequence based on the time series relationship of the target virtualization environment parameter sequence. Finally, according to the change trend of the target virtualization environment parameter sequence, the fault result of the virtualization environment in the future target time period is predicted. The present application implements fault prediction based on virtual machine state data and host machine state data, which not only more comprehensively determines the faults in the business plane or storage plane; and because the fault prediction model can accurately predict the state changes of the virtual machine and the host machine based on the time series relationship of the target virtualization environment parameters, it can timely predict possible fault trends, improve timeliness, and can also detect problems such as performance degradation or resource bottlenecks of the host machine. It can be seen that the present application scheme can achieve comprehensive and timely determination of faults in the virtualization environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0045] Figure 1 A schematic diagram of a process of a virtualized environment fault prediction method provided by an embodiment of the present application is shown;
[0046] Figure 2 A system architecture diagram provided for an embodiment of the present application;
[0047] Figure 3 This is a complete flow chart of a virtualized environment fault prediction method provided by another embodiment of the present application;
[0048] Figure 4 A schematic diagram of the hardware structure of a virtualized environment fault prediction device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0049] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0050] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0051] In traditional solutions, each host in the cluster usually sends heartbeat detection signals regularly. These signals act as a status indicator to report its own survival status to other hosts. By sending these signals periodically, each host verifies whether other hosts are running normally.
[0052] If a host does not receive a heartbeat signal from other hosts within a certain period of time (for example, within 3 cycles, i.e., 15 seconds), it is considered to have encountered a physical failure. However, the traditional method usually triggers the virtual machine escape mechanism only when the host is considered no longer alive. This may cause some problems to not be detected and handled in time, such as the performance degradation or resource bottleneck of the host, which may affect the performance of the virtual machine but will not trigger the escape operation.
[0053] In a resource pool, there are multiple network planes, such as the management plane, business plane, and storage plane. Traditional solutions often only focus on the survival status of the host machine, while ignoring the status of these different network planes. Therefore, when the business plane or storage plane fails, the virtual machine may not be able to escape and self-heal in time. When the business plane or storage plane fails, it may not be possible to correctly identify the problem and take appropriate measures. This may affect the continuity of the virtual machine and thus the availability of the business.
[0054] In order to solve the problems of the traditional solution, the embodiment of the present application provides a virtualized environment fault prediction method, device, equipment, medium and product. The virtualized environment fault prediction method provided by the embodiment of the present application is first introduced below. Figure 1 A schematic diagram of a virtualization environment fault prediction method provided by an embodiment of the present application is shown; Figure 1 As shown, the method includes the following steps: S101, S102 and S103.
[0055] S101: Collect a target virtualization environment parameter sequence within a preset historical time period.
[0056] The target virtualization environment parameters can be set according to actual conditions. Usually, the target virtualization environment parameters include: virtual machine state data, host machine state data, and the corresponding relationship between the virtual machine and the host machine.
[0057] The correspondence between the virtual machine and the host is used to match the virtual machine with the host. By dynamically collecting the association between the virtual machine and the host, and collecting the virtual machine state data and the host state data in real time, the virtualization environment fault prediction can be performed.
[0058] Specifically, the acquisition module completes the acquisition of the target virtualization environment parameter sequence. The function of the acquisition module is to obtain the status data of the virtual machine and the host in real time. By deploying an agent program on each host, it continuously collects multi-dimensional data such as the operating status, resource utilization, network data of the virtual machine, and the operating status, resource load, storage status, etc. of the host.
[0059] The preset historical time period is usually a period of time before the current moment, and its specific length can be set according to actual conditions. The parameter change trend can be obtained through the target virtualization environment parameter sequence within the time period.
[0060] S102: Inputting the target virtualization environment parameter sequence into the fault prediction model to obtain a change trend of the target virtualization environment parameter sequence based on a time series relationship of the target virtualization environment parameter sequence.
[0061] The specific type of fault prediction model can be selected according to actual needs. Usually, the ARIMA model is selected (this model is used as an example below). The ARIMA model is trained by the target virtualization environment parameter training set. After the ARIMA model is established and trained, it can be used to predict the fault results of the virtual machine and host machine status in the future. After collecting the target virtualization environment parameter sequence, the target virtualization environment parameter sequence is input into the ARIMA model, which can accurately capture the trends and changes in the data.
[0062] This application first collects the status data of the virtual machine and the host machine as the past and current status description, and then based on the ARIMA model, predicts the failure of the collected status data for a period of time in the future to obtain the future status description.
[0063] S103: predicting the failure result of the virtualization environment within a future target time period according to the change trend of the target virtualization environment parameter sequence.
[0064] Finally, according to the changing trend of the target virtualization environment parameter sequence output by the ARIMA model, the failure results of the virtualization environment in the future target time period are predicted. The failure results can be set according to the actual application process. For example, it can be the duration of the processor usage of the virtual machine being too high, the duration of the memory usage of the host machine being too high, the network traffic changes, and the duration of the processor usage and memory usage of the host machine being too low, etc. If there is a failure, timely warning information is provided for the potential failure of the virtual machine and the host machine.
[0065] Here is a specific prediction process, the steps are as follows:
[0066] 1. Data collection: Collect the status data of virtual machines and hosts in the actual production environment, including historical data and current data. This data will be used as input for the model to achieve future predictions. The data is organized in the form of time series, where the timestamp is the time unit and the status value is the resource utilization and load of the virtual machine and host.
[0067] 2. Data preprocessing: Preprocess the collected time series data, including filling missing values and removing outliers, and perform differential operations to achieve stationarity.
[0068] 3. Model prediction: Use the trained ARIMA model to input historical data from the actual production environment into the model to predict failures in the future. The ARIMA model will generate predicted values for the status of virtual machines and hosts based on the patterns and trends in the historical data.
[0069] 4. Generate prediction results: The prediction results of the model include the predicted values of the virtual machine and host machine status in the future. These predicted values are used to predict possible changes in the system and make corresponding adjustments and decisions.
[0070] Figure 2 This is a system architecture diagram provided for an embodiment of the present application; the above operations can be completed through this system. Figure 2 As shown, it includes a collection module 201, a prediction module 202 and a processing module 203; wherein the collection module 201 is used to collect virtual machine state data, host machine state data and the relationship between the virtual machine and the host machine. The prediction module 202 is used to perform data processing, model building, model solving and performance prediction. The processing module 203 is used to perform operations such as virtual machine migration, host machine migration, automatic scaling and resource release.
[0071] Based on the ARIMA time series analysis algorithm, the system can accurately predict the state changes of virtual machines and host machines, thereby timely predicting possible failure trends. Comprehensive state monitoring is achieved through multi-dimensional data collection, including management, business and storage planes. Its automated escape mechanism enables the system to quickly and automatically migrate virtual machines once a potential problem is detected to ensure system availability. This dynamic decision support and autonomy reduces the need for manual intervention and improves resource utilization efficiency. At the same time, the rapid response capability enables the system to better cope with emergencies.
[0072] Figure 3 FIG. 1 is a complete flow chart of a virtualized environment fault prediction method provided by another embodiment of the present application; Figure 3As shown, the specific steps are as follows: S301: data processing. S302: ARIMA model establishment. S303: ARIMA model solution. S304: performance prediction. S305: virtual machine self-healing escape operation. After collecting the original data, the solution is performed based on the established ARIMA model. Combined with the collected state data of the virtual machine and the host machine, it can accurately capture the trends and changes in the data and provide timely warning information for predicting potential failures of the virtual machine.
[0073] This solution can also automatically migrate virtual machines to achieve self-healing and escape. When the fault result indicates a system failure, a series of actions such as virtual machine migration and resource scaling can be performed through the Application Programming Interface (API) to complete self-healing and escape. Through multi-dimensional data collection, real-time status monitoring, and a prediction module based on time series analysis, the system can promptly identify potential faults and adopt automated scheduling strategies to ensure the continuous and stable operation of virtual machines.
[0074] A virtualization environment fault prediction method of an embodiment of the present application first collects a target virtualization environment parameter sequence within a preset historical time period; such as virtual machine state data, host machine state data, and the corresponding relationship between the virtual machine and the host machine. Then the target virtualization environment parameter sequence is input into the fault prediction model to obtain the change trend of the target virtualization environment parameter sequence based on the time series relationship of the target virtualization environment parameter sequence. Finally, according to the change trend of the target virtualization environment parameter sequence, the fault result of the virtualization environment in the future target time period is predicted. The present application implements fault prediction based on virtual machine state data and host machine state data, which not only more comprehensively determines the faults in the business plane or storage plane; and because the fault prediction model can accurately predict the state changes of the virtual machine and the host machine based on the time series relationship of the target virtualization environment parameters, it can timely predict possible fault trends, improve timeliness, and can also detect problems such as performance degradation or resource bottlenecks of the host machine. It can be seen that the present application scheme can achieve comprehensive and timely determination of faults in the virtualization environment.
[0075] The ARIMA model in the above embodiment is obtained by training the target virtualization environment parameter training set. The present embodiment provides a specific training method. Before collecting the target virtualization environment parameter sequence within the preset historical time period, the method also includes: obtaining the target virtualization environment parameter training set, and then constructing the initial ARIMA model according to the target virtualization environment parameter training set; the parameters of the initial ARIMA model include autoregressive coefficients and moving average coefficients. Then, based on the autoregressive coefficients and the moving average coefficients, a likelihood function is established; and the logarithm of the likelihood function is taken to obtain a log-likelihood function. For the log-likelihood function, a first target value is obtained when the partial derivative of the autoregressive coefficient is zero, and a second target value is obtained when the partial derivative of the moving average coefficient is zero; finally, based on the first target value, the second target value and the initial ARIMA model, the ARIMA model is determined.
[0076] This solution needs to predict whether a virtual machine is likely to fail by modeling the status data of historical virtual machines and host machines. ARIMA is a statistical method commonly used for time series analysis and prediction. It combines autoregression (AR), difference (I) and moving average (MA) to build a model that can describe trends and seasonal changes in time series data. The ARIMA model looks for specific patterns in time series data in order to predict future values. Therefore, this solution uses the ARIMA algorithm to predict the possibility of system failure.
[0077] Specifically, an ARIMA model is established based on the target virtualization environment parameter training set. The mathematical expression of the ARIMA (p, d, q) model is as follows:
[0078] (1-φ1B-φ2B 2 -…-φ p B p )(1-B) d X t =(1+θ1B+θ2B 2 +…+φ q B q )Z t ;
[0079] Among them, X t is the stationary time series data after difference; B is the lag operator, which is used to represent the lagged version of the series; Z t is the white noise term, representing the random part not explained by the model; φ i and θ iThey are the autoregressive coefficient and the moving average coefficient, which need to be solved by the model. p (autoregressive order): use the data of the previous p moments to predict the current value. d (difference order): the data needs to be differentiated d times to reach stability. q (moving average order): use the errors of the previous q moments to adjust the predicted value.
[0080] The model is solved below. The specific steps are as follows:
[0081] a. Define the likelihood function. Suppose there is a time series data X t , which conforms to an ARIMA model (p, d, q). We need to define the likelihood function L(φ, θ) about the model parameters φ (autoregressive coefficient) and θ (moving average coefficient). The likelihood function describes the probability of the observed data occurring under given parameters.
[0082] b. Take the log-likelihood function. Usually, for the convenience of calculation, the logarithm of the likelihood function is taken to obtain the log-likelihood function l(φ,θ). After taking the logarithm, the multiplication of the likelihood function becomes addition, which is convenient for calculation and optimization.
[0083] c. Take the derivative and set it to zero. For the log-likelihood function, calculate its partial derivative with respect to the parameters - and θ, then set the partial derivative to zero and solve for the estimated values of the parameters. These values maximize the log-likelihood function. Specifically, an optimization algorithm can be used to solve it. Take Newton's method as an example to solve the parameter value that maximizes the log-likelihood function:
[0084] 1. Calculate the first-order derivative and the second-order derivative: Calculate the first-order derivative and the second-order derivative of the log-likelihood function respectively. The first-order derivative is the gradient of the log-likelihood function, and the second-order derivative is the Hessian matrix.
[0085] 2. Initialization parameters: Initialize the initial values of the model parameters, usually using some heuristic methods or random initialization.
[0086] 3. Iterative update: Use the iterative formula of Newton's method to update the parameter value. The iterative formula of Newton's method is:
[0087]
[0088] where θ new is the new parameter value, θ old is the old parameter value, H -1 is the inverse of the Hessian matrix, is the first derivative of the log-likelihood function.
[0089] 4. Termination condition: Repeat step 3 until the parameter changes very little or a certain number of iterations is reached.
[0090] 5. Obtain parameter estimates: After the iteration is completed, the parameter values obtained are the parameter estimates that maximize the log-likelihood function.
[0091] This solution uses maximum likelihood estimation to estimate model parameters. In the ARIMA model, maximum likelihood estimation can find the parameter value that maximizes the probability of occurrence of observed data, so that the ARIMA model can obtain the best results when performing fault prediction.
[0092] In actual application, before building the initial ARIMA model based on the target virtualization environment parameter training set, it may be necessary to perform a powdering operation on the target virtualization environment parameter training set. The specific steps are as follows: first obtain the target virtualization environment parameter training set, and determine the usage change trend of the processor usage and memory usage of the virtual machine and the host based on the target virtualization environment parameter training set. Finally, when the usage change trend meets the preset conditions, perform a differential operation on the target virtualization environment parameter training set to update the target virtualization environment parameter training set.
[0093] This solution builds the ARIMA model according to the following steps: Determine the difference order (d):
[0094] First, observe the state data of the virtual machine and the host machine to determine whether a differential operation is needed to make the data sequence stable. For the resource utilization data of the virtual machine and the host machine that have been collected, such as CPU utilization and memory usage, observe whether their trends exist. If so, a first-order differential operation is required.
[0095] Select the autoregressive order (p) and moving average order (q): Based on the collected virtual machine and host state data, draw the autocorrelation diagram (ACF) and partial autocorrelation diagram (PACF) to determine the autoregressive order (p) and moving average order (q). The ACF diagram shows the correlation between the series and its lagged version, while the PACF diagram shows the correlation between the series and its lagged version after eliminating other related factors.
[0096] Difference operation (I): Based on the difference order determined above, the original time series is differentiated to make it smooth. This helps to eliminate trends and seasonality. Differentiation operations are performed on data such as resource utilization of virtual machines and host machines to obtain differentiated data.
[0097] The data sample after difference processing is as follows:
[0098] Table 1 Data sample table after differential processing
[0099]
[0100]
[0101] After obtaining the differenced data, an initial ARIMA model can be constructed based on the differenced target virtualization environment parameter training set, which can make the data sequence area of the target virtualization environment parameter training set stable and the obtained ARIMA model has better effect.
[0102] In the above embodiment, after the ARIMA model is determined based on the first target value, the second target value and the initial ARIMA model, the model can also be evaluated to verify the availability of the model. The specific steps are: obtaining the target virtualization environment parameter test set and the real trend corresponding to the target virtualization environment parameter test set, inputting the target virtualization environment parameter test set into the ARIMA model for trend prediction, and obtaining the predicted trend. Then determine the difference index between the predicted trend and the real trend; when the difference index exceeds the preset threshold, determine that the performance of the ARIMA model does not meet the preset requirements.
[0103] Specifically, this solution can use mean square error (MSE) as a difference indicator to evaluate model performance. The steps are as follows:
[0104] Data preparation: Let the true observations of the test set be denoted as y t , and the model predicted value (the predicted value obtained by the ARIMA model) is recorded as
[0105] Calculate the prediction error: For each time step t, calculate the prediction error e t , that is, the gap between the actual observed value and the model predicted value:
[0106] Calculate the mean square error: Use the average of the sum of squares of all prediction errors to calculate the mean square error. The mean square error measures the average of the squared differences between the predicted values and the actual observed values, thereby measuring the prediction performance of the model. The calculation formula for the mean square error is: Where n is the number of data points in the test set. A smaller mean square error value indicates that the model prediction is relatively accurate; a larger mean square error value indicates that the model prediction deviates far from the actual observation.
[0107] Through the solution provided in the embodiments of the present application, the evaluation of model performance is achieved, thereby ensuring that the model used can accurately achieve fault prediction.
[0108] In practical applications, the correspondence between the virtual machine and the host machine is used to match the virtual machine with the host machine, and the change trend of the virtual machine state data and the host state data in time series reflects the state change of the virtualization environment.
[0109] The present application does not limit the specific content of the virtual machine state data and the host machine state data. Here, a specific solution is provided. The virtual machine state data includes at least one of the following: the virtual machine running state, the virtual machine resource utilization, the virtual machine network traffic data, and the virtual machine disk usage. The host machine state data includes at least one of the following: the host machine running state, the host machine resource utilization, the host machine storage state, and the host machine network load.
[0110] Among them, in the virtual machine state data, the virtual machine running state includes running, stopping and pausing, etc.; the virtual machine resource utilization includes the central processing unit (CPU) utilization and memory utilization. Similarly, in the host machine state data, the host machine resource utilization includes the CPU utilization and memory utilization.
[0111] Through the virtual machine status data and host machine status data provided by the embodiments of the present application, it is possible to comprehensively predict failures in the virtualization environment to ensure that the virtual machines and the host machine can operate normally.
[0112] In traditional solutions, once other hosts notice that a host may fail, the cluster system will take measures to ensure service continuity. A common approach is virtual machine migration or host migration, which migrates the virtual machines originally running on the failed host to other normal hosts and starts these virtual machines on the new host to ensure that the service is not interrupted.
[0113] It can be seen that traditional solutions have limitations in the self-healing ability of virtual machines. Even if a virtual machine is successfully migrated from a faulty host to another host, there is usually no automatic repair mechanism for internal faults in the virtual machine (such as application crashes), which cannot cope with the complex situations of actual applications.
[0114] The embodiment of the present application provides a specific implementation scheme. After predicting the failure result of the virtualized environment in a future target time period according to the change trend of the target virtualized environment parameter sequence, the method further includes:
[0115] In the case where the fault result indicates that the virtualization environment has a target fault, calling a fault handling program corresponding to the target fault;
[0116] According to the fault handling procedure, the virtual machine and / or the host machine are processed.
[0117] In actual application, different faults can be handled in different ways. Here are some specific handling methods. When the fault result indicates that the virtualization environment has a target fault, call the fault handling program corresponding to the target fault; and according to the fault handling program, process the virtual machine and / or host machine, including any of the following:
[0118] In the case where the fault result indicates that the first duration exceeds a first preset value, calling a virtual machine migration program to migrate the corresponding virtual machine; the first duration is the duration during which the processor usage of the virtual machine exceeds a first usage threshold;
[0119] When the fault result indicates that the second duration exceeds the second preset value, calling the host migration program to migrate the virtual machine on the corresponding host; the second duration is the duration during which the memory usage of the host exceeds the second usage threshold;
[0120] When the fault result indicates a change in network traffic, the virtual machine automatic scaling program is called to adjust the number of virtual machines;
[0121] When the fault result indicates that the third duration exceeds a third preset value, a resource release program is called to shut down the corresponding host machine; the third duration is the duration during which the processor usage and memory usage of the host machine are lower than a third usage threshold.
[0122] The specific values of the first duration, second duration, third duration, first preset value, second preset value, third preset value, first usage rate threshold, second usage rate threshold and third usage rate threshold shall be based on actual needs.
[0123] Here, a specific implementation scheme is used as an example for explanation. It should be noted that this example does not limit other schemes of the present application. In this scheme, the fault handling program can be executed through a processing module, and the processing module has a built-in escape device and performs post-processing operations based on the time series data of various indicators that have been predicted.
[0124] The escape device is an intelligent mechanism based on system status prediction and analysis, which aims to ensure the stability and high availability of computer systems. By monitoring, analyzing and predicting changes in key system indicators, the escape device can automatically trigger a series of targeted operations, such as virtual machine migration, resource adjustment, automatic scaling, etc., to adapt to load changes, failure risks and performance fluctuations in different scenarios, thereby realizing intelligent management and automated response of the system. In response to different situations, the operation of the escape device is as follows:
[0125] Virtual machine migration: When the predicted CPU utilization time series shows that the utilization of a virtual machine continues to exceed the threshold, virtual machine migration will be triggered to migrate the virtual machine from the current host to another host. For example, if the CPU utilization of virtual machine A continues to be above 90% in the predicted time series, the system will automatically migrate virtual machine A from host 1 to host 2 to balance the load.
[0126] Host migration: When the predicted memory usage time series shows that the usage of a host machine continues to exceed the threshold, host migration will be triggered to migrate the virtual machines on the host machine to other hosts. For example, the memory usage of host B exceeds 90% several times in a row in the predicted time series. The system automatically migrates the virtual machines on host B to host C to avoid insufficient memory.
[0127] Automatic scaling: When the predicted network traffic time series shows that the system traffic will continue to increase in the future, the number of virtual machines will be automatically scaled to cope with the increased load. For example, if the system's network traffic has increased rapidly in the predicted time series, indicating that the traffic will continue to rise in the future, the system will automatically start new virtual machine instances to share the network load.
[0128] Resource release: When the predicted host resource utilization time series shows that the CPU and memory usage of a host is continuously below 20%, the host resources are released, the number of virtual machines is reduced, or the host is shut down. For example, the CPU and memory usage of host C is continuously around 15% in the predicted time series. The system automatically shuts down host C to reduce costs.
[0129] In the embodiment of the present application, based on the fault prediction results in the above-mentioned embodiment, corresponding virtual machine self-healing escape devices are set for different faults, which can not only migrate the virtual machine, but also automatically repair the internal faults of the virtual machine, thereby ensuring the availability of the system and enabling the system to better cope with emergencies.
[0130] In addition, the target virtualization environment parameter sequences used in the training model and the use of the model in the above embodiment need to be preprocessed first. First, the state data of the virtual machine and the host machine are time-sorted to ensure that the data is arranged in chronological order. If there is a slight time difference between the timestamps of the virtual machine state data and the host state data, time alignment is performed to ensure that the two correspond to the same time point. For missing values, this solution uses the K nearest neighbor method.
[0131] The specific steps of the K nearest neighbor method are as follows: First, determine the appropriate K value, then calculate the distance between the missing value and other data points, and find the nearest K neighbors. Next, perform a weighted average on the feature values of these K neighbors, and the weight can be set according to the distance. Finally, fill the missing values with the weighted average, and repeat this process until all missing values are filled. After processing, the overall trend and distribution of the data are effectively maintained. The processed data is then normalized using the z-score method, and the formula is as follows:
[0132]
[0133] Among them, μ is the mean of each feature data, and σ is the standard deviation of each feature data.
[0134] In order to solve the above technical problems, the embodiment of the present application further provides a virtualized environment fault prediction device, which includes the following modules:
[0135] The acquisition module is used to acquire a target virtualization environment parameter sequence within a preset historical time period; the target virtualization environment parameters include: virtual machine state data, host machine state data, and the corresponding relationship between the virtual machine and the host machine;
[0136] An input module is used to input the target virtualization environment parameter sequence into the fault prediction model to obtain the change trend of the target virtualization environment parameter sequence based on the time series relationship of the target virtualization environment parameter sequence; the fault prediction model is trained by the target virtualization environment parameter training set;
[0137] The prediction module is used to predict the failure results of the virtualization environment within a future target time period according to the change trend of the target virtualization environment parameter sequence.
[0138] In some embodiments, the virtualized environment fault prediction device further includes:
[0139] A first acquisition module is used to acquire a target virtualization environment parameter training set before acquiring a target virtualization environment parameter sequence within a preset historical time period;
[0140] A construction module is used to construct an initial ARIMA model according to a target virtualization environment parameter training set; the parameters of the initial ARIMA model include an autoregressive coefficient and a moving average coefficient;
[0141] Establishing a module for establishing a likelihood function based on autoregressive coefficients and moving average coefficients;
[0142] A calculation module, used for taking the logarithm of the likelihood function to obtain a log-likelihood function;
[0143] A second acquisition module is used to obtain, for the log-likelihood function, a first target value when the partial derivative of the autoregressive coefficient is zero, and to obtain a second target value when the partial derivative of the moving average coefficient is zero;
[0144] The first determination module is used to determine the ARIMA model based on the first target value, the second target value and the initial ARIMA model.
[0145] In some embodiments, the virtualized environment fault prediction device further includes:
[0146] A third acquisition module is used to acquire a target virtualization environment parameter training set before building an initial ARIMA model according to the target virtualization environment parameter training set;
[0147] A second determination module is used to determine the usage change trend of the processor usage and memory usage of the virtual machine and the host machine based on the target virtualization environment parameter training set;
[0148] The updating module is used to perform a differential operation on the target virtualization environment parameter training set to update the target virtualization environment parameter training set when the usage rate change trend meets the preset conditions.
[0149] In some embodiments, the virtualized environment fault prediction device further includes:
[0150] A fourth acquisition module is used to acquire a target virtualization environment parameter test set and a real trend corresponding to the target virtualization environment parameter test set after determining the ARIMA model based on the first target value, the second target value and the initial ARIMA model;
[0151] The above input module is also used to input the target virtualization environment parameter test set into the ARIMA model for trend prediction to obtain the predicted trend;
[0152] A third determination module is used to determine the difference index between the predicted trend and the actual trend;
[0153] The fourth determination module is used to determine that the performance of the ARIMA model does not meet the preset requirements when the difference index exceeds the preset threshold.
[0154] In some embodiments, the virtualized environment fault prediction device further includes:
[0155] The execution module is used to predict the failure results of the virtualization environment in a future target time period according to the change trend of the target virtualization environment parameter sequence, and when the failure results indicate that the virtualization environment has a target failure, process the virtual machine and / or host machine based on the target failure.
[0156] In some embodiments, the execution module is specifically configured to:
[0157] When the fault result indicates that the first duration exceeds the first preset value, the corresponding virtual machine is migrated; the first duration is the duration during which the processor usage of the virtual machine exceeds the first usage threshold;
[0158] If the fault result indicates that the second duration exceeds the second preset value, the virtual machine on the corresponding host machine is migrated; the second duration is the duration during which the memory usage of the host machine exceeds the second usage threshold;
[0159] In the event that the failure results indicate changes in network traffic, adjusting the number of virtual machines;
[0160] When the fault result indicates that the third duration exceeds the third preset value, the corresponding host machine is shut down; the third duration is the duration during which the processor usage and memory usage of the host machine are lower than the third usage threshold.
[0161] Because the virtualization environment fault prediction device provided in the embodiment of the present application corresponds to the above method, it has the same effect as the above method and will not be described in detail here.
[0162] Figure 4 The hardware structure diagram of the virtualized environment fault prediction device provided in the embodiment of the present application is shown; Figure 4 As shown, the virtualized environment fault prediction device may include a processor 401 and a memory 402 storing computer program instructions.
[0163] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0164] Memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, memory 402 may include a removable or non-removable (or fixed) medium. In appropriate cases, memory 402 may be inside or outside of an integrated gateway disaster recovery device. In a specific embodiment, memory 402 is a non-volatile solid-state memory.
[0165] The memory 402 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0166] The processor 401 implements any one of the virtualization environment fault prediction methods in the above embodiments by reading and executing computer program instructions stored in the memory 402 .
[0167] In one example, the virtualized environment fault prediction device may further include a communication interface 403 and a bus 404. The processor 401, the memory 402, and the communication interface 403 are connected via the bus 404 and communicate with each other.
[0168] The communication interface 403 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0169] Bus 404 includes hardware, software or both, and the parts of virtualization environment fault prediction device are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 404 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0170] In addition, in combination with the virtualized environment fault prediction method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the virtualized environment fault prediction methods in the above embodiment is implemented.
[0171] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed, implements any one of the virtualization environment fault prediction methods in the above embodiments.
[0172] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0173] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0174] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0175] The above describes various aspects of the present disclosure with reference to a flowchart and / or block diagram of a virtualized environment fault prediction method, device, equipment, medium and product according to an embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0176] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A virtualization environment fault prediction method, characterized in that: include: Collect target virtualization environment parameter sequences within a preset historical time period; The target virtualization environment parameters include: virtual machine state data, host machine state data, and the corresponding relationship between the virtual machine and the host machine; Inputting the target virtualization environment parameter sequence into a fault prediction model to obtain a change trend of the target virtualization environment parameter sequence based on a time series relationship of the target virtualization environment parameter sequence; the fault prediction model is trained by a target virtualization environment parameter training set; According to the change trend of the target virtualization environment parameter sequence, the failure result of the virtualization environment in the future target time period is predicted.
2. The virtualization environment fault prediction method according to claim 1, characterized in that: The fault prediction model includes an autoregressive integrated moving average (ARIMA) model; Before collecting the target virtualization environment parameter sequence within the preset historical time period, the method further includes: Obtaining the target virtualization environment parameter training set; Constructing an initial ARIMA model according to the target virtualization environment parameter training set; the parameters of the initial ARIMA model include autoregressive coefficients and moving average coefficients; Based on the autoregressive coefficient and the moving average coefficient, a likelihood function is established; Taking the logarithm of the likelihood function to obtain a log-likelihood function; For the log-likelihood function, obtaining a first target value when the partial derivative of the autoregressive coefficient is zero, and obtaining a second target value when the partial derivative of the moving average coefficient is zero; The ARIMA model is determined based on the first target value, the second target value, and the initial ARIMA model.
3. The virtualization environment fault prediction method according to claim 2, characterized in that: Before constructing the initial ARIMA model according to the target virtualized environment parameter training set, the method further includes: Obtaining the target virtualization environment parameter training set; Based on the target virtualization environment parameter training set, determining the usage change trend of the processor usage and memory usage of the virtual machine and the host machine; When the usage rate variation trend meets a preset condition, a differential operation is performed on the target virtualization environment parameter training set to update the target virtualization environment parameter training set.
4. The virtualization environment fault prediction method according to claim 2, characterized in that: After determining the ARIMA model based on the first target value, the second target value, and the initial ARIMA model, the method further includes: Obtaining a target virtualization environment parameter test set and a real trend corresponding to the target virtualization environment parameter test set; Inputting the target virtualization environment parameter test set into the ARIMA model for trend prediction to obtain a predicted trend; determining a difference indicator between the predicted trend and the actual trend; When the difference index exceeds a preset threshold, it is determined that the performance of the ARIMA model does not meet the preset requirements.
5. The virtualization environment fault prediction method according to claim 1, characterized in that: The virtual machine state data includes at least one of the following: virtual machine operation state, virtual machine resource utilization, virtual machine network traffic data, and virtual machine disk usage; The host machine status data includes at least one of the following: host machine operation status, host machine resource utilization, host machine storage status, and host machine network load status.
6. The virtualization environment fault prediction method according to any one of claims 1 to 5, characterized in that: After predicting the failure result of the virtualized environment in a future target time period according to the change trend of the target virtualized environment parameter sequence, the method further includes: When the fault result indicates that a target fault exists in the virtualization environment, the virtual machine and / or the host machine is processed based on the target fault.
7. The virtualization environment fault prediction method according to claim 6, characterized in that: When the fault result indicates that the virtualization environment has a target fault, processing the virtual machine and / or the host machine based on the target fault includes: When the fault result indicates that the first duration exceeds a first preset value, the corresponding virtual machine is migrated; the first duration is the duration during which the processor usage of the virtual machine exceeds a first usage threshold; When the fault result indicates that the second duration exceeds the second preset value, the virtual machine on the corresponding host machine is migrated; the second duration is the duration during which the memory usage of the host machine exceeds the second usage threshold; If the fault result indicates a change in network traffic, adjusting the number of virtual machines; When the fault result indicates that the third duration exceeds a third preset value, the corresponding host machine is shut down; the third duration is the duration during which the processor usage and memory usage of the host machine are lower than a third usage threshold.
8. A virtualized environment fault prediction device, characterized in that: The device comprises: The acquisition module is used to acquire a target virtualization environment parameter sequence within a preset historical time period; the target virtualization environment parameters include: virtual machine state data, host machine state data, and the corresponding relationship between the virtual machine and the host machine; An input module, used to input the target virtualization environment parameter sequence into a fault prediction model, so as to obtain a change trend of the target virtualization environment parameter sequence based on a time series relationship of the target virtualization environment parameter sequence; the fault prediction model is trained by a target virtualization environment parameter training set; The prediction module is used to predict the failure result of the virtualization environment within a future target time period according to the change trend of the target virtualization environment parameter sequence.
9. A virtualized environment fault prediction device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the virtualization environment fault prediction method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the virtualization environment fault prediction method according to any one of claims 1 to 7 is implemented.
11. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the virtualization environment fault prediction method as described in any one of claims 1 to 7.
Citation Information
Cited By
Efficient ultrahigh-pressure water jet cleaning system and method
CN119747276A
5G-R core network virtual machine fault prediction method and system based on random forest algorithm
CN120029717A
Cloud platform virtual machine fault prediction method and system, terminal and medium
CN120162612A
Display panel aging prediction method and device, equipment and storage medium
CN121171120A
