Virtual machine parameter adjustment method and device, electronic equipment and computer readable medium

CN122963748APending Publication Date: 2026-10-23JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510473335.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0003]有鉴于此,本申请实施例提供一种虚拟机参数调整方法、装置、电子设备及计算机可读介质,能够解决现有的不同的虚拟机,如Windows虚拟机和Linux虚拟机,或虚拟机中的不同的应用场景可能需要不同的内核参数配置以达到最佳性能,全局参数设置无法满足这种细粒度的优化需求,可能导致某些虚拟机性能不佳或资源利用率不高的问题

Benefits of technology

[0050]上述发明中的一个实施例具有如下优点或有益效果:本申请通过根据接收到的虚拟机参数调整请求获取对应的虚拟机标识和目标参数;确定目标参数的参数类型,根据参数类型和虚拟机标识,确定目标节点;根据目标节点,确定对应的目标文件;调用虚拟化管理接口,以将目标文件中的目标参数的参数值调整为目标参数值。从而提高虚拟机参数调整的灵活性,提高虚拟机性能和资源利用率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122963748A_ABST
    Figure CN122963748A_ABST
Patent Text Reader

Abstract

The application discloses a virtual machine parameter adjustment method and device, electronic equipment and a computer readable medium, and relates to the technical field of computers. A specific embodiment comprises obtaining a corresponding virtual machine identifier and a target parameter according to a received virtual machine parameter adjustment request; determining the parameter type of the target parameter, determining a target node according to the parameter type and the virtual machine identifier; determining a corresponding target file according to the target node; and calling a virtualization management interface to adjust the parameter value of the target parameter in the target file to a target parameter value. Thus, the flexibility of virtual machine parameter adjustment is improved, and the performance and resource utilization of the virtual machine are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and computer-readable medium for adjusting virtual machine parameters. Background Technology

[0002] Currently, different virtual machines, such as Windows virtual machines and Linux virtual machines, or different application scenarios within virtual machines, may require different kernel parameter configurations to achieve optimal performance. Global parameter settings cannot meet this fine-grained optimization requirement, which may lead to poor performance or low resource utilization in some virtual machines. Summary of the Invention

[0003] In view of this, embodiments of this application provide a virtual machine parameter adjustment method, apparatus, electronic device, and computer-readable medium, which can solve the problem that different existing virtual machines, such as Windows virtual machines and Linux virtual machines, or different application scenarios in virtual machines may require different kernel parameter configurations to achieve optimal performance. Global parameter settings cannot meet such fine-grained optimization needs, which may lead to poor performance or low resource utilization of some virtual machines.

[0004] To achieve the above objectives, according to one aspect of the embodiments of this application, a method for adjusting virtual machine parameters is provided, comprising:

[0005] Obtain the corresponding virtual machine identifier and target parameters based on the received virtual machine parameter adjustment request;

[0006] Determine the parameter type of the target parameter, and based on the parameter type and virtual machine identifier, determine the target node;

[0007] Based on the target node, determine the corresponding target file;

[0008] Call the virtualization management interface to adjust the parameter values ​​of the target parameters in the target file to the target parameter values.

[0009] Optionally, the target node is determined based on the parameter type and virtual machine identifier, including:

[0010] Retrieve the structure tree data of the node corresponding to the virtual machine identifier;

[0011] Determine the target node based on the parameter type and structure tree data.

[0012] Optionally, the target node is determined based on the parameter type and virtual machine identifier, including:

[0013] If the parameter type is a global parameter, determine the root node of the node corresponding to the virtual machine identifier in the structure tree data, and determine the root node as the target node;

[0014] If the parameter type is a non-global parameter, the node corresponding to the virtual machine identifier in the structure tree data will be determined as the target node.

[0015] Optionally, based on the target node, the corresponding target file is determined, including:

[0016] Determine the target file name based on the target node;

[0017] Determine the corresponding target file based on the target file name.

[0018] Optionally, the target file name is determined based on the target node, including:

[0019] Replace the corresponding placeholder in the file name generation template with the target node identifier corresponding to the target node to generate the target file name.

[0020] Optionally, before obtaining the corresponding virtual machine identifier and target parameters based on the received virtual machine parameter adjustment request, the method further includes:

[0021] During virtual machine operation, it continuously monitors whether it receives requests to adjust virtual machine parameters.

[0022] Optionally, the method further includes:

[0023] Before the virtual machine runs, modify the virtual machine configuration file according to the target parameters and their values;

[0024] Run the virtual machine according to the modified virtual machine configuration file.

[0025] In addition, this application also provides a virtual machine parameter adjustment device, including:

[0026] The acquisition unit is configured to obtain the corresponding virtual machine identifier and target parameters based on the received virtual machine parameter adjustment request;

[0027] The target node determination unit is configured to determine the parameter type of the target parameters and determine the target node based on the parameter type and the virtual machine identifier;

[0028] The target file determination unit is configured to determine the corresponding target file based on the target node;

[0029] The parameter value adjustment unit is configured to call the virtualization management interface to adjust the parameter values ​​of the target parameters in the target file to the target parameter values.

[0030] Optionally, the target node determination unit is further configured to:

[0031] Retrieve the structure tree data of the node corresponding to the virtual machine identifier;

[0032] Determine the target node based on the parameter type and structure tree data.

[0033] Optionally, the target node determination unit is further configured to:

[0034] If the parameter type is a global parameter, determine the root node of the node corresponding to the virtual machine identifier in the structure tree data, and determine the root node as the target node;

[0035] If the parameter type is a non-global parameter, the node corresponding to the virtual machine identifier in the structure tree data will be determined as the target node.

[0036] Optionally, the target file determination unit is further configured to:

[0037] Determine the target file name based on the target node;

[0038] Determine the corresponding target file based on the target file name.

[0039] Optionally, the target file determination unit is further configured to:

[0040] Replace the corresponding placeholder in the file name generation template with the target node identifier corresponding to the target node to generate the target file name.

[0041] Optionally, the acquisition unit is further configured to:

[0042] During virtual machine operation, it continuously monitors whether it receives requests to adjust virtual machine parameters.

[0043] Optionally, the virtual machine parameter tuning device also includes a configuration file modification unit, configured to:

[0044] Before the virtual machine runs, modify the virtual machine configuration file according to the target parameters and their values;

[0045] Run the virtual machine according to the modified virtual machine configuration file.

[0046] In addition, this application also provides a virtual machine parameter adjustment electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by one or more processors, enable the one or more processors to implement the virtual machine parameter adjustment method as described above.

[0047] In addition, this application also provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the virtual machine parameter adjustment method as described above.

[0048] To achieve the above objectives, according to another aspect of the embodiments of this application, a computer program product is provided.

[0049] A computer program product according to an embodiment of this application includes a computer program that, when executed by a processor, implements the virtual machine parameter adjustment method provided in an embodiment of this application.

[0050] One embodiment of the above invention has the following advantages or beneficial effects: This application obtains the corresponding virtual machine identifier and target parameters based on the received virtual machine parameter adjustment request; determines the parameter type of the target parameters; determines the target node based on the parameter type and virtual machine identifier; determines the corresponding target file based on the target node; and calls the virtualization management interface to adjust the parameter values ​​of the target parameters in the target file to the target parameter values. This improves the flexibility of virtual machine parameter adjustment and enhances virtual machine performance and resource utilization.

[0051] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0052] The accompanying drawings are provided to better understand this application and do not constitute an undue limitation thereof. Wherein:

[0053] Figure 1 This is a schematic diagram of the main flow of a virtual machine parameter adjustment method according to an embodiment of this application;

[0054] Figure 2 This is a schematic diagram of the main flow of a virtual machine parameter adjustment method according to an embodiment of this application;

[0055] Figure 3 This is a schematic diagram of the main flow of a virtual machine parameter adjustment method according to an embodiment of this application;

[0056] Figure 4 This is a schematic diagram of the main units of a virtual machine parameter adjustment device according to an embodiment of this application;

[0057] Figure 5 This is an exemplary system architecture diagram to which embodiments of this application can be applied;

[0058] Figure 6 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers in the embodiments of this application. Detailed Implementation

[0059] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These embodiments should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that the acquisition, transmission, storage, use, and processing of data in the technical solutions of this application comply with relevant national laws and regulations. It should also be noted that certain software, components, models, and other existing industry solutions may be mentioned in the embodiments of this application. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solutions of this application, and do not imply that the applicant has already used or necessarily used such solutions. The collection, gathering, updating, analysis, processing, use, transmission, and storage of user personal information involved in the technical solutions of this application all comply with relevant laws and regulations, are used for legal and reasonable purposes, do not violate public order and good morals, are not shared, disclosed, or sold outside of these legal uses, and are subject to supervision and management by regulatory authorities. Necessary measures should be taken to prevent unauthorized access to user personal information, safeguard user personal information security, cybersecurity, and national security, and ensure that those authorized to access personal information comply with relevant laws and regulations. Once this user personal information is no longer needed, risks should be minimized by restricting or even prohibiting data collection and / or deleting the data.

[0060] When used, including in certain relevant applications, data is deidentified to protect user privacy, for example by removing specific identifiers, controlling the amount or specificity of stored data, controlling how data is stored, and / or other methods.

[0061] Figure 1 This is a schematic diagram of the main flow of a virtual machine parameter adjustment method according to an embodiment of this application, as shown below. Figure 1 As shown, the virtual machine parameter adjustment method mainly includes the following steps S101-S104.

[0062] Step S101: Obtain the corresponding virtual machine identifier and target parameters based on the received virtual machine parameter adjustment request.

[0063] In this embodiment, the execution entity of the virtual machine parameter adjustment method (e.g., a server) can receive virtual machine parameter adjustment requests via wired or wireless connections. Upon receiving the request, it can obtain the corresponding virtual machine identifier and target parameters. The virtual machine identifier identifies the virtual machine whose parameters are to be adjusted, and the target parameters can be global or non-global. Modifying global parameters modifies global virtual machine parameters; modifying non-global parameters modifies the parameters of a specific simulated CPU within the virtual machine.

[0064] Specifically, before obtaining the corresponding virtual machine identifier and target parameters based on the received virtual machine parameter adjustment request, the method further includes: during the virtual machine operation, detecting in real time whether a virtual machine parameter adjustment request has been received.

[0065] The timing for adjusting virtual machine parameters can be either during virtual machine operation or before virtual machine starts running. If virtual machine parameters are adjusted during virtual machine operation, it is necessary to monitor in real time whether virtual machine parameter adjustment requests are received and respond promptly to complete the virtual machine parameter adjustment during virtual machine operation.

[0066] Step S102: Determine the parameter type of the target parameter, and determine the target node based on the parameter type and virtual machine identifier.

[0067] Each parameter can be found in the parameter type database, which includes global and non-global parameters. If the parameter type is non-global and the virtual machine identifier carries a branch identifier, such as numbers like 1 or 2, then the executing entity can determine that the target node is the simulated CPU within the virtual machine. Figure 3 In the B1 cgroup, this application embodiment does not specifically limit the branch identifier.

[0068] Step S103: Determine the corresponding target file based on the target node.

[0069] Specifically, based on the target node, the corresponding target file is determined, including: determining the target file name based on the target node, and determining the corresponding target file based on the target file name.

[0070] Once the target node is identified, it can be determined whether to modify global parameters or non-global parameters. The target file name can then be generated from the target node, and a query statement can be generated using the target file name and the target database. This query statement can then be executed in the target database, and the query result will be the corresponding target file, thereby improving the efficiency and accuracy of identifying the target file.

[0071] Specifically, based on the target node, the target file name is determined, including replacing the corresponding placeholder in the file name generation template with the target node identifier corresponding to the target node, so as to generate the target file name quickly and accurately.

[0072] Step S104: Call the virtualization management interface to adjust the parameter values ​​of the target parameters in the target file to the target parameter values.

[0073] The virtualization management interface is invoked to locate the target parameters and their values ​​from the target file, and the located target parameter values ​​are adjusted to match the target parameter values. This enables fast and accurate adjustment of the target parameter values.

[0074] This embodiment obtains the corresponding virtual machine identifier and target parameters based on the received virtual machine parameter adjustment request; determines the parameter type of the target parameters; determines the target node based on the parameter type and virtual machine identifier; determines the corresponding target file based on the target node; and calls the virtualization management interface to adjust the parameter values ​​of the target parameters in the target file to the target parameter values. This improves the flexibility of virtual machine parameter adjustment and enhances virtual machine performance and resource utilization.

[0075] Figure 2 This is a schematic diagram of the main flow of a virtual machine parameter adjustment method according to an embodiment of this application, as follows: Figure 2 As shown, the virtual machine parameter adjustment method mainly includes the following steps S201-S205.

[0076] Step S201: Obtain the corresponding virtual machine identifier and target parameters based on the received virtual machine parameter adjustment request.

[0077] Specifically, the method also includes: modifying the virtual machine configuration file according to the target parameters and target parameter values ​​before the virtual machine runs; and running the virtual machine according to the modified virtual machine configuration file.

[0078] Virtual machine parameters can be adjusted either during virtual machine operation or before virtual machine starts running. If the virtual machine parameters are adjusted before virtual machine starts running, the virtual machine configuration file can be directly modified to run the virtual machine according to the modified configuration file, making virtual machine parameter deployment more convenient.

[0079] Step S202: Determine the parameter type of the target parameter and obtain the structure tree data of the node corresponding to the virtual machine identifier.

[0080] Determine the root node and parent node of the node corresponding to the virtual machine identifier. Based on the determined root node, parent node, and node corresponding to the virtual machine identifier, accurately determine the corresponding structure tree data.

[0081] Step S203: Determine the target node based on the parameter type and structure tree data.

[0082] Specifically, the target node is determined based on the parameter type and the virtual machine identifier, including: if the parameter type is a global parameter, the root node of the node corresponding to the virtual machine identifier in the structure tree data is determined, and the root node is determined as the target node; if the parameter type is a non-global parameter, the node corresponding to the virtual machine identifier in the structure tree data is determined as the target node.

[0083] Adjusting the virtual machine parameters of the root node can be applied to global parameters. If the parameter type is global, determine the root node of the node corresponding to the virtual machine identifier in the structure tree data, and determine the root node as the target node, so as to achieve the purpose of adjusting the global parameters by adjusting the virtual machine parameters of the target node.

[0084] Adjusting virtual machine parameters for nodes other than the root node is only a partial adjustment and does not apply to global parameters. If the parameter type is a non-global parameter, the node corresponding to the virtual machine identifier in the structure tree data is determined as the target node. This allows for the adjustment of local virtual machine parameters by adjusting the virtual machine parameters of the target node, improving the flexibility of virtual machine parameter adjustment, meeting various fine-grained optimization needs, and improving virtual machine performance and resource utilization.

[0085] Step S204: Determine the corresponding target file based on the target node.

[0086] The target node can be associated with a corresponding file. The file associated with the target node is identified as the target file, thereby accurately adjusting the virtual machine parameters of the target node.

[0087] Step S205: Call the virtualization management interface to adjust the parameter values ​​of the target parameters in the target file to the target parameter values.

[0088] The executing entity can call the virtualization management interface to adjust the parameter values ​​of the target parameters in the target file to the target parameter values ​​through batch processing, thereby improving the efficiency of virtual machine parameter adjustment and increasing resource utilization.

[0089] In this application embodiment, KVM (Kernel-based Virtual Machine) is an open-source virtualization solution that transforms the Linux kernel into a hypervisor. cgroup (Control Group) is a feature of the Linux kernel used to limit, record, and isolate the physical resources (such as CPU and memory) used by process groups. vCPU (Virtual CPU) is a simulated CPU in a virtual machine, corresponding to the physical CPU of the host machine. Simulated CPUs are an important program component of a source code protection system; they are themselves programs.

[0090] In this embodiment, some (virtual machine) KVM parameters are added to cgroup (used to limit, record and isolate the physical resources used by process groups, such as CPU and memory) management and attached to the CPU cgroup subsystem. When the KVM module uses these parameters, it will find the corresponding values ​​in a certain way through new functions such as get_halt_poll_ns, and no longer use global variables.

[0091] Figure 3 This is a schematic diagram of the main flow of a virtual machine parameter adjustment method according to an embodiment of this application. kvmmodule: use get_halt_poll_ns() get its value. (Example) Figure 3As shown, root is the root node, and cgroup (Control Group) is a feature of the Linux kernel used to limit, record, and isolate the physical resources (such as CPU and memory) used by process groups. The cpu cgroup itself will always have a root cgroup (cpu.shares=1024, cpu.halt_poll_ns=200000), which is used to adjust global virtual machine parameters. A and B can be the names or IDs of virtual machines. A cgroup (cpu.shares = 1024, cpu.halt_poll_ns = 0), B cgroup (cpu.shares = 1024, cpu.halt_poll_ns = 200000), B1 and B2 are virtual CPUs, whose names can be vcpu0 and vcpu1 respectively. Specifically, a virtual CPU (VirtualCPU) is a CPU simulated in the virtual machine, corresponding to the physical CPU of the host machine. B1 cgroup (cpu.shares = 512, cpu.halt_poll_ns = 200000), B2 cgroup (cpu.shares = 1024, cpu.halt_poll_ns = 500000). The parameters of each virtual CPU can be modified through B1 cgroup and B2 cgroup. For example, reading / writing to Bcgroup allows you to obtain or change a variable in the kernel: halt_poll_ns. This is a global value that all virtual machines are controlled by, allowing for global parameter modification. For example, performing read / write operations on cgroup B:

[0092] static struct cftype cpu_legacy_files[]={

[0093] #ifdef CONFIG_KVM_PARAMETERS_GROUP

[0094] {

[0095] .name = "halt_poll_ns";

[0096] .read_u64=cpu_halt_poll_ns_read_u64,

[0097] .write_u64=cpu_halt_poll_ns_write_u64,

[0098] },

[0099] #endif

[0100] ...

[0101] }

[0102] In KVM virtualization, each vCPU is a thread, managed by a task_struct in the Linux kernel (a task_struct is a data structure in the Linux kernel used to describe processes, also known as a process control block (PCB). In the Linux system, each process has a task_struct structure to describe its state and behavior). When using the CPU cgroup subsystem, each task_struct also has a task_group, which records metadata about group scheduling.

[0103] Since virtual machines are managed by libvirt, libvirt creates a cgroup for each vCPU, similar to... Figure 3 The B1 cgroup is used in libvirt. When starting a virtual machine, libvirt adds each vCPU (the CPU simulated in the virtual machine, which corresponds to the physical CPU of the host machine) thread to a cpu cgroup, so it is convenient to attach some parameter management to the cpu cgroup.

[0104] Virtual machines have many parameters during operation. For example, when a VM exits (i.e., exits virtual machine mode), it will poll (i.e., enter an infinite loop) for a period of time. This time is managed by halt_poll_ns, but this value is global and affects every virtual machine running on this machine. It can be read or modified by the kernel interface / sys / module / kvm / parameters / halt_poll_ns.

[0105] In this embodiment, this value (i.e., halt_poll_ns) is added to cgroup management, and can be modified for each vCPU through the cgroup interface / sys / fs / cgroup / cpu / ... / vcpux / cpu.halt_poll_ns. When the vm exits (i.e., the execution flow jumps) to the kvm module, kvm first searches for the vCPU (e.g., first searches for...). Figure 3The system checks the `task_group` in the `task_struct` of the lowest-level `B1cgroup` or `B2cgroup` in the tree structure to see if `halt_poll_ns` is set. If not, it continues to check the `task_group` in the `task_struct` of its parent (e.g., `B` cgroup) to see if it is set, all the way to the root cgroup. The value in the root cgroup is the default KVM parameter value, which is also the global value.

[0106] In this embodiment, global modifications can also be made through the interface / sys / module / kvm / parameters / halt_poll_ns provided by kvm, consistent with the previous (kernel) interface. The difference is that each vcpu can set different values ​​through the new cgroup interface, which provides finer granularity.

[0107] like Figure 3 As shown, the B cgroup has not been modified and its value is 200000, which is the same as the root cgroup (this 200000 is the default value in higher kernel versions). The B2 cgroup is set to 500000, so this value takes effect, and 200000 no longer takes effect.

[0108] Furthermore, this application integrates the step of modifying cgroups (which can be understood as a directory) into libvirt. Similar to libvirt changing the value of cpu.shares through virtual machine configuration files, the corresponding parameter values ​​can also be changed by modifying virtual machine configuration files, making deployment more convenient. A fine-grained method for adjusting virtual machine kernel parameters based on cgroups is implemented by introducing virtualization-specific resource control options into cgroups, such as the cpu.halt_poll_ns resource control option file. The KVM module is modified to support reading kernel parameters from cgroups. libvirt is modified to support modifying cgroups through configuration files.

[0109] This application improves the flexibility of global kernel parameter adjustment by using a cgroup-based method to enable fine-grained (level-specific) adjustment of kernel parameters for different virtual machines or virtual machines in different usage scenarios.

[0110] Figure 4 This is a schematic diagram of the main units of a virtual machine parameter adjustment device according to an embodiment of this application. Figure 4 As shown, the virtual machine parameter adjustment device 400 includes an acquisition unit 401, a target node determination unit 402, a target file determination unit 403, and a parameter value adjustment unit 404.

[0111] The acquisition unit 401 is configured to acquire the corresponding virtual machine identifier and target parameters based on the received virtual machine parameter adjustment request.

[0112] The target node determination unit 402 is configured to determine the parameter type of the target parameter and determine the target node based on the parameter type and the virtual machine identifier.

[0113] The target file determination unit 403 is configured to determine the corresponding target file based on the target node.

[0114] The parameter value adjustment unit 404 is configured to call the virtualization management interface to adjust the parameter values ​​of the target parameters in the target file to the target parameter values.

[0115] In some embodiments, the target node determination unit 402 is further configured to: obtain the structure tree data of the node corresponding to the virtual machine identifier; and determine the target node based on the parameter type and the structure tree data.

[0116] In some embodiments, the target node determination unit 402 is further configured to: if the parameter type is a global parameter, determine the root node of the node corresponding to the virtual machine identifier in the structure tree data, and determine the root node as the target node; if the parameter type is a non-global parameter, determine the node corresponding to the virtual machine identifier in the structure tree data as the target node.

[0117] In some embodiments, the target file determination unit 403 is further configured to: determine the target file name based on the target node; and determine the corresponding target file based on the target file name.

[0118] In some embodiments, the target file determination unit 403 is further configured to: replace the corresponding placeholder in the file name generation template with the target node identifier corresponding to the target node to generate the target file name.

[0119] In some embodiments, the acquisition unit 401 is further configured to: detect in real time whether a virtual machine parameter adjustment request is received during the virtual machine operation.

[0120] In some embodiments, the virtual machine parameter adjustment device further includes Figure 4 The configuration file modification unit (not shown) is configured to: modify the virtual machine configuration file according to the target parameters and target parameter values ​​before the virtual machine runs; and run the virtual machine according to the modified virtual machine configuration file.

[0121] It should be noted that the virtual machine parameter adjustment method and virtual machine parameter adjustment device in this application are related in terms of specific implementation content, so the repeated content will not be described again.

[0122] Figure 5An exemplary system architecture 500 is shown that can be applied to the virtual machine parameter adjustment method or virtual machine parameter adjustment apparatus of the embodiments of this application.

[0123] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, and 503, a network 504, and a server 505. Network 504 serves as the medium for providing communication links between terminal devices 501, 502, and 503 and server 505. Network 504 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0124] Users can use terminal devices 501, 502, and 503 to interact with server 505 via network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, and 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0125] Terminal devices 501, 502, and 503 can be various electronic devices with virtual machine parameter adjustment and processing screens that support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0126] Server 505 can be a server providing various services, such as a backend management server supporting virtual machine parameter adjustment requests submitted by users using terminal devices 501, 502, and 503 (for example only). The backend management server can obtain the corresponding virtual machine identifier and target parameters based on the received virtual machine parameter adjustment request; determine the parameter type of the target parameters; determine the target node based on the parameter type and virtual machine identifier; determine the corresponding target file based on the target node; and call the virtualization management interface to adjust the parameter values ​​of the target parameters in the target file to the target parameter values. This improves the flexibility of virtual machine parameter adjustment and enhances virtual machine performance and resource utilization.

[0127] It should be noted that the virtual machine parameter adjustment method provided in this application embodiment is generally executed by server 505, and correspondingly, the virtual machine parameter adjustment device is generally set in server 505.

[0128] It should be understood that Figure 5 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0129] The following is for reference. Figure 6 It shows a schematic diagram of the structure of a computer system 600 suitable for implementing a terminal device according to the embodiments of this application. Figure 6The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0130] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the computer system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0131] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0132] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs the functions defined above in the system of this application.

[0133] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. Computer-readable storage media can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0134] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0135] The units described in the embodiments of this application can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor can be described as including an acquisition unit, a target node determination unit, a target file determination unit, and a parameter value adjustment unit. The names of these units do not necessarily limit the specific unit itself.

[0136] In another aspect, this application also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to obtain the corresponding virtual machine identifier and target parameters based on a received virtual machine parameter adjustment request; determine the parameter type of the target parameters; determine the target node based on the parameter type and the virtual machine identifier; determine the corresponding target file based on the target node; and call the virtualization management interface to adjust the parameter values ​​of the target parameters in the target file to the target parameter values.

[0137] The computer program product of this application includes a computer program that, when executed by a processor, implements the virtual machine parameter adjustment method in the embodiments of this application.

[0138] According to the technical solution of the embodiments of this application, the flexibility of virtual machine parameter adjustment can be improved, and the performance and resource utilization of virtual machines can be improved.

[0139] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for adjusting virtual machine parameters, characterized in that, include: Obtain the corresponding virtual machine identifier and target parameters based on the received virtual machine parameter adjustment request; Determine the parameter type of the target parameter, and determine the target node based on the parameter type and the virtual machine identifier; Based on the target node, determine the corresponding target file; Call the virtualization management interface to adjust the parameter values ​​of the target parameters in the target file to the target parameter values.

2. The method according to claim 1, characterized in that, The step of determining the target node based on the parameter type and the virtual machine identifier includes: Obtain the structure tree data of the node corresponding to the virtual machine identifier; The target node is determined based on the parameter type and the structure tree data.

3. The method according to claim 2, characterized in that, The step of determining the target node based on the parameter type and the virtual machine identifier includes: If the parameter type is a global parameter, determine the root node of the node corresponding to the virtual machine identifier in the structure tree data, and determine the root node as the target node; If the parameter type is a non-global parameter, the node corresponding to the virtual machine identifier in the structure tree data is determined as the target node.

4. The method according to claim 1, characterized in that, The step of determining the corresponding target file based on the target node includes: Based on the target node, determine the target file name; Based on the target file name, determine the corresponding target file.

5. The method according to claim 4, characterized in that, Determining the target file name based on the target node includes: Replace the corresponding placeholder in the file name generation template with the target node identifier corresponding to the target node to generate the target file name.

6. The method according to claim 1, characterized in that, Before obtaining the corresponding virtual machine identifier and target parameters based on the received virtual machine parameter adjustment request, the method further includes: During virtual machine operation, it continuously monitors whether it receives requests to adjust virtual machine parameters.

7. The method according to claim 1, characterized in that, The method further includes: Before the virtual machine runs, modify the virtual machine configuration file according to the target parameters and their values; Run the virtual machine according to the modified virtual machine configuration file.

8. A virtual machine parameter adjustment device, characterized in that, include: The acquisition unit is configured to obtain the corresponding virtual machine identifier and target parameters based on the received virtual machine parameter adjustment request; The target node determination unit is configured to determine the parameter type of the target parameter, and determine the target node based on the parameter type and the virtual machine identifier; The target file determination unit is configured to determine the corresponding target file based on the target node; The parameter value adjustment unit is configured to call the virtualization management interface to adjust the parameter value of the target parameter in the target file to the target parameter value.

9. An electronic device for adjusting virtual machine parameters, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7.

10. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-7.