A configuration method and device

By checking the validity of cloud host configuration parameters, the problem of failed upgrade of cloud host configuration parameters is solved, and the success rate of online upgrades is improved.

CN111966413BActive Publication Date: 2025-07-29BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010820817.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-14
Publication Date
2025-07-29
Estimated Expiration
2040-08-14

AI Technical Summary

Technical Problem

In the prior art, cloud host configuration parameters upgrade may have the problem of failure in upgrading, resulting in a low online upgrade success rate.

Method used

By obtaining the configuration parameter upgrade call request, extracting the target configuration parameters, and performing validity checks to ensure that it is within the limit of the configuration parameters of the physical machine before adjustments are made.

Benefits of technology

This improves the success rate of online upgrade of cloud hosts and ensures that the cloud hosts can run normally after the configuration parameters are adjusted.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111966413B_ABST
    Figure CN111966413B_ABST
Patent Text Reader

Abstract

The present application provides a configuration method and apparatus, which obtains a configuration parameter upgrade call request for indicating adjustment of configuration parameters of a cloud host to be upgraded, extracts target configuration parameters carried in the configuration parameter upgrade call request, performs a validity check on the target configuration parameters to determine whether the target configuration parameters are valid; if the target configuration parameters are valid, adjusts the configuration parameters of the cloud host to be upgraded to the target configuration parameters, thereby checking the validity of the target configuration parameters during the dynamic adjustment of the configuration parameters of the cloud host to be upgraded, so that the target configuration parameters configured for the cloud host to be upgraded are valid configuration parameters, and it can be ensured that the cloud host to be upgraded can operate normally after the configuration parameters of the cloud host to be upgraded are adjusted to the target configuration parameters, improving the success rate of online upgrade.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of data processing, and particularly relates to a configuration method and device. Background Art

[0002] With the rapid development of the cloud computing industry, higher requirements are put forward for the configuration parameters of cloud hosts, so that cloud hosts have higher computing and processing capabilities. In order to make cloud hosts have higher computing and processing capabilities, the configuration parameters of cloud hosts can be configured according to the current computing and processing capabilities, such as configuring the virtual processors and memory used by cloud hosts. However, there may be problems of upgrade failure in the current upgrade of the configuration parameters of cloud hosts. Summary of the Invention

[0003] In view of this, the purpose of this application is to provide a configuration method and device, which are used to check the validity of the configuration parameters to be upgraded during the dynamic adjustment process of the configuration parameters of the cloud host to be upgraded, and improve the success rate of online upgrade.

[0004] On the one hand, this application provides a configuration method, and the method includes:

[0005] Obtain a configuration parameter upgrade call request, where the configuration parameter upgrade call request is used to indicate the adjustment of the configuration parameters of the cloud host to be upgraded;

[0006] Extract the target configuration parameters carried in the configuration parameter upgrade call request;

[0007] Check the validity of the target configuration parameters to determine whether the target configuration parameters are valid;

[0008] If the target configuration parameters are valid, adjust the configuration parameters of the cloud host to be upgraded to the target configuration parameters.

[0009] Optionally, the method further includes: if a configuration parameter upgrade success message is obtained, update the configuration file of the cloud host to be upgraded based on the target configuration parameters, so as to call the target configuration parameters in the configuration file during the startup process of the cloud host to be upgraded.

[0010] Optionally, the obtaining of the configuration parameter upgrade call request includes: obtaining the configuration parameter upgrade call request through an online upgrade interface, where the online upgrade interface is used to receive a configuration parameter upgrade call request for adjusting any configuration parameter of the cloud host to be upgraded, and the online upgrade interface corresponds to a configuration parameter check function and a configuration parameter adjustment function;

[0011] The configuration parameter adjustment function is used to indicate checking the validity of the configuration parameters, and the configuration parameter adjustment function is used to indicate adjusting the configuration parameters of the cloud host to be upgraded.

[0012] Optionally, the validity check on the target configuration parameter to determine whether the target configuration parameter is valid includes:

[0013] Perform a validity check on the number of target virtual processors in the target configuration parameter to determine whether the number of target virtual processors is greater than or equal to the number of virtual processors currently configured for the cloud host to be upgraded and less than the total number of available virtual processors of the cloud host to be upgraded;

[0014] If the number of target virtual processors is greater than or equal to the number of virtual processors currently configured for the cloud host to be upgraded and less than the total number of available virtual processors of the cloud host to be upgraded, determine that the number of target virtual processors is valid;

[0015] And / or

[0016] The validity check on the target configuration parameter to determine whether the target configuration parameter is valid includes:

[0017] Perform a validity check on the target memory quantity in the target configuration parameter to determine whether the target memory quantity is greater than or equal to the memory quantity currently configured for the cloud host to be upgraded and less than the total available memory of the cloud host to be upgraded; <s

[0018] If the target memory quantity is greater than or equal to the memory quantity currently configured for the cloud host to be upgraded and less than the total available memory of the cloud host to be upgraded, determine that the target memory quantity is valid.

[0019] On the other hand, the present application provides a configuration device, and the device includes:

[0020] An acquisition unit, configured to acquire a configuration parameter upgrade call request, where the configuration parameter upgrade call request is used to indicate an adjustment to the configuration parameters of the cloud host to be upgraded;

[0021] An extraction unit, configured to extract the target configuration parameter carried in the configuration parameter upgrade call request;

[0022] An inspection unit, configured to perform a validity check on the target configuration parameter to determine whether the target configuration parameter is valid;

[0023] A processing unit, configured to, if the target configuration parameter is valid, adjust the configuration parameter of the cloud host to be upgraded to the target configuration parameter.

[0024] Optionally, the device further includes: an update unit, configured to, if a configuration parameter upgrade success message is obtained, update the configuration file of the cloud host to be upgraded based on the target configuration parameter, so as to call the target configuration parameter in the configuration file during the startup process of the cloud host to be upgraded.

[0025] Optionally, the obtaining unit is configured to obtain the configuration parameter upgrade call request through an online upgrade interface, where the online upgrade interface is used to receive a configuration parameter upgrade call request for adjusting any configuration parameter of the cloud host to be upgraded, and the online upgrade interface corresponds to a configuration parameter check function and a configuration parameter adjustment function;

[0026] The configuration parameter adjustment function is configured to instruct to check the validity of the configuration parameter, and the configuration parameter adjustment function is configured to instruct to adjust the configuration parameter of the cloud host to be upgraded.

[0027] Optionally, the checking unit is configured to perform a validity check on the target virtual processor number in the target configuration parameter to determine whether the target virtual processor number is greater than or equal to the number of virtual processors currently configured in the cloud host to be upgraded and less than the total number of available virtual processors of the cloud host to be upgraded; if the target virtual processor number is greater than or equal to the number of virtual processors currently configured in the cloud host to be upgraded and less than the total number of available virtual processors of the cloud host to be upgraded, determine that the target virtual processor number is valid;

[0028] and / or

[0029] The checking unit is configured to perform a validity check on the target memory quantity in the target configuration parameter to determine whether the target memory quantity is greater than or equal to the memory quantity currently configured in the cloud host to be upgraded and less than the total available memory of the cloud host to be upgraded; if the target memory quantity is greater than or equal to the memory quantity currently configured in the cloud host to be upgraded and less than the total available memory of the cloud host to be upgraded, determine that the target memory quantity is valid.

[0030] In another aspect, the present application provides a configuration device, where the configuration device includes: a processor and a memory;

[0031] The processor is configured to obtain a configuration parameter upgrade call request, where the configuration parameter upgrade call request is used to indicate to adjust the configuration parameter of the cloud host to be upgraded, extract the target configuration parameter carried in the configuration parameter upgrade call request, perform a validity check on the target configuration parameter to determine whether the target configuration parameter is valid; if the target configuration parameter is valid, adjust the configuration parameter of the cloud host to be upgraded to the target configuration parameter;

[0032] The memory is used to store the configuration parameters of the to-be-upgraded cloud host.

[0033] On the other hand, the present application provides a storage medium storing computer program code, and when the computer program code is executed, the above configuration method is implemented.

[0034] For the above configuration method and device, a configuration parameter upgrade call request is obtained. The configuration parameter upgrade call request is used to indicate an adjustment to the configuration parameters of the to-be-upgraded cloud host. The target configuration parameters carried in the configuration parameter upgrade call request are extracted, and the effectiveness of the target configuration parameters is checked to determine whether the target configuration parameters are valid. If the target configuration parameters are valid, the configuration parameters of the to-be-upgraded cloud host are adjusted to the target configuration parameters. Therefore, the effectiveness of the target configuration parameters is checked during the dynamic adjustment of the configuration parameters of the to-be-upgraded cloud host, so that the target configuration parameters configured for the to-be-upgraded cloud host are valid configuration parameters. After the configuration parameters of the to-be-upgraded cloud host are adjusted to the target configuration parameters, it can be ensured that the to-be-upgraded cloud host can operate normally, and the success rate of online upgrade is improved. Description of the Drawings

[0035] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0036] Figure 1 It is a flowchart of a configuration method provided by an embodiment of the present application;

[0037] Figure 2 It is a flowchart of another configuration method provided by an embodiment of the present application;

[0038] Figure 3 It is an application schematic diagram of the configuration method provided by an embodiment of the present application;

[0039] Figure 4 It is a schematic structural diagram of a configuration device provided by an embodiment of the present application;

[0040] Figure 5 It is a schematic structural diagram of another configuration device provided by an embodiment of the present application. Detailed Embodiments

[0041] To make the objectives, technical solutions and advantages of the embodiments of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this application. Apparently, the described embodiments are some, but not all, of the embodiments of this application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without making creative efforts shall fall within the scope of protection of this application.

[0042] Please refer to Figure 1 , which shows a flowchart of a configuration method provided by an embodiment of this application, and may include the following steps:

[0043] 101. Obtain a configuration parameter upgrade call request, which is used to indicate an adjustment to the configuration parameters of the cloud host to be upgraded. The configuration parameter upgrade call request may be obtained when there is a change in the computing and processing capabilities of the cloud host to be upgraded. The configuration parameter upgrade call request indicates which cloud host to be upgraded to adjust the configuration parameters, and the configuration parameter upgrade call request may be executed during the normal operation of the cloud host to be upgraded, so as to adjust the configuration parameters of the cloud host to be upgraded without interrupting the normal operation of the cloud host to be upgraded. In this way, the user does not need to perform shutdown or restart operations on the cloud host to be upgraded.

[0044] The configuration parameter upgrade call request includes: the identifier of the cloud host to be upgraded and the target configuration parameters. For example, the identifier of the cloud host to be upgraded can be represented by, but not limited to, the ID (Identity Document) of the cloud host to be upgraded. For the cloud host to be upgraded, the number of virtual processors and the amount of memory used by the cloud host to be upgraded are two main technical indicators that determine the performance of a cloud host to be upgraded. The adjustment of the configuration parameters of the cloud host to be upgraded is mainly aimed at the number of virtual processors and the amount of memory. Therefore, the target configuration parameters in the configuration parameter upgrade call request may include, but are not limited to: the target number of virtual processors and the target amount of memory. The target number of virtual processors is used to indicate the number of virtual processors used by the cloud host to be upgraded after online upgrade adjustment, and the target amount of memory is used to indicate the amount of memory used by the cloud host to be upgraded after online upgrade adjustment.

[0045] In this embodiment, the identifier of the cloud host to be upgraded and the target configuration parameters in the configuration parameter upgrade call request may be input by the user or selected by the user from the provided data. This embodiment does not limit the content carried in the configuration parameter upgrade call request.

[0046] 102. Extract the target configuration parameters carried in the configuration parameter upgrade call request. The configuration parameter upgrade call request can be encapsulated and generated according to a preset format. In the preset format, the lengths and corresponding fields of the target configuration parameters and the identifier of the cloud host to be upgraded can be specified, so as to extract the target configuration parameters from the configuration parameter upgrade call request based on the preset format. The preset format is not limited in this embodiment.

[0047] 103. Perform a validity check on the target configuration parameters to determine whether the target configuration parameters are valid. Since the cloud host to be upgraded is a virtual machine running on a physical machine, some configurations of the cloud host to be upgraded are restricted by the physical machine. For example, the number of virtual processors used by the cloud host to be upgraded is limited by the logical cores of the processor of the physical machine. Therefore, in this embodiment, it is necessary to perform a validity check on the target configuration parameters to check whether the target configuration parameters are valid configuration parameters. For example, check whether the target configuration parameters are within the range defined by the configuration parameters of the physical machine where the cloud host to be upgraded is located. If they are within the range defined by the configuration parameters of the physical machine, it is determined that the target configuration parameters are valid configuration parameters and the target configuration parameters are valid.

[0048] Taking the number of virtual processors as an example, the virtual processors in the cloud host to be upgraded are simulated by the logical cores on the processor of the physical machine. One logical core corresponds to one virtual processor in the cloud host to be upgraded. For example, if the number of processors of the physical machine is 2 and the number of logical cores of each processor is 64, the total number of logical cores is 128, and at most 128 virtual processors can be simulated. If the number of virtual processors exceeds 128, such as configuring 156 virtual processors, it will exceed the computing power of 128 logical cores, resulting in the computing power of the cloud host to be upgraded not meeting the requirements and reducing the user experience. Therefore, it is necessary to perform a validity check before adjusting the configuration parameters of the cloud host to be upgraded.

[0049] If the target configuration parameters include: the number of virtual processors and / or the amount of memory, the check process is as follows:

[0050] Perform a validity check on the target number of virtual processors in the target configuration parameters to determine whether the target number of virtual processors is greater than or equal to the number of virtual processors currently configured in the cloud host to be upgraded and less than the total number of available virtual processors in the cloud host to be upgraded; if the target number of virtual processors is greater than or equal to the number of virtual processors currently configured in the cloud host to be upgraded and less than the total number of available virtual processors in the cloud host to be upgraded, it is determined that the target number of virtual processors is valid.

[0051] Perform a validity check on the target memory quantity in the target configuration parameters to determine whether the target memory quantity is greater than or equal to the memory quantity currently configured for the cloud host to be upgraded and less than the total available memory of the cloud host to be upgraded; if the target memory quantity is greater than or equal to the memory quantity currently configured for the cloud host to be upgraded and less than the total available memory of the cloud host to be upgraded, determine that the target memory quantity is valid.

[0052] The currently configured number of virtual processors is the number of virtual processors configured for the cloud host to be upgraded before the configuration parameter adjustment is made through the configuration parameter upgrade call request. Similarly, the currently configured memory quantity is the memory quantity configured for the cloud host to be upgraded before the configuration parameter adjustment is made through the configuration parameter upgrade call request. The currently configured number of virtual processors and memory quantity can be obtained from the configuration file of the cloud host to be upgraded.

[0053] The total number of available virtual processors of the cloud host to be upgraded is the number of logical cores that the physical machine where the cloud host to be upgraded is located can provide. The available memory quantity of the cloud host to be upgraded is the memory quantity that the physical machine where the cloud host to be upgraded is located can provide. The target number of virtual processors should be less than the total number of available virtual processors, and the target memory quantity should be less than the total available memory, so that the configuration parameters of the cloud host to be upgraded are within the range defined by the configuration parameters of the physical machine on which it runs, that is, within the tolerance of the physical machine.

[0054] 104. If the target configuration parameters are valid, adjust the configuration parameters of the cloud host to be upgraded to the target configuration parameters.

[0055] If the target configuration parameters are valid, it means that the target configuration parameters are within the range defined by the configuration parameters of the physical machine where the cloud host to be upgraded is located, and the configuration parameters of the cloud host to be upgraded can be adjusted. Adjusting the configuration parameters of the cloud host to be upgraded to the target configuration parameters means that the configuration parameters of the cloud host to be upgraded are successfully upgraded and the target configuration parameters take effect immediately. In this way, the cloud host to be upgraded can be reconfigured based on the target configuration parameters, such as reconfiguring the virtual processors used by the cloud host to be upgraded based on the target number of virtual processors.

[0056] 105. If the target configuration parameter is not valid, prohibit adjusting the configuration parameter of the cloud host to be upgraded. If the target configuration parameter is valid, it indicates that the target configuration parameter exceeds the range of the configuration parameter limit of the physical machine where the cloud host to be upgraded is located, and prohibit adjusting the configuration parameter of the cloud host to be upgraded. If adjusting the configuration parameter of the cloud host to be upgraded is prohibited, it means that the upgrade of the configuration parameter of the cloud host to be upgraded fails. In this case, a message indicating the failure of the configuration parameter upgrade can be fed back to indicate that the target configuration parameter exceeds the range of the configuration parameter limit of the physical machine where the cloud host to be upgraded is located. Users can use this as a reference to decide whether to adjust the configuration parameter of the physical machine or virtualize the cloud host to be upgraded on other physical machines.

[0057] For the above configuration method, obtain a configuration parameter upgrade call request, which is used to indicate adjusting the configuration parameter of the cloud host to be upgraded, extract the target configuration parameter carried in the configuration parameter upgrade call request, and perform a validity check on the target configuration parameter to determine whether the target configuration parameter is valid; if the target configuration parameter is valid, adjust the configuration parameter of the cloud host to be upgraded to the target configuration parameter, so as to check the validity of the target configuration parameter during the dynamic adjustment of the configuration parameter of the cloud host to be upgraded, so that the target configuration parameter configured for the cloud host to be upgraded is a valid configuration parameter. After adjusting the configuration parameter of the cloud host to be upgraded to the target configuration parameter, it can ensure that the cloud host to be upgraded can run normally and improve the success rate of online upgrade.

[0058] Please refer to Figure 2 , which shows a flowchart of another configuration method provided by an embodiment of the present application. On the basis of the above Figure 1 it may further include the following steps:

[0059] 106. If a configuration parameter upgrade success message is obtained, update the configuration file of the cloud host to be upgraded based on the target configuration parameter, so as to call the target configuration parameter in the configuration file during the startup process of the cloud host to be upgraded.

[0060] The configuration parameter upgrade success message is obtained when the configuration parameter of the cloud host to be upgraded is adjusted to the target configuration parameter, and is used to indicate that the configuration parameter of the upgraded cloud host is adjusted to the target configuration parameter through the configuration parameter upgrade call request. If a configuration parameter upgrade success message is obtained, the configuration file of the cloud host to be upgraded can be further updated based on the target configuration parameter, such as adjusting the configuration parameter in the configuration file of the cloud host to be upgraded to the target configuration parameter. For example, adjusting the number of virtual processors in the configuration file to the target number of virtual processors, and adjusting the amount of memory in the configuration file to the target amount of memory, to realize the management of the configuration file of the cloud host to be upgraded, so that the configuration parameter in the configuration file can be updated along with the configuration parameter upgrade call request.

[0061] The configuration file of the cloud host to be upgraded is called during the startup process of the cloud host to be upgraded. In this way, when the cloud host to be upgraded is restarted after the configuration file is adjusted, the adjusted configuration parameters in the configuration file will be called, enabling the successful startup configuration of the cloud host to be upgraded and preventing the configuration parameters from reverting to the pre-upgrade configuration parameters during the restart of the cloud host to be upgraded.

[0062] In this embodiment, the above-mentioned configuration parameter upgrade call request can be obtained through an online upgrade interface. The online upgrade interface is used to receive a configuration parameter upgrade call request for adjusting any configuration parameter of the cloud host to be upgraded, thereby providing a unified interface for adjusting each configuration parameter externally. When adjusting any configuration parameter in the cloud host to be upgraded, the configuration parameter upgrade call request can be obtained through this online upgrade interface.

[0063] Moreover, the online upgrade interface corresponds to a configuration parameter check function and a configuration parameter adjustment function. The configuration parameter adjustment function is used to indicate checking the validity of the configuration parameters, and the configuration parameter adjustment function is used to indicate adjusting the configuration parameters of the cloud host to be upgraded, so as to realize the adjustment of the configuration parameters of the cloud host to be upgraded through the configuration parameter check function and the configuration parameter adjustment function corresponding to the online upgrade interface, thereby adjusting the configuration parameters of the cloud host to be upgraded with the help of the unified online upgrade interface.

[0064] The above-mentioned configuration parameter check function and configuration parameter adjustment function can adopt English names, and the functions corresponding to the names can be determined through the English names. For example, the name of the configuration parameter check function is HotplugCheck(), and the name of the configuration parameter adjustment function is HotplugAction(), making the function naming of the online upgrade interface clear and the meaning of the input parameters clear, so that the online upgrade interface is an interface with a clear meaning.

[0065] The configuration method provided in this embodiment will be described below with examples. The cloud host to be upgraded is a virtual machine running in a physical machine, and the Libvirt component is a component used to manage virtual machine instances. The Libvirt component can manage various types of virtual machine instances including QEMU (Quick Emulator, an open-source emulator and virtual machine monitor). Then, the configuration method provided in this embodiment can be integrated into the Libvirt component. For example, an online upgrade module is set in the Libvirt component, and the functions that can implement the above configuration method are integrated in the online upgrade module to execute the above configuration method through the online upgrade module. The process is as Figure 3 shown:

[0066] In Figure 3The Libvirt component provides an online upgrade interface that can be called by the Openstack component to receive a configuration parameter upgrade call request sent by the Openstack component. The configuration parameter upgrade call request carries target configuration parameters, including the target number of virtual processors and the target virtual memory size. The online upgrade module in the Libvirt component determines whether the target number of virtual processors is greater than or equal to the number of virtual processors currently configured for the cloud host to be upgraded and less than the total number of available virtual processors for the cloud host to be upgraded. If the target number of virtual processors is greater than or equal to the number of virtual processors currently configured for the cloud host to be upgraded and less than the total number of available virtual processors for the cloud host to be upgraded, a processor upgrade is performed to indicate an adjustment to the configuration parameters of the cloud host to be upgraded, such as adding virtual processors to the cloud host to be upgraded.

[0067] The online upgrade module in the Libvirt component determines whether the target memory size is greater than or equal to the memory size currently configured for the cloud host to be upgraded and less than the total available memory for the cloud host to be upgraded. If the target memory size is greater than or equal to the memory size currently configured for the cloud host to be upgraded and less than the total available memory for the cloud host to be upgraded, a memory upgrade is performed to indicate an adjustment to the configuration parameters of the cloud host to be upgraded, such as adding virtual memory to the cloud host to be upgraded.

[0068] In the case of a successful upgrade, the online upgrade module updates the configuration file of the cloud host to be upgraded, updating the number of virtual processors and the virtual memory size in the configuration file for the next startup of the cloud host to be upgraded.

[0069] For the foregoing method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that this application is not limited by the described action sequence because, according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0070] Please refer to Figure 4 , which shows an optional structure of a configuration device provided by an embodiment of this application, and may include: an acquisition unit 10, an extraction unit 20, an inspection unit 30, and a processing unit 40.

[0071] An obtaining unit 10 is configured to obtain a configuration parameter upgrade call request, which is used to indicate an adjustment to the configuration parameters of a cloud host to be upgraded. The configuration parameter upgrade call request may be obtained when there is a change in the computing and processing capabilities of the cloud host to be upgraded. The configuration parameter upgrade call request indicates which cloud host to be upgraded's configuration parameters should be adjusted, and the configuration parameter upgrade call request may be executed during the normal operation of the cloud host to be upgraded, so as to adjust the configuration parameters of the cloud host to be upgraded without interrupting its normal operation. In this way, the user does not need to shut down or restart the cloud host to be upgraded. For the form of the configuration parameter upgrade call request, please refer to the above method embodiments, and this embodiment will not elaborate further.

[0072] The obtaining unit 10 may obtain the configuration parameter upgrade call request through an online upgrade interface. The online upgrade interface is used to receive a configuration parameter upgrade call request for adjusting any configuration parameter of the cloud host to be upgraded, and the online upgrade interface corresponds to a configuration parameter check function and a configuration parameter adjustment function. The configuration parameter adjustment function is used to indicate checking the validity of the configuration parameters, and the configuration parameter adjustment function is used to indicate adjusting the configuration parameters of the cloud host to be upgraded. Thus, the checking unit 30 may call the configuration parameter check function to check the validity of the target configuration parameters, and the processing unit 40 may call the configuration parameter adjustment function to adjust the configuration parameters of the cloud host to be upgraded.

[0073] An extraction unit 20 is configured to extract the target configuration parameters carried in the configuration parameter upgrade call request. The configuration parameter upgrade call request may be encapsulated according to a preset format. In the preset format, the lengths and corresponding fields of the target configuration parameters and the identifier of the cloud host to be upgraded may be specified, so as to extract the target configuration parameters from the configuration parameter upgrade call request based on the preset format. The preset format is not limited in this embodiment.

[0074] A checking unit 30 is configured to check the validity of the target configuration parameters to determine whether the target configuration parameters are valid.

[0075] Since the cloud host to be upgraded runs as a virtual machine on a physical machine, some configurations of the cloud host to be upgraded are restricted by the physical machine. For example, the number of virtual processors used by the cloud host to be upgraded is limited by the logical cores of the processor of the physical machine. Therefore, in this embodiment, it is necessary to check the validity of the target configuration parameters to check whether the target configuration parameters are valid configuration parameters. For example, check whether the target configuration parameters are within the range defined by the configuration parameters of the physical machine where the cloud host to be upgraded is located. If it is within the range defined by the configuration parameters of the physical machine, it is determined that the target configuration parameters are valid configuration parameters and the target configuration parameters are valid.

[0076] In this embodiment, the process by which the checking unit 30 checks the validity of the target configuration parameters includes, but is not limited to, the following methods:

[0077] In one method, the validity of the target virtual processor number in the target configuration parameters is checked: the validity of the target virtual processor number in the target configuration parameters is checked to determine whether the target virtual processor number is greater than or equal to the number of virtual processors currently configured for the cloud host to be upgraded and whether it is less than the total number of available virtual processors of the cloud host to be upgraded; if the target virtual processor number is greater than or equal to the number of virtual processors currently configured for the cloud host to be upgraded and less than the total number of available virtual processors of the cloud host to be upgraded, it is determined that the target virtual processor number is valid.

[0078] In another method, the validity of the target memory amount in the target configuration parameters is checked: the validity of the target memory amount in the target configuration parameters is checked to determine whether the target memory amount is greater than or equal to the memory amount currently configured for the cloud host to be upgraded and whether it is less than the total available memory of the cloud host to be upgraded; if the target memory amount is greater than or equal to the memory amount currently configured for the cloud host to be upgraded and less than the total available memory of the cloud host to be upgraded, it is determined that the target memory amount is valid.

[0079] The processing unit 40 is configured to, if the target configuration parameters are valid, adjust the configuration parameters of the cloud host to be upgraded to the target configuration parameters. The processing unit 40 is further configured to, if the target configuration parameters are not valid, prohibit the adjustment of the configuration parameters of the cloud host to be upgraded.

[0080] If the target configuration parameters are valid, it indicates that the target configuration parameters are within the range of the configuration parameters of the physical machine where the cloud host to be upgraded is located, and the configuration parameters of the cloud host to be upgraded can be adjusted. Adjusting the configuration parameters of the cloud host to be upgraded to the target configuration parameters indicates that the configuration parameters of the cloud host to be upgraded have been successfully upgraded, and the target configuration parameters take effect immediately. In this way, the cloud host to be upgraded can be reconfigured based on the target configuration parameters, such as reconfiguring the virtual processors used by the cloud host to be upgraded based on the target virtual processor number.

[0081] If the target configuration parameters are valid, it indicates that the target configuration parameters exceed the range of the configuration parameters of the physical machine where the cloud host to be upgraded is located, and the adjustment of the configuration parameters of the cloud host to be upgraded is prohibited. If the adjustment of the configuration parameters of the cloud host to be upgraded is prohibited, it indicates that the upgrade of the configuration parameters of the cloud host to be upgraded has failed. In this case, a message indicating the failure of the configuration parameter upgrade can be fed back to indicate that the target configuration parameters exceed the range of the configuration parameters of the physical machine where the cloud host to be upgraded is located, and the user can use this as a reference to decide whether to adjust the configuration parameters of the physical machine or virtualize the cloud host to be upgraded on other physical machines.

[0082] The above configuration device obtains a configuration parameter upgrade call request, which is used to indicate an adjustment to the configuration parameters of the cloud host to be upgraded, extracts the target configuration parameters carried in the configuration parameter upgrade call request, and performs a validity check on the target configuration parameters to determine whether the target configuration parameters are valid; if the target configuration parameters are valid, the configuration parameters of the cloud host to be upgraded are adjusted to the target configuration parameters, so as to check the validity of the target configuration parameters during the dynamic adjustment of the configuration parameters of the cloud host to be upgraded, so that the target configuration parameters configured for the cloud host to be upgraded are valid configuration parameters. After the configuration parameters of the cloud host to be upgraded are adjusted to the target configuration parameters, it can be ensured that the cloud host to be upgraded can run normally, improving the success rate of online upgrade.

[0083] Please refer to Figure 5 , which shows an optional structure of another configuration device provided by an embodiment of the present application. Based on the above Figure 4 shown configuration device, it may further include: an update unit 50, which is used to, if a configuration parameter upgrade success message is obtained, update the configuration file of the cloud host to be upgraded based on the target configuration parameters, so as to call the target configuration parameters in the configuration file during the startup process of the cloud host to be upgraded.

[0084] The configuration parameter upgrade success message is obtained when the configuration parameters of the cloud host to be upgraded are adjusted to the target configuration parameters, and is used to indicate that the configuration parameters of the upgraded cloud host are adjusted to the target configuration parameters through the configuration parameter upgrade call request. If a configuration parameter upgrade success message is obtained, the configuration file of the cloud host to be upgraded can be further updated based on the target configuration parameters, such as adjusting the configuration parameters in the configuration file of the cloud host to be upgraded to the target configuration parameters. For example, adjusting the number of virtual processors in the configuration file to the target number of virtual processors and adjusting the amount of memory in the configuration file to the target amount of memory, so as to manage the configuration file of the cloud host to be upgraded, so that the configuration parameters in the configuration file can be updated along with the configuration parameter upgrade call request.

[0085] The configuration file of the cloud host to be upgraded is called during the startup process of the cloud host to be upgraded. In this way, when the cloud host to be upgraded is restarted after the configuration file is adjusted, the adjusted configuration parameters in the configuration file will be called, so that the startup configuration of the cloud host to be upgraded is successful, preventing the configuration parameters from reverting to the configuration parameters before the upgrade during the restart process of the cloud host to be upgraded.

[0086] An embodiment of the present application also provides a configuration device, which includes: a processor and a memory.

[0087] A processor is configured to obtain a configuration parameter upgrade call request for indicating adjustment of configuration parameters of a cloud host to be upgraded, extract target configuration parameters carried in the configuration parameter upgrade call request, perform a validity check on the target configuration parameters to determine whether the target configuration parameters are valid; if the target configuration parameters are valid, adjust the configuration parameters of the cloud host to be upgraded to the target configuration parameters. For the execution process of the processor, please refer to the above method embodiments and will not be elaborated here.

[0088] A memory is configured to store the configuration parameters of the cloud host to be upgraded.

[0089] An embodiment of the present application further provides a storage medium storing computer program code, and when the computer program code is executed, the above configuration method is implemented.

[0090] It should be noted that the various embodiments in this specification can be described in a progressive manner, the features described in the various embodiments in this specification can be mutually replaced or combined, and each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and reference can be made to the partial description of the method embodiments for the relevant parts.

[0091] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.

[0092] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0093] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.

Claims

1. A configuration method, characterized in that, The method includes: Obtaining a configuration parameter upgrade call request, where the configuration parameter upgrade call request is used to indicate adjusting the configuration parameters of the cloud host to be upgraded; Extracting the target configuration parameters carried in the configuration parameter upgrade call request; Performing a validity check on the target number of virtual processors in the target configuration parameters to determine whether the target number of virtual processors is greater than or equal to the number of virtual processors currently configured for the cloud host to be upgraded and less than the total number of available virtual processors of the cloud host to be upgraded; if the target number of virtual processors is greater than or equal to the number of virtual processors currently configured for the cloud host to be upgraded and less than the total number of available virtual processors of the cloud host to be upgraded, determining that the target number of virtual processors is valid; the total number of available virtual processors of the cloud host to be upgraded is the number of logical cores that the physical machine where the cloud host to be upgraded is located can provide; And / or; Performing a validity check on the target memory quantity in the target configuration parameters to determine whether the target memory quantity is greater than or equal to the memory quantity currently configured for the cloud host to be upgraded and less than the total available memory of the cloud host to be upgraded; if the target memory quantity is greater than or equal to the memory quantity currently configured for the cloud host to be upgraded and less than the total available memory of the cloud host to be upgraded, determining that the target memory quantity is valid; the total available memory of the cloud host to be upgraded is the total memory that the physical machine where the cloud host to be upgraded is located can provide; If the target number of virtual processors and / or the target memory quantity is valid, adjusting the configuration parameters of the cloud host to be upgraded to the target configuration parameters.

2. The method according to claim 1, wherein The method further includes: if a configuration parameter upgrade success message is obtained, updating the configuration file of the cloud host to be upgraded based on the target configuration parameters, so as to call the target configuration parameters in the configuration file during the startup process of the cloud host to be upgraded.

3. The method according to claim 1, wherein The obtaining of the configuration parameter upgrade call request includes: obtaining the configuration parameter upgrade call request through an online upgrade interface, where the online upgrade interface is used to receive a configuration parameter upgrade call request for adjusting any configuration parameter of the cloud host to be upgraded, and the online upgrade interface corresponds to a configuration parameter check function and a configuration parameter adjustment function; The configuration parameter adjustment function is used to indicate checking the validity of the configuration parameters, and the configuration parameter adjustment function is used to indicate adjusting the configuration parameters of the cloud host to be upgraded.

4. A configuration device, characterized in that, The device includes: An obtaining unit, configured to obtain a configuration parameter upgrade call request, where the configuration parameter upgrade call request is used to indicate adjusting the configuration parameters of the cloud host to be upgraded; An extracting unit, configured to extract the target configuration parameters carried in the configuration parameter upgrade call request; A checking unit is configured to perform validity check on the number of target virtual processors in the target configuration parameters to determine whether the number of target virtual processors is greater than or equal to the number of virtual processors currently configured for the cloud host to be upgraded and less than the total number of available virtual processors of the cloud host to be upgraded; if the number of target virtual processors is greater than or equal to the number of virtual processors currently configured for the cloud host to be upgraded and less than the total number of available virtual processors of the cloud host to be upgraded, it is determined that the number of target virtual processors is valid; the total number of available virtual processors of the cloud host to be upgraded is the number of logical cores provided by the physical machine where the cloud host to be upgraded is located; and / or; perform validity check on the target memory quantity in the target configuration parameters to determine whether the target memory quantity is greater than or equal to the memory quantity currently configured for the cloud host to be upgraded and less than the total available memory of the cloud host to be upgraded; if the target memory quantity is greater than or equal to the memory quantity currently configured for the cloud host to be upgraded and less than the total available memory of the cloud host to be upgraded, it is determined that the target memory quantity is valid; the total available memory of the cloud host to be upgraded is the total memory provided by the physical machine where the cloud host to be upgraded is located; A processing unit is configured to, if the number of target virtual processors and / or the target memory quantity is valid, adjust the configuration parameters of the cloud host to be upgraded to the target configuration parameters.

5. The device according to claim 4, characterized in that, The device further includes: an updating unit configured to, if a configuration parameter upgrade success message is obtained, update the configuration file of the cloud host to be upgraded based on the target configuration parameters, so as to call the target configuration parameters in the configuration file during the startup process of the cloud host to be upgraded.

6. The device according to claim 4, characterized in that, The obtaining unit is configured to obtain the configuration parameter upgrade call request through an online upgrade interface, where the online upgrade interface is used to receive a configuration parameter upgrade call request for adjusting any configuration parameter of the cloud host to be upgraded, and the online upgrade interface corresponds to a configuration parameter check function and a configuration parameter adjustment function; The configuration parameter adjustment function is used to instruct to check the validity of the configuration parameters and is used to instruct to adjust the configuration parameters of the cloud host to be upgraded.

7. A configuration device, characterized in that, The configuration device includes: a processor and a memory; The processor is configured to obtain a configuration parameter upgrade call request for indicating adjustment of configuration parameters of a cloud host to be upgraded, extract target configuration parameters carried in the configuration parameter upgrade call request, perform a validity check on a target virtual processor number in the target configuration parameters to determine whether the target virtual processor number is greater than or equal to the number of virtual processors currently configured for the cloud host to be upgraded and less than the total number of available virtual processors of the cloud host to be upgraded; if the target virtual processor number is greater than or equal to the number of virtual processors currently configured for the cloud host to be upgraded and less than the total number of available virtual processors of the cloud host to be upgraded, determine that the target virtual processor number is valid; the total number of available virtual processors of the cloud host to be upgraded is the number of logical cores that can be provided by the physical machine where the cloud host to be upgraded is located; and / or; perform a validity check on a target memory quantity in the target configuration parameters to determine whether the target memory quantity is greater than or equal to the memory quantity currently configured for the cloud host to be upgraded and less than the total available memory of the cloud host to be upgraded; if the target memory quantity is greater than or equal to the memory quantity currently configured for the cloud host to be upgraded and less than the total available memory of the cloud host to be upgraded, determine that the target memory quantity is valid; the total available memory of the cloud host to be upgraded is the total memory that can be provided by the physical machine where the cloud host to be upgraded is located; if the target virtual processor number and / or the target memory quantity is valid, adjust the configuration parameters of the cloud host to be upgraded to the target configuration parameters; The memory is configured to store the configuration parameters of the cloud host to be upgraded.

8. A storage medium, characterized in that, Computer program code is stored in the storage medium, and when the computer program code runs, it implements the configuration method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Resource management and control method for virtual machines, and resource management and control device for virtual machines

    CN103645957A

  • Verification method, device and system for virtual machine illegal configuration

    CN104461683A