KVM virtualization optimization implementation method and system for second-level creation of cloud server

Through real-time state optimization of pre-built template libraries and resource pools, combined with lightweight KVM kernels and differentiated disk structures, the problems of slow cloud server creation and low resource utilization are solved, and second-level creation and efficient resource management are achieved.

CN120407088AActive Publication Date: 2025-08-01NEWLIXON TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510927041.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-07
Publication Date
2025-08-01
Estimated Expiration
2045-07-07

AI Technical Summary

Technical Problem

The existing cloud server creation speed is slow, unable to reach the second level, resource allocation is inflexible, idle resources are not effectively recycled and reused, and cannot adapt to changes in business needs.

Method used

By matching virtual machine templates through the pre-built template library, resource allocation and elastic scaling are combined with the real-time state of the resource pool, recycle idle resources to optimize virtual machines, adopt lightweight KVM kernel and differentiated disk structure, skip the self-test stage, and realize cloud server creation in seconds.

Benefits of technology

It improves the speed of cloud server creation and resource utilization, meets the needs of rapid deployment of business, reduces operating costs, and adapts to diversified business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407088A_ABST
    Figure CN120407088A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer cloud processing, and discloses a KVM virtualization optimization implementation method and system for second-level creation of a cloud server, and the method comprises the steps: carrying out the analysis of a received cloud server creation request, and carrying out the matching of a corresponding virtual machine template from a pre-constructed template library; constructing a virtual machine instance based on the virtual machine template; in combination with the real-time state of a resource pool, corresponding resources are allocated to the virtual machine instance, the virtual machine is started, and the resource pool pre-allocates the resources through a preset resource allocation model and supports elastic scaling; idle resources in the virtual machine instance are recycled, and the started virtual machine is optimized, so that second-level creation of the cloud server is realized; according to the method, the virtualization process of the virtual machine is optimized, so that second-level creation of the cloud server is realized, the creation speed of the cloud server is greatly improved, and the requirement of a user for quickly deploying services is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer cloud processing, and particularly to a method and system for optimizing the implementation of KVM virtualization for creating cloud servers in seconds. Background Art

[0002] In the existing method for creating cloud servers, direct creation is performed, resulting in a slow creation speed, so that the creation of cloud servers cannot reach the second level, affecting the user experience and the efficiency of business deployment; there is a lack of effective combination of the real-time state of the resource pool and an elastic scaling resource allocation model, and resources cannot be flexibly allocated according to actual needs, reducing the resource utilization efficiency; there is a lack of an effective mechanism for recycling and reusing the idle resources in the virtual machine after startup, and the virtual machine cannot be optimized in real time to adapt to the changing business needs.

[0003] The existing technology has the following problems: direct server creation is performed, resulting in a slow creation speed, so that the creation of cloud servers cannot reach the second level, affecting the user experience and the efficiency of business deployment; there is a lack of effective combination of the real-time state of the resource pool and an elastic scaling resource allocation model, and resources cannot be flexibly allocated according to actual needs, reducing the resource utilization efficiency; there is a lack of an effective mechanism for recycling and reusing the idle resources in the virtual machine after startup, and the virtual machine cannot be optimized in real time to adapt to the changing business needs; to solve at least one of the above problems, the present invention proposes a method and system for optimizing the implementation of KVM virtualization for creating cloud servers in seconds. Summary of the Invention

[0004] Aiming at the deficiencies of the existing technology, the main object of the present invention is to provide a method and system for optimizing the implementation of KVM virtualization for creating cloud servers in seconds, which can effectively solve the problems in the background art. The specific technical solutions of the present invention are as follows:

[0005] A method for optimizing the implementation of KVM virtualization for creating cloud servers in seconds includes:

[0006] Parsing the received cloud server creation request, and matching the corresponding virtual machine template from a pre-built template library;

[0007] Based on the virtual machine template, constructing a virtual machine instance;

[0008] Combining the real-time state of the resource pool, allocating corresponding resources to the virtual machine instance, and starting the virtual machine, wherein the resource pool pre-allocates resources through a preset resource allocation model and supports elastic scaling;

[0009] Optimizing the virtual machine after startup by recycling the idle resources in the virtual machine instance to achieve the creation of cloud servers in seconds.

[0010] Specifically, parsing the received cloud server creation request and matching the corresponding virtual machine template from the pre-built template library includes:

[0011] According to the received cloud server creation request, parse the creation task requirement parameters, where the creation task requirement parameters include task type, resource configuration parameters, and performance requirements;

[0012] Based on the preset task types, generate multiple image templates to obtain a template library;

[0013] According to the creation task requirement parameters, perform matching in the template library to obtain the corresponding virtual machine template.

[0014] Specifically, the generating multiple image templates based on the preset task types to obtain a template library includes:

[0015] According to the preset task types, analyze the task requirements for each task type and construct the corresponding basic templates;

[0016] Based on the basic templates, use the configuration management tool to generate the corresponding first image templates;

[0017] When there is no corresponding matching basic template for the task type, construct the corresponding second image template;

[0018] Combine the first image templates and the second image templates to obtain a template library.

[0019] Specifically, according to the creation task requirement parameters, performing matching in the template library to obtain the corresponding virtual machine template includes:

[0020] According to the creation task requirement parameters, dynamically allocate the weights of multiple parameters through a preset weight adjustment model to obtain the corresponding parameter weights;

[0021] Perform weighted calculation on the creation task requirement parameters and the corresponding parameter weights to obtain the comprehensive task requirements;

[0022] According to the task type, perform matching in the template library to obtain the first target template set;

[0023] Screen out the templates that meet the comprehensive task requirements from the first target template set to obtain the second target template set;

[0024] Select the template with the highest utilization rate from the second target template set to obtain the corresponding virtual machine template.

[0025] Specifically, based on the virtual machine template, construct a virtual machine instance, including:

[0026] Based on the virtual machine template, load the pre-generated memory snapshot of the image template from the memory pool to generate the initial state of the virtual machine;

[0027] On the basis of the initial state of the virtual machine, create a read-only parent disk and generate a writable differential disk to construct a virtual machine instance.

[0028] Specifically, in combination with the real-time state of the resource pool, allocate corresponding resources to the virtual machine instance and start the virtual machine, where the resource pool pre-allocates resources through a preset resource allocation model and supports elastic scaling, including:

[0029] Analyze the resource requirements through a preset resource allocation model according to the real-time state of the resource pool combined with the creation task requirements to obtain the resource demand;

[0030] Partition the resources corresponding to the resource demand into the elastic resource pool;

[0031] Allocate corresponding resources from the elastic resource pool to the virtual machine instance;

[0032] Analyze the resource allocation situation according to the real-time state of the resource pool, perform elastic scaling on the resource pool to obtain the real-time resource pool;

[0033] Start the virtual machine by loading the lightweight KVM kernel and skipping the self-check stage.

[0034] Specifically, the analyzing the resource allocation situation according to the real-time state of the resource pool, performing elastic scaling on the resource pool to obtain the real-time resource pool includes:

[0035] Analyze the resource utilization rate of the resource pool according to the real-time state of the resource pool to obtain the resource utilization rate;

[0036] When the resource utilization rate is greater than a preset first threshold, expand the resource pool by adding virtualized resources;

[0037] When the resource utilization rate is less than a preset second threshold, shrink the resource pool by reclaiming idle resources;

[0038] After performing the expansion or contraction operation on the resource pool, update the resource pool state to obtain the real-time resource pool.

[0039] Specifically, optimize the started virtual machine by reclaiming the idle resources in the virtual machine instance to achieve the second-level creation of the cloud server, including: <L

[0040] Monitor the started virtual machine instance in real time, identify the resources with a resource utilization rate less than a preset third threshold and a duration exceeding a preset time length to obtain idle resources;

[0041] Unbind the idle resources from the virtual machine instance and release them back to the elastic resource pool;

[0042] Optimize the virtual machine after startup according to the real-time status of the resource pool to achieve the second-level creation of cloud servers.

[0043] Specifically, the optimizing the virtual machine after startup according to the real-time status of the resource pool to achieve the second-level creation of cloud servers includes:

[0044] Update the resource configuration parameters of the virtual machine instance according to the status of the recycled resources to obtain an optimized virtual machine instance;

[0045] Pre-allocate resources to the elastic resource pool according to the real-time status of the resource pool to obtain pre-allocated resources;

[0046] When a new virtual machine creation request arrives, directly call the pre-allocated resources from the elastic resource pool and combine them with the optimized configuration parameters to achieve the second-level creation of cloud servers.

[0047] The KVM virtualization optimization implementation system for the second-level creation of cloud servers is used to implement the KVM virtualization optimization implementation method for the second-level creation of cloud servers, including:

[0048] A template matching module, which parses the received cloud server creation request and matches the corresponding virtual machine template from the pre-built template library;

[0049] A virtual machine instance creation module, which constructs a virtual machine instance based on the virtual machine template;

[0050] A virtual machine startup module, which allocates corresponding resources to the virtual machine instance in combination with the real-time status of the resource pool and starts the virtual machine, where the resource pool pre-allocates resources through a preset resource allocation model and supports elastic scaling;

[0051] A virtual machine optimization module, which optimizes the virtual machine after startup by recycling the idle resources in the virtual machine instance to achieve the second-level creation of cloud servers.

[0052] Compared with the prior art, the present application has the following beneficial effects:

[0053] This application performs template matching based on a preset template library to generate the initial state of a virtual machine. Combining the real-time state of the resource pool and the requirements of the creation task, it analyzes the resource requirements through a preset resource allocation model, divides the resources into an elastic resource pool and dynamically allocates them. At the same time, it elastically scales the resource pool according to the resource utilization rate, achieving efficient allocation and flexible management of resources; it monitors the running virtual machine instances in real time, reclaims idle resources and releases them back to the elastic resource pool, and optimizes the virtual machines, realizing the creation of cloud servers in seconds, greatly improving the creation speed of cloud servers and meeting the user's requirement for rapid business deployment. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 It is a flowchart of the method for optimizing the KVM virtualization implementation of the second-level creation of cloud servers in Embodiment 1 of the present invention;

[0055] Figure 2 It is a schematic diagram of virtual machine template matching in Embodiment 1 of the present invention;

[0056] Figure 3 It is a schematic diagram of the update of the resource pool and the elastic resource pool in Embodiment 1 of the present invention;

[0057] Figure 4 It is a schematic diagram of the structure of the system for optimizing the KVM virtualization implementation of the second-level creation of cloud servers in Embodiment 2 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0058] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following detailed description of the specific embodiments of the present invention will be made in conjunction with the accompanying drawings of the specification.

[0059] In the following description, many specific details are set forth in order to fully understand the present invention. However, the present invention can also be implemented in other ways different from those described herein. Those skilled in the art can make similar promotions without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.

[0060] Secondly, the so-called "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that can be included in at least one implementation manner of the present invention. The "in one embodiment" that appears in different places in this specification does not all refer to the same embodiment, nor is it a separate or alternative embodiment that mutually excludes other embodiments.

[0061] Embodiment 1

[0062] This embodiment provides a method for optimizing the KVM virtualization implementation of the second-level creation of cloud servers, as Figure 1 shown. The method for optimizing the KVM virtualization implementation of the second-level creation of cloud servers includes:

[0063] S101. Parse the received cloud server creation request, and match the corresponding virtual machine template from the pre-built template library;

[0064] S102. Build a virtual machine instance based on the virtual machine template;

[0065] S103. Combine the real-time status of the resource pool, allocate corresponding resources to the virtual machine instance, and start the virtual machine, where the resource pool pre-allocates resources through a preset resource allocation model and supports elastic scaling;

[0066] S104. Optimize the started virtual machine by recycling the idle resources in the virtual machine instance to achieve the second-level creation of the cloud server.

[0067] In this embodiment, according to the cloud server creation request, template matching is performed in the template library, rapid virtual machine instance construction, optimized resource allocation and startup process, and real-time virtual machine optimization are carried out. Compared with the existing server creation method, the second-level creation of the cloud server is achieved, greatly improving the creation speed of the cloud server and meeting the user's demand for rapid business deployment; through the elastic scaling of the resource pool and the recycling of idle resources, the reasonable allocation and efficient utilization of resources are ensured, and the operation cost is reduced; dynamic adjustment is performed according to different business requirements and resource usage conditions to adapt to diverse business scenarios, improving the flexibility and adaptability of the system.

[0068] In this embodiment, when the cloud server creation request is received, the most suitable virtual machine template for the request is found from the pre-built template library. Among them, the template library is a set of image templates pre-built according to different task types. By parsing the key parameters in the request, screening and matching are performed in the template library to find the most suitable template; according to the received cloud server creation request, the creation task requirement parameters are parsed, including task type (such as Web service, database service, etc.), resource configuration parameters (such as number of CPU cores, memory size, etc.), and performance requirements (such as high concurrency processing ability, low latency, etc.); the appropriate template is matched through the creation task requirement parameters. Through the pre-built template library and matching, the appropriate template can be quickly found, avoiding the need to configure from scratch every time a cloud server is created, and greatly shortening the creation time.

[0069] Specifically, after a suitable virtual machine template is matched, a virtual machine instance is constructed based on the template. By loading the memory snapshot of the template and creating a disk structure, the initial state of the virtual machine is quickly generated. Based on the virtual machine template, the pre-generated memory snapshot of the image template is loaded from the memory pool. The memory snapshot records the memory state of the template at a specific moment. Loading the memory snapshot can quickly restore the initial memory state of the virtual machine, reducing the system initialization time. On the basis of the initial state of the virtual machine, a read-only parent disk is created, and a writable differential disk is generated. The parent disk contains the original data of the template, and the differential disk is used to record the data modifications made by the virtual machine during operation. This disk structure can improve the disk usage efficiency and data manageability. By loading the memory snapshot and using the disk structure, the virtual machine instance can be quickly constructed, reducing the time to read data from the disk and initialize the system, and further improving the creation speed of the cloud server.

[0070] Meanwhile, according to the real-time state of the resource pool and the requirements of the creation task, corresponding resources are reasonably allocated to the virtual machine instance, and the virtual machine is started. According to the real-time state of the resource pool combined with the requirements of the creation task, the resource requirements are analyzed through a preset resource allocation model to obtain the resource demand quantity. The resources corresponding to the resource demand quantity are divided into the elastic resource pool, and the corresponding resources are allocated from the elastic resource pool to the virtual machine instance. The virtual machine is started by loading the lightweight KVM kernel and skipping the self-check stage. The lightweight KVM kernel reduces the loading items during system startup, and skipping the self-check stage avoids unnecessary hardware checks, thus accelerating the startup speed of the virtual machine. Combining the real-time state of the resource pool for resource allocation and elastic scaling ensures that resources are reasonably utilized, avoiding resource waste and resource shortage. Loading the lightweight KVM kernel and skipping the self-check stage greatly shortens the startup time of the virtual machine, realizing the fast startup of the cloud server.

[0071] Specifically, the running virtual machine instance is monitored in real time to identify the idle resources therein, which are recycled and released back to the elastic resource pool. Meanwhile, the virtual machine is optimized according to the real-time state of the resource pool to improve the resource utilization rate and the creation speed of the cloud server. By recycling the idle resources and reallocating them, the resources are more fully utilized, reducing the operation cost. Through real-time monitoring and optimization, it is ensured that the virtual machine is always in the best running state, improving the performance and stability of the cloud server.

[0072] This application performs template matching based on a preset template library to generate the initial state of the virtual machine. Combining the real-time state of the resource pool and the requirements of the creation task, it analyzes the resource requirements through a preset resource allocation model, divides the resources into an elastic resource pool and performs dynamic allocation. At the same time, it elastically scales the resource pool according to the resource utilization rate, achieving efficient allocation and flexible management of resources; it monitors the running virtual machine instances in real time, reclaims idle resources and releases them back to the elastic resource pool, and optimizes the virtual machines, realizing the creation of cloud servers in seconds, greatly improving the creation speed of cloud servers and meeting the user's requirement for rapid business deployment.

[0073] Further, the parsing of the received cloud server creation request and the matching of the corresponding virtual machine template from the pre-built template library include:

[0074] S201. According to the received cloud server creation request, parse out the creation task requirement parameters, where the creation task requirement parameters include task type, resource configuration parameters, and performance requirements;

[0075] S202. Generate multiple image templates based on the preset task type to obtain a template library;

[0076] S203. According to the creation task requirement parameters, perform matching in the template library to obtain the corresponding virtual machine template.

[0077] In this embodiment, when the system receives a cloud server creation request, it extracts the key information in the request to obtain the creation task requirement parameters, including task type (such as Web application service, database service, big data analysis, etc.), resource configuration parameters (such as number of CPU cores, memory size, disk space, etc.), and performance requirements (such as response time, throughput, etc.), which can clarify the specific requirements of the user for the upcoming cloud server. Different task types, resource configuration parameters, and performance requirements will match different virtual machine templates to ensure that the created cloud server can meet the user's business needs.

[0078] Specifically, based on the preset task type, analyze the required software environment, configuration information, etc. for each task type, and generate corresponding image templates. The image templates contain the basic data and configurations required for creating virtual machines; by using the pre-generated image templates, it is possible to avoid repeated software installation and configuration operations every time a cloud server is created, greatly shortening the creation time; by generating templates for different task types, it can meet the diverse business needs of users and improve the applicability of the system.

[0079] Specifically, according to the parsed task creation requirement parameters, filter and match in the template library to find the most suitable virtual machine template. The matching process comprehensively considers multiple factors such as task type, resource configuration parameters, and performance requirements for precise matching. By comprehensively considering multiple parameters and dynamically allocating weights, it is possible to more accurately find the virtual machine template that meets the user's needs and improve the applicability of the created cloud server. The process of matching in the template library is relatively fast, which can promptly provide the user with a suitable virtual machine template and accelerate the creation speed of the cloud server.

[0080] Further, generating multiple image templates based on the preset task types to obtain the template library includes:

[0081] S301. According to the preset task types, analyze the task requirements for each task type and construct the corresponding basic template;

[0082] S302. Based on the basic template, generate the corresponding first image template through the configuration management tool;

[0083] S303. When there is no corresponding basic template for the task type, construct the corresponding second image template;

[0084] S304. Combine the first image template and the second image template to obtain the template library.

[0085] In this embodiment, analyze the corresponding task requirements for each task type and construct the corresponding basic template. First, clarify the various task types preset by the system, such as Web application services, database services, data analysis services, etc.; for each task type, conduct requirement analysis. For Web application services, it is necessary to determine its commonly used Web server software, the adapted programming language running environment (such as the running frameworks corresponding to PHP and Python), and basic security configuration requirements, etc.; according to the requirement analysis results, install and configure the core software and basic settings required for this task type on the basis of a standard operating system image. Construct exclusive basic templates for different task types to ensure that the generated image templates can accurately adapt to various business requirements and avoid the inadaptability of general templates in specific task scenarios.

[0086] Specifically, based on the basic template, a corresponding first image template is generated through a configuration management tool. Common configuration management tools include Ansible, Puppet, Chef, etc. In this embodiment, Ansible is used. A series of configuration tasks are defined by writing a playbook in YAML format. For a Web application service, the playbook includes tasks such as installing a specific version of the PHP extension library, configuring the virtual host of the Web server, and setting file permissions. The configuration script is applied to the corresponding basic template, and these scripts are executed through the configuration management tool. The tool will automatically perform software installation, parameter adjustment, etc. in the basic template environment according to the order and rules defined in the script, generating the first image template. Through refined configuration by the configuration management tool, the first image template better fits the complex requirements of the actual business, improving the quality and usability of the template.

[0087] Meanwhile, when encountering some special task types for which there is no corresponding basic template in the system preset, a new image template is constructed manually to obtain the second image template. The specific requirements of this special task type are analyzed in detail, including the required software, hardware resource requirements, network configuration requirements, security policies, etc. A suitable operating system version is selected and installed according to the task requirements. According to the task requirements, various types of software required are installed in sequence. After the software installation and configuration are completed, the constructed image template is tested to ensure that all functions are running normally. And according to the test results, the template is optimized as necessary, such as adjusting software parameters to improve performance, optimizing resource allocation to enhance efficiency, etc. By manually creating the template, the demand for creating cloud servers in some special business scenarios can be met, expanding the applicable scope of the system and enhancing the flexibility and scalability of the system. The newly constructed second image template can be added to the template library, providing convenience for creating cloud servers of the same or similar task types and continuously improving the content of the template library.

[0088] Specifically, the first image template and the second image template generated by different methods are integrated together to form a unified template library. When receiving a cloud server creation request, the system can quickly retrieve and match the most suitable virtual machine template from the template library. All image templates are centrally stored in a template library, facilitating unified management and maintenance, improving the management efficiency of the templates, enabling the system to quickly find the virtual machine template that meets the requirements from the template library when receiving a cloud server creation request, greatly shortening the template matching time, and enhancing the overall efficiency of cloud server creation.

[0089] Further, as Figure 2 , matching in the template library according to the creation task requirement parameters to obtain the corresponding virtual machine template, including:

[0090] S401. Dynamically allocate the weights of multiple parameters according to the parameters required for creating a task through a preset weight adjustment model to obtain the corresponding parameter weights;

[0091] S402. Perform weighted calculation on the parameters required for creating the task and the corresponding parameter weights to obtain a comprehensive task requirement;

[0092] S403. Match in a template library according to the task type to obtain a first target template set;

[0093] S404. Screen out the templates that meet the comprehensive task requirement from the first target template set to obtain a second target template set;

[0094] S405. Select the template with the highest utilization rate from the second target template set to obtain the corresponding virtual machine template.

[0095] In this embodiment, during the template matching process, according to the parameters required for creating a task, the weights of multiple parameters are dynamically allocated to obtain the corresponding parameter weights. The parameters required for creating a task include task type, resource configuration parameters, performance requirements, etc. Different tasks have different emphases on these parameters. Through a preset weight adjustment model, corresponding weights are dynamically allocated to each parameter according to the specific parameters required for creating a task, reflecting the importance of each parameter in this matching. By dynamically allocating weights, the importance of different tasks for each parameter can be more accurately reflected, thereby improving the accuracy of matching to a suitable virtual machine template.

[0096] Specifically, multiply each parameter required for creating a task by its corresponding weight, and then add all the results to obtain a comprehensive task requirement value. The comprehensive task requirement value can comprehensively consider the influence of multiple parameters, avoiding inaccurate matching caused by only focusing on a single parameter. Extract the task type information from the parameters required for creating a task, traverse each virtual machine template in the template library, check the task type it belongs to, and screen out the templates that match the task type to obtain a first target template set. By initially screening the task type, a large number of irrelevant templates can be quickly excluded, improving the matching efficiency.

[0097] Further, in the first target template set, templates that meet the comprehensive task requirements are further screened. For each template in the first target template set, extract its corresponding parameter values, such as the number of CPU cores, memory size, disk capacity, etc. Compare the parameter values of each template with the comprehensive task requirements, and screen out the templates that meet the comprehensive task requirements to obtain the second target template set. By demand matching, it can be ensured that the finally selected template can meet the comprehensive requirements of creating a task, improving the quality and applicability of cloud server creation; in the second target template set, select the template with the highest utilization rate as the final virtual machine template. A template with a high utilization rate indicates that resources are more fully utilized, which can reduce costs and improve the overall utilization efficiency of resources, helping to optimize the allocation of cloud server resources and improve the performance and efficiency of the entire system.

[0098] Further, based on the virtual machine template, a virtual machine instance is constructed, including:

[0099] S501. Based on the virtual machine template, load the pre-generated mirror template memory snapshot from the memory pool to generate the initial state of the virtual machine;

[0100] S502. On the basis of the initial state of the virtual machine, create a read-only parent disk and generate a writable differential disk to construct the virtual machine instance.

[0101] In this embodiment, a memory pool is pre-planned to store various types of temporary data and a storage area for storing the mirror template memory snapshot. According to the selected virtual machine template, locate the corresponding pre-generated memory snapshot in the storage area. Each virtual machine template has a unique identifier, and the memory snapshot is also associated with the corresponding identifier for quick search; read the located memory snapshot data from the storage device into the memory pool, and the system reconstructs the initial memory layout of the virtual machine template in memory according to the data in the memory snapshot, including the state of the operating system, installed software, and related configuration information in memory, to generate the initial state of the virtual machine; by directly loading the memory snapshot, the process of slowly reading data from the disk and initializing memory is avoided, significantly shortening the time required to construct the virtual machine instance and helping to achieve the rapid creation of cloud servers.

[0102] Specifically, based on the initial state of the virtual machine, a complete virtual machine instance disk structure is constructed by creating a read-only parent disk and a writable differential disk. On the storage device, according to the data information of the virtual machine template, a read-only parent disk is created. The content of the parent disk is the complete disk image data of the virtual machine template, including operating system files, pre-installed software, and initial configuration files, etc. During the creation process, this data is written into the storage area of the parent disk according to the disk format specification, and the disk is set to read-only property to ensure that the data will not be accidentally modified during the operation of the virtual machine instance. For each virtual machine instance to be constructed, a writable differential disk is created on the storage device. The differential disk is initially empty and is used to record all modifications to the parent disk data during the operation of the virtual machine instance. When the virtual machine instance runs, any write operation to the disk data will be recorded in the differential disk, while the read operation will first check the differential disk and read from the parent disk if there is no corresponding data.

[0103] At the same time, the created read-only parent disk and writable differential disk are associated with the previously generated initial state of the virtual machine. In the virtual machine management system, the disk parameters of the virtual machine instance are configured so that it can correctly identify and use these two disks, constructing a complete virtual machine instance with the memory state and disk structure required for independent operation. Through the construction of the disk structure, multiple virtual machine instances can share the data of the read-only parent disk, reducing the repeated occupation of disk space and improving the utilization efficiency of storage resources. It is convenient to manage the data of the virtual machine instance. When backing up, only the differential disk needs to be backed up, greatly reducing the amount of backup data and improving the efficiency of data management.

[0104] Furthermore, in combination with the real-time state of the resource pool, corresponding resources are allocated to the virtual machine instance and the virtual machine is started. The resource pool pre-allocates resources through a preset resource allocation model and supports elastic scaling, including:

[0105] S601. Analyze the resource requirements through a preset resource allocation model according to the real-time state of the resource pool in combination with the creation task requirements to obtain the resource demand;

[0106] S602. Divide the resources corresponding to the resource demand into the elastic resource pool;

[0107] S603. Allocate corresponding resources from the elastic resource pool to the virtual machine instance;

[0108] S604. Analyze the resource allocation situation according to the real-time state of the resource pool and perform elastic scaling on the resource pool to obtain the real-time resource pool;

[0109] S605. Start the virtual machine by loading the lightweight KVM kernel and skipping the self-check stage.

[0110] In this embodiment, according to the real-time state of the resource pool and the requirements of creating a task, the resource requirements are analyzed to obtain the resource demand quantity. The real-time state of the resource pool reflects the available situation of the current resources, and the requirements of creating a task clarify the resource types and quantities required for a new virtual machine instance. The preset resource allocation model synthesizes these two aspects of information, accurately analyzes the resource requirements, and obtains the specific quantity of resources required to meet the creation task; by analyzing the resource requirements, it ensures that the allocated resources precisely meet the actual requirements of the creation task, avoiding waste caused by over-allocation of resources or affecting the performance of the virtual machine due to insufficient allocation.

[0111] Specifically, an elastic resource pool is preset in the system. As a buffer area for resource allocation, the elastic resource pool has the ability to flexibly allocate resources. The resources determined according to the resource demand quantity are divided into the elastic resource pool. During the division process, the resources will be identified and recorded for tracking and management; the elastic resource pool plays a buffering role, making the resource allocation process smoother and reducing the chaos and conflicts brought about by directly allocating resources from the total resource pool. In the elastic resource pool, according to the requirements of the virtual machine instance, the corresponding allocated resources are allocated to the corresponding virtual machine instance. After the resource allocation is completed, the resource status information of the elastic resource pool and the virtual machine instance is updated in a timely manner. The allocated resources are marked as unavailable in the elastic resource pool, and at the same time, the allocated resource situation is recorded in the resource configuration information of the virtual machine instance; it provides the resources required for the virtual machine instance to run, ensuring that it can be started and work normally to meet the business requirements.

[0112] At the same time, as the virtual machine instance runs, the usage situation of the resource pool will change. By analyzing the resource allocation situation in the real-time state of the resource pool, when the resource utilization rate is too high or too low, elastic scaling operations are performed on the resource pool to increase or decrease the resource quantity to maintain the efficient utilization of resources and the stable operation of the system.

[0113] Specifically, a lightweight KVM kernel optimized in advance is prepared in the system. When starting the virtual machine, it is specified to load the pre-selected lightweight KVM kernel. Through the startup configuration parameters of the virtual machine management system, the path and related startup options of the lightweight kernel are passed to the virtual machine startup program. In the virtual machine startup program, parameters for skipping the hardware self-check stage are configured. After the above configuration is completed, the virtual machine is started, avoiding the problem that the traditional virtual machine startup process requires loading a complete kernel and performing a comprehensive hardware self-check, which takes a long time; through this startup method, the startup time of the virtual machine is significantly shortened, achieving the goal of creating a cloud server in seconds, and improving the user experience and business deployment efficiency.

[0114] Furthermore, the analyzing the resource allocation situation according to the real-time state of the resource pool, performing elastic scaling on the resource pool, and obtaining the real-time resource pool includes:

[0115] S701. Analyze the resource utilization rate of the resource pool based on the real-time status of the resource pool to obtain the resource utilization rate.

[0116] S702. When the resource utilization rate is greater than a preset first threshold, expand the resource pool by adding virtualized resources.

[0117] S703. When the resource utilization rate is less than a preset second threshold, shrink the resource pool by reclaiming idle resources.

[0118] S704. After performing the expansion or contraction operation on the resource pool, update the status of the resource pool to obtain the real-time resource pool.

[0119] In this embodiment, a resource monitoring tool is used to continuously collect the real-time data of various resources in the resource pool. According to the collected data, the corresponding resource utilization rate is calculated. The first threshold is set based on experience and business requirements, and the calculated resource utilization rate is compared with the first threshold. When the resource utilization rate of the resource pool is greater than the preset first threshold, it means that the resources in the current resource pool are tight and cannot meet the business's demand for resources. By adding virtualized resources, such as creating new virtual machines, allocating more physical resources to existing virtual machines, etc., the total amount of resources in the resource pool is increased to relieve the resource tight situation and ensure the normal operation of the business.

[0120] At the same time, when the resource utilization rate of the resource pool is less than the preset second threshold, it indicates that there are a large number of idle resources in the resource pool, resulting in resource waste. By reclaiming idle resources, such as shutting down idle virtual machines, releasing unused physical resources, etc., the total amount of resources in the resource pool is reduced, and the utilization efficiency of resources is improved. Through the flexible expansion and contraction mechanism, the system can dynamically adjust the resource configuration according to business development, enhancing the scalability of the system and adapting to the changing business scale. After performing the expansion or contraction operation on the resource pool, the status information such as the total amount of resources and the resource utilization rate in the resource pool has changed. Update the status of the resource pool to obtain the real-time resource pool. Through the update of the resource pool, ensure that the status information of the resource pool used by each part in the system is consistent, and avoid resource allocation errors or management chaos caused by inconsistent information.

[0121] Further, by reclaiming the idle resources in the virtual machine instance, optimize the started virtual machine to achieve the second-level creation of cloud servers, including:

[0122] S801. Monitor the started virtual machine instance in real time, identify the resources with a resource utilization rate less than a preset third threshold and a continuous duration exceeding a preset time length, to obtain idle resources.

[0123] S802. Unbind the idle resources from the virtual machine instance and release them back to the elastic resource pool.

[0124] S803. Optimize the virtual machine after startup according to the real-time status of the resource pool to achieve the creation of cloud servers in seconds.

[0125] In this embodiment, by monitoring the running virtual machine instances in real time, continuously obtain the usage data of various resources of the virtual machine (such as CPU, memory, disk I / O, network bandwidth, etc.). According to actual business experience and performance requirements, preset the third threshold and preset duration. For example, set the third threshold of CPU resource utilization rate to 20% and the preset duration to 10 minutes; the monitoring tool collects the resource utilization rate data of the virtual machine instance in real time, such as CPU usage rate, used memory ratio, disk I / O read and write speed, network bandwidth occupancy rate, etc., compare the collected real-time utilization rate with the corresponding third threshold, and record the duration of the resource in the low utilization state. When the utilization rate of a certain resource is less than the preset third threshold and the duration exceeds the preset duration, mark the resource as an idle resource; by identifying the resources that contribute little to the current operation of the virtual machine and are in an idle state, it provides a clear goal for resource recovery and optimization.

[0126] Specifically, as Figure 3 shown, use the management interface or command-line tool provided by the virtual machine management system to unbind the identified idle resources. After the unbinding is completed, release the idle resources back to the elastic resource pool. The elastic resource pool, as the centralized management and allocation area of resources, is responsible for receiving and reallocating these released resources. During the release process, update the resource list and status information of the elastic resource pool, and mark the released resources as available; enable the idle resources to quickly return to the resource pool and participate in the new round of resource allocation, increasing the liquidity of resources and improving the resource utilization efficiency.

[0127] Specifically, based on the real-time status of the resource pool, including information such as resource availability and resource utilization rate, optimize the virtual machine after startup. On the one hand, according to the status after resource recovery, adjust the resource configuration parameters of the virtual machine instance to make it more adaptable to the current business needs and resource conditions; on the other hand, use the real-time status of the resource pool to pre-allocate resources to the elastic resource pool in advance to prepare for the creation of new virtual machines in seconds; when a new virtual machine creation request arrives, quickly obtain the pre-allocated resources from the elastic resource pool and combine them with the optimized configuration parameters to quickly complete the creation of the virtual machine, achieving the goal of creating cloud servers in seconds; through the combination of resource pre-allocation and optimized configuration parameters, the creation time of new virtual machines is greatly shortened, realizing the creation of cloud servers in seconds and meeting the user's demand for quickly obtaining cloud servers.

[0128] Further, optimizing the virtual machine after startup according to the real-time state of the resource pool to achieve the second-level creation of cloud servers includes:

[0129] S901. Updating the resource configuration parameters of the virtual machine instance according to the recycled resource state to obtain an optimized virtual machine instance;

[0130] S902. Pre-allocating resources to the elastic resource pool according to the real-time state of the resource pool to obtain pre-allocated resources;

[0131] S903. When a new virtual machine creation request arrives, directly call the pre-allocated resources from the elastic resource pool, and combine with the optimized configuration parameters to achieve the second-level creation of cloud servers.

[0132] In this embodiment, during the operation of the cloud server, the resource usage of the virtual machine will change dynamically. When some idle resources are recycled, it indicates that the current resource configuration of the virtual machine does not match the actual demand. By analyzing the recycled resource state, such as resource type, recycled quantity, etc., it is possible to understand the redundant resources of the virtual machine, so as to make targeted adjustments to the resource configuration parameters of the virtual machine instance, making the resource configuration of the virtual machine more in line with the actual load, improving resource utilization efficiency; by updating the resource configuration parameters of the virtual machine instance, over-allocation of resources is avoided, enabling resources to be used more reasonably; making the resource configuration of the virtual machine match the actual business load, reducing performance bottlenecks caused by resource shortage or surplus, and improving the operation efficiency of the virtual machine.

[0133] Specifically, by monitoring and analyzing the real-time state of the resource pool, predicting future virtual machine creation requirements, and pre-allocating an appropriate amount of resources to the elastic resource pool, when a new virtual machine creation request arrives, the required resources can be quickly provided, reducing the time overhead of resource allocation, thereby achieving the rapid creation of cloud servers; pre-allocating resources in advance reduces the time for resource allocation when creating a virtual machine, enabling the new virtual machine to start faster; the elastic resource pool can dynamically adjust the pre-allocated resource amount according to actual needs, improving the flexibility and response speed of resource allocation.

[0134] At the same time, when the user initiates a new virtual machine creation request, the system receives the request and parses the virtual machine configuration requirements included in the request, such as operating system type, application program requirements, etc. The system searches for and calls the pre-allocated resources that match the new virtual machine creation request from the elastic resource pool, and applies the optimized virtual machine configuration parameters to the newly created virtual machine, enabling the virtual machine to reach a stable operation state faster after startup; by directly obtaining the required resources from the elastic resource pool and quickly creating and starting the virtual machine according to the optimized configuration parameters, the time-consuming processes of resource allocation and configuration adjustment in the traditional method are avoided, thereby achieving the second-level creation of cloud servers.

[0135] Example 2

[0136] In this embodiment, as Figure 4 , a KVM virtualization optimization implementation system for creating a cloud server in seconds is provided, which is used to implement the KVM virtualization optimization implementation method for creating a cloud server in seconds, including:

[0137] A template matching module parses the received cloud server creation request and matches the corresponding virtual machine template from a pre-built template library;

[0138] A virtual machine instance creation module constructs a virtual machine instance based on the virtual machine template;

[0139] A virtual machine startup module, in combination with the real-time status of the resource pool, allocates corresponding resources to the virtual machine instance and starts the virtual machine, where the resource pool pre-allocates resources through a preset resource allocation model and supports elastic scaling;

[0140] A virtual machine optimization module optimizes the started virtual machine by reclaiming idle resources in the virtual machine instance to achieve the creation of a cloud server in seconds.

[0141] In this embodiment, the template matching module parses and processes the cloud server creation request, and accurately finds the most suitable virtual machine template for the creation request from the template library through dynamically allocating parameter weights, calculating comprehensive task requirements, and multiple rounds of screening and matching, providing a basis for the creation of the virtual machine instance; the virtual machine instance creation module efficiently constructs a virtual machine instance that meets the creation request by loading a memory snapshot and creating a specific disk structure, which can not only ensure the consistency of the virtual machine instance, but also save disk space and improve resource utilization efficiency.

[0142] Specifically, the virtual machine startup module combines the real-time status of the resource pool, accurately analyzes and allocates resources, performs elastic scaling on the resource pool to optimize resource configuration, and at the same time adopts an optimized startup method to quickly start the virtual machine, ensuring that the virtual machine can run efficiently and stably, realizing the rapid creation of the cloud server; the virtual machine optimization module identifies and reclaims idle resources in the virtual machine instance through real-time monitoring and analysis, optimizes the resource configuration of the virtual machine, and at the same time pre-allocates resources to meet future creation requirements, improving resource utilization efficiency, further shortening the creation time of the new cloud server, and achieving the creation of the cloud server in seconds.

[0143] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. What is described in the above embodiments and the specification only illustrates the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention will have various changes and improvements, and all these changes and improvements fall within the scope of the present invention claimed. The scope of the present invention claimed is defined by the appended claims and their equivalents.

Claims

1. A method for optimizing the implementation of KVM virtualization for creating cloud servers in seconds, characterized in that, It includes: Parsing the received cloud server creation request, and matching the corresponding virtual machine template from a pre-built template library; Building a virtual machine instance based on the virtual machine template; Combining the real-time status of the resource pool, allocating corresponding resources to the virtual machine instance, and starting the virtual machine, where the resource pool pre-allocates resources through a preset resource allocation model and supports elastic scaling; Optimizing the started virtual machine by recycling the idle resources in the virtual machine instance to achieve the second-level creation of the cloud server.

2. The method for optimizing the implementation of KVM virtualization for creating cloud servers within seconds according to claim 1, wherein The step of parsing the received cloud server creation request and matching the corresponding virtual machine template from a pre-built template library includes: According to the received cloud server creation request, parsing out the creation task requirement parameters, where the creation task requirement parameters include task type, resource configuration parameters, and performance requirements; Generating multiple image templates based on a preset task type to obtain a template library; Matching in the template library according to the creation task requirement parameters to obtain the corresponding virtual machine template.

3. The method for optimizing the implementation of KVM virtualization for creating cloud servers within seconds according to claim 2, wherein The step of generating multiple image templates based on a preset task type to obtain a template library includes: According to a preset task type, analyzing the task requirements for each task type and building the corresponding basic template; Based on the basic template, generating the corresponding first image template through a configuration management tool; When there is no corresponding matching basic template for the task type, building the corresponding second image template; Combining the first image template and the second image template to obtain a template library.

4. The method for optimizing the implementation of KVM virtualization for creating a cloud server in seconds according to claim 2, characterized in that, The step of matching in the template library according to the creation task requirement parameters to obtain the corresponding virtual machine template includes: According to the creation task requirement parameters, dynamically allocating the weights of multiple parameters through a preset weight adjustment model to obtain the corresponding parameter weights; Performing weighted calculation on the creation task requirement parameters and the corresponding parameter weights to obtain the comprehensive task requirements; Matching in the template library according to the task type to obtain the first target template set; Filtering out the templates that meet the comprehensive task requirements from the first target template set to obtain the second target template set; Selecting the template with the highest utilization rate from the second target template set to obtain the corresponding virtual machine template.

5. The method for optimizing the implementation of KVM virtualization for creating cloud servers in seconds according to claim 1, characterized in that, Building a virtual machine instance based on the virtual machine template includes: Based on the virtual machine template, loading the pre-generated image template memory snapshot from the memory pool to generate the initial state of the virtual machine; On the basis of the initial state of the virtual machine, creating a read-only parent disk and generating a writable differential disk to build a virtual machine instance.

6. The method for optimizing the implementation of KVM virtualization for creating cloud servers within seconds according to claim 1, wherein The step of combining the real-time status of the resource pool, allocating corresponding resources to the virtual machine instance, and starting the virtual machine, where the resource pool pre-allocates resources through a preset resource allocation model and supports elastic scaling, includes: Analyzing the resource requirements through a preset resource allocation model according to the real-time status of the resource pool combined with the creation task requirements to obtain the resource demand; Dividing the resources corresponding to the resource demand into an elastic resource pool; Allocating corresponding resources from the elastic resource pool to the virtual machine instance; Analyze the resource allocation situation according to the real-time status of the resource pool, perform elastic scaling on the resource pool, and obtain a real-time resource pool; Start the virtual machine by loading the lightweight KVM kernel and skipping the self-check stage.

7. The method for optimizing the implementation of KVM virtualization for creating cloud servers within seconds according to claim 6, wherein The step of analyzing the resource allocation situation according to the real-time status of the resource pool, performing elastic scaling on the resource pool, and obtaining a real-time resource pool includes: Analyze the resource utilization rate of the resource pool according to the real-time status of the resource pool to obtain the resource utilization rate; When the resource utilization rate is greater than a preset first threshold, expand the resource pool by adding virtualized resources; When the resource utilization rate is less than a preset second threshold, shrink the resource pool by reclaiming idle resources; After performing the expansion or contraction operation on the resource pool, update the status of the resource pool to obtain a real-time resource pool.

8. The method for optimizing the implementation of KVM virtualization for creating cloud servers in seconds according to claim 1, wherein Optimize the started virtual machine by reclaiming the idle resources in the virtual machine instance to achieve the second-level creation of cloud servers, including: Perform real-time monitoring on the started virtual machine instance, identify the resources with a resource utilization rate less than a preset third threshold and a duration exceeding a preset time period to obtain idle resources; Unbind the idle resources from the virtual machine instance and release them back to the elastic resource pool; Optimize the started virtual machine according to the real-time status of the resource pool to achieve the second-level creation of cloud servers.

9. The method for optimizing the implementation of KVM virtualization for creating cloud servers within seconds according to claim 8, characterized in that, The step of optimizing the started virtual machine according to the real-time status of the resource pool to achieve the second-level creation of cloud servers includes: Update the resource configuration parameters of the virtual machine instance according to the status of the reclaimed resources to obtain an optimized virtual machine instance; According to the real-time status of the resource pool, pre-allocate resources to the elastic resource pool to obtain pre-allocated resources; When a new virtual machine creation request arrives, directly call the pre-allocated resources from the elastic resource pool and combine them with the optimized configuration parameters to achieve the second-level creation of cloud servers.

10. A KVM virtualization optimization implementation system for creating cloud servers in seconds, which is used to implement the KVM virtualization optimization implementation method for creating cloud servers in seconds as described in any one of claims 1 to 9, characterized in that, It includes: A template matching module that parses the received cloud server creation request and matches the corresponding virtual machine template from a pre-built template library; A virtual machine instance creation module that constructs a virtual machine instance based on the virtual machine template; A virtual machine startup module that allocates corresponding resources to the virtual machine instance in combination with the real-time status of the resource pool and starts the virtual machine, where the resource pool pre-allocates resources through a preset resource allocation model and supports elastic scaling; A virtual machine optimization module that optimizes the started virtual machine by reclaiming the idle resources in the virtual machine instance to achieve the second-level creation of cloud servers.

Citation Information

Patent Citations

  • Rapid deployment system under multi-dummy machine environment

    CN101216777A

  • Virtual machine management method and virtual machine management platform

    CN103019802A

  • Method and device for constructing domain-oriented virtual machine template library

    CN106897112A

  • Cloud desktop deployment method and device

    CN117435261A