Virtual machine disk management method, system, terminal and storage medium
By setting up disk management command templates on the host machine and sending and receiving programs via the virtual machine's serial port, the problem of disk expansion in a virtual machine Linux system is solved, enabling efficient utilization of virtual machine disk space and user-friendly expansion operations.
Patent Information
- Application Number
- CN202111217138.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-19
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2041-10-19
AI Technical Summary
In Linux systems running in virtual machines, the expanded virtual disk space is not being used effectively, and users unfamiliar with Linux find it difficult to expand the disk using existing techniques.
By setting up a disk management command template on the host machine, a disk management program is generated. The disk management program is then sent to and received from the virtual machine via the virtual machine's serial port, enabling the expansion of the virtual machine's disk and the utilization of its space.
It simplifies the virtual machine disk expansion process, making it convenient for users to operate on the host machine and achieving effective utilization of the internal disk space of the virtual machine.
Smart Images

Figure CN114168256B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of virtual machine technology, specifically to a virtual machine disk management method, system, terminal, and storage medium. Background Technology
[0002] A virtual machine (VM) is a complete computer system simulated by software, possessing full hardware system functionality and running in a completely isolated environment. Any task that can be performed on a physical computer can also be performed in a VM. When creating a VM, a portion of the physical machine's hard drive and memory capacity is used as the VM's hard drive and memory capacity. Each VM has its own independent CMOS, hard drive, and operating system, and can be operated just like a physical machine. Currently, VMs are an important component of cloud platform environments.
[0003] In virtualization environments, most virtual machines run Linux. The virtualization platform allows adding virtual disks or increasing the capacity of a virtual disk within the virtual machine. However, this virtual disk or capacity expansion is merely a hardware upgrade; the expanded space is not actually used within the virtual machine's Linux system. To use this expanded space within the Linux system, one needs to access the Linux system and manipulate it via command line or internal Linux management tools. While this is simple for experienced Linux maintainers, it can be difficult for those unfamiliar with Linux. Summary of the Invention
[0004] In view of the above-mentioned shortcomings of the prior art, the present invention provides a virtual machine disk management method, system, terminal and storage medium to solve the above-mentioned technical problems.
[0005] In a first aspect, the present invention provides a virtual machine disk management method, comprising:
[0006] Set up a disk management command template on the host machine, import the input virtual machine disk modification parameters into the disk management command template to generate a disk management program;
[0007] Send the disk management program to the virtual machine via the virtual machine's serial port;
[0008] Receive the disk management program execution results returned by the virtual machine via the virtual machine's serial port.
[0009] Furthermore, a disk management command template is set on the host machine. The input virtual machine disk modification parameters are imported into the disk management command template to generate a disk management program, including:
[0010] Configure partition structure expansion template and add disk partition expansion template;
[0011] The corresponding disk management instruction template is invoked according to the expansion type selected by the user. The expansion type is either partition structure expansion or disk partition expansion. The disk management instruction template includes multiple instructions, the execution order of the multiple instructions, and parameters to be filled in.
[0012] Import the virtual machine disk modification parameters entered by the user into the corresponding parameter fields to be filled in the disk management command template.
[0013] Furthermore, a disk management program is sent to the virtual machine via the virtual machine's serial port, including:
[0014] Send disk information retrieval commands to the virtual machine via the host machine command sending thread;
[0015] If the disk information returned by the virtual machine indicates that it is expandable, then the disk management program is sent to the virtual machine through the host machine instruction sending thread;
[0016] The disk management program information sent is saved to the database. The disk management program information includes the instruction type and instruction parameters.
[0017] Furthermore, the execution results of the disk management program returned by the virtual machine are received via the virtual machine's serial port, including:
[0018] The host machine receives the execution results of the disk management program returned by the virtual machine through the result receiving thread, and saves the execution results of the disk management program to the corresponding disk management program information item in the database.
[0019] In a second aspect, the present invention provides a virtual machine disk management system, comprising:
[0020] The program generation unit is used to set up a disk management instruction template on the host machine and import the input virtual machine disk modification parameters into the disk management instruction template to generate a disk management program.
[0021] The program sending unit is used to send disk management programs to the virtual machine via the virtual machine serial port.
[0022] The result receiving unit is used to receive the execution results of the disk management program returned by the virtual machine through the virtual machine serial port.
[0023] Furthermore, the program generation unit includes:
[0024] The template settings module is used to set partition structure expansion templates and add disk partition expansion templates;
[0025] The template invocation module is used to invoke the corresponding disk management instruction template according to the expansion type selected by the user. The expansion type is either partition structure expansion or disk partition expansion. The disk management instruction template includes multiple instructions, the execution order of the multiple instructions, and parameters to be filled in.
[0026] The parameter import module is used to import the virtual machine disk modification parameters entered by the user into the corresponding parameter fields to be filled in the disk management command template.
[0027] Furthermore, the program sending unit includes:
[0028] Send disk information retrieval commands to the virtual machine via the host machine command sending thread;
[0029] If the disk information returned by the virtual machine indicates that it is expandable, then the disk management program is sent to the virtual machine through the host machine instruction sending thread;
[0030] The disk management program information sent is saved to the database. The disk management program information includes the instruction type and instruction parameters.
[0031] Furthermore, the result receiving unit includes:
[0032] The host machine receives the execution results of the disk management program returned by the virtual machine through the result receiving thread, and saves the execution results of the disk management program to the corresponding disk management program information item in the database.
[0033] Thirdly, a terminal is provided, including:
[0034] Processor, memory, among which,
[0035] This memory is used to store computer programs.
[0036] The processor is used to retrieve and run the computer program from memory, causing the terminal to perform the terminal method described above.
[0037] Fourthly, a computer storage medium is provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform the methods described in the above aspects.
[0038] The beneficial effects of this invention are as follows: The virtual machine disk management method, system, terminal, and storage medium provided by this invention, by setting a disk management command template on the host machine, importing the input virtual machine disk modification parameters into the disk management command template to generate a disk management program; then, sending the disk management program to the virtual machine through the virtual machine's serial port, and receiving the execution result of the disk management program returned by the virtual machine, realizes the expansion of the virtual machine's disk capacity and the sending of expansion commands to the virtual machine from the host machine, applying the expanded space to a specific file system. This invention obtains the disk information inside the virtual machine and displays the disk usage information through the virtualization management terminal, while also allowing the expansion of the internal disk structure of the virtual machine through the virtualization management terminal, making it convenient for users.
[0039] Furthermore, the design principle of this invention is reliable, the structure is simple, and it has a very wide range of application prospects. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a schematic flowchart of a method according to an embodiment of the present invention.
[0042] Figure 2 This is another illustrative flowchart of a method according to an embodiment of the present invention.
[0043] Figure 3 This is a schematic block diagram of a system according to an embodiment of the present invention.
[0044] Figure 4 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present invention. Detailed Implementation
[0045] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.
[0046] The key terms used in this invention will be explained below.
[0047] BIOS is an abbreviation for "Basic Input Output System." On IBM PC-compatible systems, it's an industry-standard firmware interface. It's a set of programs embedded in a ROM chip on the computer's motherboard. It stores the computer's most important basic input / output programs, power-on self-test (POST) programs, and system boot programs. It can read and write specific system settings from the CMOS. Its main function is to provide the lowest-level, most direct hardware settings and control for the computer. In addition, the BIOS provides some system parameters to the operating system. Changes to system hardware are hidden by the BIOS; programs use BIOS functions rather than directly controlling the hardware. Modern operating systems often bypass the abstraction layer provided by the BIOS and directly control hardware components.
[0048] The CPU (Central Processing Unit) is the core of a computer system for computation and control, and is the final execution unit for information processing and program execution.
[0049] Virtualization software allows a host computer to create and run one or more virtual environments. Virtualization software typically uses emulation to simulate a complete computer system, and then installs an operating system on this virtual system. From the operating system's perspective, it is impossible to detect the difference between this virtual environment and a real, physical computer; it runs entirely in the same way as a traditional, fully functional physical machine. Such an operating system can be called a guest operating system.
[0050] Linux, short for GNU / Linux, is a free and open-source Unix-like operating system. Its kernel was first released by Linus Benedict Torvalds on October 5, 1991. Primarily inspired by Minix and Unix, it is a POSIX-compliant, multi-user, multi-tasking operating system that supports multi-threading and multi-CPU systems. It can run major Unix utilities, applications, and network protocols. It supports both 32-bit and 64-bit hardware. Linux inherits Unix's network-centric design philosophy and is a stable multi-user network operating system. There are hundreds of different Linux distributions, such as community-developed Debian and Arch Linux, and commercially developed Red Hat Enterprise Linux, SUSE, and Oracle Linux.
[0051] UUID stands for Universally Unique Identifier, a software construction standard and part of the Open Software Foundation's work on distributed computing environments. Its purpose is to provide unique identification information for all elements in a distributed system, eliminating the need for a central control point to assign identification information. This allows everyone to create UUIDs that don't conflict with others, thus avoiding name duplication issues during database creation. The most widely used UUID is Microsoft's Globally Unique Identifier (GUID), while other important applications include Linux ext2 / ext3 file systems, LUKS encrypted partitions, GNOME, KDE, macOS, and more. Implementations can also be found in the UUID library within the e2fsprogs package.
[0052] Figure 1 This is a schematic flowchart illustrating a method according to an embodiment of the present invention. Wherein, Figure 1 The executing entity can be a virtual machine disk management system.
[0053] like Figure 1 As shown, the method includes:
[0054] Step 110: Set up a disk management command template on the host machine, import the input virtual machine disk modification parameters into the disk management command template to generate a disk management program;
[0055] Step 120: Send the disk management program to the virtual machine via the virtual machine's serial port;
[0056] Step 130: Receive the disk management program execution result returned by the virtual machine via the virtual machine serial port.
[0057] This invention proposes a method for disk management in a Linux virtual machine system. The invention involves running an instruction sending program and a result receiving program on the host system of the virtual machine to send and receive information to and from the virtual machine system using the virtual machine's serial port device; and running an instruction processing program within the virtual machine to receive instructions, process instructions, and return results. Through the host program and the programs within the virtual machine, the invention obtains disk usage information within the virtual machine, including disk usage, disk partitions, capacity, file system type, and mount points. It also enables the expansion of the virtual machine's disk capacity from the host side and sends expansion commands to the virtual machine, applying the expanded space to specific file systems.
[0058] To facilitate understanding of the present invention, the virtual machine disk management method provided by the present invention will be further described below based on the principle of the virtual machine disk management method of the present invention and in conjunction with the process of managing the virtual machine disk in the embodiments.
[0059] For details, please refer to Figure 2 The virtual machine disk management method includes:
[0060] S1. Set up a disk management command template on the host machine, import the input virtual machine disk modification parameters into the disk management command template to generate a disk management program.
[0061] Set up partition structure expansion templates and add disk partition expansion templates; call the corresponding disk management instruction template according to the expansion type selected by the user, wherein the expansion type is partition structure expansion or disk partition expansion, and the disk management instruction template includes multiple instructions, the execution order of multiple instructions, and parameters to be filled in; import the virtual machine disk modification parameters entered by the user into the corresponding parameters to be filled in the called disk management instruction template.
[0062] Expanding storage space includes expanding the LVM partition structure and adding new disk partitions. Expanding the LVM structure involves adding a new partition to the disk, formatting the file system, and mounting the partition. Updating the fstab file allows the virtual machine to automatically mount the partition after a reboot. Users select the disk or partition to expand based on the obtained disk partition information, configure the expansion size, and then submit the command.
[0063] S2. Send the disk management program to the virtual machine via the virtual machine's serial port.
[0064] The host machine sends a disk information retrieval command to the virtual machine via a host instruction sending thread; if the disk information returned by the virtual machine is expandable, a disk management program is sent to the virtual machine via the host instruction sending thread; the sent disk management program information is saved to the database, and the disk management program information includes the instruction type and instruction parameters.
[0065] A daemon process is started on the host machine running the virtual machine. This daemon process consists of two threads: an instruction sending thread and a result receiving thread. The instruction sending thread sends relevant instructions to the virtual machine via its serial port, instructing the virtual machine to execute related programs. The result receiving thread receives the processing results of the instructions sent from within the virtual machine. The sent instruction content includes the instruction UUID, instruction type, and instruction parameters; the result content includes the instruction UUID, instruction type, and instruction result. The sent instruction and result are paired, sharing the same instruction UUID and instruction type. After the host machine sends an instruction, it records the instruction information in the database, including the instruction UUID, instruction type, instruction parameters, and instruction result information (empty if no result is received). The result receiving thread listens for the result information sent via the virtual machine's serial port and then updates the information for the instruction UUID in the database, thus completing the entire instruction task.
[0066] The instruction sending thread sends the instruction to retrieve disk information to the virtual machine via serial port. The instruction content includes the instruction UUID, instruction type, and instruction parameters. The sent instruction information is also recorded in the database. After receiving the instruction, the virtual machine retrieves the disk information, mainly the disk's tree structure information, including disk name, partition information, file type, size, and used capacity. The partition information also includes child node information, file type, size, and used capacity; the child node information includes file type, size, and used capacity.
[0067] Based on the obtained disk partition information, the user selects the disk or partition to be expanded, configures the expansion capacity, and submits the command. The expansion program on the host machine first obtains the virtual machine's disk information and checks if expansion is possible. If expansion is not possible, it returns an "expansion not possible" message, records it in the database, and ends the expansion task. If expansion is possible, it sends the expansion command to the virtual machine. Upon receiving the information, the expansion program inside the virtual machine expands the relevant partitions according to the received configuration parameters.
[0068] S3. Receive the disk management program execution results returned by the virtual machine through the virtual machine's serial port.
[0069] The host machine receives the disk management program execution results returned by the virtual machine via a result receiving thread, and saves the disk management program execution results to the corresponding disk management program information entry in the database. Specifically, after expansion, the virtual machine returns the expansion results and the virtual machine's disk information; after receiving the expansion results, the host machine updates the task information in the database and completes the expansion task.
[0070] like Figure 3 As shown, the system 300 includes:
[0071] The program generation unit 310 is used to set up a disk management instruction template on the host machine and import the input virtual machine disk modification parameters into the disk management instruction template to generate a disk management program.
[0072] The program sending unit 320 is used to send a disk management program to the virtual machine via the virtual machine serial port;
[0073] The result receiving unit 330 is used to receive the disk management program execution results returned by the virtual machine through the virtual machine serial port.
[0074] Optionally, as an embodiment of the present invention, the program generation unit includes:
[0075] The template settings module is used to set partition structure expansion templates and add disk partition expansion templates;
[0076] The template invocation module is used to invoke the corresponding disk management instruction template according to the expansion type selected by the user. The expansion type is either partition structure expansion or disk partition expansion. The disk management instruction template includes multiple instructions, the execution order of the multiple instructions, and parameters to be filled in.
[0077] The parameter import module is used to import the virtual machine disk modification parameters entered by the user into the corresponding parameter fields to be filled in the disk management command template.
[0078] Expanding storage space includes expanding the LVM partition structure and adding new disk partitions. For LVM structures, this involves expanding the LV (Level Manager) partition. Adding a partition involves creating a new partition on the disk, formatting the file system, and mounting the partition. Updating the fstab file allows the virtual machine to automatically mount the partition after a reboot. The user selects the disk or partition to expand based on the obtained disk partition information, configures the expansion size, and submits the command. The host machine's expansion program first obtains the virtual machine's disk information and checks if expansion is possible. If not, it returns an "expansion not possible" message, records it in the database, and ends the expansion task. If expansion is possible, it sends the expansion command to the virtual machine. The virtual machine's internal expansion program receives the information and expands the relevant partitions according to the received configuration parameters. After expansion, it returns the expansion result and the virtual machine's disk information. The host machine receives the expansion result, updates the task information in the database, and completes the expansion task.
[0079] Optionally, as an embodiment of the present invention, the program sending unit includes:
[0080] Send disk information retrieval commands to the virtual machine via the host machine command sending thread;
[0081] If the disk information returned by the virtual machine indicates that it is expandable, then the disk management program is sent to the virtual machine through the host machine instruction sending thread;
[0082] The disk management program information sent is saved to the database. The disk management program information includes the instruction type and instruction parameters.
[0083] A daemon process is started on the host machine running the virtual machine. This daemon process consists of two threads: an instruction sending thread and a result receiving thread. The instruction sending thread sends relevant instructions to the virtual machine via its serial port, instructing the virtual machine to execute related programs. The result receiving thread receives the processing results of the instructions sent from within the virtual machine. The sent instruction content includes the instruction UUID, instruction type, and instruction parameters; the result content includes the instruction UUID, instruction type, and instruction result. The sent instruction and result are paired, sharing the same instruction UUID and instruction type. After the host machine sends the instruction, it records the instruction information in the database, including the instruction UUID, instruction type, instruction parameters, and instruction result information (empty if no result is received). The result receiving thread listens for the result information sent via the virtual machine's serial port and then updates the information for the instruction UUID in the database, thus completing the entire instruction task.
[0084] The process of obtaining disk information includes: the instruction sending thread sends the instruction to obtain disk information to the virtual machine via serial port. The instruction content includes the instruction UUID, instruction type, and instruction parameters. The sent instruction information is also recorded in the database. After receiving the instruction, the virtual machine obtains the disk information, mainly the tree structure information of the disk, including disk name, partition information, file type, size, and used capacity. The partition information also includes child node information, file type, size, and used capacity; the child node information includes file type, size, and used capacity.
[0085] Optionally, as an embodiment of the present invention, the result receiving unit includes:
[0086] The host machine receives the execution results of the disk management program returned by the virtual machine through the result receiving thread, and saves the execution results of the disk management program to the corresponding disk management program information item in the database.
[0087] Figure 4 This is a schematic diagram of the structure of a terminal 400 provided in an embodiment of the present invention. The terminal 400 can be used to execute the virtual machine disk management method provided in the embodiment of the present invention.
[0088] The terminal 400 may include a processor 410, a memory 420, and a communication unit 430. These components communicate via one or more buses. Those skilled in the art will understand that the server structure shown in the figure does not constitute a limitation of the present invention. It may be a bus topology or a star topology, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0089] The memory 420 can be used to store the execution instructions of the processor 410. The memory 420 can be implemented by any type of volatile or non-volatile memory terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk. When the execution instructions in the memory 420 are executed by the processor 410, the terminal 400 is able to perform some or all of the steps in the above method embodiments.
[0090] The processor 410 serves as the control center of the storage terminal, connecting various parts of the electronic terminal via various interfaces and lines. It executes software programs and / or modules stored in the memory 420, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of integrated circuits (ICs), such as a single packaged IC or multiple packaged ICs with the same or different functions connected together. For example, the processor 410 may consist only of a central processing unit (CPU). In this embodiment of the invention, the CPU may have a single processing core or include multiple processing cores.
[0091] The communication unit 430 is used to establish a communication channel, enabling the storage terminal to communicate with other terminals. It can receive user data sent by other terminals or send user data to other terminals.
[0092] The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, which, when executed, may include some or all of the steps provided in the embodiments of the present invention. The storage medium may be a magnetic disk, an optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0093] Therefore, this invention generates a disk management program by setting a disk management command template on the host machine, importing the input virtual machine disk modification parameters into the disk management command template, and then sending the disk management program to the virtual machine via the virtual machine's serial port and receiving the execution result of the disk management program returned by the virtual machine. This achieves the expansion of the virtual machine's disk capacity and the sending of expansion commands to the virtual machine from the host machine, applying the expanded space to a specific file system. This invention displays disk usage information through the virtualization management terminal by obtaining the disk information inside the virtual machine, and can also expand the internal disk structure of the virtual machine through the virtualization management terminal, making it convenient for users. The technical effects achieved by this embodiment can be found in the description above, and will not be repeated here.
[0094] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or any other medium capable of storing program code. It includes several instructions to cause a computer terminal (which may be a personal computer, a server, or a second terminal, a network terminal, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0095] The same or similar parts between the various embodiments in this specification can be referred to mutually. In particular, the terminal embodiments are basically similar to the method embodiments, so the description is relatively simple, and the relevant parts can be referred to the description in the method embodiments.
[0096] In the embodiments provided by this invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between systems or units may be electrical, mechanical, or other forms.
[0097] The units described as separate components may or may not be physically separate. The 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 the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0098] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0099] Although the present invention has been described in detail with reference to the accompanying drawings and preferred embodiments, the invention is not limited thereto. Various equivalent modifications or substitutions can be made to the embodiments of the invention by those skilled in the art without departing from the spirit and essence of the invention, and such modifications or substitutions should all be within the scope of the invention. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the invention should also be covered within the protection scope of the invention. Therefore, the protection scope of the invention should be determined by the scope of the claims.
Claims
1. A virtual machine disk management method, characterized in that, include: Set up a disk management command template on the host machine, import the input virtual machine disk modification parameters into the disk management command template to generate a disk management program; Send the disk management program to the virtual machine via the virtual machine's serial port; Receive the execution results of the disk management program returned by the virtual machine via the virtual machine's serial port; Configure a disk management command template on the host machine, import the input virtual machine disk modification parameters into the disk management command template to generate a disk management program, including: Configure partition structure expansion template and add disk partition expansion template; The corresponding disk management instruction template is invoked according to the expansion type selected by the user. The expansion type is either partition structure expansion or disk partition expansion. The disk management instruction template includes multiple instructions, the execution order of the multiple instructions, and parameters to be filled in. Import the virtual machine disk modification parameters entered by the user into the corresponding parameter fields to be filled in the disk management command template; Send the disk management program to the virtual machine via the virtual machine's serial port, including: Send disk information retrieval commands to the virtual machine via the host machine command sending thread; If the disk information returned by the virtual machine indicates that it is expandable, then the disk management program is sent to the virtual machine through the host machine instruction sending thread; The disk management program information sent is saved to the database. The disk management program information includes the instruction type and instruction parameters.
2. The method according to claim 1, characterized in that, Receive the disk management program execution results returned by the virtual machine via the virtual machine's serial port, including: The host machine receives the execution results of the disk management program returned by the virtual machine through the result receiving thread, and saves the execution results of the disk management program to the corresponding disk management program information item in the database.
3. A virtual machine disk management system, characterized in that, include: The program generation unit is used to set up a disk management instruction template on the host machine and import the input virtual machine disk modification parameters into the disk management instruction template to generate a disk management program. The program sending unit is used to send disk management programs to the virtual machine via the virtual machine serial port. The result receiving unit is used to receive the disk management program execution results returned by the virtual machine through the virtual machine serial port; The program generation unit includes: The template settings module is used to set partition structure expansion templates and add disk partition expansion templates; The template invocation module is used to invoke the corresponding disk management instruction template according to the expansion type selected by the user. The expansion type is either partition structure expansion or disk partition expansion. The disk management instruction template includes multiple instructions, the execution order of the multiple instructions, and parameters to be filled in. The parameter import module is used to import the virtual machine disk modification parameters entered by the user into the corresponding parameter items to be filled in the disk management command template called; The program sending unit includes: Send disk information retrieval commands to the virtual machine via the host machine command sending thread; If the disk information returned by the virtual machine indicates that it is expandable, then the disk management program is sent to the virtual machine through the host machine instruction sending thread; The disk management program information sent is saved to the database. The disk management program information includes the instruction type and instruction parameters.
4. The system according to claim 3, characterized in that, The result receiving unit includes: The host machine receives the execution results of the disk management program returned by the virtual machine through the result receiving thread, and saves the execution results of the disk management program to the corresponding disk management program information item in the database.
5. A terminal, characterized in that, include: processor; Memory used to store the processor's execution instructions; The processor is configured to perform the method according to any one of claims 1-2.
6. A computer-readable storage medium storing a computer program, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-2.
Citation Information
Patent Citations
Method and a device for expanding a disk partition of a KVM virtual machine
CN109614053A