Programmable cluster installation method and device based on hyper-converged architecture
By reserving script slots and environment variable configurations in the ISO file, the operating system installation and network connection are automatically completed, and the stability problem of nested cluster installation under the hyper-converged architecture is solved, and integrated automatic deployment from bare metal to cluster environment is realized, which improves the stability and efficiency of installation.
Patent Information
- Application Number
- CN202510932950.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-08
- Publication Date
- 2025-08-05
AI Technical Summary
Under the hyper-converged architecture, the existing technology is in the automation of nested clusters, and the stability of interactive operations during the installation process is low, and character input errors cannot be detected and corrected in a timely manner, resulting in installation failure.
By reserving pre- and post-installation script slots in the ISO file, implanting environment variable configuration files and script files, generating operating system installation images, and recording installation status information on the target virtual machine, automatically completing network connections and cluster joining, adapting to dynamic or static IP allocation, and achieving fully automated deployment.
Improves the installation stability, flexibility and reliability of nested clusters, simplifies configuration processes, significantly improves efficiency and monitorability, and reduces configuration errors.
Smart Images

Figure CN120428983A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and specifically to a programmable cluster installation method and device based on a hyper-converged architecture. Background Art
[0002] With the rapid development of cloud computing, big data, and artificial intelligence technologies, enterprises and organizations are placing higher demands on the elasticity, efficiency, and automation of their IT infrastructure. Hyperconverged architecture, as a highly integrated IT infrastructure solution, combines computing, storage, networking, and virtualization into a unified platform, greatly simplifying data center management and operations, becoming a key enabling technology in modern data centers and edge computing scenarios. Building on this foundation, cluster management technologies orchestrate and schedule resources, providing an efficient operating environment for cloud-native applications and distributed systems. To enhance automated resource management and rapid deployment capabilities, automated cluster installation methods based on hyperconverged architectures are gaining increasing attention in the industry.
[0003] Currently, in the process of automatically building nested clusters under a hyper-converged architecture, existing technologies mainly rely on the following methods and means: when installing the operating system on a virtual machine, the virsh send-key command of libvirt is used to send characters to implement interactive actions during the installation process, such as entering user information and disk partition configuration.
[0004] The time interval for interactive operations is manually set, while the character sending interval of virsh send-key depends on cluster resource usage, resulting in significant uncertainty in the time interval setting. When cluster resource utilization is high, interactions during the operating system installation process may be misplaced or fail, affecting the stability of the automated installation. Furthermore, using only virsh send-key to send characters does not verify input accuracy. If problems occur during the installation process, such as character misplacement or failure to send, they cannot be detected and corrected in a timely manner, resulting in installation failure. Therefore, existing methods suffer from low stability when automating cluster setup. Summary of the Invention
[0005] The present application provides a programmable cluster installation method and device based on a hyper-converged architecture, which improves the stability of automatically building nested clusters.
[0006] In a first aspect of the present application, a programmable cluster installation method based on a hyper-converged architecture is provided, the method comprising: obtaining an original ISO file, wherein a script slot is reserved in the original ISO file, and the script slot comprises a pre-installation script slot and a post-installation script slot; respectively implanting at least one environment variable configuration file and at least one script file into a designated directory of the original ISO file to generate an operating system installation image; based on the operating system installation image and the script slot, installing the operating system on a target virtual machine, and recording installation status information, wherein the installation status information is an installation startup status or an installation completion status; if it is determined that the installation status information is an installation completion status, determining the network environment of the target virtual machine; completing the network connection of the target virtual machine according to the network environment; after the network connection of the target virtual machine is successful, adding the target virtual machine to a nested cluster.
[0007] By adopting this technical solution, pre-installation and post-installation script slots are reserved in the original ISO file, allowing custom scripts to be inserted during the OS installation process, enabling flexible control and customization of the installation process. By embedding the environment variable configuration file and script file into the original ISO file to generate the OS installation image, the required configuration parameters and automation scripts can be integrated with the installation image, achieving consistent and repeatable automated installation. The OS installation image and script slots are used to complete the OS installation on the target VM, and installation status information is recorded. By recording the installation start and completion status, installation progress can be monitored in real time, identifying key milestones during the installation process and providing decision-making support for subsequent automated deployment. After installation is complete, network connectivity is automatically configured based on the target VM's network environment. This accommodates both dynamic and static IP allocation scenarios, improving network configuration flexibility and adaptability, and ensuring that the VM can communicate properly with the network. Finally, the target VM, with the configured network, is automatically added to a pre-configured nested cluster, achieving fully automated deployment from bare metal to a clustered environment, significantly simplifying the cluster setup process and improving efficiency and reliability. By reserving script slots, introducing dynamic environment variable configuration, automatically detecting the network environment, recording status information in real time, and integrating the operating system installation and cluster configuration processes, this solution achieves integrated automatic deployment, from operating system installation to nested cluster setup. This solution avoids the problems of misplaced character input encountered in traditional methods, significantly improving installation stability, reliability, flexibility, and monitorability, while also reducing configuration errors and significantly increasing the efficiency and stability of nested cluster setup.
[0008] Optionally, based on the operating system installation image and the script slot, the operating system installation is completed on the target virtual machine, and the installation status information is recorded, specifically including: executing a preset pre-installation script through the pre-installation script slot, and configuring the operating system installation parameters according to the variables defined in the environment variable configuration file; based on the operating system installation parameters, starting to install the operating system on the target virtual machine, and writing the installation startup status of the operating system to a preset log file through the pre-installation script; executing a preset post-installation script through the post-installation script slot, completing the installation of the operating system on the target virtual machine, and writing the installation completion status to the preset log file.
[0009] By implementing the above technical solution, a pre-installation script is executed in the pre-installation script slot, allowing the operating system installation parameters to be dynamically configured based on the variables defined in the environment variable configuration file. This parameterized configuration approach improves installation flexibility, adapts to different environments and requirements, and reduces the workload of manual configuration. The operating system is installed on the target virtual machine based on the configured installation parameters, and the pre-installation script writes the installation startup status to a pre-set log file. By recording the installation startup status, installation progress can be monitored in real time, allowing installation problems to be quickly identified and providing a visual monitoring tool for subsequent automated deployment. After the operating system installation is complete, the pre-installation script is executed in the post-installation script slot. Simultaneously, the installation completion status is written to the pre-set log file, indicating the successful completion of the operating system installation. The automated execution of the post-installation script significantly reduces manual configuration workload, improves system configuration standardization, and ensures consistency across all virtual machine nodes. The installation status log provides data support for troubleshooting and auditing, facilitating management and maintenance. In summary, this technical solution achieves parameterized configuration, real-time monitoring, and automated configuration of the operating system installation process through the automated execution of pre-installation and post-installation scripts, improving the efficiency, reliability, and consistency of system deployment and simplifying the complexity of cluster setup.
[0010] Optionally, the network environment includes using dynamic IP allocation and using static IP allocation, and completing the network connection of the target virtual machine according to the network environment specifically includes: when the network environment uses dynamic IP allocation, executing the network request script through the post-installation script slot to request the DHCP service to allocate an IP address until the IP address is successfully obtained, thereby completing the network connection of the target virtual machine; when the network environment uses static IP allocation, generating a network configuration file according to the network parameters in the environment variable configuration file, restarting the network service of the target virtual machine, completing the static IP configuration, and completing the network connection of the target virtual machine.
[0011] By implementing the above technical solution, two automated configuration options—dynamic IP allocation and static IP allocation—are provided for the target virtual machine's network environment. This solution flexibly adapts to diverse network deployment requirements and improves the adaptability and scalability of network configuration. When the network environment uses dynamic IP allocation, a network request script is executed in the post-installation script slot to automatically request an IP address from a DHCP server. The network request script continuously sends DHCP requests until it successfully obtains an available IP address. This adaptive network configuration approach ensures that the target virtual machine automatically obtains network connectivity in a DHCP environment. When the network environment uses static IP allocation, a network configuration file is automatically generated by reading predefined network parameters from an environment variable configuration file. The target virtual machine's network service is then restarted to implement the static IP configuration. This configuration file-based static IP configuration method enables batch, parameterized network configuration, improving configuration efficiency and accuracy. The above technical solution automatically adapts to the virtual machine's network environment, enabling automatic network connection configuration for both dynamic and static IP addresses. This adaptive network configuration capability significantly improves network configuration efficiency during cluster setup, reduces the risk of network configuration errors, ensures network connectivity between cluster nodes, and provides a foundation for subsequent cluster service deployment and application operation.
[0012] Optionally, executing the network request script through the post-installation script slot to request the DHCP service to allocate an IP address until the IP address is successfully obtained specifically includes: executing the DHCP request script through the post-installation script slot, the DHCP request script including a loop body for requesting the IP address; in the loop body, matching a preset IP address segment in the network configuration of the target virtual machine; if the preset IP address segment is matched, determining that the IP address is successfully obtained; if the preset IP address segment is not matched, terminating the current DHCP client process, and re-initiating the DHCP request until the IP address is successfully obtained.
[0013] By implementing the above technical solution, automated IP address acquisition is achieved in dynamic IP allocation scenarios by executing a DHCP request script via a post-installation script slot. The DHCP request script incorporates built-in looping logic for requesting IP addresses, continuously sending DHCP requests until an available IP address is successfully obtained, thereby ensuring that the target virtual machine can adaptively obtain network connectivity. In each loop, the DHCP request script matches the target virtual machine's network configuration with a preset IP address segment. If a match is successful, the virtual machine has successfully obtained an IP address within the expected network segment, and a network connection is established. If a match fails to find the preset IP address segment, the currently obtained IP address does not meet expectations, possibly due to a DHCP server configuration error or an IP address conflict. In this case, the script automatically terminates the current DHCP client process and re-initiates the DHCP request, entering the next loop until a satisfying IP address is obtained. This looping request mechanism, based on matching the preset IP address segment, effectively prevents IP address allocation errors in DHCP environments and improves network connection reliability. In summary, the above solution enables adaptive network connection configuration in DHCP environments. The target virtual machine can automatically request and obtain an IP address within the expected network segment, establishing a reliable network connection. This adaptive network configuration method greatly simplifies the network configuration process in a dynamic IP environment, improves configuration accuracy and efficiency, and provides reliable protection for network communication between cluster nodes.
[0014] Optionally, the step of respectively implanting at least one environment variable configuration file and at least one script file into the designated directory of the original ISO file to generate an operating system installation image specifically includes: uploading the environment variable configuration file to the env directory of the original ISO file, uploading the pre-installation script file to the pre directory of the original ISO file, and uploading the post-installation script file to the post directory of the original ISO file; and repackaging the original ISO file to generate the operating system installation image, where the operating system installation image is an installation image file used to automatically install the operating system.
[0015] By implementing the above technical solution, by embedding the environment variable configuration file and script file into designated directories of the original ISO file, configuration data and automation scripts can be integrated with the operating system installation image, forming a complete, automated installation and deployment unit. This integration ensures the availability and consistency of configuration data and scripts during the installation process, streamlining the installation and deployment process. The environment variable configuration file centrally stores various configuration parameters and variables. By uploading it to the env directory of the original ISO file, these parameters can be conveniently referenced and used during the installation process, enabling flexible and customized configuration. Pre-installation and post-installation script files are uploaded to the pre and post directories of the original ISO file, respectively, allowing for automated execution of corresponding scripts at different stages of the operating system installation, enabling customized system configuration and optimization. By repackaging the modified original ISO file, an installation image file for automated operating system installation is generated. This customized installation image, integrating the environment variable configuration and automation script, enables one-click, unattended operating system installation and deployment on the target virtual machine. In summary, this solution integrates configuration data and scripts into the operating system installation image, achieving parameterization, automation, and standardization of the installation process. The generated customized installation images can be applied to multiple target virtual machines in batches, achieving large-scale and repeatable operating system deployment, and providing a standardized basic environment for subsequent cluster construction.
[0016] Optionally, after the target virtual machine obtains the network connection and adds the target virtual machine to the nested cluster, the method further includes: creating multiple target virtual machines on the virtualization management platform based on the operating system installation image, and completing the operating system installation and network connection configuration; determining the master virtual machine as the master node of the nested cluster, installing and initializing the cluster management software on the master virtual machine, and generating a cluster configuration file, where the master virtual machine is any one of the multiple target virtual machines; passing the cluster configuration file and the connection information of the master node to other virtual machines through an environment variable configuration file, where the other virtual machines are the target virtual machines other than the master virtual machine among the multiple target virtual machines, so that the other virtual machines can read the environment variable configuration file; and completing the construction of the nested cluster based on the master node and the other nodes.
[0017] By employing the above technical solution, multiple target virtual machines are created in batches on a virtualization management platform based on a customized operating system installation image, and the operating system installation and network connection configuration are automatically completed. This batch virtual machine creation and configuration method significantly improves cluster setup efficiency and reduces repetitive manual operations. One of the multiple target virtual machines is selected as the master node for the nested cluster. The cluster management software is installed and initialized on it, and a cluster configuration file is generated. The master node assumes core responsibilities for cluster control and management. The cluster configuration file defines key information such as the cluster's network topology, node roles, and resource configuration. The cluster configuration file and the master node's connection information are propagated to other virtual machines via an environment variable configuration file. This environment variable-based configuration propagation method ensures consistent cluster configuration across all nodes and simplifies the configuration distribution process. Other virtual machines can obtain the cluster configuration and master node information by reading the environment variable configuration file, preparing to join the cluster. The nested cluster setup process is automatically completed based on the prepared master node and other virtual machines.
[0018] Optionally, the building of the nested cluster is completed based on the master node and the other nodes, specifically including: installing cluster management software on the other virtual machines, and reading the environment variable configuration file to obtain the cluster configuration file and the connection information of the master node, so that the other virtual machines join the nested cluster based on the cluster configuration file and the connection information of the master node and become the working nodes of the nested cluster; assigning tasks to the working nodes through the master node, coordinating the work of the nested cluster, so as to complete the building of the nested cluster.
[0019] By implementing this technical solution, cluster management software is automatically installed on other virtual machines, enabling them to join the cluster. By reading the environment variable configuration file, obtaining the pre-generated cluster configuration file and master node connection information, this ensures consistent cluster configuration across all nodes, streamlining configuration synchronization and distribution. Based on the cluster configuration file and master node information, other virtual machines automatically join the nested cluster and become worker nodes. Worker nodes establish a connection with the master node, registering their identity and resource information, and accepting unified management and scheduling from the master node. As the cluster's control center, the master node is responsible for allocating tasks and resources to worker nodes and coordinating the entire cluster. This solution enables fully automated deployment and configuration, from bare metal to nested clusters. By automating these steps, including batch creation of virtual machines, automated operating system installation and network configuration, cluster configuration distribution, and automatic cluster joining, the cluster setup process is significantly simplified, improving the efficiency and reliability of cluster deployment.
[0020] In a second aspect of the present application, a programmable cluster installation device based on a hyper-converged architecture is provided, which includes an original file acquisition module, an installation image generation module, an operating system installation module, a network connection module, and a cluster construction module, wherein: the original file acquisition module is used to obtain an original ISO file, wherein a script slot is reserved in the original ISO file, and the script slot includes a pre-installation script slot and a post-installation script slot; the installation image generation module is used to implant at least one environment variable configuration file and at least one script file into a specified directory of the original ISO file to generate an operating system installation image; the operating system installation module is used to complete the installation of the operating system on a target virtual machine based on the operating system installation image and the script slot, and record installation status information, wherein the installation status information is an installation startup status or an installation completion status; the network connection module is used to determine the network environment of the target virtual machine if it is determined that the installation status information is an installation completion status; the network connection module is also used to complete the network connection of the target virtual machine based on the network environment; the cluster construction module is used to add the target virtual machine to a nested cluster after the target virtual machine obtains the network connection, thereby completing the construction of the nested cluster.
[0021] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are both used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device performs any of the methods described above.
[0022] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions. When the instructions are executed, any one of the methods described above is executed.
[0023] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. Pre- and post-installation script slots are reserved in the operating system installation image to ensure that key steps in the installation process are completed automatically by scripts rather than relying on dynamic character input. Script execution is automated and predefined, avoiding issues such as character misalignment or input failures. Configuration files are loaded into the script slots, and installation behavior is dynamically adjusted based on the parameters in the configuration files, enhancing the flexibility of the installation process. By combining automatic detection and dynamic configuration, network issues caused by unstable DHCP services are resolved, ensuring stable network access for virtual machines. Status recording and feedback improve the monitorability and maintainability of the installation process, ensuring the stability of automated deployment. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 This is a flowchart of a programmable cluster installation method based on a hyper-converged architecture disclosed in an embodiment of the present application; Figure 2 This is a module diagram of a programmable cluster installation device based on a hyper-converged architecture disclosed in an embodiment of the present application; Figure 3 This is a structural diagram of an electronic device disclosed in an embodiment of the present application.
[0025] Explanation of the accompanying drawings: 201, original file acquisition module; 202, installation image generation module; 203, operating system installation module; 204, network connection module; 205, cluster building module; 300, electronic device; 301, processor; 302, communication bus; 303, user interface; 304, network interface; 305, memory. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0027] In the description of the embodiments of this application, words such as "for example" or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "for example" or "for instance" in the embodiments of this application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "for example" or "for instance" is intended to present the relevant concepts in a concrete manner.
[0028] In the description of the embodiments of the present application, the term "multiple" means two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0029] Before introducing the embodiments of the present application, some terms involved in the embodiments of the present application are first defined and explained.
[0030] Installation image: An installation image is an image file containing operating system installation files, typically in ISO format. Similar to traditional operating system installation discs (such as Windows or Linux installation CDs), an installation image is used to boot a target machine (or virtual machine) to perform operating system installation tasks.
[0031] Script slots: Script slots are predefined executable script placeholders within operating system installation media (such as ISO files). These placeholders are used to dynamically inject and execute user-defined scripts during different stages of the operating system installation (e.g., pre-installation and post-installation). In this application, script slots are used to flexibly extend the operating system installation process and enable automated configuration.
[0032] Nested clusters: Nested clusters are clusters running in a virtualized environment. The "nested" part refers to the fact that virtual machines (VMs) may run within the virtualized environment of a physical server, while cluster software runs within the VMs. A cluster is a group of computers or VMs connected via a network to perform tasks together. In a hyperconverged architecture, a cluster typically consists of multiple VMs, each of which can be considered a "node" within the cluster.
[0033] This application provides a programmable cluster installation method based on a hyper-converged architecture. Figure 1 , Figure 1 This is a flow chart of a method for installing a programmable cluster based on a hyper-converged architecture, provided in an embodiment of the present application. The method is applied to a server, which is a server that executes a programmable cluster installation program based on a hyper-converged architecture. The server can be a single server, a server cluster consisting of multiple servers, or a cloud computing service center. The method includes steps S101 to S106, which are as follows: Step S101: obtaining an original ISO file, wherein script slots are reserved in the original ISO file, and the script slots include a pre-installation script slot and a post-installation script slot.
[0034] In step S101, the server first obtains an original operating system installation ISO file, also known as an original ISO file. This file is typically a standard installation medium obtained from the operating system publisher. This ISO file contains the complete operating system installation files and programs and can be used to boot and install the operating system. The server can obtain this original ISO file in a variety of ways, such as downloading it from an official website, obtaining it from a local file server, or obtaining it from a version control system such as SVN or Git. Regardless of the method used, the server ensures that it obtains a complete and unmodified original ISO file to ensure that the subsequent installation process can proceed normally.
[0035] A special feature of the original ISO file is that it reserves script slots for executing custom scripts at specific times during the installation process. These script slots include pre-installation script slots and post-installation script slots. The pre-installation script slot is located in a specific directory of the ISO file, such as " / run / install / repo / pre / ", and is used to perform some preparatory work before the operating system is installed, such as environment checks, partition adjustments, network configuration, etc. The server places customized shell script files in this directory, and the ISO file automatically executes these scripts when it is booted for installation. The post-installation script slot is usually located in another specific directory of the ISO file, such as " / run / install / repo / post / ", and is used to perform some configuration tasks after the operating system is installed, such as installing additional software packages, modifying system configurations, starting services, etc. The server can also place customized shell script files in this directory, and these scripts will be automatically executed after the installation is complete.
[0036] Step S102: at least one environment variable configuration file and at least one script file are respectively implanted into designated directories of the original ISO file to generate an operating system installation image.
[0037] In step S102, at least one environment variable configuration file and at least one script file are respectively implanted into the designated directories of the original ISO file to generate an operating system installation image, specifically including: uploading the environment variable configuration file to the env directory of the original ISO file, uploading the pre-installation script file to the pre directory of the original ISO file, and uploading the post-installation script file to the post directory of the original ISO file; repackaging the original ISO file to generate an operating system installation image, which is an installation image file used to automatically install the operating system.
[0038] Specifically, the server embeds some customized environment variable configuration files and script files into the original ISO file to achieve automated operating system installation. This process can be regarded as customizing and enhancing the original ISO file to generate a new operating system installation image.
[0039] First, the server determines the required environment variable configuration files and script files. The environment variable configuration files are one or more text files with a ".env" suffix. They are used to set environment variables during the installation process, such as network configuration parameters, disk partitioning schemes, and user information. Environment variables can be referenced in installation scripts for dynamic configuration. Pre-installation and post-installation scripts are shell scripts used to perform custom tasks before and after the operating system installation.
[0040] Next, the server inserts these files into the designated directories of the original ISO file. Typically, the root directory of an ISO file contains a directory called "run," a subdirectory called "install," and a subdirectory called "repo." The server creates three subdirectories within the "repo" directory: "env," "pre," and "post," which store environment variable configuration files, pre-installation scripts, and post-installation scripts, respectively.
[0041] The server uploads the prepared environment variable configuration file to the "env" directory, the pre-installation script file to the "pre" directory, and the post-installation script file to the "post" directory. The upload process can be accomplished by file copying, FTP upload, SCP transfer, and other methods, depending on the server and ISO file environment, which are not limited by this application.
[0042] After the file implantation is complete, the server repackages the original ISO file, merging the newly added directories and files into the ISO file to generate a new operating system installation image. The server can use ISO creation tools such as mkisofs and genisoimage. These tools can be invoked from the command line or through automated scripts to repackage the modified ISO directory structure into an ISO file. This packaged file is the customized operating system installation image, which can be used for automated operating system installation.
[0043] Step S103: Based on the operating system installation image and the script slot, the operating system is installed on the target virtual machine, and installation status information is recorded. The installation status information is an installation start status or an installation completion status.
[0044] In step S103, based on the operating system installation image and the script slot, the operating system installation is completed on the target virtual machine, and the installation status information is recorded, specifically including: executing the preset pre-installation script through the pre-installation script slot, and configuring the operating system installation parameters according to the variables defined in the environment variable configuration file; starting to install the operating system on the target virtual machine based on the operating system installation parameters, and writing the installation startup status of the operating system to the preset log file through the pre-installation script; executing the preset post-installation script through the post-installation script slot, completing the installation of the operating system on the target virtual machine, and writing the installation completion status to the preset log file.
[0045] Specifically, the server uses a customized operating system installation image and pre-configured script slots to automatically complete the operating system installation process on the target virtual machine and record installation status information. First, the server creates a new virtual machine (the target virtual machine) on a virtualization platform (such as VMware or KVM) as the target for the operating system installation. The server can complete the creation and configuration of the virtual machine by calling the virtualization platform's API or using automated tools. When creating the virtual machine, the server specifies the previously generated operating system installation image as the target virtual machine's boot disk.
[0046] When the target virtual machine starts, it automatically boots from the custom installation image and begins the operating system installation process. During the installation process, the target virtual machine automatically loads and executes the scripts and configuration files pre-installed in the installation image, thus achieving automated installation.
[0047] The first script to be executed is the pre-install script, which is automatically loaded and executed through the pre-install script slot. The pre-install script's primary task is to set various operating system installation parameters, such as keyboard layout, time zone, language, partitioning scheme, and network configuration, based on the variables defined in the environment variable configuration file. Variables defined in the environment variable configuration file can be read and referenced by the pre-install script, enabling flexible parameter configuration.
[0048] After the pre-installation script completes execution, the target VM officially begins the operating system installation process based on the configured installation parameters. This process includes disk partitioning, file system formatting, system file copying, and bootloader installation. At the start of the installation, the pre-installation script writes the operating system installation and startup status to a pre-set log file to record the installation progress.
[0049] After the operating system installation is complete, the target virtual machine automatically executes the post-installation script, which is automatically loaded and executed through the post-installation script slot. The post-installation script's primary task is to perform post-installation configuration and cleanup tasks, such as creating user accounts, installing additional software packages, optimizing system settings, and cleaning temporary files. After the post-installation script completes, it writes the operating system installation completion status to a pre-set log file to record the installation results.
[0050] Throughout the installation process, the server can monitor the console output or log files of the target virtual machine to obtain real-time installation status information. For example, when the server detects the "Installation Started" record in the log file, it can confirm that the operating system installation has begun; when the server detects the "Installation Completed" record in the log file, it can confirm that the operating system installation has completed.
[0051] Step S104: If it is determined that the installation status information is in the installation completion state, the network environment of the target virtual machine is determined.
[0052] In step S104, the server continuously monitors the target virtual machine's installation status until it confirms that the operating system installation is complete. This can be achieved by regularly checking the virtual machine's log files, as in step S103. Once the server detects installation completion status information (e.g., a "Installation Completed" entry appears in the log file), it deems the target virtual machine's operating system installation successful and can proceed to the network environment confirmation phase.
[0053] The main purpose of determining the network environment is to assign a suitable IP address to the target virtual machine and ensure that it can communicate with other virtual machines and servers.
[0054] Step S105: Complete the network connection of the target virtual machine according to the network environment.
[0055] In step S105, the network environment includes using dynamic IP allocation and using static IP allocation. According to the network environment, the network connection of the target virtual machine is completed, specifically including: when the network environment uses dynamic IP allocation, executing the network request script through the post-installation script slot to request the DHCP service to allocate an IP address until the IP address is successfully obtained, thereby completing the network connection of the target virtual machine; when the network environment uses static IP allocation, generating a network configuration file according to the network parameters in the environment variable configuration file, restarting the network service of the target virtual machine, completing the static IP configuration, and completing the network connection of the target virtual machine.
[0056] Specifically, the server configures the target virtual machine's network connection based on the pre-defined network environment using automated scripts and configuration files. Specifically, the server first determines whether the current network environment uses dynamic or static IP allocation. This determination can be based on pre-defined environment variables or configuration parameters.
[0057] If the network environment uses dynamic IP allocation, the server executes a pre-written network request script on the target VM. This script is injected into the VM's operating system via a post-installation script slot. The network request script's primary task is to send an IP address request to a DHCP server. DHCP is a protocol that automatically assigns IP addresses to network devices. When the VM boots up, the network request script automatically runs and broadcasts a DHCP discover message, requesting an available IP address from the DHCP server.
[0058] Upon receiving the request, the DHCP server selects an unused IP address from its managed IP address pool and packages it, along with other network configuration parameters (such as the subnet mask, default gateway, and DNS server), into a DHCP offer message, which is then sent to the requesting VM. Upon receiving the DHCP offer message, the network request script extracts the IP address and network configuration parameters and applies them to the VM's network interface, completing the dynamic IP allocation process.
[0059] If the network request script fails to obtain an IP address within a certain period of time, the server will control it to resend the DHCP request until it succeeds. This ensures that the virtual machine can reliably obtain a network connection in a dynamic IP environment.
[0060] Alternatively, if your network environment uses static IP allocation, the server will use a different configuration approach. Static IP allocation requires manually specifying a fixed IP address and network configuration parameters for each virtual machine. The server then reads the virtual machine's corresponding network parameters, such as IP address, subnet mask, default gateway, and DNS server, from a predefined environment variable configuration file.
[0061] The server then enters these network parameters into a network configuration file template to generate a complete network configuration file. The format and content of this configuration file depend on the operating system and network management tools used by the virtual machine. The server then uploads the generated network configuration file to the corresponding location of the virtual machine through an automated script. The server then restarts the virtual machine's network service through remote commands or an agent to make the new network configuration take effect. The virtual machine now has a static IP configuration and fixed network connection parameters.
[0062] In one possible implementation, a network request script is executed through a post-installation script slot to request the DHCP service to allocate an IP address until the IP address is successfully obtained, specifically including: executing a DHCP request script through the post-installation script slot, the DHCP request script including a loop body for requesting an IP address; in the loop body, matching a preset IP address segment in the network configuration of the target virtual machine; if the preset IP address segment is matched, determining that the IP address is successfully obtained; if the preset IP address segment is not matched, terminating the current DHCP client process, and re-initiating a DHCP request until the IP address is successfully obtained.
[0063] Specifically, the server first calls the DHCP request script within the target VM's post-installation script. This script's primary task is to send an IP address request to the DHCP server via the DHCP client program and determine whether the returned IP address meets predefined conditions. The DHCP request script contains a loop that requests an IP address and repeatedly executes the following steps until a matching IP address is successfully obtained: Use the DHCP client program to send an IP address request to the DHCP server.
[0064] Wait for the DHCP server to return the assigned IP address and other network parameters.
[0065] The newly assigned IP address is searched for in the target VM's network configuration and matched against the pre-defined IP address range. If the match is successful, a matching IP address has been obtained, the loop terminates, and the next network configuration step is executed. If the match fails, the currently obtained IP address does not meet the pre-defined requirements, and a new DHCP request must be initiated.
[0066] Before re-issuing the request, the server will first terminate the current DHCP client process to ensure that the allocated IP address is released and avoid conflicts. The server waits for a period of time (such as 30 seconds) and then returns to step 1 to start a new round of DHCP requests.
[0067] The preset IP address range is usually pre-defined by the server administrator based on the actual network environment and cluster requirements. For example, the administrator may specify that the IP addresses of cluster nodes must be within the range of "192.168.1.100-192.168.1.200". The DHCP request script will compare the obtained IP address with this range. Only when the IP address is within the specified range will it be considered an eligible IP address. When matching IP address ranges, the script can use various methods, such as string matching and regular expression matching. Once the DHCP request script obtains a qualified IP address, the server can proceed to execute subsequent network configuration steps, such as updating the network configuration file and restarting the network service.
[0068] Step S106: After the target virtual machine is successfully connected to the network, the target virtual machine is added to the nested cluster.
[0069] In step S106 , after the target virtual machine obtains the network connection, the target virtual machine is added to the nested cluster.
[0070] In one possible implementation, after the target virtual machine obtains a network connection and adds the target virtual machine to the nested cluster, the method further includes: creating multiple target virtual machines on a virtualization management platform based on the operating system installation image, and completing the operating system installation and network connection configuration; determining a master virtual machine as the master node of the nested cluster, installing and initializing cluster management software on the master virtual machine, and generating a cluster configuration file, where the master virtual machine is any one of the multiple target virtual machines; passing the cluster configuration file and the connection information of the master node to other virtual machines through an environment variable configuration file, where the other virtual machines are target virtual machines other than the master virtual machine among the multiple target virtual machines, so that the other virtual machines can read the environment variable configuration file; and completing the construction of the nested cluster based on the master node and the other virtual machines.
[0071] Specifically, after the target VM acquires network connectivity, the server adds it to the nested cluster, completing the nested cluster setup process. This process can be considered the final, critical step in automated deployment, organizing multiple VMs—already equipped with operating systems and network configurations—into a collaborative cluster. First, the server creates multiple target VMs in batches on a virtualization management platform (such as VMware vSphere or OpenStack) based on the previously prepared operating system installation image. These VMs serve as nodes in the nested cluster, sharing computing, storage, and networking tasks.
[0072] The server can automatically create virtual machines by calling the API of the virtualization management platform or using automation tools such as Ansible and Terraform. During the creation process, the server specifies the virtual machine's hardware configuration (such as CPU, memory, disk, etc.), network configuration (such as the connected virtual switch and VLAN, etc.), and the operating system installation image to be used.
[0073] After creation is complete, the server assigns a unique identifier (such as a host name or UUID) to each target VM and proceeds with the installation of the operating system and configuration of network connections. These steps can be performed in the same manner as described in steps S103 through S105, using an automated response file and script to complete the unattended installation of the operating system and configure the IP address and network connection based on the network environment.
[0074] After all target VMs have completed operating system installation and network configuration, the server selects one VM as the master node for the nested cluster. The master node manages and coordinates the entire cluster and serves as the cluster's control center. The server can automatically determine the master node based on pre-set criteria (such as the first VM created or the VM with the highest hardware configuration), or the administrator can manually designate the master node.
[0075] After determining the master node, the server logs in to the virtual machine via SSH and performs a series of initialization operations, including installing the cluster management software, configuring its core components and services, generating a cluster configuration file containing the cluster name, network address range, and authentication method, and initializing the cluster's data storage and communication mechanisms. Once initialization is complete, the master node becomes a fully functional cluster control center, ready to accept join requests from other nodes.
[0076] Next, the server passes the cluster configuration file and the master node's connection information to other target VMs so that they can join the cluster. Other VMs here refer to all target VMs except the master node.
[0077] The server can write the cluster configuration file and the master node connection information into an environment variable configuration file, and then inject the file into the operating system of other virtual machines through the script in the previous step, and automatically load the file when the operating system of other virtual machines starts through the script to ensure that the cluster configuration is available on all nodes. Finally, the server will log in to other virtual machines in turn through SSH and execute the command to join the cluster. This command is usually provided by the cluster management software to register the node with the master node and perform the necessary authentication and authorization. When the other virtual machines are successfully joined to the cluster, the entire nested cluster is completed. At this point, all nodes are connected to the master node and are managed and scheduled by the master node. Users can deploy applications, manage resources, monitor performance, etc. by accessing the API interface of the master node or using cluster management tools (such as kubectl).
[0078] In one possible implementation, the nested cluster is built based on the master node and other nodes, specifically including: installing cluster management software on other virtual machines, and reading the environment variable configuration file to obtain the cluster configuration file and the connection information of the master node, so that other virtual machines can join the nested cluster based on the cluster configuration file and the connection information of the master node and become the working nodes of the nested cluster; assigning tasks to the working nodes through the master node, coordinating the work of the nested cluster, and completing the construction of the nested cluster.
[0079] Specifically, the server first creates multiple virtual machine instances based on a predefined operating system installation image, which serve as nodes in the nested cluster. Using automated installation scripts and configuration files, the server controls these virtual machines, completes the operating system installation and basic environment configuration, and ensures they have network connectivity, preparing them for cluster participation.
[0080] Next, the server selects one of the VMs as the cluster's master node and installs and initializes cluster management software, such as Kubernetes or OpenShift. Cluster management software provides a comprehensive set of tools and services for managing and scheduling containerized applications within the cluster. The server uses the cluster management software to create a cluster control plane, which includes key components such as the API Server, Controller Manager, and Scheduler. This plane is responsible for managing and coordinating the entire cluster.
[0081] After the master node is initialized, the server generates a cluster configuration file containing important parameters such as the cluster's network address range, service ports, and security policies. This configuration file defines the cluster's basic operating environment and rules. The server passes this cluster configuration file, along with the master node's connection information, to the other virtual machine nodes in the cluster via an environment variable configuration file.
[0082] After completing the operating system installation and network connection, the other virtual machine nodes retrieve the cluster configuration file and the master node's connection information from the environment variable configuration file. The server also installs the same cluster management software on these nodes, enabling them to join the cluster. Using commands or APIs provided by the cluster management software, the nodes initiate a registration request to the master node, indicating their desire to become part of the cluster.
[0083] After receiving a registration request from a worker node, the master node performs identity verification and permission checks to ensure its legitimacy and security. Nodes that pass verification are accepted by the master node and brought into the cluster's management. The server, through the master node, assigns a unique identifier and role tag to the newly joined worker node to facilitate subsequent management and scheduling.
[0084] Once all nodes have successfully joined the cluster, the server deploys the necessary infrastructure components, such as the container runtime, network plugins, and storage plugins, on each node through the cluster management software. These components provide the infrastructure support for running containerized applications. The server selects the appropriate component versions and configurations based on actual needs and automatically deploys them to each node in the cluster through the cluster management software's orchestration capabilities.
[0085] At this point, a complete nested cluster has been built. The server, acting as the manager of the entire cluster, coordinates the worker nodes through the master node, achieving unified resource scheduling and distributed application deployment. For example, to run a web application on a cluster, the server can define the application's deployment descriptor using the cluster management software, specifying parameters such as the required container image, number of replicas, and resource requirements. Based on this descriptor, the master node schedules the different application replicas to the appropriate worker nodes and ensures they work together to provide external services.
[0086] Through automated server management and coordination, nested clusters enable efficient resource utilization and dynamic application deployment, providing users with a flexible and reliable distributed computing environment. Furthermore, servers can monitor the cluster's operating status in real time through the monitoring and logging features provided by the cluster management software, making adjustments and optimizations as needed to ensure cluster stability and performance.
[0087] Reference Figure 2 The present application also provides a programmable cluster installation device based on a hyper-converged architecture, which is a server. The server includes an original file acquisition module 201, an installation image generation module 202, an operating system installation module 203, a network connection module 204, and a cluster building module 205, wherein: the original file acquisition module 201 is used to obtain an original ISO file, and a script slot is reserved in the original ISO file. The script slot includes a pre-installation script slot and a post-installation script slot; the installation image generation module 202 is used to respectively implant at least one environment variable configuration file and at least one script file into a specified directory of the original ISO file to generate an operating system installation image; the operating system installation module 203 is used to complete the installation of the operating system on the target virtual machine based on the operating system installation image and the script slot, and record the installation status information, the installation status information being the installation startup status or the installation completion status; the network connection module 204 is used to determine the network environment of the target virtual machine if it is determined that the installation status information is the installation completion status; the network connection module 204 is also used to complete the network connection of the target virtual machine according to the network environment; the cluster building module 205 is used to add the target virtual machine to the nested cluster after the target virtual machine obtains the network connection.
[0088] In one possible implementation, the operating system installation module 203 completes the installation of the operating system on the target virtual machine based on the operating system installation image and the script slot, and records the installation status information, specifically including: the operating system installation module 203 executes the preset pre-installation script through the pre-installation script slot, and configures the operating system installation parameters according to the variables defined in the environment variable configuration file; the operating system installation module 203 starts to install the operating system on the target virtual machine based on the operating system installation parameters, and writes the installation startup status of the operating system to the preset log file through the pre-installation script; the operating system installation module 203 executes the preset post-installation script through the post-installation script slot, completes the installation of the operating system on the target virtual machine, and writes the installation completion status to the preset log file.
[0089] In one possible implementation, the network environment includes using dynamic IP allocation and using static IP allocation. The network connection module 204 completes the network connection of the target virtual machine according to the network environment, specifically including: when the network environment uses dynamic IP allocation, the network connection module 204 executes the network request script through the post-installation script slot to request the DHCP service to allocate an IP address until the IP address is successfully obtained, thereby completing the network connection of the target virtual machine; when the network environment uses static IP allocation, the network connection module 204 generates a network configuration file based on the network parameters in the environment variable configuration file, restarts the network service of the target virtual machine, completes the static IP configuration, and completes the network connection of the target virtual machine.
[0090] In one possible implementation, the network connection module 204 executes a network request script through a post-installation script slot to request the DHCP service to allocate an IP address until the IP address is successfully obtained, specifically including: the network connection module 204 executes a DHCP request script through a post-installation script slot, and the DHCP request script includes a loop body for requesting an IP address; in the loop body, the network connection module 204 matches a preset IP address segment in the network configuration of the target virtual machine; if the preset IP address segment is matched, the network connection module 204 determines that the IP address is successfully obtained; if the preset IP address segment is not matched, the network connection module 204 terminates the current DHCP client process and re-initiates a DHCP request until the IP address is successfully obtained.
[0091] In one possible implementation, the installation image generation module 202 implants at least one environment variable configuration file and at least one script file into a designated directory of the original ISO file to generate an operating system installation image, specifically including: the installation image generation module 202 uploads the environment variable configuration file to the env directory of the original ISO file, uploads the pre-installation script file to the pre directory of the original ISO file, and uploads the post-installation script file to the post directory of the original ISO file; the installation image generation module 202 repackages the original ISO file to generate an operating system installation image, which is an installation image file used to automatically install the operating system.
[0092] In a possible implementation, after the target virtual machine obtains the network connection and adds the target virtual machine to the nested cluster, the cluster building module 205 also includes: the cluster building module 205 creates multiple target virtual machines on the virtualization management platform based on the operating system installation image, and completes the operating system installation and network connection configuration; the cluster building module 205 determines the master virtual machine as the master node of the nested cluster, installs and initializes the cluster management software on the master virtual machine, and generates a cluster configuration file, where the master virtual machine is any one of the multiple target virtual machines; the cluster building module 205 passes the cluster configuration file and the connection information of the master node to other virtual machines through the environment variable configuration file, where the other virtual machines are the target virtual machines other than the master virtual machine among the multiple target virtual machines, so that other virtual machines can read the environment variable configuration file; the cluster building module 205 completes the construction of the nested cluster based on the master node and other nodes.
[0093] In one possible implementation, the cluster building module 205 completes the building of a nested cluster based on the master node and other nodes, specifically including: the cluster building module 205 installs cluster management software on other virtual machines, and reads the environment variable configuration file to obtain the cluster configuration file and the connection information of the master node, so that other virtual machines can join the nested cluster based on the cluster configuration file and the connection information of the master node and become the working nodes of the nested cluster; the cluster building module 205 assigns tasks to the working nodes through the master node, coordinates the work of the nested cluster, and completes the building of the nested cluster.
[0094] It should be noted that the above embodiments provide devices that implement their functions using only the division of the above functional modules as examples. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0095] This application also provides an electronic device. Figure 3 , Figure 3 3. This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. The electronic device 300 may include: at least one processor 301, at least one network interface 304, a user interface 303, a memory 305, and at least one communication bus 302.
[0096] The communication bus 302 is used to implement the connection and communication between these components.
[0097] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.
[0098] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).
[0099] The processor 301 may include one or more processing cores. Using various interfaces and circuits, the processor 301 connects to various components within the server. It executes instructions, programs, code sets, or instruction sets stored in the memory 305, as well as accesses data stored in the memory 305, to perform various server functions and process data. Optionally, the processor 301 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 301 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing content displayed on the display screen; and the modem handles wireless communications. It is understood that the modem may not be integrated into the processor 301 but implemented as a separate chip.
[0100] Among them, the memory 305 may include a random access memory (RAM) or a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may also optionally be at least one storage device located away from the aforementioned processor 301. Refer to Figure 3 , the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module and an application program of a programmable cluster installation method based on a hyper-converged architecture.
[0101] exist Figure 3 In the electronic device 300 shown, the user interface 303 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 301 can be used to call an application program stored in the memory 305 for a programmable cluster installation method based on a hyper-converged architecture. When executed by one or more processors 301, the electronic device 300 executes one or more of the methods described in the above embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should know that this application is not limited to the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for this application.
[0102] The present application further provides a computer-readable storage medium storing instructions, which, when executed by one or more processors 301 , enable the electronic device 300 to perform one or more of the methods described in the above embodiments.
[0103] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0104] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely schematic, such as the division of units, which is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interface, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0105] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0106] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0107] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of this application, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the method of this application. The aforementioned memory includes various media that can store program code, such as USB flash drives, mobile hard drives, magnetic disks, or optical disks.
[0108] The foregoing is merely an exemplary embodiment of the present disclosure and is not intended to limit the scope of the present disclosure. In other words, any equivalent variations and modifications made in accordance with the teachings of the present disclosure are still within the scope of the present disclosure. Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the disclosure and the practical implications thereof.
[0109] This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not described herein. The description and examples are to be considered as exemplary only, and the scope and spirit of the present disclosure are to be defined by the claims.
Claims
1. A programmable cluster installation method based on a hyper-converged architecture, characterized in that: The method comprises: Obtain an original ISO file, wherein the original ISO file has script slots reserved therein, the script slots including a pre-installation script slot and a post-installation script slot; Implanting at least one environment variable configuration file and at least one script file into designated directories of the original ISO file to generate an operating system installation image; Based on the operating system installation image and the script slot, installing the operating system on the target virtual machine, and recording installation status information, wherein the installation status information is an installation start status or an installation completion status; If it is determined that the installation status information is in the installation completion state, determining the network environment of the target virtual machine; According to the network environment, completing the network connection of the target virtual machine; After the target virtual machine is successfully connected to the network, the target virtual machine is added to the nested cluster.
2. The method according to claim 1, characterized in that The step of completing the installation of the operating system on the target virtual machine based on the operating system installation image and the script slot and recording the installation status information specifically includes: Executing a preset pre-installation script through the pre-installation script slot to configure operating system installation parameters according to the variables defined in the environment variable configuration file; Based on the operating system installation parameters, start installing the operating system on the target virtual machine, and write the installation startup status of the operating system into a preset log file through the pre-installation script; The preset post-installation script is executed through the post-installation script slot to complete the installation of the operating system on the target virtual machine, and the installation completion status is written into the preset log file.
3. The method according to claim 1, characterized in that The network environment includes using dynamic IP allocation and using static IP allocation, and completing the network connection of the target virtual machine according to the network environment specifically includes: When the network environment uses dynamic IP allocation, executing the network request script through the post-installation script slot to request the DHCP service to allocate an IP address until the IP address is successfully obtained, thereby completing the network connection of the target virtual machine; When the network environment uses static IP allocation, a network configuration file is generated according to the network parameters in the environment variable configuration file, and the network service of the target virtual machine is restarted to complete the static IP configuration and the network connection of the target virtual machine.
4. The method according to claim 3, characterized in that The network request script is executed through the post-installation script slot to request the DHCP service to allocate an IP address until the IP address is successfully obtained, specifically including: Executing a DHCP request script through the post-installation script slot, wherein the DHCP request script includes a loop body for requesting an IP address; In the loop body, matching a preset IP address segment in the network configuration of the target virtual machine; If the preset IP address segment is matched, it is determined that the IP address is successfully obtained; if the preset IP address segment is not matched, the current DHCP client process is terminated and a DHCP request is re-initiated until the IP address is successfully obtained.
5. The method according to claim 1, wherein The step of respectively implanting at least one environment variable configuration file and at least one script file into designated directories of the original ISO file to generate an operating system installation image specifically includes: Upload the environment variable configuration file to the env directory of the original ISO file, upload the pre-installation script file to the pre-directory of the original ISO file, and upload the post-installation script file to the post-directory of the original ISO file; The original ISO file is repackaged to generate the operating system installation image, where the operating system installation image is an installation image file for automatically installing the operating system.
6. The method according to claim 1, characterized in that After the target virtual machine obtains a network connection and adds the target virtual machine to the nested cluster, the method further includes: Based on the operating system installation image, create multiple target virtual machines on the virtualization management platform, and complete the operating system installation and network connection configuration; Determine a master virtual machine as a master node of the nested cluster, install and initialize cluster management software on the master virtual machine, and generate a cluster configuration file, wherein the master virtual machine is any one of the multiple target virtual machines; Passing the cluster configuration file and the connection information of the master node to other virtual machines through an environment variable configuration file, wherein the other virtual machines are target virtual machines other than the master virtual machine among the multiple target virtual machines, so that the other virtual machines can read the environment variable configuration file; Based on the master node and the other virtual machines, the nested cluster is built.
7. The method according to claim 6, characterized in that The step of building the nested cluster based on the master node and the other nodes specifically includes: Installing cluster management software on the other virtual machines and reading the environment variable configuration file to obtain the cluster configuration file and the connection information of the master node, so that the other virtual machines join the nested cluster based on the cluster configuration file and the connection information of the master node and become working nodes of the nested cluster; The master node assigns tasks to the working nodes and coordinates the work of the nested cluster to complete the construction of the nested cluster.
8. A programmable cluster installation device based on a hyper-converged architecture, characterized in that: The device comprises an original file acquisition module (201), an installation image generation module (202), an operating system installation module (203), a network connection module (204), and a cluster construction module (205), wherein: The original file acquisition module (201) is used to acquire the original ISO file, wherein the original ISO file has a script slot reserved therein, and the script slot includes a pre-installation script slot and a post-installation script slot; The installation image generation module (202) is used to respectively implant at least one environment variable configuration file and at least one script file into a designated directory of the original ISO file to generate an operating system installation image; The operating system installation module (203) is used to complete the installation of the operating system on the target virtual machine based on the operating system installation image and the script slot, and record installation status information, wherein the installation status information is an installation start status or an installation completion status; The network connection module (204) is configured to determine the network environment of the target virtual machine if it is determined that the installation status information is in the installation completion state; The network connection module (204) is further configured to complete the network connection of the target virtual machine according to the network environment; The cluster building module (205) is used to add the target virtual machine to the nested cluster after the target virtual machine obtains the network connection, thereby completing the building of the nested cluster.
9. An electronic device, characterized in that: The electronic device (300) comprises a processor (301), a memory (305), a user interface (303) and a network interface (304), wherein the memory (305) is used to store instructions, the user interface (303) and the network interface (304) are used to communicate with other devices, and the processor (301) is used to execute the instructions stored in the memory (305) so that the electronic device (300) executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is executed.
Citation Information
Patent Citations
Management platform deployment method of super fusion system
CN108388433A
Installation method of hyper-converged system, system, device and medium
CN111857744A
Network intercommunication method of virtual machine cluster based on hyper-converged nodes
CN116582546A
Method and device for automatically deploying virtual machine software environment and readable storage medium
CN119621081A
Node automatic management method and device based on cloud native environment
CN119960909A