Automatic deployment method and device of test cloud, equipment and medium

By using KVM virtualization technology and the Fabric framework for automated deployment, the problems of low deployment efficiency and high labor costs in traditional test cloud are solved, achieving efficient and reliable test cloud environment management and meeting the needs of agile testing.

CN120896844APending Publication Date: 2025-11-04PING AN TECH (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511186654.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-22
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

Traditional test cloud deployments in fields such as healthcare and finance suffer from low deployment efficiency, high labor costs, and difficulty in ensuring environmental consistency.

Method used

By employing KVM virtualization technology and the Fabric framework, KVM cloud hosts are created in batches through automated configuration scripts and network configuration. Combined with NAS intelligent mounting and environment health checks, environment rollback and automated destruction are achieved using disk image snapshots, reducing manual intervention.

Benefits of technology

It enables minute-level elastic scaling of KVM cloud servers and NAS services, meeting the needs of high-frequency, multi-version agile testing, reducing labor costs, and improving environment consistency and deployment efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120896844A_ABST
    Figure CN120896844A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of cloud, the scheme can be applied to the fields of finance and medical treatment, and the invention provides an automatic deployment method, device, equipment and medium of a test cloud, and the method comprises the steps: after creating a preset number of KVM cloud hosts, executing network automatic configuration on each KVM cloud host to obtain a configured KVM cloud host; performing NAS intelligent mounting operation on each configured KVM cloud host to obtain a mounted KVM cloud host; performing environmental health examination on all the mounted KVM cloud hosts to obtain an environmental health examination result; if the environmental health examination result is passed, obtaining temporary snapshots of different test stages; and after the test task is completed, closing and deleting all the mounted KVM cloud hosts, and synchronously triggering an NAS storage cleaning task so as to position and delete corresponding NAS data based on the test task identifier. According to the invention, high-frequency and multi-version agile test requirements can be met, and the labor cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of cloud technology, and can be applied to the fields of finance and medicine, and particularly relates to an automatic deployment method, device and equipment for a test cloud and a medium. BACKGROUND

[0002] When a traditional test cloud is deployed in the fields of medicine and finance, which have strict requirements for environmental stability and security, and a full manual operation mode is used to build an environment including 100 cloud hosts + NAS storage, the following inefficient processes need to be experienced:

[0003] First step: KVM cloud host initialization (time-consuming 2.5 hours): an operation and maintenance personnel creates a virtual machine through a graphical interface one by one, and manually configures basic parameters such as CPU, memory and disk for each cloud host; at the same time, network-related configurations are performed, including specifying a bridge network card, recording the MAC and IP correspondence one by one, and additionally manually setting a network isolation strategy in line with data security specifications in the medical field; after the creation of 100 cloud hosts is completed, a host list document including compliance information needs to be manually generated.

[0004] Second step: NAS storage configuration (time-consuming 3 hours): repeated operations such as installing a tool package, creating a mounting point and configuring mounting information need to be performed on each cloud host, and the server bandwidth needs to be manually checked, and connection timeout problems are prone to occur when more than 50 servers are mounted at the same time.

[0005] Third step: environment verification (time-consuming 1.5 hours): a test personnel logs in to the cloud host one by one to perform verification operations, including checking the mounting state, testing the write performance and checking the error log.

[0006] Fourth step: environment destruction (time-consuming 45 minutes): manually close all virtual machines, delete related files and storage directories. In the financial field, it is necessary to confirm that the data to be deleted has been cleaned up one by one, and there is no transaction mechanism in the whole process, and there is a risk of mistakenly deleting key data.

[0007] The average time consumption of the present application is 7 hours and 45 minutes, the NAS mounting failure rate is about 15%, the environment consistency cannot be guaranteed, and the whole process relies on manual operation, which is high in labor cost. SUMMARY

[0008] The present application provides a test cloud automatic deployment method, device, equipment and medium, which aims to solve the problems of low deployment efficiency and high labor cost in the existing test cloud deployment.

[0009] In a first aspect, the present application provides a test cloud automatic deployment method, which comprises:

[0010] After a preset number of KVM cloud hosts are created in batches through a virtualization management interface, network automatic configuration is performed on each KVM cloud host based on an automatic configuration script, and a configured KVM cloud host is obtained;

[0011] NAS intelligent mounting is performed on each configured KVM cloud host based on a Fabric framework, and a mounted KVM cloud host is obtained;

[0012] Environment health check is performed on all mounted KVM cloud hosts, and an environment health check result is obtained;

[0013] If the environment health check result is passed, temporary snapshots of different test stages are obtained based on a disk image, and rollback is performed to a target environment state based on the obtained temporary snapshots;

[0014] After a test task is completed, a destruction module is called to batch close and delete all mounted KVM cloud hosts, a NAS storage cleaning task is triggered synchronously, and corresponding NAS data is located and deleted based on a test task identifier.

[0015] In a second aspect, an embodiment of the present application further provides an automatic deployment device for a test cloud, and the device comprises:

[0016] A creation configuration unit is configured to create a preset number of KVM cloud hosts in batches through a virtualization management interface, perform network automatic configuration on each KVM cloud host based on an automatic configuration script, and obtain a configured KVM cloud host;

[0017] A mounting unit is configured to perform NAS intelligent mounting on each configured KVM cloud host based on a Fabric framework, and obtain a mounted KVM cloud host;

[0018] An environment health check unit is configured to perform environment health check on all mounted KVM cloud hosts, and obtain an environment health check result;

[0019] An obtaining unit is configured to, if the environment health check result is passed, obtain temporary snapshots of different test stages based on a disk image, and perform rollback to a target environment state based on the obtained temporary snapshots;

[0020] A deletion unit is configured to, after a test task is completed, call a destruction module to batch close and delete all mounted KVM cloud hosts, trigger a NAS storage cleaning task synchronously, and locate and delete corresponding NAS data based on a test task identifier.

[0021] In a third aspect, an embodiment of the present application further provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the method in the first aspect when executing the computer program.

[0022] In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium, which stores a computer program, the computer program comprising program instructions, and the program instructions, when executed by a processor, can implement the method of the first aspect.

[0023] The present application provides a test cloud automation deployment method, device, equipment and medium, the method comprises: after creating a preset number of KVM cloud hosts in batches through a virtualization management interface, performing network automation configuration on each KVM cloud host based on an automation configuration script to obtain a configured KVM cloud host; performing NAS intelligent mounting operation on each configured KVM cloud host based on Fabric framework to obtain a mounted KVM cloud host; performing environment health check on all mounted KVM cloud hosts to obtain an environment health check result; if the environment health check result is passed, obtaining temporary snapshots of different test stages based on disk images, and rolling back to a target environment state based on the obtained temporary snapshots; after the test task is completed, calling a destruction module to batch close and delete all mounted KVM cloud hosts, synchronously triggering NAS storage cleaning tasks, and deleting corresponding NAS data based on test task identification. The technical stack composed of KVM virtualization technology, automation configuration script and Fabric framework realizes minute-level elastic scaling of KVM cloud hosts and NAS services, meets the agile testing requirements of high frequency and multiple versions, provides high-reliability infrastructure guarantee for cloud platform function verification, and the automation deployment scheme can effectively reduce manual intervention and significantly reduce labor costs. BRIEF DESCRIPTION OF DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0025] Figure 1 The flowchart of the test cloud automation deployment method provided by the embodiment of the present application is shown.

[0026] Figure 2 The schematic block diagram of the test cloud automation deployment device provided by the embodiment of the present application is shown.

[0027] Figure 3 The schematic block diagram of the electronic device provided by the embodiment of the present application is shown.

[0028] Figure 4 The application environment schematic diagram of the test cloud automation deployment method provided by the embodiment of the present application is shown. DETAILED DESCRIPTION

[0029] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative effort are within the protection scope of the present application.

[0030] It should be understood that, when used in the specification and the appended claims, the terms "comprise" and "include" indicate the presence of the described features, integers, steps, operations, elements, and / or components, but do not exclude one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0031] It should also be understood that the terms used in the present application specification are only for the purpose of describing particular embodiments and are not intended to limit the present application. As used in the present application specification and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0032] It should be further understood that the term "and / or" used in the present application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. The embodiments of the present application provide an automatic deployment method, device, equipment and medium for testing a cloud. The method is applied to a controller for automatically deploying a testing cloud system. The execution subject of the present application can be a terminal or a server, and the specific execution subject is not limited here. The embodiments of the present application take a server as an execution subject for example, as shown in FIG. 1, a user terminal initiates a deployment instruction containing testing cloud configuration parameters (such as the number of KVM cloud hosts) and sends it to a server, triggering the server to execute an automatic deployment process of the testing cloud. The server can be an independent server, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN), and big data, etc. basic cloud computing services. The present application will be described in detail through specific embodiments. Figure 4

[0033] Figure 1 The flowchart of the automatic deployment method for testing a cloud provided by the embodiments of the present application is shown in FIG. 2. As shown in FIG. 2, the method comprises the following steps S110-S150. Figure 1

[0034] ​​S110, after creating a preset number of KVM cloud hosts in batches through a virtualization management interface, performing network automatic configuration on each KVM cloud host based on an automatic configuration script to obtain a KVM cloud host after configuration.

[0035] In the embodiment, the virtualization management interface (libvirt API) is used as an open-source virtualization management tool interface, supports cross-platform calling, can break through the limitation of graphical interface operation, and can create a preset number of KVM cloud hosts in batches (about 18 minutes). For example, an operator can write a script containing a preset number and hardware specifications, and call the virtualization management interface to initiate a KVM cloud host creation task of 100 KVM cloud hosts at a time, instead of the traditional manual creation mode, thereby greatly shortening the initialization time. After the creation, network automatic configuration is performed on each KVM cloud host based on an automatic configuration script (such as Ansible Playbook) to obtain a KVM cloud host after configuration (about 10 minutes).

[0036] In an embodiment, the creating a preset number of KVM cloud hosts in batches through the virtualization management interface comprises: creating a preset number of initialization KVM cloud hosts in batches through the virtualization management interface; dynamically generating individualized configuration of each initialization KVM cloud host by using a preset configuration template; and automatically injecting a key, a host name and network parameters into the individualized configuration of each initialization KVM cloud host in the creation process of the initialization KVM cloud host by using an initialization tool to obtain a KVM cloud host; wherein all the KVM cloud hosts share one base image file.

[0037] In the embodiment, a preset number of initialization KVM cloud hosts are created in batches through the virtualization management interface; individualized configuration of each initialization KVM cloud host is dynamically generated by using a preset configuration template (such as an XML format configuration template, which contains a standardized file of virtual machine basic configuration information); and a key (such as an SSH key, which is convenient for subsequent passwordless login), a host name and network parameters (IP, gateway, etc.) are automatically injected into the individualized configuration of each initialization KVM cloud host in the creation process of the initialization KVM cloud host by using an initialization tool (such as a cloud-init tool), so that the step of manually configuring network and recording the correspondence between IP and MAC is omitted, and a KVM cloud host with standardization and individualization is obtained; wherein all the KVM cloud hosts share one base image file; specifically, all the KVM cloud hosts share one base image file based on a differential image technology, and each KVM cloud host only records the difference (such as individualized configuration, new data, etc.) between itself and the base image, rather than a complete image.

[0038] Further, before the using the preset configuration template to dynamically generate the individualized configuration of each of the initialized KVM cloud host, the method further comprises: dynamically adapting the basic parameters in the configuration template according to actual test scene requirements or preset rules, so as to complete the individualized configuration of each KVM cloud host without manual intervention.

[0039] In an embodiment, the network automation configuration of each of the KVM cloud hosts based on the automatic configuration script comprises: building a unified bridging network environment for all the KVM cloud hosts; dividing a plurality of the KVM cloud hosts into different VLAN groups; and configuring a firewall rule for each of the KVM cloud hosts to obtain the configured KVM cloud host.

[0040] In this embodiment, a unified bridging network environment is built for all the KVM cloud hosts; according to the test environment or business module requirements, a plurality of the KVM cloud hosts are divided into different VLAN groups; specifically, taking the medical and financial scenes with strict requirements for data security and business isolation as examples, according to the isolation requirements of the test scene (such as "medical image test environment" and "financial transaction simulation environment") or business module, a batch of KVM cloud hosts related to functions and needing to cooperate are classified into the same VLAN. For example, in the medical scene, 20 KVM cloud hosts processing patient diagnosis data test will be uniformly divided into VLAN 10 to ensure the diagnosis data flow within the exclusive network domain because they need to cooperate to complete the image diagnosis process; in the financial scene, 30 KVM cloud hosts responsible for transaction payment test will be classified into VLAN 20 because of the business relevance. The KVM cloud hosts in the same VLAN can communicate normally to meet the cooperative test requirements; the KVM cloud hosts in different VLANs cannot directly communicate because of network isolation, which can avoid the risks of medical patient data leakage across scenes, financial transaction resource contention, etc., and meet the data security specifications in the medical and financial fields, thereby improving the security and compliance of the overall test environment. After the VLAN division, a firewall rule (such as an iptables firewall rule) is configured for each of the KVM cloud hosts to obtain the configured KVM cloud host.

[0041] Further, a firewall rule is configured for each KVM cloud host, and after the KVM cloud host is configured, the method further comprises: automatically generating a hosts file containing all IP address (IP address of the KVM cloud host after configuration) and host name mapping relationship based on an automatic configuration script, and pushing the hosts file to each KVM cloud host after configuration, so as to ensure that the IP address and host name of all KVM cloud hosts after configuration in the network are consistent, avoid errors caused by traditional manual recording, and provide a standardized basis for network cooperation of the KVM cloud host after configuration. At the same time, the network connectivity test task is integrated, and the abnormally configured KVM cloud host is automatically marked, so as to facilitate the operation and maintenance personnel to quickly locate and process problems.

[0042] In S120, NAS intelligent mounting operation is performed on each KVM cloud host after configuration based on the Fabric framework, and a KVM cloud host after mounting is obtained.

[0043] In this embodiment, the NAS intelligent mounting is performed on the KVM cloud host after configuration in batches based on the Fabric framework, batch automation operation is realized, and the mounting efficiency is improved to 15 minutes.

[0044] In one embodiment, the step S120 comprises: selecting the optimal NAS server for each KVM cloud host after configuration according to real-time network delay based on the Fabric framework and the built-in intelligent routing selection algorithm, and completing the NAS intelligent mounting operation.

[0045] In this embodiment, by means of the batch operation capability of the Fabric framework, the real-time network delay between each NAS server and each KVM cloud host after configuration is collected in real time based on the built-in intelligent routing selection algorithm, the optimal NAS server is selected for each KVM cloud host after configuration based on the real-time network delay, and the NAS intelligent mounting operation is completed. This dynamic selection mechanism based on real-time network state can effectively avoid the network congestion problem caused by traditional manual mounting target specification.

[0046] In one embodiment, after the step of selecting the optimal NAS server for each KVM cloud host after configuration according to real-time network delay based on the Fabric framework and the built-in intelligent routing selection algorithm, and completing the NAS intelligent mounting operation, the method further comprises: automatically detecting whether the KVM cloud host after mounting and the corresponding NAS server are compatible by using a mounting script during the NAS intelligent mounting process; and if the KVM cloud host after mounting and the corresponding NAS server are incompatible, switching the current protocol version of the NAS server to another protocol version and reinitiating the NAS intelligent mounting.

[0047] In the embodiment, when the mounted KVM cloud host mounts the NAS server, the mounting may fail due to the fact that the NFS protocol version (v3 or v4) supported by the NAS server does not match the mounted KVM cloud host. The present scheme automatically detects the incompatibility problem by using the mounting script: if it is found that the current protocol version (for example, v4) cannot normally communicate, it will immediately switch to another protocol version (for example, v3) and re-initiate the NAS intelligent mounting without manual intervention. This mechanism solves the inefficient problem of manually checking the protocol version and manually retrying in the traditional manual mounting, and significantly reduces the mounting failure rate caused by protocol incompatibility.

[0048] Further, after completing the mounting, the account information in the AD domain is automatically synchronized by the permission configuration module, so that the access permissions of all the mounted KVM cloud hosts to the NAS server are completely unified.

[0049] S130, performing an environment health check on all the mounted KVM cloud hosts to obtain an environment health check result.

[0050] In the embodiment, the environment health check on all the mounted KVM cloud hosts covers multiple dimensions such as IOPS test, network bandwidth verification, clock synchronization check, access compatibility verification, and the whole process takes about 8 minutes, which is significantly more efficient than the traditional manual login check.

[0051] In an embodiment, step S130 comprises: using a first performance test tool to perform IOPS test on all the NAS servers to obtain a test result; if the test result is passed, using a second performance test tool to verify the network bandwidth between the mounted KVM cloud hosts to obtain a first verification result; if the first verification result is passed, checking the clock synchronization state of the mounted KVM cloud host and the corresponding NAS server to obtain a clock synchronization check result; if the clock synchronization check result is clock synchronization, verifying the access compatibility of the SELinux policy and the NAS server to obtain a second verification result; if the second verification result is passed, determining that the environment health check result is passed.

[0052] In the embodiment, the first performance test tool (such as the fio tool) is used to perform IOPS testing on all the NAS servers to obtain a test result; the first performance test tool is used to perform IOPS testing on all the NAS servers to detect the response capability of the NAS storage (the NAS storage is a storage resource provided by the NAS server) under different loads, and to ensure that the performance requirement of the KVM cloud host for data storage after mounting can be met; if the test result is passed, a second performance test tool (such as the iperf3 tool) is used to verify the network bandwidth between the KVM cloud hosts after mounting to obtain a first verification result; if the first verification result is passed, the clock synchronization state of each KVM cloud host after mounting and the corresponding NAS server is checked to obtain a clock synchronization checking result; if the clock synchronization checking result is clock synchronization, the compatibility of the SELinux policy and the access of the NAS server is verified to obtain a second verification result; if the second verification result is passed, it is determined that the environment health check result is passed.

[0053] Further, if any one of the test result, the first verification result, the clock synchronization checking result, and the second verification result is not passed, the abnormal node is marked in the visual report. Specifically, a visual report is generated in real time according to the environment health check result (including the test result, the first verification result, the clock synchronization checking result, and the second verification result), and the abnormal node and the fault type (such as “the IOPS of the NAS server is lower than the threshold, and the test result is not passed” or “the KVM cloud host after mounting and the NAS server have a clock deviation of 10 seconds, and the clock synchronization checking result is not passed”) are marked, so as to facilitate the operation and maintenance personnel to quickly locate and repair the problem.

[0054] In the embodiment, if the environment health check result is passed, temporary snapshots of different test stages are obtained based on the disk image, and the target environment state is rolled back based on the obtained temporary snapshots.

[0055] In the embodiment, if the environment health check result is passed, temporary snapshots of different test stages are obtained based on the disk image (such as the QCOW2 image), and the target environment state is rolled back based on the obtained temporary snapshots, which takes about 3 minutes. When the problem found in a test stage needs to be reproduced later, the environment does not need to be re-built, and only the snapshot management system needs to be switched to the temporary snapshot of the corresponding test stage, so that the environment state at that time can be quickly recovered, and the problem troubleshooting efficiency is greatly improved.

[0056] In an embodiment, after step S140, it further includes: after the test task is completed, the temporary snapshots generated in each test stage are merged with the base image file based on the disk image, so that the operating system and the associated storage data of each KVM cloud host after mounting are restored to the initial clean state.

[0057] In the embodiment, after the test task is completed, the temporary snapshots generated by each test phase are merged with the base image file based on the disk image, so that the operating system of each mounted KVM cloud host and the associated storage data are restored to the initial clean state; wherein the associated storage data is the test data related to the mounted KVM cloud host in the NAS server.

[0058] S150, after the test task is completed, a destruction module is called to batch close and delete all the mounted KVM cloud hosts, and a NAS storage cleaning task is triggered synchronously to locate and delete the corresponding NAS data based on the test task identifier.

[0059] In the embodiment, a destruction module (such as a Terraform destruction module) is called to batch close and delete all the mounted KVM cloud hosts, and a NAS storage cleaning task is triggered synchronously to locate and delete the corresponding NAS data (i.e. the associated data generated by the mounted KVM cloud host in the NAS server) based on the test task identifier; during the destruction process, audit logs are recorded throughout the process; wherein the audit logs include resource release details and operation timestamps.

[0060] Specifically, each test task generates a unique test task identifier when it is started, and all NAS data (such as files under the mounted directory) related to the task are associated with the test task identifier; when the environment is destroyed, the automated deployment test cloud system automatically locates and deletes the corresponding NAS data based on the test task identifier, ensuring that the resources are completely released, while avoiding the deletion of other task data, solving the "risk of mistaken deletion" and "incomplete cleaning" problems existing in traditional manual deletion.

[0061] In summary, the embodiment of the application realizes the minute-level elastic scaling of KVM cloud hosts and NAS services through the technology stack composed of KVM virtualization technology, automated configuration scripts and Fabric framework, meets the high-frequency and multi-version agile testing requirements, provides high-reliability infrastructure protection for cloud platform function verification, and the automated deployment scheme can effectively reduce manual intervention and significantly reduce labor costs.

[0062] Figure 2 A schematic block diagram of an automated deployment device of a test cloud provided by the embodiment of the application is shown in FIG. 7. Figure 2 As shown in FIG. 7, corresponding to the above-mentioned automated deployment method of a test cloud, the application also provides an automated deployment device of a test cloud, which is configured in a controller of an automated deployment test cloud system. Specifically, please refer to FIG. 7. Figure 2 The automated deployment device 700 of a test cloud includes:

[0063] The creating and configuring unit 701 is configured to, after creating a preset number of KVM cloud hosts in batches through a virtualization management interface, perform network automatic configuration on each of the KVM cloud hosts based on an automatic configuration script to obtain configured KVM cloud hosts.

[0064] The mounting unit 702 is configured to perform NAS intelligent mounting operations on each of the configured KVM cloud hosts based on a Fabric framework to obtain mounted KVM cloud hosts.

[0065] The environment health checking unit 703 is configured to perform environment health checks on all the mounted KVM cloud hosts to obtain environment health check results.

[0066] The obtaining unit 704 is configured to, if the environment health check results are passed, acquire temporary snapshots of different test stages based on a disk image, and roll back to a target environment state based on the acquired temporary snapshots.

[0067] The deleting unit 705 is configured to, after a test task is completed, call a destruction module to batch close and delete all the mounted KVM cloud hosts, synchronously trigger a NAS storage cleaning task, and delete corresponding NAS data based on a test task identifier.

[0068] In some embodiments, the creating and configuring unit 701, when performing the step of creating a preset number of KVM cloud hosts in batches through a virtualization management interface, is specifically configured to:

[0069] create a preset number of initialized KVM cloud hosts in batches through a virtualization management interface, dynamically generate individualized configurations of each of the initialized KVM cloud hosts using a preset configuration template, and automatically inject a key, a host name, and network parameters into the individualized configurations of each of the initialized KVM cloud hosts through an initialization tool during the creation of the initialized KVM cloud hosts to obtain KVM cloud hosts, wherein all the KVM cloud hosts share one base image file.

[0070] In some embodiments, the obtaining unit 704, after performing the step of acquiring temporary snapshots of different test stages based on a disk image to roll back to a target environment state based on the acquired temporary snapshots, is further configured to:

[0071] after a test task is completed, merge temporary snapshots generated by each test stage and the base image file based on a disk image, so that an operating system and associated storage data of each of the mounted KVM cloud hosts are restored to an initial clean state.

[0072] In some embodiments, the creating and configuring unit 701, when performing the step of performing network automatic configuration on each of the KVM cloud hosts based on an automatic configuration script to obtain configured KVM cloud hosts, is specifically configured to:

[0073] build a unified bridging network environment for all the KVM cloud hosts; divide multiple KVM cloud hosts into different VLAN groups; and configure a firewall rule for each KVM cloud host to obtain a configured KVM cloud host.

[0074] In some embodiments, the mounting unit 702, in the step of performing NAS intelligent mounting operation based on the Fabric framework for each configured KVM cloud host to obtain a mounted KVM cloud host, is specifically configured to:

[0075] based on the Fabric framework and the built-in intelligent routing algorithm, select an optimal NAS server for each configured KVM cloud host according to real-time network delay to complete the NAS intelligent mounting operation.

[0076] In some embodiments, after the step of performing NAS intelligent mounting operation based on the Fabric framework and the built-in intelligent routing algorithm, selecting an optimal NAS server for each configured KVM cloud host according to real-time network delay, the mounting unit 702 is further configured to:

[0077] In the NAS intelligent mounting process, the mounting script is used to automatically detect whether the mounted KVM cloud host and the corresponding NAS server are compatible; if the mounted KVM cloud host and the corresponding NAS server are not compatible, the current protocol version of the NAS server is switched to another protocol version and the NAS intelligent mounting is reinitiated.

[0078] In some embodiments, the environment health check unit 703, in the step of performing environment health check on all the mounted KVM cloud hosts to obtain an environment health check result, is specifically configured to:

[0079] perform IOPS test on all the NAS servers using a first performance test tool to obtain a test result; if the test result is passed, verify the network bandwidth between each mounted KVM cloud host using a second performance test tool to obtain a first verification result; if the first verification result is passed, check the clock synchronization state of each mounted KVM cloud host and the corresponding NAS server to obtain a clock synchronization check result; if the clock synchronization check result is clock synchronization, verify the access compatibility of the SELinux policy and the NAS server to obtain a second verification result; and if the second verification result is passed, determine that the environment health check result is passed.

[0080] It should be noted that the specific implementation process of the test cloud automation deployment device and each unit can be clearly understood by those skilled in the art, and can refer to the corresponding description in the foregoing method embodiment. For the convenience and brevity of description, it will not be repeated here.

[0081] The test cloud automation deployment device can be implemented in the form of a computer program, which can run on an electronic device as shown in the figure. Figure 3

[0082] Please refer to Figure 3 , Figure 3 is a schematic block diagram of an electronic device provided by an embodiment of the application. The electronic device 800 can be a terminal or a server, wherein the terminal can be an electronic device with communication function.

[0083] Please refer to Figure 3 , the electronic device 800 includes a processor 802, a memory and a network interface 805 connected through a system bus 801, wherein the memory can include a non-volatile storage medium 803 and an internal memory 804.

[0084] The non-volatile storage medium 803 can store an operating system 8031 and a computer program 8032. The computer program 8032 includes program instructions, which when executed, can cause the processor 802 to perform a test cloud automation deployment method.

[0085] The processor 802 is configured to provide computing and control capabilities to support the operation of the entire electronic device 800.

[0086] The internal memory 804 provides an environment for the running of the computer program 8032 in the non-volatile storage medium 803, which when executed by the processor 802, can cause the processor 802 to perform a test cloud automation deployment method.

[0087] The network interface 805 is configured to perform network communication with other devices. Those skilled in the art can understand that Figure 3 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the application, and does not constitute a limitation on the electronic device 800 to which the scheme of the application is applied. The specific electronic device 800 can include more or less components than those shown in the figure, or combine certain components, or have a different component arrangement.

[0088] The processor 802 is configured to run the computer program 8032 stored in the memory to implement the following steps:

[0089] ​After a preset number of KVM cloud hosts are created in batches through a virtualization management interface, network automation configuration is performed on each KVM cloud host based on an automation configuration script to obtain a configured KVM cloud host; NAS intelligent mounting is performed on each configured KVM cloud host based on a Fabric framework to obtain a mounted KVM cloud host; environment health check is performed on all mounted KVM cloud hosts to obtain an environment health check result; if the environment health check result is passed, temporary snapshots of different test stages are obtained based on a disk image, and rollback is performed to a target environment state based on the obtained temporary snapshots; after a test task is completed, a destruction module is called to batch close and delete all mounted KVM cloud hosts, a NAS storage cleaning task is triggered synchronously, and corresponding NAS data is located and deleted based on a test task identifier.

[0090] In some embodiments, the processor 802, when implementing the step of creating a preset number of KVM cloud hosts in batches through a virtualization management interface, specifically implements the following steps:

[0091] A preset number of initialization KVM cloud hosts are created in batches through a virtualization management interface; individualized configurations of each initialization KVM cloud host are dynamically generated using a preset configuration template; keys, host names and network parameters are automatically injected into the individualized configurations of each initialization KVM cloud host during the creation of the initialization KVM cloud host through an initialization tool to obtain KVM cloud hosts; wherein all KVM cloud hosts share one base image file.

[0092] In some embodiments, after the processor 802 implements the step of obtaining temporary snapshots of different test stages based on a disk image, and rolling back to a target environment state based on the obtained temporary snapshots, it further implements the following steps:

[0093] After a test task is completed, the temporary snapshots generated by each test stage are merged with the base image file based on a disk image, so that the operating system and associated storage data of each mounted KVM cloud host are restored to an initial clean state.

[0094] In some embodiments, the processor 802, when implementing the step of performing network automation configuration on each KVM cloud host based on an automation configuration script to obtain a configured KVM cloud host, specifically implements the following steps:

[0095] A unified bridging network environment is built for all KVM cloud hosts; multiple KVM cloud hosts are divided into different VLAN groups; a firewall rule is configured for each KVM cloud host to obtain a configured KVM cloud host.

[0096] In some embodiments, the processor 802, when implementing the NAS intelligent mounting operation on each of the configured KVM cloud host based on the Fabric framework, obtains a mounted KVM cloud host, implements the following steps:

[0097] Based on the Fabric framework and the built-in intelligent routing algorithm, the optimal NAS server is selected for each of the configured KVM cloud host according to real-time network delay, and the NAS intelligent mounting operation is completed.

[0098] In some embodiments, after the processor 802 implements the step of selecting the optimal NAS server for each of the configured KVM cloud host according to real-time network delay based on the Fabric framework and the built-in intelligent routing algorithm, and completes the NAS intelligent mounting operation, the following steps are further implemented:

[0099] In the NAS intelligent mounting process, the mounting script is used to automatically detect whether the mounted KVM cloud host and the corresponding NAS server are compatible; if the mounted KVM cloud host and the corresponding NAS server are not compatible, the current protocol version of the NAS server is switched to another protocol version and the NAS intelligent mounting is reinitiated.

[0100] In some embodiments, when the processor 802 implements the step of performing an environment health check on all of the mounted KVM cloud host, and obtains an environment health check result, the following steps are implemented:

[0101] The first performance test tool is used to perform IOPS testing on all of the NAS servers, and a test result is obtained; if the test result is passed, the second performance test tool is used to verify the network bandwidth between each of the mounted KVM cloud host, and a first verification result is obtained; if the first verification result is passed, the clock synchronization state of each of the mounted KVM cloud host and the corresponding NAS server is checked, and a clock synchronization check result is obtained; if the clock synchronization check result is clock synchronization, the access compatibility of the SELinux policy and the NAS server is verified, and a second verification result is obtained; if the second verification result is passed, it is determined that the environment health check result is passed.

[0102] It should be appreciated that in the embodiments of the present application, the processor 802 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0103] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiments can be completed by instructing related hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer readable storage medium. The program instructions are executed by at least one processor in the computer system to realize the process steps of the above-mentioned embodiments.

[0104] Therefore, the present application also provides a storage medium. The storage medium can be a computer readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. The program instructions are executed by a processor to make the processor execute the following steps:

[0105] After a preset number of KVM cloud hosts are created in batches through a virtualization management interface, network automation configuration is performed on each of the KVM cloud hosts based on an automatic configuration script to obtain configured KVM cloud hosts; NAS intelligent mounting operations are performed on each of the configured KVM cloud hosts based on a Fabric framework to obtain mounted KVM cloud hosts; environment health checks are performed on all the mounted KVM cloud hosts to obtain environment health check results; if the environment health check results are passed, temporary snapshots of different test stages are obtained based on disk images, and rollback is performed to a target environment state based on the obtained temporary snapshots; after the test task is completed, a destruction module is called to batch close and delete all the mounted KVM cloud hosts, and a NAS storage cleaning task is triggered synchronously to locate and delete corresponding NAS data based on a test task identifier.

[0106] In an embodiment, when the processor executes the program instructions to realize the step of creating a preset number of KVM cloud hosts in batches through a virtualization management interface, the processor specifically realizes the following steps:

[0107] A preset number of initialization KVM cloud hosts are created in batches through a virtualization management interface; personalized configurations of each of the initialization KVM cloud hosts are dynamically generated using a preset configuration template; keys, host names and network parameters are automatically injected into the personalized configurations of each of the initialization KVM cloud hosts during the creation of the initialization KVM cloud hosts through an initialization tool, to obtain KVM cloud hosts; wherein all the KVM cloud hosts share one base image file.

[0108] In an embodiment, the processor, in executing the program instructions to implement the step of obtaining temporary snapshots of different test stages based on a disk image, further implements the following steps after the step of rolling back to a target environment state based on the obtained temporary snapshots:

[0109] After completion of the test task, the temporary snapshots generated by each test stage are merged with the base image file based on the disk image, so that the operating system and associated storage data of each mounted KVM cloud host are restored to the initial clean state.

[0110] In an embodiment, the processor, in executing the program instructions to implement the step of performing network automatic configuration on each of the KVM cloud hosts based on an automatic configuration script to obtain configured KVM cloud hosts, further implements the following steps:

[0111] A unified bridging network environment is built for all the KVM cloud hosts; a plurality of the KVM cloud hosts are divided into different VLAN groups; and a firewall rule is configured for each of the KVM cloud hosts to obtain configured KVM cloud hosts.

[0112] In an embodiment, the processor, in executing the program instructions to implement the step of performing NAS intelligent mounting operation on each of the configured KVM cloud hosts based on a Fabric framework to obtain mounted KVM cloud hosts, further implements the following steps:

[0113] Based on the Fabric framework and the built-in intelligent routing algorithm, the optimal NAS server is selected for each of the configured KVM cloud hosts according to real-time network delay to complete the NAS intelligent mounting operation.

[0114] In an embodiment, the processor, in executing the program instructions to implement the step of performing NAS intelligent mounting operation on each of the configured KVM cloud hosts based on a Fabric framework and a built-in intelligent routing algorithm according to real-time network delay to select the optimal NAS server for each of the configured KVM cloud hosts, further implements the following steps:

[0115] In the NAS intelligent mounting process, a mounting script is used to automatically detect whether the mounted KVM cloud host and the corresponding NAS server are compatible; if the mounted KVM cloud host and the corresponding NAS server are not compatible, the current protocol version of the NAS server is switched to another protocol version and the NAS intelligent mounting is reinitiated.

[0116] In an embodiment, when the processor executes the program instructions to implement the environment health check on all the mounted KVM cloud hosts to obtain the environment health check result, the processor implements the following steps:

[0117] The first performance test tool is used to perform IOPS testing on all the NAS servers to obtain a testing result; if the testing result is passed, the second performance test tool is used to verify the network bandwidth between the mounted KVM cloud hosts to obtain a first verification result; if the first verification result is passed, the clock synchronization state of the mounted KVM cloud host and the corresponding NAS server is checked to obtain a clock synchronization check result; if the clock synchronization check result is clock synchronization, the SELinux policy and the access compatibility of the NAS server are verified to obtain a second verification result; if the second verification result is passed, the environment health check result is determined to be passed.

[0118] The storage medium can be a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, and various computer readable storage media that can store program codes.

[0119] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been described in general terms in the above description. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0120] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and actual implementation can have another division manner. For example, a plurality of units or components can be combined or integrated into another system, or some features can be omitted or not implemented.

[0121] The steps in the method of the embodiments of the present application can be adjusted in sequence, combined and deleted according to actual needs. The units in the device of the embodiments of the present application can be combined, divided and deleted according to actual needs. In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically independently, or two or more units can be integrated in one unit.

[0122] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a storage medium. Based on such understanding, the technical solutions of the present application essentially or say the part that contributes to the prior art, or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing an electronic device (which can be a personal computer, a terminal or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application.

[0123] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. An automated deployment method for a test cloud, characterized in that, The method includes: After creating a preset number of KVM cloud hosts in batches through the virtualization management interface, network automation configuration is performed on each KVM cloud host based on the automation configuration script to obtain the configured KVM cloud hosts; Based on the Fabric framework, a NAS intelligent mounting operation is performed on each configured KVM cloud host to obtain the mounted KVM cloud host. Perform an environment health check on all the mounted KVM cloud hosts and obtain the environment health check results; If the environmental health check result is passed, temporary snapshots of different test stages are obtained based on the disk image, and the system is rolled back to the target environment state based on the obtained temporary snapshots. After the test task is completed, the destruction module is invoked to shut down and delete all the mounted KVM cloud hosts in batches, and a NAS storage cleanup task is triggered simultaneously to locate and delete the corresponding NAS data based on the test task identifier.

2. The automated deployment method for the test cloud according to claim 1, characterized in that, The process of creating a preset number of KVM cloud hosts in batches through a virtualization management interface includes: Create a preset number of initial KVM cloud hosts in batches through the virtualization management interface; The personalized configuration for each of the initial KVM cloud hosts is dynamically generated using a pre-set configuration template. During the initialization process of creating the KVM cloud host, the initialization tool automatically injects the key, hostname, and network parameters into the personalized configuration of each KVM cloud host to obtain the KVM cloud host; wherein, all the KVM cloud hosts share a base image file.

3. The automated deployment method for the test cloud according to claim 2, characterized in that, The process of obtaining temporary snapshots of different testing phases based on disk images, and then rolling back to the target environment state based on the obtained temporary snapshots, further includes: After the test task is completed, the temporary snapshots generated in each test stage are merged with the base image file based on the disk image, so that the operating system and associated storage data of each mounted KVM cloud host are restored to the initial clean state.

4. The automated deployment method for the test cloud according to claim 1, characterized in that, The process of performing automated network configuration on each KVM cloud host based on an automated configuration script to obtain the configured KVM cloud host includes: Establish a unified bridged network environment for all the aforementioned KVM cloud hosts; Divide the multiple KVM cloud hosts into different VLAN groups; Configure firewall rules for each of the KVM cloud hosts to obtain the configured KVM cloud hosts.

5. The automated deployment method for the test cloud according to claim 1, characterized in that, The process of performing NAS intelligent mounting operations on each configured KVM cloud host based on the Fabric framework to obtain the mounted KVM cloud host includes: Based on the Fabric framework and its built-in intelligent routing algorithm, the system selects the optimal NAS server for each configured KVM cloud host according to the real-time network latency, thus completing the intelligent NAS mounting operation.

6. The automated deployment method for the test cloud according to claim 5, characterized in that, The Fabric framework and its built-in intelligent routing algorithm select the optimal NAS server for each configured KVM cloud host based on real-time network latency. After completing the intelligent NAS mounting operation, the system also includes: During the NAS intelligent mounting process, the mounting script automatically detects whether the mounted KVM cloud host is compatible with the corresponding NAS server; If the mounted KVM cloud host is incompatible with the corresponding NAS server, the current protocol version of the NAS server will be switched to another protocol version and the NAS smart mounting will be re-initiated.

7. The automated deployment method for the test cloud according to claim 1, characterized in that, The process of performing an environment health check on all mounted KVM cloud hosts to obtain the environment health check results includes: The IOPS of all the NAS servers were tested using the first performance testing tool, and the test results were obtained. If the test result is passed, the network bandwidth between each mounted KVM cloud host is verified by the second performance testing tool to obtain the first verification result; If the first verification result is passed, then check the clock synchronization status between each mounted KVM cloud host and the corresponding NAS server to obtain the clock synchronization check result. If the clock synchronization check result is clock synchronization, then verify the access compatibility between the SELinux policy and the NAS server to obtain a second verification result; If the second verification result is passed, then the environmental health check result is determined to be passed.

8. An automated deployment device for a test cloud, characterized in that, The device includes: A configuration unit is created to batch create a preset number of KVM cloud hosts through the virtualization management interface, and then perform network automated configuration on each KVM cloud host based on the automated configuration script to obtain the configured KVM cloud hosts. The mounting unit is used to perform NAS intelligent mounting operations on each configured KVM cloud host based on the Fabric framework to obtain the mounted KVM cloud host. The environment health check unit is used to perform an environment health check on all the mounted KVM cloud hosts and obtain the environment health check results. The acquisition unit is used to acquire temporary snapshots of different test stages based on the disk image if the environmental health check result is passed, so as to roll back to the target environment state based on the acquired temporary snapshots. The deletion unit is used to call the destruction module to batch shut down and delete all the mounted KVM cloud hosts after the test task is completed, and simultaneously trigger the NAS storage cleanup task to locate and delete the corresponding NAS data based on the test task identifier.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the automated deployment method of the test cloud as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which includes program instructions that, when executed by a processor, cause the processor to perform the automated deployment method of the test cloud as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Virtualization platform stability test method

    CN109634825A

  • Method and system for quickly deploying multi-node Ceph cluster under single-machine KVM virtualization

    CN111258719A

  • OpenStack large-scale cluster deployment test method and system based on KVM virtualization technology

    CN111538561A