Load balancer creation method and device, electronic equipment and storage medium

By obtaining user configuration information and determining target resources based on anti-affinity policies, the problem of lack of flexibility in manual configuration parameters in load balancer creation is solved, and efficient creation and high availability of load balancers are achieved.

CN120201030APending Publication Date: 2025-06-24JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510425586.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

In the prior art, the creation of load balancers requires the user to manually configure parameters, and the lack of flexibility makes the load balancers unable to perform maximum performance.

Method used

By obtaining the load balancer configuration information determined by the user based on the load balancer configuration item, if the configuration item includes the host and/or storage pool configuration item of the cloud host, the target host and/or target storage pool information are determined based on the anti-affinity policy, and then the target load balancer is created.

Benefits of technology

Improves flexibility in load balancer parameter configuration, ensuring that load balancers can be created under optimal conditions, improving load balancers' performance and high availability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120201030A_ABST
    Figure CN120201030A_ABST
Patent Text Reader

Abstract

The invention discloses a load balancer creation method and device, electronic equipment and a storage medium, and relates to the technical field of cloud computing, and the method comprises the steps: obtaining load balancer configuration information determined by a user based on a load balancer configuration item; determining a to-be-determined configuration item based on the load balancer configuration information; if the configuration item to be determined comprises a host configuration item of the cloud host and / or a storage pool configuration item of the cloud host, determining target host information corresponding to the host configuration item of the cloud host and / or target storage pool information corresponding to the storage pool configuration item of the cloud host based on an anti-affinity strategy; and determining target load balancer configuration information based on the load balancer configuration information, the target host information and / or the target storage pool information, and creating a target load balancer. The technical problems that manual parameter configuration lacks flexibility and the created load balancer cannot exert the maximum performance in the prior art are solved, and the technical effects of improving the parameter configuration flexibility and improving the performance of the load balancer are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and particularly to a method, device, electronic device and storage medium for creating a load balancer. Background Art

[0002] With the booming development of cloud computing, as a key component, the load balancer plays an important role in the digital wave. The implementation method of the load balancer is as follows: create a virtual machine in each of the two resource pools of the cloud platform, or create two virtual machines in the same resource pool of the cloud platform, and configure the two created virtual machines as a cluster. One of the virtual machines serves as the primary cloud host, and the other serves as the standby cloud host. These two virtual machines jointly undertake the load balancing service. Among them, a series of parameters need to be configured to create a load balancer, such as the host of the primary cloud host, the host of the standby cloud host, the storage pool of the primary cloud host, the storage pool of the standby cloud host, etc. The configuration of these parameters directly affects the performance and availability of the load balancer.

[0003] However, in the related art, when creating a load balancer, users need to manually configure the parameters that need to be configured, which results in a lack of flexibility in the hosts and storage pools configured for the primary and standby cloud hosts, and the created load balancer is very likely not to achieve its maximum performance. Summary of the Invention

[0004] This application provides a method, device, electronic device and storage medium for creating a load balancer, so as to at least solve the problem that in the related art, users manually configure the parameters that need to be configured, lacking flexibility, and the created load balancer is very likely not to achieve its maximum performance.

[0005] This application provides a method for creating a load balancer, including:

[0006] Obtain the load balancer configuration information determined by the user based on the load balancer configuration items, where the host configuration item of the cloud host and the storage pool configuration item of the cloud host in the load balancer configuration items are optional items;

[0007] Determine the configuration items to be determined based on the load balancer configuration information;

[0008] If the configuration items to be determined include the host configuration item of the cloud host and / or the storage pool configuration item of the cloud host, then determine the target host information corresponding to the host configuration item of the cloud host and / or the target storage pool information corresponding to the storage pool configuration item of the cloud host based on the anti-affinity policy;

[0009] Determine the target load balancer configuration information based on the load balancer configuration information, the target host information and / or the target storage pool information;

[0010] Create a target load balancer based on the target load balancer configuration information.

[0011] The present application also provides a load balancer creation device, including:

[0012] An obtaining module, configured to obtain load balancer configuration information determined by a user based on load balancer configuration items, where the host configuration item of the cloud host and the storage pool configuration item of the cloud host in the load balancer configuration items are optional items;

[0013] A first determination module, configured to determine to-be-determined configuration items based on the load balancer configuration information;

[0014] A second determination module, configured to, if the to-be-determined configuration items include the host configuration item of the cloud host and / or the storage pool configuration item of the cloud host, determine target host information corresponding to the host configuration item of the cloud host and / or target storage pool information corresponding to the storage pool configuration item of the cloud host based on the anti-affinity policy;

[0015] A third determination module, configured to determine target load balancer configuration information based on the load balancer configuration information, the target host information, and / or the target storage pool information;

[0016] A creation module, configured to create a target load balancer based on the target load balancer configuration information.

[0017] The present application also provides an electronic device, including: a memory, configured to store a computer program; a processor, configured to implement the steps of any of the above load balancer creation methods when executing the computer program.

[0018] The present application also provides a computer-readable storage medium, in which a computer program is stored, where the computer program implements the steps of any of the above load balancer creation methods when executed by a processor.

[0019] The present application also provides a computer program product, including a computer program, where the computer program implements the steps of any of the above load balancer creation methods when executed by a processor.

[0020] Through this application, since the load balancer configuration information determined by the user based on the load balancer configuration items is obtained, where the host configuration item and the storage pool configuration item of the cloud host in the load balancer configuration items are optional items; based on the load balancer configuration information, the configuration items to be determined are determined; if the configuration items to be determined include the host configuration item and / or the storage pool configuration item of the cloud host, then based on the anti-affinity policy, the target host information corresponding to the host configuration item of the cloud host and / or the target storage pool information corresponding to the storage pool configuration item of the cloud host are determined; based on the load balancer configuration information, the target host information, and / or the target storage pool information, the target load balancer configuration information is determined, and the target load balancer is created. The user can choose to configure the host configuration item and / or the storage pool configuration item, or not to configure the host configuration item and / or the storage pool configuration item. According to the load balancer configuration information configured by the user, the cloud platform performs optimal configuration on the unconfigured configuration items, solving the technical problem in the related art of manually configuring parameters, lacking flexibility, and the created load balancer not being able to exert the maximum performance, and achieving the technical effects of improving the flexibility of parameter configuration and improving the performance of the load balancer. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only 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.

[0022] Figure 1 It is a schematic diagram of the architecture of a load balancer creation system provided by an embodiment of the present application;

[0023] Figure 2 It is a schematic flowchart of a load balancer creation method provided by an embodiment of the present application;

[0024] Figure 3 It is a schematic flowchart of another load balancer creation method provided by an embodiment of the present application;

[0025] Figure 4 It is a schematic diagram of sorting multiple first mounted storage pools provided by an embodiment of the present application;

[0026] Figure 5 It is a schematic diagram of the load balancer created by the load balancer creation method provided by an embodiment of the present application;

[0027] Figure 6 It is a block diagram of the structure of a load balancer creation device provided by an embodiment of the present application;

[0028] Figure 7Schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0029] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.

[0030] It should be noted that in the description of the present application, the terms "including", "comprising" or any other variant thereof are 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. The terms "first", "second", etc. in the present application are used to distinguish similar objects, rather than to describe a specific order or sequence.

[0031] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.

[0032] In today's era of rapid digital development, cloud computing has become the core force driving enterprise innovation and transformation. Generally speaking, the cloud computing market is in a stage of continuous growth. All industries' dependence on and investment in cloud computing have increased year by year. Whether it is emerging technology startups or traditional industries, they have all migrated their businesses to the cloud. Behind this migration are the significant advantages provided by cloud computing: cost reduction, enabling agile deployment, and providing almost unlimited scalability.

[0033] For small, medium and micro enterprises, in the past, they were limited by insufficient funds and difficult to build complex information technology (IT) infrastructures. Now, through cloud services, they can quickly start digital operations by simply renting resources on demand and compete in the market on the same starting line as large enterprises.

[0034] Digging deeper into the service models of cloud computing, Infrastructure as a Service (IaaS) is particularly eye-catching. As the basic layer of cloud computing, IaaS provides users with basic resources such as computing, storage, and networks. Users can use and pay according to the amount as needed, just like using water and electricity.

[0035] As cloud computing is booming, load balancers, as key components to ensure efficient and stable operation of cloud services, play an important role in the wave of digitalization. With the acceleration of digital transformation of enterprises, massive data traffic is surging, and the demand for load balancers has exploded. Whether it is the shopping peak of e-commerce platforms, the premiere of popular dramas on video websites, or the intensive trading hours of financial institutions, load balancers are indispensable for diverting network traffic. Cloud service providers have keenly captured this trend and have incorporated load balancers into their core service systems to enhance the competitiveness of their own cloud platforms. They not only provide users with basic load balancer configuration options, but also customize exclusive solutions for different industry scenarios.

[0036] From a technical perspective, load balancers have undergone significant innovation. Traditional polling and random allocation algorithms are gradually being replaced by more intelligent weighted algorithms that can dynamically adjust allocation strategies based on actual traffic and business needs. In addition, software-defined load balancers, as an emerging technology, break the limitations of hardware devices and achieve flexible deployment and policy updates through software programming. Enterprises can adjust load balancing rules in real time according to changes in business peaks and troughs, thereby better adapting to the changing rhythm of operations.

[0037] The load balancer essentially creates a virtual machine in each of the two resource pools of the cloud platform, or creates two virtual machines in the same resource pool of the cloud platform, and forms a cluster with the two virtual machines. The two virtual machines serve as the primary cloud host and the backup cloud host, forming the main body that jointly carries the load balancing service, each of which runs specially customized services, forming an organic whole to the outside world.

[0038] In order to create a load balancer, you need to configure a series of parameters, such as name, central processing unit (CPU) architecture, specifications (mainly including CPU cores, memory size, etc.), virtual private cloud (VPC) network, subnet, encryption type, resource pool of the master node, host of the master node, storage pool of the master node, target image library of the master node, resource pool of the standby node, host of the standby node, storage pool of the standby node, target image library of the standby node, etc. Among them, the master node is the main cloud host, and the standby node is the standby cloud host. It can be seen that many of the parameters that need to be configured to create a load balancer are parameters set for creating two cloud hosts that carry load balancing services, which are used to limit where the main cloud host and the standby cloud host are built, what they look like, and how much performance and specifications they have.

[0039] In order to ensure that the load balancer can be created accurately, all of the above parameters must be configured, that is, all corresponding parameter information must be configured. The configuration of these parameters directly affects the performance and availability of the load balancer.

[0040] However, in the related art, when creating a load balancer, users need to manually configure the parameters to be configured, lacking flexibility, and there is a great possibility that the created load balancer cannot exert its maximum performance or even fails to be created due to unreasonable configured parameter information.

[0041] Exemplarily, when configuring the host and storage pool of the primary node and the host and storage pool of the standby node, some large customers have an extremely large resource scale. There may be hundreds or thousands of hosts, and there may also be hundreds or thousands of storage pools deployed. If the hosts of the primary node and the standby node are not configured properly, for example, the anti-affinity policy is not considered and the same host is misselected, then when this host fails, the entire load balancer may become unusable, and the high-availability feature cannot be exerted. The same is true for the storage pool. Furthermore, if a certain host or storage pool is already running at a high load and there are few remaining resources and no more resources can be created on it, then if the user misselects this host or storage pool without awareness, it will inevitably lead to the failure to create the primary cloud host or standby cloud host due to insufficient remaining resources, and then the load balancer creation fails. There are also many other special cases, which all impose extremely high requirements on the creation of the load balancer invisibly.

[0042] In view of the above problems, the embodiments of the present application provide a method, device, electronic device, and storage medium for creating a load balancer. The method includes: obtaining load balancer configuration information determined by a user based on load balancer configuration items, where the host configuration item of the cloud host and the storage pool configuration item of the cloud host in the load balancer configuration items are optional items; determining to-be-determined configuration items based on the load balancer configuration information; if the to-be-determined configuration items include the host configuration item of the cloud host and / or the storage pool configuration item of the cloud host, then determining target host information corresponding to the host configuration item of the cloud host and / or target storage pool information corresponding to the storage pool configuration item of the cloud host based on the anti-affinity policy; determining target load balancer configuration information based on the load balancer configuration information, target host information, and / or target storage pool information; and creating a target load balancer based on the target load balancer configuration information. The method provided by the above solution, by setting the host configuration item of the cloud host and the storage pool configuration item of the cloud host as optional items, the user can choose to configure the host configuration item and / or the storage pool configuration item, or can choose not to configure the host configuration item and / or the storage pool configuration item. According to the load balancer configuration information configured by the user, the cloud platform performs optimal configuration on the unconfigured configuration items, solves the technical problem of manual parameter configuration in the related art, lacking flexibility, and the created load balancer cannot exert its maximum performance, and achieves the technical effects of improving the flexibility of parameter configuration and improving the performance of the load balancer.

[0043] The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0044] First, in combination with the specific application environment architecture or specific hardware architecture on which the execution of the load balancer creation method depends, the specific application environment architecture or specific hardware architecture is described herein.

[0045] The load balancer creation method, device, electronic device, and storage medium provided by the embodiments of the present application are applicable to configuring the configuration parameters required for the load balancer when creating the load balancer, so as to create the load balancer based on the configured parameter information. As Figure 1 shown, it is a schematic diagram of the architecture of the load balancer creation system based on the embodiments of the present application. The load balancer creation system includes a client and a cloud platform. The client is used to obtain the load balancer configuration information determined by the user based on the load balancer configuration items, and transmit the load balancer configuration information to the cloud platform. The cloud platform is used to receive the load balancer configuration information sent by the client, determine the to-be-determined configuration items based on the load balancer configuration information, determine the to-be-determined configuration information corresponding to the to-be-determined configuration items based on the to-be-determined configuration items, and create a load balancer based on the load balancer configuration information and the to-be-determined configuration information.

[0046] An embodiment of the present application provides a load balancer creation method, which is applied to the cloud platform. Figure 2 It is a flowchart of the load balancer creation method provided by the embodiments of the present application. As Figure 2 shown, the process includes the following steps:

[0047] Step S201, obtain the load balancer configuration information determined by the user based on the load balancer configuration items, where the host configuration item of the cloud host and the storage pool configuration item of the cloud host in the load balancer configuration items are optional items.

[0048] Among them, a series of parameters need to be configured to create a load balancer, and each parameter corresponds to a load balancer configuration item.

[0049] It can be understood that other configuration items in the load balancer configuration items except the host configuration item of the cloud host and the storage pool configuration item of the cloud host are required items.

[0050] Since the host configuration item of the cloud host and the storage pool configuration item of the cloud host are optional items, the user can select the corresponding target host information based on the host configuration item of the cloud host, or can not select the corresponding target host information. The user can select the corresponding target storage pool information based on the storage pool configuration item of the cloud host, or can not select the corresponding target storage pool information.

[0051] Step S202: Determine the configuration items to be determined based on the load balancer configuration information.

[0052] Among them, after obtaining the load balancer configuration information, according to the load balancer configuration information, it is possible to determine the load balancer configuration items for which the user has not selected the corresponding configuration item information, that is, the configuration items to be determined.

[0053] Step S203: If the configuration items to be determined include the host configuration items of the cloud host and / or the storage pool configuration items of the cloud host, then based on the anti-affinity policy, determine the target host information corresponding to the host configuration items of the cloud host and / or the target storage pool information corresponding to the storage pool configuration items of the cloud host.

[0054] Among them, the load balancer includes two cloud hosts, and high-availability services are provided by forming a cluster of the two cloud hosts. The creation of these two cloud hosts requires specifying their own hosts and storage pools respectively for creation. Whichever hosts and storage pools are selected, the two cloud hosts of the load balancer will ultimately be created on the corresponding physical hosts and storage devices.

[0055] To ensure the high-availability characteristics of the load balancer, it is necessary to avoid, as much as possible, the situation where the hosts and storage pools used by the two cloud hosts of the load balancer are the same device, and it is necessary to make the hosts and storage pools of the two cloud hosts be anti-affine as much as possible.

[0056] The anti-affinity policy means avoiding the situation where the hosts of the two cloud hosts are the same host and avoiding the situation where the storage pools of the two cloud hosts are the same storage pool.

[0057] Step S204: Determine the target load balancer configuration information based on the load balancer configuration information, the target host information, and / or the target storage pool information.

[0058] It can be understood that if the configuration items to be determined only include the host configuration items of the cloud host, then based on the anti-affinity policy, determine the target host information corresponding to the host configuration items of the cloud host, and based on the load balancer configuration information and the target host information, determine the target load balancer configuration information.

[0059] If the configuration items to be determined only include the storage pool configuration items of the cloud host, then based on the anti-affinity policy, determine the target storage pool information corresponding to the storage pool configuration items of the cloud host, and based on the load balancer configuration information and the target storage pool information, determine the target load balancer configuration information.

[0060] If the configuration items to be determined include both the host configuration items of the cloud host and the storage pool configuration items of the cloud host, then based on the anti-affinity policy, determine the target host information corresponding to the host configuration items of the cloud host and the target storage pool information corresponding to the storage pool configuration items of the cloud host, and based on the load balancer configuration information, the target host information, and the target storage pool information, determine the target load balancer configuration information.

[0061] Step S205: Create a target load balancer based on the target load balancer configuration information.

[0062] Among them, after determining the target load balancer configuration information, based on the target load balancer configuration, the corresponding target load balancer can be created on the cloud platform.

[0063] The load balancer creation method provided by the embodiments of this application obtains the load balancer configuration information determined by the user based on the load balancer configuration items. Among them, the host configuration item of the cloud host and the storage pool configuration item of the cloud host in the load balancer configuration items are optional items; based on the load balancer configuration information, determine the configuration items to be determined; if the configuration items to be determined include the host configuration item of the cloud host and / or the storage pool configuration item of the cloud host, then based on the anti-affinity policy, determine the target host information corresponding to the host configuration item of the cloud host and / or the target storage pool information corresponding to the storage pool configuration item of the cloud host; based on the load balancer configuration information, target host information, and / or target storage pool information, determine the target load balancer configuration information and create a target load balancer. When creating a load balancer, the user can freely choose to configure the host configuration item and / or the storage pool configuration item, or not configure the host configuration item and / or the storage pool configuration item. According to the load balancer configuration information configured by the user, the cloud platform performs optimal configuration on the unconfigured configuration items, that is, creates the primary cloud host and the standby cloud host of the load balancer on different hosts and storage pools. When one of the cloud hosts fails, the other cloud host can still ensure continuous and stable service provision, making the load balancer have extremely high high-availability characteristics. This solves the technical problem in the related art of manually configuring parameters, lacking flexibility, and the created load balancer not being able to exert its maximum performance, and achieves the technical effects of improving the flexibility of parameter configuration, normally creating a load balancer, the created load balancer having high availability, and improving the performance of the load balancer.

[0064] That is to say, when creating a load balancer, the user can manually configure all based on the load balancer configuration items, or partially manually configure and partially automatically configure by the cloud platform, or all be automatically configured by the cloud platform, providing a more convenient processing strategy for the user. In semi-automatic and full-automatic configuration, the best host or storage pool can be found according to the running conditions of the host or storage pool, improving the performance of the created load balancer, having strong compatibility and flexibility, ensuring the stable operation of the cloud platform, and bringing better stability, reliability, and security to the cloud platform.

[0065] The embodiments of this application provide a load balancer creation method, which is applied to a cloud platform. Figure 3 This is the flowchart of the load balancer creation method provided by the embodiments of this application, asFigure 3 As shown, the process includes the following steps:

[0066] Step S301: Obtain the load balancer configuration information determined by the user based on the load balancer configuration items. Among them, the host configuration item and the storage pool configuration item of the cloud host in the load balancer configuration items are optional items. For details, please refer to Figure 2 Step S201 of the embodiment shown, which will not be elaborated here.

[0067] Step S302: Determine the configuration items to be determined based on the load balancer configuration information.

[0068] Step S303: If the configuration items to be determined include the host configuration item and / or the storage pool configuration item of the cloud host, then based on the anti-affinity policy, determine the target host information corresponding to the host configuration item of the cloud host and / or the target storage pool information corresponding to the storage pool configuration item of the cloud host.

[0069] Specifically, the above step S303 includes:

[0070] Step S3031: If the configuration items to be determined include the host configuration item of the first cloud host and / or the host configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then sort the multiple hosts in the resource pool in ascending order of memory usage to obtain the first sequence. Based on the first target storage pool information corresponding to the storage pool configuration item of the first cloud host, determine the multiple first mounted hosts mounted on the first target storage pool corresponding to the first target storage pool information. Based on the first sequence, determine the first target host that is the most forward in the sorting and is different from the host characterized by the second target host information corresponding to the host configuration item of the second cloud host from the multiple first mounted hosts, and determine the host information corresponding to the first target host as the first target host information corresponding to the host configuration item of the first cloud host; and / or, based on the second target storage pool information corresponding to the storage pool configuration item of the second cloud host, determine the multiple second mounted hosts mounted on the second target storage pool corresponding to the second target storage pool information. Based on the first sequence, determine the second target host that is the most forward in the sorting and is different from the host characterized by the first target host information corresponding to the host configuration item of the first cloud host from the multiple second mounted hosts, and determine the host information corresponding to the second target host as the second target host information corresponding to the host configuration item of the second cloud host. The target host information includes the first target host information and / or the second target host information.

[0071] The cloud host includes a first cloud host and a second cloud host. The first cloud host can be a primary cloud host or a backup cloud host. The second cloud host can be a primary cloud host or a backup cloud host. The first cloud host is different from the second cloud host, that is, when the first cloud host is the primary cloud host, the second cloud host is the backup cloud host; when the first cloud host is the backup cloud host, the second cloud host is the primary cloud host.

[0072] It should be noted that whether the first cloud host and the second cloud host are located in the same resource pool of the cloud platform is determined based on the load balancer configuration information.

[0073] In the case where the configuration items to be determined include the host configuration items of the first cloud host or the host configuration items of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, Algorithm 1 is used to determine the first target host information or the second target host information. Algorithm 1 is: If a cloud host A selects host C and storage pool D, and another cloud host B does not select a host but selects storage pool E, then the available hosts in the resource pool are sorted in positive order according to memory usage, and the first host in the sequence that is mounted by storage pool E and is different from host C is assigned to cloud host B. If there is no such host, then the first host in the sequence that is mounted by storage pool E is assigned to cloud host B. Among them, the available host is a host that has mounted a storage pool, runs normally without failure, and can provide services normally. Under some cloud platforms, the available host must also have been initialized with software-defined networking (Software-Defined Networking, referred to as: SDN) to support the use of software-defined networking. It should be noted that the cloud host selects the host, which means that the user has configured the corresponding host information for the cloud host, and the cloud host selects the storage pool, which means that the user has configured the corresponding storage pool information for the cloud host. Among them, the primary cloud host and the backup cloud host are defined as cloud host A and cloud host B. Cloud host A and cloud host B do not correspond to the primary cloud host and the backup cloud host respectively, but only represent the existence of these two cloud hosts. Cloud host A and cloud host B are not ranked in order.

[0074] It is understandable that if there is no first target host that meets the above conditions among the multiple first mounting hosts, the host with the highest ranking among the multiple first mounting hosts is determined as the first target host based on the first sequence. Algorithm 1 has the same meaning as the corresponding description in step S3031.

[0075] That is to say, it is the best result that the host and storage pool of the first cloud host are not the same as those of the second cloud host. However, anti-affinity is not a necessary condition that must be achieved. If it is impossible to achieve absolute anti-affinity due to factors such as insufficient hosts or storage pools, failures, etc., then it should also be allowed that the host of the first cloud host is the same as the host of the second cloud host or the storage pool of the first cloud host is the same as the storage pool of the second cloud host. The first priority is to legally create a load balancer.

[0076] It should be noted that there is a mounting relationship between the host and the storage pool. Only when the storage pool is mounted on the host can this combination of the host and the storage pool be used. That is, when creating the primary cloud host and the standby cloud host, only a certain host and a certain storage pool mounted on this host can be used.

[0077] The configuration items to be determined include the host configuration items of the first cloud host and the host configuration items of the second cloud host. When the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, Algorithm 2 is used to determine the first target host information and the second target host information. Algorithm 2 is as follows: If neither Cloud Host A nor Cloud Host B has selected a host but has selected a storage pool, then the available hosts in the resource pool are sorted in ascending order according to the memory usage rate. First, the host mounted by the storage pool selected by the primary cloud host in the sequence is preferentially assigned to the primary cloud host. Then, the host mounted by the storage pool selected by the standby cloud host in the sequence and different from the host assigned to the primary cloud host is assigned to the standby cloud host. If there is no such host, then the host mounted by the storage pool selected by the standby cloud host in the sequence is assigned to the standby cloud host.

[0078] It can be understood that if there is no second target host among the multiple second-mounted hosts that meets the above conditions, then based on the first sequence, the host ranked highest in the multiple second-mounted hosts is determined as the second target host. Algorithm 2 has the same meaning as the corresponding description in step S3031.

[0079] Step S304, based on the load balancer configuration information, target host information, and / or target storage pool information, determine the target load balancer configuration information. For details, please refer to Figure 2 Step S204 of the embodiment shown, which will not be elaborated here.

[0080] Step S305, based on the target load balancer configuration information, create the target load balancer. For details, please refer to Figure 2 Step S205 of the embodiment shown, which will not be elaborated here.

[0081] The load balancer creation method provided by the embodiments of the present application selects a host with a lower memory usage rate as the target host by sorting based on the memory usage rate from low to high, which can allocate resources more reasonably, avoid the situation where some hosts are overloaded while other hosts are idle, and thus improve the overall resource utilization rate. Using the anti-affinity policy to ensure that the first cloud host and the second cloud host are not allocated to the same host or storage pool. This design can prevent single points of failure. Even if a certain host or a certain storage pool fails, it will not affect the first cloud host and the second cloud host at the same time, thereby enhancing the reliability and stability of the system.

[0082] In some alternative embodiments, step S303 includes:

[0083] Step a1, if the configuration item to be determined includes the storage pool configuration item of the first cloud host and / or the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, based on the first target host information corresponding to the host configuration item of the first cloud host, determine the multiple first mounted storage pools mounted on the first target host corresponding to the first target host information. Sort the multiple first mounted storage pools in the order of storage type priority from high to low to obtain a second sequence. Sort the storage pools with the same storage type in the second sequence in the order of remaining storage space from more to less to obtain a third sequence. Determine the first target storage pool that is the most forward in the third sequence and is different from the storage pool represented by the second target storage pool information corresponding to the storage pool configuration item of the second cloud host, and determine the storage pool information corresponding to the first target storage pool as the first target storage pool information corresponding to the storage pool configuration item of the first cloud host; and / or, based on the second target host information corresponding to the host configuration item of the second cloud host, determine the multiple second mounted storage pools mounted on the second target host corresponding to the second target host information. Sort the multiple second mounted storage pools in the order of storage type priority from high to low to obtain a fourth sequence. Sort the storage pools with the same storage type in the fourth sequence in the order of remaining storage space from more to less to obtain a fifth sequence. Determine the second target storage pool that is the most forward in the fifth sequence and is different from the storage pool represented by the first target storage pool information corresponding to the storage pool configuration item of the first cloud host, and determine the storage pool information corresponding to the second target storage pool as the second target storage pool information corresponding to the storage pool configuration item of the second cloud host. Among them, the target storage pool information includes the first target storage pool information and / or the second target storage pool information.

[0084] Among them, when the configuration item to be determined includes the storage pool configuration item of the first cloud host or the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, Algorithm 3 is used to determine the first target storage pool information or the second target storage pool information. Algorithm 3 is as follows: If cloud host A selects storage pool D which is also selected by host C, and cloud host B selects host F but does not select a storage pool, then sort the storage pools mounted by host F according to the configured storage type priority, and then in the storage pools of each storage type, sort them in reverse order according to the available amount, that is, the remaining storage space. Finally, a sequence sorted in two levels is obtained. At this time, the first storage pool different from storage pool D in this storage sequence is assigned to cloud host B. If there is no such storage pool, then the first storage pool in this storage sequence is assigned to cloud host B.

[0085] It can be understood that if there is no first target storage pool in the third sequence that meets the above conditions, then based on the third sequence, the storage pool with the highest sort order is determined as the first target storage pool. Algorithm 3 has the same meaning as the corresponding description in step a1.

[0086] Among them, when the configuration item to be determined includes the storage pool configuration item of the first cloud host and the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, Algorithm 4 is used to determine the first target storage pool information and the second target storage pool information. Algorithm 4 is as follows: If both cloud host A and cloud host B select hosts and do not select storage pools, then for the host assigned to the primary cloud host and the host assigned to the standby cloud host, sort the storage pools they have mounted respectively according to the configured storage type priority, and then in the storage pools of each storage type, sort them in reverse order according to the available amount. Finally, a sequence sorted in two levels is obtained. Then, first assign the first storage pool in the storage sequence under the host of the primary cloud host to the primary cloud host, and then assign the first storage pool in the storage sequence under the host of the standby cloud host to the standby cloud host. If the storage pool selected by the standby cloud host is the same as the storage pool selected by the primary cloud host, then the standby cloud host selects the second storage pool in its storage sequence. If not, it still uses the first storage pool.

[0087] It can be understood that if there is no second target storage pool in the fifth sequence that meets the above conditions, then based on the fifth sequence, the storage pool with the highest sort order is determined as the second target storage pool. Algorithm 4 has the same meaning as the corresponding description in step a1.

[0088] It should be noted that the storage type priority is the priority order set by the user according to their actual needs. The earlier one is, the more preferentially it will be used. The priority of the storage type can be specified through the configuration file. Exemplarily, the default storage type priority from high to low is as follows: highly available storage pool, local storage pool, high-speed highly available storage pool, Network File System (NFS) storage pool, and various other types of storage pools. Among them, an available storage pool refers to a storage pool with normal status, sufficient available space, and already mounted on the host. Both available hosts and available storage pools can ensure with 100% certainty that cloud hosts can be correctly created and can be powered on and provide services normally.

[0089] Figure 4 This is a schematic diagram for sorting multiple first-mounted storage pools provided by an embodiment of the present application. As Figure 4 shown, the first-mounted storage pools include local storage pool 1 and local storage pool 2 of the type of local storage pool, highly available storage pool 1, highly available storage pool 2, and disaster recovery storage pool 1 of the type of highly available storage pool. Perform the first-level sorting according to the storage type priority, that is, sort the first-mounted storage pools in the order of the default storage type priority from high to low, and obtain the sorting result of highly available storage pool 1, highly available storage pool 2, disaster recovery storage pool 1, local storage pool 1, and local storage pool 2. Perform the second-level sorting on the sorting result after the first-level sorting in descending order of available quantity, that is, sort the storage pools with the same storage type in the sorting result after the first-level sorting in the order of the remaining storage space from more to less, and obtain the sorting result of highly available storage pool 1, disaster recovery storage pool 1, highly available storage pool 2, local storage pool 2, and local storage pool 1.

[0090] The load balancer creation method provided by the embodiment of the present application, through sorting based on the storage type priority from high to low, and further sorting in the order of the remaining storage space from more to less among the storage pools with the same storage type, preferentially selects the storage pool with a high storage type priority and sufficient remaining storage space, which can reduce the performance bottleneck problem caused by insufficient storage resources, thereby improving the overall performance of the load balancer.

[0091] In some alternative embodiments, the above step S303 includes:

[0092] Step b1, if the configuration items to be determined include the host configuration item of the first cloud host and the storage pool configuration item of the first cloud host, and the first cloud host and the second cloud host are in the same resource pool of the cloud platform, then based on the anti-affinity policy, the memory usage rates of multiple hosts in the resource pool, and the second target host information corresponding to the host configuration item of the second cloud host, determine the first target host information corresponding to the host configuration item of the first cloud host; based on the anti-affinity policy, the first target host information, and the second target storage pool information corresponding to the storage pool configuration item of the second cloud host, determine the first target storage pool information corresponding to the storage pool configuration item of the first cloud host.

[0093] Among them, when the configuration items to be determined include the host configuration item of the first cloud host and the storage pool configuration item of the first cloud host, and the first cloud host and the second cloud host are in the same resource pool of the cloud platform, Algorithm 5 is used to determine the first target host information and the first target storage pool information. Algorithm 5 is as follows: If cloud host A selects host C and also selects storage pool D, and cloud host B does not select a host or a storage pool, then sort the available hosts in the resource pool in ascending order of memory usage rate, and allocate the first host different from host C to cloud host B. If there is no such host, then allocate the first host in this host sequence to cloud host B; then sort the storage pools already mounted by the host allocated to cloud host B in ascending order according to the configured storage type priority, and then in each storage type of storage pool, sort in descending order of available amount respectively. Finally, a sequence sorted by two levels is obtained. At this time, allocate the first storage pool different from storage pool D in this storage sequence to cloud host B. If there is no such storage pool, then allocate the first storage pool in this storage sequence to cloud host B.

[0094] That is to say, if the configuration item to be determined includes the host configuration item of the first cloud host and the storage pool configuration item of the first cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then sort the multiple hosts in the resource pool in ascending order of memory usage to obtain the sixth sequence, determine the first target host that is the topmost in the sixth sequence and is different from the host represented by the second target host information corresponding to the host configuration item of the second cloud host, and determine the host information corresponding to the first target host as the first target host information corresponding to the host configuration item of the first cloud host; based on the first target host information, determine the multiple first mounted storage pools already mounted by the first target host corresponding to the first target host information, sort the multiple first mounted storage pools in descending order of storage type priority to obtain the seventh sequence, sort the storage pools with the same storage type in the seventh sequence in descending order of remaining storage space to obtain the eighth sequence, determine the first target storage pool that is the topmost in the eighth sequence and is different from the storage pool represented by the second target storage pool information corresponding to the storage pool configuration item of the second cloud host, and determine the storage pool information corresponding to the first target storage pool as the first target storage pool information corresponding to the storage pool configuration item of the first cloud host.

[0095] Among them, the target host information includes the first target host information, and the target storage pool information includes the first target storage pool information.

[0096] Step b2, if the configuration item to be determined includes the host configuration item of the second cloud host and the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then determine the second target host information corresponding to the host configuration item of the second cloud host based on the anti-affinity policy, the memory usage of the multiple hosts in the resource pool, and the first target host information corresponding to the host configuration item of the first cloud host; determine the second target storage pool information corresponding to the storage pool configuration item of the second cloud host based on the anti-affinity policy, the second target host information, and the first target storage pool information corresponding to the storage pool configuration item of the first cloud host.

[0097] Among them, when the configuration item to be determined includes the host configuration item of the second cloud host and the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, Algorithm 5 is used to determine the second target host information and the second target storage pool information. For details, refer to the description of the foregoing step b1, which will not be elaborated here.

[0098] Among them, the target host information includes the second target host information, and the target storage pool information includes the second target storage pool information.

[0099] The load balancer creation method provided by the embodiments of the present application can more reasonably allocate host resources and avoid resource waste or over - concentration on certain hosts by determining host configuration items based on memory usage rate and anti - affinity policy. During the determination process of storage pool configuration items, the storage type priority and remaining storage space are comprehensively considered to ensure the efficient utilization of storage resources. The overall performance of the load balancer is improved.

[0100] In some alternative embodiments, step S303 includes:

[0101] Step c1, if the configuration item to be determined includes the host configuration item of the first cloud host and the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are in the same resource pool of the cloud platform, then based on the anti - affinity policy, the memory usage rates of multiple hosts in the resource pool, the first target storage pool information corresponding to the storage pool configuration item of the first cloud host, and the second target host information corresponding to the host configuration item of the second cloud host, determine the first target host information corresponding to the host configuration item of the first cloud host; based on the anti - affinity policy, the second target host information, and the first target storage pool information, determine the second target storage pool information corresponding to the storage pool configuration item of the second cloud host.

[0102] Among them, when the configuration item to be determined includes the host configuration item of the first cloud host and the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are in the same resource pool of the cloud platform, Algorithm 6 is used to determine the first target host information and the second target storage pool information. Algorithm 6 is as follows: If cloud host A selects host C but does not select a storage pool, and cloud host B does not select a host but selects storage pool E, then sort the available hosts in the resource pool in ascending order of memory usage rate, and find the first host that has been mounted by storage pool E and is different from host C and allocate it to cloud host B. If there is no such host, then find the first host that has been mounted by storage pool E from this host sequence and allocate it to cloud host B; among the storage pools where host C has been mounted, sort them according to the configured storage type priority, and then in each storage type of storage pool, sort them in descending order of available amount respectively. Finally, a sequence sorted in two levels is obtained. At this time, allocate the first storage pool different from storage pool E in this storage sequence to cloud host A. If there is no such storage pool, then allocate the first storage pool in this storage sequence to cloud host A.

[0103] That is to say, if the configuration item to be determined includes the host configuration item of the first cloud host and the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then multiple hosts in the resource pool are sorted in ascending order of memory usage rate to obtain the ninth sequence. Based on the first target storage pool information corresponding to the storage pool configuration item of the first cloud host, multiple first-mounted hosts mounted on the first target storage pool corresponding to the first target storage pool information are determined. The first target host that is the most forward in the ninth sequence, different from the host characterized by the second target host information corresponding to the host configuration item of the second cloud host, and belongs to the multiple first-mounted hosts is determined, and the host information corresponding to the first target host is determined as the first target host information corresponding to the host configuration item of the first cloud host; based on the second target host information, multiple second-mounted storage pools already mounted on the second target host corresponding to the second target host information are determined. The multiple second-mounted storage pools are sorted in descending order of storage type priority to obtain the tenth sequence, and the storage pools with the same storage type in the tenth sequence are sorted in descending order of remaining storage space to obtain the eleventh sequence. The second target storage pool that is the most forward in the eleventh sequence and different from the storage pool characterized by the first target storage pool information corresponding to the storage pool configuration item of the first cloud host is determined, and the storage pool information corresponding to the second target storage pool is determined as the second target storage pool information corresponding to the storage pool configuration item of the second cloud host.

[0104] Among them, the target host information includes the first target host information, and the target storage pool information includes the second target storage pool information.

[0105] Step c2, if the configuration item to be determined includes the storage pool configuration item of the first cloud host and the host configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then based on the anti-affinity policy, the memory usage rate of multiple hosts in the resource pool, the second target storage pool information corresponding to the storage pool configuration item of the second cloud host, and the first target host information corresponding to the host configuration item of the first cloud host, the second target host information corresponding to the host configuration item of the second cloud host is determined; based on the anti-affinity policy, the first target host information and the second target storage pool information, the first target storage pool information corresponding to the storage pool configuration item of the first cloud host is determined.

[0106] Among them, when the configuration item to be determined includes the storage pool configuration item of the first cloud host and the host configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, Algorithm 6 is used to determine the second target host information and the first target storage pool information. For the detailed description, please refer to the relevant description in the foregoing step c1, and it will not be elaborated here.

[0107] Among them, the target host information includes the second target host information, and the target storage pool information includes the first target storage pool information.

[0108] The load balancer creation method provided by the embodiments of this application helps to reduce performance bottleneck problems caused by insufficient resources by preferentially selecting hosts with lower memory usage rates and storage pools with more remaining storage space, thereby improving the overall performance of the load balancer.

[0109] In some optional implementation manners, the above step S303 includes:

[0110] Step d1, if the configuration items to be determined include the host configuration item of the first cloud host, the storage pool configuration item of the first cloud host, and the host configuration item of the second cloud host, and the first cloud host and the second cloud host are in the same resource pool of the cloud platform, then based on the second target storage pool information corresponding to the storage pool configuration item of the second cloud host and the memory usage rates of multiple hosts in the resource pool, determine the second target host information corresponding to the host configuration item of the second cloud host; based on the anti-affinity policy, the second target host information, and the memory usage rates of multiple hosts in the resource pool, determine the first target host information corresponding to the host configuration item of the first cloud host; based on the anti-affinity policy, the first target host information, and the second target storage pool information, determine the first target storage pool information corresponding to the storage pool configuration item of the first cloud host.

[0111] Among them, in the case where the configuration items to be determined include the host configuration item of the first cloud host, the storage pool configuration item of the first cloud host, and the host configuration item of the second cloud host, and the first cloud host and the second cloud host are in the same resource pool of the cloud platform, Algorithm 7 is used to determine the first target host information, the second target host information, and the first target storage pool information. Algorithm 7 is as follows: If neither cloud host A nor cloud host B has selected a host, and one of the cloud hosts has selected a storage pool while the other has not, then sort the available hosts in the resource pool in ascending order of memory usage rate, and preferentially allocate the host mounted by the first selected storage pool to the cloud host to which the storage pool belongs. After this, this cloud host has already determined its host and storage pool, but the other cloud host has neither a host nor a storage pool; Next, from the current host sequence, find the first host different from the already allocated host and allocate it to the other cloud host. If there is no such host, then allocate the first host in the host sequence to the other cloud host, and then sort the storage pools mounted by this host in descending order of available amount according to the configured storage type priority. Then, in each storage type of storage pool, sort them in descending order of available amount respectively. Finally, obtain a sequence sorted in two levels. At this time, allocate the first storage pool different from the selected storage pool in this storage sequence to the other cloud host. If there is no such storage pool, then allocate the first storage pool in this storage sequence to the other cloud host.

[0112] That is to say, if the configuration items to be determined include the host configuration item of the first cloud host, the storage pool configuration item of the first cloud host, and the host configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then the multiple hosts in the resource pool are sorted in ascending order of memory usage rate to obtain the twelfth sequence. Based on the second target storage pool information corresponding to the storage pool configuration item of the second cloud host, determine the multiple second mounted hosts mounted on the second target storage pool corresponding to the second target storage pool information. Determine the second target host that is the most forward in the twelfth sequence and belongs to the multiple second mounted hosts, and determine the host information corresponding to the second target host as the second target host information corresponding to the host configuration item of the second cloud host; Determine the first target host that is the most forward in the twelfth sequence and is different from the host characterized by the second target host information, and determine the host information corresponding to the first target host as the first target host information corresponding to the host configuration item of the first cloud host; Based on the first target host information, determine the multiple first mounted storage pools already mounted on the first target host corresponding to the first target host information. Sort the multiple first mounted storage pools in descending order of storage type priority to obtain the thirteenth sequence. Sort the storage pools with the same storage type in the thirteenth sequence in descending order of remaining storage space to obtain the fourteenth sequence. Determine the first target storage pool that is the most forward in the fourteenth sequence and is different from the storage pool characterized by the second target storage pool information, and determine the storage pool information corresponding to the first target storage pool as the first target storage pool information corresponding to the storage pool configuration item of the first cloud host.

[0113] Among them, the target host information includes the first target host information and the second target host information, and the target storage pool information includes the first target storage pool information.

[0114] Step d2, if the configuration items to be determined include the host configuration item of the first cloud host, the storage pool configuration item of the first cloud host, and the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then based on the anti-affinity policy, the memory usage rate of the multiple hosts in the resource pool, and the second target host information corresponding to the host configuration item of the second cloud host, determine the first target host information corresponding to the host configuration item of the first cloud host; Based on the first target host information, determine the first target storage pool information corresponding to the storage pool configuration item of the first cloud host; Based on the anti-affinity policy, the second target host information, and the first target storage pool information, determine the second target storage pool information corresponding to the storage pool configuration item of the second cloud host.

[0115] Among them, when the configuration items to be determined include the host configuration item of the first cloud host, the storage pool configuration item of the first cloud host, and the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, Algorithm 8 is used to determine the first target host information, the first target storage pool information, and the second target storage pool information. Algorithm 8 is as follows: If only one of Cloud Host A and Cloud Host B selects a host and neither selects a storage pool, then sort the available hosts in the resource pool in ascending order of memory usage rate, find the first different host and assign it to the cloud host that has not selected a host. If there is no different host, then the primary cloud host and the standby cloud host share this only host. Then, among the hosts assigned to the primary cloud host and the standby cloud host, sort the already mounted storage pools respectively according to the configured storage type priority, and then sort them in descending order of available capacity in each storage type of storage pool. Finally, obtain a sequence sorted in two levels. Then, first assign the first storage pool in the storage sequence under the host of the primary cloud host to the primary cloud host, and then assign the first storage pool in the storage sequence under the host of the standby cloud host to the standby cloud host. If the storage pool selected by the standby cloud host is the same as the storage pool selected by the primary cloud host, then the standby cloud host selects the second storage pool in its storage sequence; if not, it still uses the first storage pool.

[0116] That is to say, if the configuration items to be determined include the host configuration item of the first cloud host, the storage pool configuration item of the first cloud host, and the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then sort the multiple hosts in the resource pool in ascending order of memory usage rate to obtain the fifteenth sequence, determine the first target host that is the most forward in the fifteenth sequence and is different from the host characterized by the host configuration item of the second cloud host, and determine the host information corresponding to the first target host as the first target host information corresponding to the host configuration item of the first cloud host. At this time, the configuration items to be determined include the storage pool configuration item of the first cloud host and the storage pool configuration item of the second cloud host, and Algorithm 4 described above can be used for determination, which will not be elaborated here.

[0117] Among them, the target host information includes the first target host information, and the target storage pool information includes the first target storage pool information and the second target storage pool information.

[0118] In some alternative embodiments, step S303 described above includes:

[0119] Step e1, if the configuration items to be determined include the host configuration item of the first cloud host, the storage pool configuration item of the first cloud host, the host configuration item of the second cloud host, and the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are in the same resource pool of the cloud platform, then based on the memory utilization rates of multiple hosts in the resource pool, determine the first target host information corresponding to the host configuration item of the first cloud host.

[0120] Step e2, based on the anti-affinity policy, the memory utilization rates of multiple hosts in the resource pool, and the first target host information, determine the second target host information corresponding to the host configuration item of the second cloud host.

[0121] Step e3, based on the first target host information, determine the first target storage pool information corresponding to the storage pool configuration item of the first cloud host.

[0122] Step e4, based on the anti-affinity policy, the second target host information, and the first target storage pool information, determine the second target storage pool information corresponding to the storage pool configuration item of the second cloud host.

[0123] Specifically, in the case where the configuration items to be determined include the host configuration item of the first cloud host, the storage pool configuration item of the first cloud host, the host configuration item of the second cloud host, and the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are in the same resource pool of the cloud platform, Algorithm 9 is used to determine the first target host information, the second target host information, the first target storage pool information, and the second target storage pool information. Algorithm 9 is as follows: If neither the host nor the storage pool of cloud host A and cloud host B has been selected, then sort the available hosts in the resource pool in ascending order of memory utilization rate, and find the lowest two hosts to be assigned to the primary cloud host and the standby cloud host respectively. If there is only one available host, then the primary cloud host and the standby cloud host share this single host; then among the two hosts assigned to the primary cloud host and the standby cloud host, sort the already mounted storage pools of each according to the configured storage type priority respectively, and then in each storage of each storage type, sort them in descending order of available quantity respectively. Finally, obtain a sequence sorted in two levels. Then first assign the first storage pool in the storage sequence of the host of the primary cloud host to the primary cloud host, and then assign the first storage pool in the storage sequence of the host of the standby cloud host to the standby cloud host. If the storage pool selected by the standby cloud host is the same as that selected by the primary cloud host, then the standby cloud host selects the second storage pool in its storage sequence; if not, it still uses the first storage pool.

[0124] That is to say, if the configuration items to be determined include the host configuration item of the first cloud host, the storage pool configuration item of the first cloud host, the host configuration item of the second cloud host, and the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then multiple hosts in the resource pool are sorted in ascending order of memory usage rate to obtain the sixteenth sequence, and the first target host ranked at the top of the sixteenth sequence is determined, and the host information corresponding to the first target host is determined as the first target host information corresponding to the host configuration item of the first cloud host. At this time, the configuration items to be determined include the storage pool configuration item of the first cloud host, the host configuration item of the second cloud host, and the storage pool configuration item of the second cloud host, which can be determined using the aforementioned Algorithm 8 and will not be elaborated here.

[0125] Among them, the target host information includes the first target host information and the second target host information, and the target storage pool information includes the first target storage pool information and the second target storage pool information.

[0126] It should be noted that in the case where the configuration items to be determined are empty, Algorithm 10 is used to determine the corresponding information. Algorithm 10 is as follows: If both cloud host A and cloud host B have selected a host and a storage pool, there is no need for further automatic processing, and the load balancer configuration information determined by the user based on the load balancer configuration item is directly used to create the target load balancer.

[0127] In some alternative embodiments, the above load balancer creation method further includes:

[0128] Step f1, during the process of creating the target load balancer based on the target load balancer configuration information, the creation status is obtained in real time.

[0129] Step f2, in the case where the creation status is creation failure, the step of creating the target load balancer based on the target load balancer configuration information is executed again.

[0130] Step f3, in the case where the number of times of executing the step of creating the target load balancer based on the target load balancer configuration information exceeds the preset number threshold and the creation status is still creation failure, an alarm message is generated to notify the user that the creation of the target load balancer fails.

[0131] Among them, the preset number threshold is set by technical personnel and is not specifically limited here.

[0132] The load balancer creation method provided by the embodiments of the present application can timely detect the situation of creation failure by obtaining the creation status in real time, and take measures to recreate. This reduces the service interruption time caused by the failure of load balancer creation and improves the overall reliability of the system. By setting a preset number threshold, it avoids infinite retries in the case of unsuccessful creation, thus saving resources and time.

[0133] It can be understood that there are 16 possible situations for the configuration items to be determined. For the configuration items that have been manually specified, the specified configuration is directly used, and the unspecified configuration items are automatically obtained by the corresponding algorithms. The corresponding relationship between each situation and the aforementioned 10 algorithms is shown in Table 1.

[0134] Table 1

[0135]

[0136] In summary, the overall strategy for determining the host and storage pool of the cloud host is as follows: prefer host anti-affinity, followed by storage pool anti-affinity, and the host preferably selects the one with low memory usage. The storage pool is sorted in two levels. The first-level sorting supports the priority of storage types that can be dynamically configured, and the one with higher priority is preferred; the second-level sorting supports sorting according to the available storage, that is, the remaining storage space, and the one with larger available amount is preferred.

[0137] Furthermore, the above embodiments are all based on the premise that the first cloud host and the second cloud host are in the same resource pool of the cloud platform to determine the host and storage pool of the cloud host. In the case where the first cloud host and the second cloud host are in different resource pools of the cloud platform, the overall strategy for determining the host and storage pool of the cloud host will not need to consider anti-affinity because the hosts and storage pools in different resource pools are different. The strategy is updated as follows: the host preferably selects the one with low memory usage in the resource pool of the cloud host. The storage pool is sorted in two levels. The first-level sorting supports the priority of storage types that can be dynamically configured, and the one with higher priority in the resource pool of the cloud host is preferred; the second-level sorting supports sorting according to the available storage, that is, the remaining storage space, and the one with larger available amount in the resource pool of the cloud host is preferred. The specific implementation is similar to that when the first cloud host and the second cloud host are in the same resource pool of the cloud platform, and will not be elaborated here.

[0138] The load balancer creation method provided by the embodiments of the present application has been actually deployed in cloud platforms built in various architecture environments and has successfully achieved the original concept, which is convenient for users to operate.

[0139] Figure 5 It is a schematic diagram of a load balancer created according to the load balancer creation method provided by the embodiments of the present application, as Figure 5As shown, a load balancer is created in a resource pool on a cloud platform. The load balancer includes a primary cloud host and a standby cloud host. The resource pool includes Host 1, Host 2, Host 3, Storage Pool 1, Storage Pool 2, Storage Pool 3, and Storage Pool 4. Among them, Storage Pool 1, Storage Pool 2, and Storage Pool 3 are mounted to Host 1, Storage Pool 2 and Storage Pool 3 are mounted to Host 2, and Storage Pool 3 and Storage Pool 4 are mounted to Host 3.

[0140] The host of the primary cloud host is different from the host of the standby cloud host. The host of the primary cloud host is Host 1, and the host of the standby cloud host is Host 2. The storage pool of the primary cloud host is also different from the storage pool of the standby cloud host. The storage pool of the primary cloud host is Storage Pool 2 mounted to Host 1, and the storage pool of the standby cloud host is Storage Pool 3 mounted to Host 2.

[0141] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.

[0142] The embodiment of the present application also provides a load balancer creation device, as Figure 6 shown. The load balancer creation device includes:

[0143] An acquisition module 601, configured to acquire load balancer configuration information determined by a user based on load balancer configuration items. Among them, the host configuration item of the cloud host and the storage pool configuration item of the cloud host in the load balancer configuration items are optional items.

[0144] A first determination module 602, configured to determine to-be-determined configuration items based on the load balancer configuration information.

[0145] A second determination module 603, configured to, if the to-be-determined configuration items include the host configuration item of the cloud host and / or the storage pool configuration item of the cloud host, determine the target host information corresponding to the host configuration item of the cloud host and / or the target storage pool information corresponding to the storage pool configuration item of the cloud host based on the anti-affinity policy.

[0146] A third determination module 604, configured to determine the target load balancer configuration information based on the load balancer configuration information, the target host information, and / or the target storage pool information.

[0147] A creation module 605, configured to create a target load balancer based on the target load balancer configuration information.

[0148] In some optional implementation manners, the second determination module 603 includes:

[0149] A first determination unit, configured to, if the configuration item to be determined includes the host configuration item of the first cloud host and / or the host configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, sort multiple hosts in the resource pool in ascending order of memory utilization rate to obtain a first sequence, determine multiple first mounted hosts mounted on a first target storage pool corresponding to the first target storage pool information corresponding to the storage pool configuration item of the first cloud host, and based on the first sequence, determine a first target host that is the most forward in sorting and is different from the host represented by the second target host information corresponding to the host configuration item of the second cloud host from the multiple first mounted hosts, and determine the host information corresponding to the first target host as the first target host information corresponding to the host configuration item of the first cloud host;

[0150] And / or, based on the second target storage pool information corresponding to the storage pool configuration item of the second cloud host, determine multiple second mounted hosts mounted on a second target storage pool corresponding to the second target storage pool information, and based on the first sequence, determine a second target host that is the most forward in sorting and is different from the host represented by the first target host information corresponding to the host configuration item of the first cloud host from the multiple second mounted hosts, and determine the host information corresponding to the second target host as the second target host information corresponding to the host configuration item of the second cloud host.

[0151] In some optional embodiments, the second determination module 603 includes:

[0152] A second determination unit, configured to, if the configuration item to be determined includes the storage pool configuration item of the first cloud host and / or the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, determine multiple first mounted storage pools mounted on a first target host corresponding to the first target host information corresponding to the host configuration item of the first cloud host, sort the multiple first mounted storage pools in descending order of storage type priority to obtain a second sequence, sort the storage pools with the same storage type in the second sequence in descending order of remaining storage space to obtain a third sequence, determine a first target storage pool that is the most forward in sorting in the third sequence and is different from the storage pool represented by the second target storage pool information corresponding to the storage pool configuration item of the second cloud host, and determine the storage pool information corresponding to the first target storage pool as the first target storage pool information corresponding to the storage pool configuration item of the first cloud host;

[0153] And / or, based on the second target host information corresponding to the host configuration item of the second cloud host, determine the multiple second mounted storage pools already mounted on the second target host corresponding to the second target host information. Sort the multiple second mounted storage pools in the order from the highest to the lowest storage type priority to obtain a fourth sequence. Sort the storage pools with the same storage type in the fourth sequence in the order from the most to the least remaining storage space to obtain a fifth sequence. Determine the second target storage pool that is the most ranked in the fifth sequence and is different from the storage pool characterized by the first target storage pool information corresponding to the storage pool configuration item of the first cloud host. Determine the storage pool information corresponding to the second target storage pool as the second target storage pool information corresponding to the storage pool configuration item of the second cloud host.

[0154] In some alternative embodiments, the second determination module 603 includes:

[0155] A third determination unit, configured to, if the configuration item to be determined includes the host configuration item of the first cloud host and the storage pool configuration item of the first cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, determine the first target host information corresponding to the host configuration item of the first cloud host based on the anti-affinity policy, the memory usage rates of multiple hosts in the resource pool, and the second target host information corresponding to the host configuration item of the second cloud host; determine the first target storage pool information corresponding to the storage pool configuration item of the first cloud host based on the anti-affinity policy, the first target host information, and the second target storage pool information corresponding to the storage pool configuration item of the second cloud host.

[0156] A fourth determination unit, configured to, if the configuration item to be determined includes the host configuration item of the second cloud host and the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, determine the second target host information corresponding to the host configuration item of the second cloud host based on the anti-affinity policy, the memory usage rates of multiple hosts in the resource pool, and the first target host information corresponding to the host configuration item of the first cloud host; determine the second target storage pool information corresponding to the storage pool configuration item of the second cloud host based on the anti-affinity policy, the second target host information, and the first target storage pool information corresponding to the storage pool configuration item of the first cloud host.

[0157] In some alternative embodiments, the second determination module 603 includes:

[0158] A fifth determination unit, configured to, if the configuration item to be determined includes the host configuration item of the first cloud host and the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, determine the first target host information corresponding to the host configuration item of the first cloud host based on the anti-affinity policy, the memory usage rates of multiple hosts in the resource pool, the first target storage pool information corresponding to the storage pool configuration item of the first cloud host, and the second target host information corresponding to the host configuration item of the second cloud host; and determine the second target storage pool information corresponding to the storage pool configuration item of the second cloud host based on the anti-affinity policy, the second target host information, and the first target storage pool information.

[0159] A sixth determination unit, configured to, if the configuration item to be determined includes the storage pool configuration item of the first cloud host and the host configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, determine the second target host information corresponding to the host configuration item of the second cloud host based on the anti-affinity policy, the memory usage rates of multiple hosts in the resource pool, the second target storage pool information corresponding to the storage pool configuration item of the second cloud host, and the first target host information corresponding to the host configuration item of the first cloud host; and determine the first target storage pool information corresponding to the storage pool configuration item of the first cloud host based on the anti-affinity policy, the first target host information, and the second target storage pool information.

[0160] In some alternative embodiments, the second determination module 603 includes:

[0161] A seventh determination unit, configured to, if the configuration item to be determined includes the host configuration item of the first cloud host, the storage pool configuration item of the first cloud host, and the host configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, determine the second target host information corresponding to the host configuration item of the second cloud host based on the second target storage pool information corresponding to the storage pool configuration item of the second cloud host and the memory usage rates of multiple hosts in the resource pool; determine the first target host information corresponding to the host configuration item of the first cloud host based on the anti-affinity policy, the second target host information, and the memory usage rates of multiple hosts in the resource pool; and determine the first target storage pool information corresponding to the storage pool configuration item of the first cloud host based on the anti-affinity policy, the first target host information, and the second target storage pool information.

[0162] An eighth determination unit, configured to, if the configuration item to be determined includes the host configuration item of the first cloud host, the storage pool configuration item of the first cloud host, and the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, determine the first target host information corresponding to the host configuration item of the first cloud host based on the anti-affinity policy, the memory usage of multiple hosts in the resource pool, and the second target host information corresponding to the host configuration item of the second cloud host; determine the first target storage pool information corresponding to the storage pool configuration item of the first cloud host based on the first target host information; and determine the second target storage pool information corresponding to the storage pool configuration item of the second cloud host based on the anti-affinity policy, the second target host information, and the first target storage pool information.

[0163] In some alternative embodiments, the second determination module 603 includes:

[0164] A ninth determination unit, configured to, if the configuration item to be determined includes the host configuration item of the first cloud host, the storage pool configuration item of the first cloud host, the host configuration item of the second cloud host, and the storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, determine the first target host information corresponding to the host configuration item of the first cloud host based on the memory usage of multiple hosts in the resource pool.

[0165] A tenth determination unit, configured to determine the second target host information corresponding to the host configuration item of the second cloud host based on the anti-affinity policy, the memory usage of multiple hosts in the resource pool, and the first target host information.

[0166] An eleventh determination unit, configured to determine the first target storage pool information corresponding to the storage pool configuration item of the first cloud host based on the first target host information.

[0167] A twelfth determination unit, configured to determine the second target storage pool information corresponding to the storage pool configuration item of the second cloud host based on the anti-affinity policy, the second target host information, and the first target storage pool information.

[0168] For the description of the features in the corresponding embodiments of the load balancer creation device, reference may be made to the relevant description in the corresponding embodiments of the load balancer creation method, which will not be elaborated here one by one.

[0169] An embodiment of the present application further provides an electronic device, as Figure 7 shown, including a processor 701 and a memory 702. The memory 702 stores a computer program, and the processor 701 is configured to run the computer program to execute the steps in any one of the above-described embodiments of the load balancer creation method.

[0170] Embodiments of the present application further provide a computer-readable storage medium storing a computer program, where the computer program is configured to execute the steps in any of the above-described embodiments of the load balancer creation method when running.

[0171] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as USB flash drives, read-only memories (ROM), random access memories (RAM), external hard drives, magnetic disks, or optical discs that can store computer programs.

[0172] Embodiments of the present application further provide a computer program product. The above computer program product includes a computer program that, when executed by a processor, implements the steps in any of the above-described embodiments of the load balancer creation method.

[0173] Embodiments of the present application further provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above-described embodiments of the load balancer creation method.

[0174] Those skilled in the art can further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled artisans can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the present application.

[0175] The above has introduced in detail a load balancer creation method, device, electronic device, and storage medium provided by the present application. Specific examples are used herein to elaborate on the principles and implementation manners of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. A method for creating a load balancer, characterized in that: include: Obtaining load balancer configuration information determined by the user based on the load balancer configuration items, wherein the host configuration item of the cloud host and the storage pool configuration item of the cloud host in the load balancer configuration items are optional items; Determining a configuration item to be determined based on the load balancer configuration information; If the configuration items to be determined include host configuration items of the cloud host and / or storage pool configuration items of the cloud host, then based on the anti-affinity policy, determine the target host information corresponding to the host configuration items of the cloud host and / or the target storage pool information corresponding to the storage pool configuration items of the cloud host; Determine target load balancer configuration information based on the load balancer configuration information, the target host information and / or the target storage pool information; Create a target load balancer based on the target load balancer configuration information.

2. The method for creating a load balancer according to claim 1, characterized in that: The cloud host includes a first cloud host and a second cloud host, and if the configuration item to be determined includes a host configuration item of the cloud host and / or a storage pool configuration item of the cloud host, determining target host information corresponding to the host configuration item of the cloud host and / or target storage pool information corresponding to the storage pool configuration item of the cloud host based on an anti-affinity policy, including: If the configuration items to be determined include host configuration items of the first cloud host and / or host configuration items of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then multiple hosts in the resource pool are sorted in order of memory usage from low to high to obtain a first sequence, and based on the first target storage pool information corresponding to the storage pool configuration item of the first cloud host, multiple first mounting hosts mounted by the first target storage pool corresponding to the first target storage pool information are determined, and based on the first sequence, a first target host that is ranked highest and is different from the host represented by the second target host information corresponding to the host configuration item of the second cloud host is determined from the multiple first mounting hosts, and the host information corresponding to the first target host is determined as the first target host information corresponding to the host configuration item of the first cloud host; and / or, based on the second target storage pool information corresponding to the storage pool configuration item of the second cloud host, determining a plurality of second mounting hosts mounted by the second target storage pool corresponding to the second target storage pool information, and based on the first sequence, determining a second target host that is ranked highest from the plurality of second mounting hosts and is different from the host represented by the first target host information corresponding to the host configuration item of the first cloud host, and determining the host information corresponding to the second target host as the second target host information corresponding to the host configuration item of the second cloud host; The target host information includes first target host information and / or second target host information.

3. The method for creating a load balancer according to claim 1, characterized in that: The cloud host includes a first cloud host and a second cloud host, and if the configuration item to be determined includes a host configuration item of the cloud host and / or a storage pool configuration item of the cloud host, determining target host information corresponding to the host configuration item of the cloud host and / or target storage pool information corresponding to the storage pool configuration item of the cloud host based on an anti-affinity policy, including: If the configuration items to be determined include storage pool configuration items of the first cloud host and / or storage pool configuration items of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then based on the first target host information corresponding to the host configuration item of the first cloud host, multiple first mounted storage pools mounted by the first target host corresponding to the first target host information are determined, and based on the order of storage type priority from high to low, the multiple first mounted storage pools are sorted to obtain a second sequence, and the storage pools with the same storage type in the second sequence are sorted in order from more to less remaining storage space to obtain a third sequence, and the first target storage pool that is the most forward in the third sequence and is different from the storage pool represented by the second target storage pool information corresponding to the storage pool configuration item of the second cloud host is determined, and the storage pool information corresponding to the first target storage pool is determined as the first target storage pool information corresponding to the storage pool configuration item of the first cloud host; And / or, based on the second target host information corresponding to the host configuration item of the second cloud host, determine multiple second mounted storage pools mounted on the second target host corresponding to the second target host information, sort the multiple second mounted storage pools based on the order of storage type priority from high to low to obtain a fourth sequence, sort the storage pools with the same storage type in the fourth sequence in order from more to less remaining storage space to obtain a fifth sequence, determine the second target storage pool that is the most forward in the fifth sequence and is different from the storage pool represented by the first target storage pool information corresponding to the storage pool configuration item of the first cloud host, and determine the storage pool information corresponding to the second target storage pool as the second target storage pool information corresponding to the storage pool configuration item of the second cloud host; The target storage pool information includes first target storage pool information and / or second target storage pool information.

4. The method for creating a load balancer according to claim 1, characterized in that: The cloud host includes a first cloud host and a second cloud host, and if the configuration item to be determined includes a host configuration item of the cloud host and / or a storage pool configuration item of the cloud host, determining target host information corresponding to the host configuration item of the cloud host and / or target storage pool information corresponding to the storage pool configuration item of the cloud host based on an anti-affinity policy, including: If the configuration items to be determined include host configuration items of the first cloud host and storage pool configuration items of the first cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then based on the anti-affinity policy, the memory usage of the multiple hosts in the resource pool, and the second target host information corresponding to the host configuration items of the second cloud host, the first target host information corresponding to the host configuration items of the first cloud host is determined; based on the anti-affinity policy, the first target host information, and the second target storage pool information corresponding to the storage pool configuration items of the second cloud host, the first target storage pool information corresponding to the storage pool configuration items of the first cloud host is determined; If the configuration items to be determined include host configuration items of the second cloud host and storage pool configuration items of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then based on the anti-affinity policy, the memory usage of multiple hosts in the resource pool, and the first target host information corresponding to the host configuration items of the first cloud host, the second target host information corresponding to the host configuration items of the second cloud host is determined; based on the anti-affinity policy, the second target host information and the first target storage pool information corresponding to the storage pool configuration items of the first cloud host, the second target storage pool information corresponding to the storage pool configuration items of the second cloud host is determined.

5. The method for creating a load balancer according to claim 1, characterized in that: The cloud host includes a first cloud host and a second cloud host, and if the configuration item to be determined includes a host configuration item of the cloud host and / or a storage pool configuration item of the cloud host, determining target host information corresponding to the host configuration item of the cloud host and / or target storage pool information corresponding to the storage pool configuration item of the cloud host based on an anti-affinity policy, including: If the configuration items to be determined include host configuration items of the first cloud host and storage pool configuration items of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then based on the anti-affinity policy, the memory usage of multiple hosts in the resource pool, the first target storage pool information corresponding to the storage pool configuration items of the first cloud host, and the second target host information corresponding to the host configuration items of the second cloud host, determine the first target host information corresponding to the host configuration items of the first cloud host; based on the anti-affinity policy, the second target host information and the first target storage pool information, determine the second target storage pool information corresponding to the storage pool configuration items of the second cloud host; If the configuration items to be determined include storage pool configuration items of the first cloud host and host configuration items of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then based on the anti-affinity policy, the memory usage of multiple hosts in the resource pool, the second target storage pool information corresponding to the storage pool configuration items of the second cloud host, and the first target host information corresponding to the host configuration items of the first cloud host, the second target host information corresponding to the host configuration items of the second cloud host is determined; based on the anti-affinity policy, the first target host information and the second target storage pool information, the first target storage pool information corresponding to the storage pool configuration items of the first cloud host is determined.

6. The method for creating a load balancer according to claim 1, characterized in that: The cloud host includes a first cloud host and a second cloud host, and if the configuration item to be determined includes a host configuration item of the cloud host and / or a storage pool configuration item of the cloud host, determining target host information corresponding to the host configuration item of the cloud host and / or target storage pool information corresponding to the storage pool configuration item of the cloud host based on an anti-affinity policy, including: If the configuration items to be determined include host configuration items of the first cloud host, storage pool configuration items of the first cloud host, and host configuration items of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then based on the second target storage pool information corresponding to the storage pool configuration items of the second cloud host and the memory usage of multiple hosts in the resource pool, determine the second target host information corresponding to the host configuration items of the second cloud host; based on the anti-affinity policy, the second target host information, and the memory usage of multiple hosts in the resource pool, determine the first target host information corresponding to the host configuration items of the first cloud host; based on the anti-affinity policy, the first target host information, and the second target storage pool information, determine the first target storage pool information corresponding to the storage pool configuration items of the first cloud host; If the configuration items to be determined include host configuration items of the first cloud host, storage pool configuration items of the first cloud host, and storage pool configuration items of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then based on the anti-affinity policy, the memory usage of multiple hosts in the resource pool, and the second target host information corresponding to the host configuration items of the second cloud host, the first target host information corresponding to the host configuration items of the first cloud host is determined; based on the first target host information, the first target storage pool information corresponding to the storage pool configuration items of the first cloud host is determined; based on the anti-affinity policy, the second target host information, and the first target storage pool information, the second target storage pool information corresponding to the storage pool configuration items of the second cloud host is determined.

7. The method for creating a load balancer according to claim 1, characterized in that: The cloud host includes a first cloud host and a second cloud host, and if the configuration item to be determined includes a host configuration item of the cloud host and / or a storage pool configuration item of the cloud host, determining target host information corresponding to the host configuration item of the cloud host and / or target storage pool information corresponding to the storage pool configuration item of the cloud host based on an anti-affinity policy, including: If the configuration items to be determined include a host configuration item of the first cloud host, a storage pool configuration item of the first cloud host, a host configuration item of the second cloud host, and a storage pool configuration item of the second cloud host, and the first cloud host and the second cloud host are located in the same resource pool of the cloud platform, then based on the memory usage of the multiple hosts in the resource pool, determine the first target host information corresponding to the host configuration item of the first cloud host; Determine the second target host information corresponding to the host configuration item of the second cloud host based on the anti-affinity policy, the memory usage of the multiple hosts in the resource pool, and the first target host information; Based on the first target host information, determine first target storage pool information corresponding to the storage pool configuration item of the first cloud host; Based on the anti-affinity policy, the second target host information and the first target storage pool information, the second target storage pool information corresponding to the storage pool configuration item of the second cloud host is determined.

8. A load balancer creation device, characterized in that: include: An acquisition module, used to acquire load balancer configuration information determined by a user based on load balancer configuration items, wherein a host configuration item of a cloud host and a storage pool configuration item of a cloud host in the load balancer configuration items are optional items; A first determination module, configured to determine a configuration item to be determined based on the load balancer configuration information; A second determination module is used to determine, based on an anti-affinity policy, target host information corresponding to the host configuration item of the cloud host and / or target storage pool information corresponding to the storage pool configuration item of the cloud host if the configuration item to be determined includes a host configuration item of the cloud host and / or a storage pool configuration item of the cloud host; A third determination module, configured to determine target load balancer configuration information based on the load balancer configuration information, the target host information and / or the target storage pool information; The creation module is used to create a target load balancer based on the target load balancer configuration information.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the load balancer creation method as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the load balancer creation method according to any one of claims 1 to 7.