Virtual machine deployment method, storage medium and computer equipment
By deploying virtual machines across layers in a financial-grade data center, it solves the problem of high availability that is difficult to deal with in existing technologies, and achieves effective response to different levels of faults and high availability guarantees.
Patent Information
- Application Number
- CN202011621766.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-30
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2040-12-30
AI Technical Summary
Existing technologies are difficult to effectively cope with deployment module-level, computer room-level, and building-level failures in financial-level data centers, resulting in virtual machines and applications becoming unavailable and affecting business stability.
By managing the virtual machine deployment terminal, virtual machines are deployed across deployment modules, computer rooms, and buildings according to the availability level and requirements of the application. The remainder algorithm is used to allocate virtual machines among resources at different levels to ensure high availability.
It achieves effective response to different levels of faults, ensures the high availability of financial-level applications, reduces the risk of imbalanced virtual machine scheduling, and reduces network access capability consistency requirements.
Smart Images

Figure CN112612579B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of virtual machine deployment, and in particular to a virtual machine deployment method, storage medium and computer equipment. Background Art
[0002] With the development of enterprise informatization, data centers have gradually become the operation center of enterprises and the heart that drives the development and progress of enterprises. For financial enterprises, designing high-availability strategies for financial-grade data centers is an important guarantee for the safe, stable operation and long-term development of enterprises.
[0003] Financial-grade application high availability is usually achieved through two levels: infrastructure high availability and application high availability. The underlying IT infrastructure provides basic high availability capabilities by setting high availability strategies, such as high availability of dual network cards in servers, high availability of switch access servers, and high availability of multi-node databases. Upper-level applications achieve high availability through clustered design, and application components achieve redundancy through distributed deployment, thereby obtaining high availability capabilities for applications.
[0004] In the related technology, the high availability of financial-grade applications is achieved based on the cluster design and deployment architecture of three lines: at the infrastructure level, financial institutions first integrate servers, storage devices and switches into an infrastructure cluster, and set up a deployment module with three such infrastructure clusters as units. Applications apply for virtual machines in multiples of 3 (3N), and the terminal that manages the deployment of virtual machines deploys the virtual machines applied by the applications on three infrastructure clusters within a deployment module. Each infrastructure cluster within the deployment module provides the computing resources, storage resources and network resources required by the virtual machines.
[0005] However, the above three-line deployment architecture is mature and stable, and can avoid certain levels of failures, but it cannot effectively deal with failures at the deployment module level, computer room level, and building level, and there are risks in safe operation. When the virtual machine or the underlying physical machine is changed, or when the upstream network equipment of the infrastructure cluster has problems, the entire infrastructure in a deployment module may be offline, and the virtual machines deployed on it and the applications based on the virtual machines may be unavailable, thus affecting the business on a large scale. Summary of the invention
[0006] To solve the above technical problems, an embodiment of the present invention provides a virtual machine deployment method, a storage medium and a computer device. The method is applied to a terminal for managing virtual machine deployment, so as to disperse the virtual machines across deployment modules, computer rooms and buildings as much as possible, cope with failures at the deployment module level, computer room level and building level, and ensure high availability at different levels.
[0007] In a first aspect, an embodiment of the present invention provides a virtual machine deployment method, the method is applied to a terminal for managing virtual machine deployment, the method comprising:
[0008] Obtaining a virtual machine application, wherein the virtual machine application carries an application identifier for the virtual machine application and an application quantity of the virtual machine;
[0009] Determining the availability level of the application applying for the virtual machine according to the application identifier;
[0010] When the availability level of the application exceeds a set level, obtaining the number of buildings in which the deployment module is deployed in the data center;
[0011] The applied virtual machines are deployed in various buildings according to the number of buildings and the number of virtual machines. The nth virtual machine is deployed in the n%Bth building, where n is a positive integer between 1 and N, N is the number of applied virtual machines, B is the number of buildings, and n%B is the remainder of n divided by B.
[0012] In one implementation of this embodiment, distributing the applied virtual machines in various buildings includes:
[0013] If there are multiple virtual machines deployed in the same building, the virtual machines deployed in the same building are dispersedly deployed in each computer room of the building, wherein the pth virtual machine is deployed in the p%Rth computer room, wherein p is a positive integer between 1 and P, P is the number of virtual machines deployed in the same building, and R is the number of computer rooms in the same building;
[0014] If there are multiple virtual machines deployed in the same computer room, the virtual machines deployed in the same computer room will be deployed in various deployment modules of the computer room, where the qth virtual machine is deployed on the q%U1th deployment module, q is a positive integer between 1 and Q, Q is the number of virtual machines deployed in the same computer room, U1 is the number of deployment modules in the same computer room, and q%U1 is the remainder of q divided by U1.
[0015] In an implementation of this embodiment, the method further includes:
[0016] When the availability level of the application does not exceed a set level, obtaining the number of computer rooms in a specified building;
[0017] Distribute the applied virtual machines in the computer rooms of the designated building according to the applied number of virtual machines and the number of computer rooms, wherein the nth virtual machine is deployed in the n%Rth computer room, wherein n is a positive integer between 1 and N, N is the applied number of virtual machines, and R is the number of computer rooms in the designated building;
[0018] If there are multiple virtual machines deployed in the same computer room, the virtual machines deployed in the same computer room will be deployed in various deployment modules of the computer room, where the qth virtual machine is deployed on the q%U1th deployment module, q is a positive integer between 1 and Q, Q is the number of virtual machines deployed in the same computer room, U1 is the number of deployment modules in the same computer room, and q%U1 is the remainder of q divided by U1.
[0019] In an implementation of this embodiment, the method further includes:
[0020] If there are multiple virtual machines deployed on the same deployment module, the virtual machines deployed on the same deployment module are dispersedly deployed on different infrastructure clusters of the deployment module, wherein the i-th virtual machine is deployed on the i%C-th infrastructure cluster, i is a positive integer between 1 and I, I is the number of virtual machines deployed on the same deployment module, C is the number of infrastructure clusters in a deployment module, and i%C is the remainder of i divided by C.
[0021] In an implementation of this embodiment, the method further includes:
[0022] If the number of virtual machines deployed on the same deployment module is 1, the virtual machine is deployed on the infrastructure cluster with the lowest resource utilization rate in the deployment module.
[0023] In an implementation of this embodiment, the method further includes:
[0024] Detect whether the virtual machine application has hardware consistency requirements for application expansion;
[0025] If so, the applied virtual machines will be deployed in a dispersed manner on the deployment modules where the original virtual machines of the application are located, wherein the nth virtual machine will be deployed on the n%U2th deployment module, where n is a positive integer between 1 and N, N is the number of applied virtual machines, U2 is the number of deployment modules where the original virtual machines of the application are located, and n%U2 is the remainder of n divided by U2.
[0026] In an implementation of this embodiment, determining the availability level of the application applying for the virtual machine according to the application identifier includes:
[0027] Determining, according to the application identifier, a time during which a service based on the application is not allowed to be interrupted;
[0028] If the service is not allowed to be interrupted for a period of time exceeding a set threshold, the availability level of the application is determined to be high.
[0029] In an implementation of this embodiment, determining the availability level of the application applying for the virtual machine according to the application identifier includes:
[0030] Determine whether the application is a network connection related application according to the application identifier;
[0031] If the application is an Internet connection related application, it is determined that the availability level of the application is high.
[0032] In a second aspect, an embodiment of the present invention provides another virtual machine deployment method, the method is applied to a terminal for managing virtual machine deployment, the method comprising:
[0033] Obtaining a virtual machine application, wherein the virtual machine application carries an application identifier for the virtual machine application and an application quantity of the virtual machine;
[0034] Determining the availability level of the application applying for the virtual machine according to the application identifier;
[0035] Obtaining a deployment module set according to the availability level of the application;
[0036] The applied virtual machines are dispersedly deployed on the deployment modules in the deployment module set according to the applied number of the virtual machines and the number of deployment modules in the deployment module set, wherein the nth virtual machine is deployed on the n%Uth deployment module, n is a positive integer between 1 and N, N is the applied number of virtual machines, U is the number of deployment modules in the deployment module set, and n%U is the remainder of n divided by U.
[0037] In one implementation of this embodiment, when the availability level of the application exceeds a first set level, the deployment module set is determined according to deployment modules in a building where deployment modules are deployed in a data center;
[0038] When the availability level of the application does not exceed the first set level but exceeds the second set level, determining the deployment module set according to the deployment modules in the designated building;
[0039] When the availability level of the application does not exceed a second set level, the deployment module set is determined according to deployment modules in a designated computer room, wherein the first set level is higher than the second set level.
[0040] In one implementation of this embodiment,
[0041] If the application has a hardware consistency requirement for application expansion, the deployment module set is determined according to the deployment module where the original virtual machine of the application is located.
[0042] In an implementation of this embodiment, the method further includes:
[0043] If there are multiple virtual machines deployed on the same deployment module, the virtual machines deployed on the same deployment module are dispersedly deployed on different infrastructure clusters of the deployment module, wherein the i-th virtual machine is deployed on the i%C-th infrastructure cluster, i is a positive integer between 1 and I, I is the number of virtual machines deployed on the same deployment module, C is the number of infrastructure clusters in a deployment module, and i%C is the remainder of i divided by C.
[0044] In an implementation of this embodiment, the method further includes:
[0045] If the number of virtual machines deployed on the same deployment module is 1, the virtual machine is deployed on the infrastructure cluster with the lowest resource utilization rate in the deployment module.
[0046] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, characterized in that the computer instructions can be executed by a processor to implement the processing of the virtual machine deployment method described in the first aspect of the above embodiment.
[0047] In a fourth aspect, an embodiment of the present invention provides a computer device, including:
[0048] a memory having a computer program stored thereon;
[0049] The processor is used to execute the computer program to implement the processing of the virtual machine deployment method described in the first aspect of the above embodiment.
[0050] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, characterized in that the computer instructions can be executed by a processor to implement the processing of the virtual machine deployment method described in the second aspect of the above embodiment.
[0051] In a sixth aspect, an embodiment of the present invention provides a computer device, including:
[0052] a memory having a computer program stored thereon;
[0053] A processor is used to execute the computer program to implement the processing of the virtual machine deployment method described in the second aspect of the above embodiment.
[0054] Compared with the prior art, the virtual machine deployment method provided by the embodiment of the present invention has the following beneficial technical effects:
[0055] By determining the availability level of the application applying for the virtual machine, when the availability level of the application exceeds the set level, the present application deploys the virtual machine applied for by the application across buildings, computer rooms, and deployment modules as much as possible. Compared with deploying the virtual machines in various infrastructure clusters in a deployment module, the present invention can ensure high availability at different levels and cope with building-level, computer room-level, and deployment module-level failures. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only drawings of some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0057] Figure 1 It is a flowchart of a virtual machine deployment method provided by an embodiment of the present invention;
[0058] Figure 2 It is a structural diagram of a deployment module provided by an embodiment of the present invention;
[0059] Figure 3 It is a flowchart of another virtual machine deployment method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0060] To make the purpose, technical solution and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings. It should be understood that the following various embodiments are only used for illustration and are not used to limit the scope of protection of the present invention.
[0061] [Example 1]
[0062] Figure 1 The present invention provides a flow chart of a virtual machine deployment method provided by an embodiment of the present invention. The virtual machine deployment method can be applied to a terminal for managing virtual machine deployment in a financial-grade data center, such as a cloud management platform, and the entire virtual machine deployment process can be controlled by the terminal for managing virtual machine deployment.
[0063] Financial-grade data centers usually have multiple buildings. For high-availability financial-grade applications, the tolerance for errors is relatively low. In this embodiment, the virtual machines applied for by high-availability applications are dispersed and deployed in different buildings. The deployment modules of different buildings provide the computing resources, storage resources and network resources required by the virtual machines. Therefore, building-level infrastructure failures can be dealt with.
[0064] like Figure 1 As shown, the virtual machine deployment method provided in this embodiment may specifically include the following processing:
[0065] S101: Obtain a virtual machine application, wherein the virtual machine application carries an application identifier for the virtual machine application and an application quantity of the virtual machines.
[0066] The terminal for managing virtual machine deployment is a unified management platform for data center resources. It can manage the equipment under its jurisdiction, realize automated production and operation and maintenance, and schedule the computing resources, network resources, and storage resources of the data center. Users can submit virtual machine applications for applications at the terminal for managing virtual machine deployment in the data center. When the terminal for managing virtual machine deployment obtains the virtual machine application, it can parse the virtual machine application and obtain information such as the application identifier of the virtual machine applied for, the applied virtual machine configuration, and the application quantity. In some implementations, in order to standardize user applications and facilitate user filling, the terminal for managing virtual machine deployment can provide a variety of virtual machine configurations for users to choose from on the virtual machine application page.
[0067] When a user submits an application for a virtual machine, the number of virtual machines applied for is multiple, and the configuration of each virtual machine is the same, so as to ensure that when a problem occurs in one virtual machine, the application can still be used based on other virtual machines, so as to achieve virtual machine redundancy and high availability of applications. For example, a user can apply for a virtual machine in multiples of 3, that is, the number of virtual machines applied for can be 3, 6, 9, 12, etc. In some implementations, in order to avoid user filling in errors, the terminal that manages the deployment of virtual machines can detect whether the number of virtual machines applied for by the user meets the quantity requirements, for example, whether the number of virtual machines applied for by the user is a multiple of 3. If it does not meet the requirements, the user can be prompted to fill in again. By applying for virtual machines in multiples of 3, this embodiment can take into account the redundancy, high availability and deployment cost of virtual machines.
[0068] In this embodiment, the number of virtual machines applied for is illustrated by taking the requirement that the number of virtual machines applied for is a multiple of 3 as an example. Under this requirement, the number of virtual machines applied for by the user is at least 3. In other embodiments, the number of virtual machines applied for may also be required to be a multiple of other numbers, such as an integer multiple of 2, an integer multiple of 5, etc. In this case, the number of virtual machines applied for by the user is at least 2 or 5. Of course, in order to achieve high availability of the application, the number of virtual machines applied for is at least 2.
[0069] S102: Determine the availability level of the application applying for the virtual machine according to the application identifier.
[0070] The availability level refers to the high availability classification of the application, for example, high-level high availability, medium-level high availability, and low-level high availability.
[0071] Different applications may have different levels of high availability requirements. For example, some applications require uninterrupted services 24 hours a day, 7 days a week, requiring high-level high availability. Some applications require uninterrupted services 24 hours a day, 5 working days a week, requiring medium-level high availability. Some applications require uninterrupted services 8 hours a day, 5 working days a week, requiring low-level high availability. In some implementations, the time when the service of the application is not allowed to be interrupted can be obtained based on the application identifier, and then the availability level of the application can be determined based on whether the time when the service is not allowed to be interrupted exceeds a set threshold. For example, if the threshold is set to: 7 days a week, 24 hours a day, the availability level of the application that requires uninterrupted services 24 hours a day, 7 days a week is high.
[0072] In addition, network-related applications may have higher high availability requirements. In some implementations, it is also possible to determine whether an application is a network-related application based on an application identifier, and to grade the availability level of the application based on whether the application is network-related. If the application is a network-related application, the availability level of the application can be determined to be high, and if the application is not a network-related application, the availability level of the application can be determined to be low.
[0073] Of course, in some implementations, the availability level of the application can also be determined by other means, for example, by determining the availability level of the application based on the instantaneous transaction volume. In addition, the user can also specify the availability level of the application when applying for a virtual machine, so that the terminal that manages the deployment of the virtual machine can directly obtain the availability level of the application based on the information in the virtual machine application.
[0074] S103: When the availability level of the application exceeds a set level, the number of buildings in which the deployment module is deployed in the data center is obtained.
[0075] The availability level of the application can be divided into high, medium and low, and the setting level can be a first setting level, which can be set according to needs, for example, set to high. Of course, in other implementations, the first setting level can also be set to other levels, and the application can also adopt other classification methods, or perform more detailed high availability classification, for example, level 1, level 2, level 3, level 4, level 5, etc.
[0076] A deployment module is a collection of computing resources, network resources, and storage resources. A deployment module includes one or more infrastructure clusters, and an infrastructure cluster includes one or more hosts. The configurations of the deployment modules and infrastructure clusters are the same. Figure 2 FIG. 2 shows a schematic diagram of a deployment module provided by an embodiment of the present invention. Figure 2As shown, the infrastructure cluster can be integrated by a series of standard computing resources, storage resources, and network resources. The deployment module (for example, CDP, which is a deployment module after the integration of cloud computing technology) is composed of multiple infrastructure clusters. The configuration of each infrastructure cluster is the same, and the configuration of each deployment module is the same to achieve flexibility in virtual machine deployment. Considering the cost and availability requirements of infrastructure cluster deployment, three infrastructure clusters are set in a deployment module of this embodiment. Of course, in other implementations, the number of infrastructure clusters in a deployment module can also be other numbers, for example, 1, 2, 4, 5, etc.
[0077] S104: Deploy the applied virtual machines in various buildings according to the number of the buildings and the number of applied virtual machines, wherein the nth virtual machine is deployed in the n%Bth building, where n is a positive integer between 1 and N, N is the number of applied virtual machines, B is the number of buildings, and n%B is the remainder of n divided by B.
[0078] Specifically, if the number of virtual machine applications is less than the number of buildings, the virtual machines are deployed in different buildings, with one virtual machine deployed in one building. For example, the first virtual machine is deployed in the first building, the second virtual machine is deployed in the second building, and the third virtual machine is deployed in the second building. Inside a building, the virtual machine can be deployed on the deployment module with the highest resource utilization rate in the building to use up the deployment modules as much as possible without leaving any fragments. Inside a deployment module, the virtual machine can be deployed on the infrastructure cluster with the lowest resource utilization rate to balance the load. For example, the applied virtual machine VM1 can be deployed on the third physical host of the infrastructure cluster Cloud2 of the deployment module D1 in the building Building1, and the physical host provides the various computing resources, storage resources, and network resources required by the virtual machine VM1. Among them, the deployment module D1 is the deployment module with the highest resource utilization rate in the building Building1, and Cloud2 is the infrastructure cluster with the lowest resource utilization rate in the deployment module D1.
[0079] If the number of virtual machine applications is greater than the number of buildings, when each virtual machine is deployed in each building, the number of virtual machines deployed in some buildings is more than one. For example, if there are 2 buildings and 3 virtual machines, the first virtual machine can be deployed in the first building, the second virtual machine can be deployed in the second building, and the third virtual machine can be deployed in the first building. At this time, there are two virtual machines deployed in the same building. If there are multiple virtual machines deployed in the same building, the virtual machines deployed in the same building can be deployed in each computer room of the building, wherein the pth virtual machine is deployed in the p%Rth computer room, wherein p is a positive integer between 1 and P, P is the number of virtual machines deployed in the same building, and R is the number of computer rooms in the same building. For example, the two virtual machines deployed in the first building can be deployed in the first computer room and the second computer room in the first building respectively. If there is only one virtual machine deployed in the same computer room, inside the computer room, the virtual machine can be deployed on the deployment module with the highest resource utilization rate in the computer room, so as to use up the deployment modules as much as possible without leaving fragments. If there is only one virtual machine deployed on the same deployment module, within the deployment module, the virtual machine can be deployed on the infrastructure cluster with the lowest resource utilization rate to achieve load balancing. If there is only one virtual machine deployed on the same infrastructure cluster, the virtual machine can be deployed on the physical host with the lowest resource utilization rate in the infrastructure cluster. For example, the virtual machine VM1 can be deployed on the third physical host of the infrastructure cluster Cloud2 of the deployment module D1 in the computer room Room1 of the building Building1, and the physical host provides various computing resources, storage resources and network resources required by the virtual machine VM1, and the virtual machine VM3 can be deployed on the second physical host of the infrastructure cluster Cloud1 of the deployment module D2 in the computer room Room2 of the building Building1, and the physical host provides various computing resources, storage resources and network resources required by the virtual machine VM3. Among them, the deployment module D1 is the deployment module with the highest resource utilization rate in the computer room Room1 of the building Building1, Cloud2 is the infrastructure cluster with the lowest resource utilization rate in the deployment module D1, and the third physical host is the physical host with the lowest resource utilization rate in Cloud2. Deployment module D2 is the deployment module with the highest resource utilization in Room2 of building Building1, Cloud1 is the infrastructure cluster with the lowest resource utilization in deployment module D2, and the second host is the physical host with the lowest resource utilization in Cloud1.
[0080] If there are multiple virtual machines deployed in the same computer room, the virtual machines deployed in the same computer room can be dispersed and deployed in various deployment modules of the computer room. The qth virtual machine is deployed on the q%U1th deployment module, where q is a positive integer between 1 and Q, Q is the number of virtual machines deployed in the same computer room, U1 is the number of deployment modules in the same computer room, and q%U1 is the remainder of q divided by U1.
[0081] For example, if there are three virtual machines deployed in the first building, but only two computer rooms in the first building have deployment modules deployed, the first virtual machine can be deployed in the first computer room, the second virtual machine can be deployed in the second computer room, and the third virtual machine can be deployed in the first computer room. At this time, there are two virtual machines deployed in the first computer room, and the two virtual machines can be further deployed in the first deployment module and the second deployment module of the computer room. Optionally, the deployment modules in the computer room can be sorted according to resource utilization, and the two deployment modules with the highest resource utilization are used as the first deployment module and the second deployment module during deployment, so as to use up the deployment modules as much as possible without leaving fragments. Within the deployment module, the virtual machine can be deployed on the infrastructure cluster with the lowest resource utilization to achieve load balancing, and within the infrastructure cluster, the virtual machine can be deployed on the physical host with the lowest resource utilization to achieve load balancing. When the resource utilization of each deployment module in the computer room is the same, the first deployment module and the second deployment module can be determined in the order of the original serial number of the deployment module from small to large.
[0082] If there are multiple virtual machines deployed on the same deployment module, the virtual machines deployed on the same deployment module can be deployed on different infrastructure clusters of the deployment module. The i-th virtual machine is deployed on the i%C-th infrastructure cluster, i is a positive integer between 1 and I, I is the number of virtual machines deployed on the same deployment module, C is the number of infrastructure clusters in a deployment module, and i%C is the remainder of i divided by C.
[0083] For example, if there are 3 virtual machines deployed in the first computer room, but there are 2 deployment modules in the first computer room, there will be two virtual machines deployed on the same deployment module. At this time, the two virtual machines are deployed separately on the two infrastructure clusters with the lowest resource utilization in the deployment module. For example, if there are 3 infrastructure clusters in the deployment module D1, and the virtual machines deployed on the deployment module D1 are VM1 and VM3, inside the deployment module D1, VM1 can be deployed on Cloud1 and VM3 can be deployed on Cloud2. Among them, Cloud1 is the infrastructure cluster with the lowest resource utilization in the deployment module D1, and Cloud2 is the infrastructure cluster with the second lowest resource utilization in the deployment module D1. If the number of virtual machines deployed on the same deployment module is 1, the virtual machine can be deployed on the infrastructure cluster with the lowest resource utilization in the deployment module.
[0084] Through the above method, the present embodiment can deploy the virtual machines requested by the high-level high-availability application as dispersedly as possible to each building, each computer room, each deployment module, and each infrastructure cluster. Compared with deploying the virtual machines dispersedly in different infrastructures of the same deployment module, the present embodiment can cope with the failures at the deployment module level, computer room level, and even building level, and ensure the high availability of different levels of applications. In addition, the present embodiment can sort the buildings, computer rooms, and deployment modules according to the order of resource utilization from high to low, and use the building, computer room, or deployment module with the highest resource utilization as the first building, computer room, and deployment module during deployment, and use the building, computer room, or deployment module with the lowest resource utilization as the last building, computer room, and deployment module during deployment, and then use the remainder algorithm to deploy the requested virtual machines as much as possible in the buildings, computer rooms, or deployment modules with lower sequence numbers. Thus, the present embodiment can deploy the virtual machines as much as possible in the buildings, computer rooms, and deployment modules with higher resource utilization rates to reduce the fragmentation of the buildings, computer rooms, and deployment modules. For the infrastructure clusters and physical hosts in the deployment module, this embodiment can sort the infrastructure clusters or physical hosts according to the order of resource utilization from low to high, and use the infrastructure cluster or physical host with the lowest resource utilization as the first infrastructure cluster or physical host, and use the infrastructure cluster with the highest resource utilization as the last infrastructure cluster or physical host. Thus, within the deployment module, this embodiment can try to deploy virtual machines on infrastructure clusters and physical hosts with low resource utilization to achieve load balancing. Among them, the resource utilization rate can be calculated by dividing the number of deployed virtual CPUs by the total number of virtual CPUs. For example, the resource utilization rate of the deployment module can be calculated by dividing the number of deployed virtual CPUs on the deployment module by the total number of virtual CPUs, the resource utilization rate of the computer room can be calculated by dividing the number of deployed virtual CPUs in the computer room by the total number of virtual CPUs, and the resource utilization rate of the building can be calculated by dividing the number of deployed virtual CPUs in the building by the total number of virtual CPUs.
[0085] It should be noted that in order to ensure balanced scheduling of virtual machines, the network capabilities of each building and each computer room must be consistent. If deployed across buildings, the network access capabilities (throughput, latency, etc.) within the same building must be consistent with those across buildings. If deployed across computer rooms, the network access capabilities (throughput, latency, etc.) within each computer room must be guaranteed.
[0086] In some implementations, some applications may not require a particularly high level of high availability. When the high availability level required by the application applying for a virtual machine does not exceed the first set level but exceeds the second set level, for example, an application requiring a medium level of high availability, this embodiment can obtain the number of computer rooms in a specified building, and deploy the applied virtual machines in each computer room of the specified building in a dispersed manner, wherein the nth virtual machine is deployed in the n%Rth computer room, wherein n is a positive integer between 1 and N, N is the number of virtual machines applied for, and R is the number of computer rooms in the specified building. The first set level is higher than the second set level.
[0087] Similar to the above implementation, if there is only one virtual machine deployed in the same computer room, inside the computer room, the virtual machine can be deployed on the deployment module with the highest resource utilization in the computer room to use up the deployment module as much as possible without leaving fragments. If there is only one virtual machine deployed on the same deployment module, inside the deployment module, the virtual machine can be deployed on the infrastructure cluster with the lowest resource utilization to achieve load balancing.
[0088] If there are multiple virtual machines deployed in the same computer room, the virtual machines deployed in the same computer room can be deployed in different deployment modules of the computer room, wherein the qth virtual machine is deployed on the q%U1th deployment module, q is a positive integer between 1 and Q, Q is the number of virtual machines deployed in the same computer room, U1 is the number of deployment modules in the same computer room, and q%U1 is the remainder of q divided by U1. If there are multiple virtual machines deployed in the same deployment module, the virtual machines deployed in the same deployment module are deployed in different infrastructure clusters of the deployment module, wherein the i-th virtual machine is deployed on the i%Cth infrastructure cluster, i is a positive integer between 1 and I, I is the number of virtual machines deployed in the same deployment module, C is the number of infrastructure clusters in a deployment module, and i%C is the remainder of i divided by C.
[0089] In practice, ensuring the consistency of network access capabilities between buildings is very demanding and requires a lot of work. If the network access capabilities between buildings are inconsistent, it is likely to cause uneven scheduling of virtual machines across buildings. Through the above method, this embodiment can reduce the requirements for ensuring the consistency of network access capabilities between buildings while meeting the high availability requirements of applications, and avoid uneven scheduling of virtual machines caused by uneven network access capabilities between buildings.
[0090] In some implementations, some applications may have lower requirements for the level of high availability. When the high availability level required by the application applying for the virtual machine does not exceed the second set level, for example, an application requiring a low level of high availability, this embodiment can obtain the number of deployment modules in the specified computer room, and deploy the applied virtual machines in various deployment modules of the specified computer room, wherein the nth virtual machine is deployed on the n%U2th deployment module, wherein n is a positive integer between 1 and N, N is the number of virtual machines applied for, and U2 is the number of deployment modules in the specified computer room. Through the above method, this embodiment can minimize the requirements for ensuring consistent network access capabilities between computer rooms while meeting the high availability requirements of the application, and avoid uneven virtual machine scheduling caused by uneven network access capabilities between computer rooms.
[0091] It can be seen from the above method that for applications requiring high-level high availability, this embodiment can deploy the virtual machines applied for across buildings, across computer rooms, and across deployment modules to ensure high-level high availability as much as possible and deal with the highest building-level failures. For applications requiring medium-level high availability, this embodiment can deploy the virtual machines applied for across buildings, only across computer rooms and across deployment modules, while meeting the high availability requirements of the application, reducing the requirements for consistent network access capabilities, avoiding unbalanced virtual machine scheduling, and dealing with the highest computer room-level failures. For applications requiring low-level high availability, this embodiment can deploy the virtual machines applied for across buildings, not across computer rooms, but only across deployment modules, while meeting the high availability requirements of the application, minimizing the requirements for ensuring consistent network access capabilities, avoiding unbalanced virtual machine scheduling, and dealing with the highest deployment module-level failures. This embodiment deploys the virtual machines applied for by the application across deployment modules, across computer rooms, and even across buildings according to the high availability level requirements of the application virtual machine application, which can achieve different levels of high availability, deal with different levels of failures, and minimize the requirements for ensuring consistent network access capabilities while meeting the high availability requirements of the application, avoiding unbalanced virtual machine scheduling.
[0092] In some application scenarios, there may be hardware consistency requirements for virtual machines for application expansion. For example, a virtual machine applies for a virtual machine when expanding the original application system. Therefore, in some implementations, when receiving a virtual machine application, the terminal that manages virtual machine deployment can determine whether the application has hardware consistency requirements for application expansion. For example, it can detect whether the application already exists based on the application identifier in the application. If it does, it is considered that the application is an expansion of an existing application, which has hardware consistency requirements for application expansion. In addition, users can also fill in the reason for the application when applying, and the terminal that manages virtual machine deployment can determine whether there is a hardware consistency requirement for application expansion based on the reason for the application.
[0093] If the application for which the virtual machine is applied for does not have consistency requirements for hardware expansion, for example, when applying for a virtual machine in a new application system, the applied virtual machine can be deployed in different deployment modules, computer rooms, and buildings according to the high availability level requirements of the application in accordance with the above-mentioned processes S101 to S104, so as to achieve different levels of high availability and cope with different levels of failures.
[0094] If the application for applying for a virtual machine has a consistency requirement for hardware expansion, the applied virtual machine can be deployed in a dispersed manner on the deployment module where the original virtual machine of the application is located, wherein the nth virtual machine is deployed on the n%U2th deployment module, n is a positive integer between 1 and N, N is the number of virtual machines applied for, U2 is the number of deployment modules where the original virtual machine of the application is located, and n%U2 is the remainder of n divided by U2. For example, if the application system originally has 30 virtual machines and needs to add 15 more virtual machines, then the deployment modules where the original 30 virtual machines are located can be determined, and the additional 15 virtual machines can be dispersedly deployed on the deployment modules where the original 30 virtual machines are located. If the original deployment module has reached the upper limit of capacity and no more virtual machines can be deployed, manual processing can be prompted. At this time, the administrator can negotiate with the application deployment personnel, and in principle, the hardware consistency requirements will no longer be considered. The applied virtual machines can be dispersedly deployed on a new group of deployment modules. According to the different high availability levels of the application, the group of deployment modules can be the deployment modules in the same computer room, the deployment modules in the computer rooms of the same building, or the deployment modules in the computer rooms of multiple buildings.
[0095] [Example 2]
[0096] Figure 3 FIG. 1 is a flow chart of another virtual machine deployment method provided by an embodiment of the present invention. Figure 3 As shown, the virtual machine deployment method described in this embodiment may include the following processing:
[0097] S201: Obtain a virtual machine application, wherein the virtual machine application carries an application identifier for the virtual machine application and an application quantity of the virtual machine.
[0098] S202: Determine the availability level of the application applying for the virtual machine according to the application identifier.
[0099] The processing of S201 to S202 is the same as the processing of S101 to S102 described above. For the specific processing, please refer to the processing of S101 to S102 described above, which will not be repeated here.
[0100] S203: Determine a deployment module set according to the availability level of the application.
[0101] The availability level refers to the high availability classification of the application.
[0102] In some implementations, the time during which the service based on the application is not allowed to be interrupted can be obtained according to the application identifier, and then the availability level of the application can be determined according to whether the time during which the service is not allowed to be interrupted exceeds a set threshold. If the time during which the service based on the application is not allowed to be interrupted exceeds a first set threshold, the availability level of the application can be determined to be high, and if the time during which the service based on the application is not allowed to be interrupted exceeds a second set threshold but does not exceed the first set threshold, the availability level of the application can be determined to be low. If the time during which the service based on the application is not allowed to be interrupted does not exceed the second set threshold, the availability level of the application can be determined to be low, wherein the first set threshold is higher than the second set threshold.
[0103] In some other implementations, whether the application is an Internet connection-related application can be determined based on an application identifier, and the availability level of the application can be graded based on whether the application is Internet connection-related.
[0104] Furthermore, when the availability level of the application exceeds a first set level, the deployment module set can be determined based on the deployment modules in the building where the deployment modules are deployed in the data center; when the availability level of the application does not exceed the first set level but exceeds a second set level, the deployment module set can be determined based on the deployment modules in each computer room in the designated building; when the availability level of the application does not exceed the second set level, the deployment module set can be determined based on the deployment modules in the designated computer room, wherein the first set level is higher than the second set level.
[0105] Specifically, the first setting level can be set to high, and the second setting level can be set to medium. When the availability level of the application is high, the deployment module set can be determined according to the deployment modules in the buildings where the deployment modules are deployed in the data center of the financial institution, and the deployment module set is composed of the deployment modules in the buildings of the data center, for example, the deployment module set is composed of the deployment modules 1 in building 1, the deployment module 2 in building 2, and the deployment module 3 in building 3. When the availability level of the application is medium, the deployment module set can be determined according to the deployment modules in the computer rooms in the designated building, and the deployment module set is composed of the deployment modules in the computer rooms in the designated building, for example, the deployment module 1 in the computer room 1 of the designated building 1, the deployment module 2 in the computer room 2, and the deployment module 3 in the computer room 3 are composed of the deployment module set. When the availability level of the application is low, the deployment module set is determined according to the deployment modules in the designated computer room, and the deployment module set is composed of the deployment modules in the designated computer room. For example, the deployment module set is composed of the deployment module 1, the deployment module 2, and the deployment module 3 in the designated computer room 1. Among them, deployment modules can be selected from each computer room and each building to form a deployment module set according to the resource utilization rate of the deployment module. For example, deployment modules whose resource utilization rate exceeds the second set threshold but is lower than the first set threshold are selected from each computer room of a specified building to form a deployment module set, or deployment modules whose resource utilization rate exceeds the second set threshold but is lower than the first set threshold are selected from each building to form a deployment module set, wherein the first set threshold is higher than the second set threshold.
[0106] In addition, this embodiment can also detect whether the application has a consistency requirement for hardware expansion. If so, the deployment module set can be determined based on the deployment module where the original virtual machine of the application is located. For example, the deployment module set is composed of the deployment module where the original virtual machine of the application is located. If not, the deployment module set can be determined based on the availability level of the application.
[0107] S204: Deploy the applied virtual machines in various deployment modules in the deployment module set according to the applied number of the virtual machines and the number of deployment modules in the deployment module set, wherein the nth virtual machine is deployed on the n%Uth deployment module, n is a positive integer between 1 and N, N is the applied number of virtual machines, U is the number of deployment modules in the deployment module set, and n%U is the remainder of n divided by U.
[0108] Among them, this embodiment can sort the deployment modules in the deployment module set according to the order of resource utilization from high to low, and use the deployment module with the highest resource utilization in the set as the first deployment module when deploying, and use the deployment module with the lowest resource utilization as the last deployment module when deploying, and then use the remainder algorithm to deploy the applied virtual machine as much as possible in the deployment module with a lower sequence number, so that this embodiment can deploy the virtual machine in the deployment module with higher resource utilization as much as possible to reduce the fragmentation of the deployment module. Among them, the resource utilization rate of the deployment module can be calculated by dividing the number of deployed virtual CPUs on the deployment module by the total number of virtual CPUs.
[0109] Through the above method, for applications that require high-level high availability, its deployment module set consists of deployment modules in various buildings of the data center. This embodiment deploys the virtual machines applied for by the application in dispersed manner on the deployment modules of the deployment module set, which can achieve cross-building virtual machine deployment to cope with building-level failures. For applications that require medium-level high availability, its deployment module set consists of deployment modules in various computer rooms in a designated building. This embodiment deploys the virtual machines applied for by the application in dispersed manner on the deployment modules of the deployment module set, which can achieve cross-computer room virtual machine deployment to cope with computer room-level failures. For applications that require low-level high availability, its deployment module set consists of deployment modules in a designated computer room. This embodiment deploys the virtual machines applied for by the application in dispersed manner on the deployment modules of the deployment module set, which can achieve cross-deployment virtual machine deployment to cope with deployment module-level failures.
[0110] If there are multiple virtual machines deployed on the same deployment module, the virtual machines deployed on the same deployment module can be deployed in different infrastructure clusters of the deployment module, wherein the i-th virtual machine is deployed on the i%C-th infrastructure cluster, i is a positive integer between 1 and I, I is the number of virtual machines deployed on the same deployment module, C is the number of infrastructure clusters in a deployment module, and i%C is the remainder of i divided by C. To ensure load balancing, the sequence number of the infrastructure cluster during deployment can be determined according to the order of resource utilization of the infrastructure cluster from low to high. For example, if there are three infrastructure clusters in a deployment module, the infrastructure cluster with the lowest resource utilization can be used as the first infrastructure cluster, the infrastructure cluster with the highest resource utilization can be used as the third infrastructure cluster, and the infrastructure cluster with resource utilization between the first two can be used as the second cluster. Through the above method, virtual machines can be preferentially deployed on infrastructure clusters with lower resource utilization to achieve load balancing.
[0111] If the number of virtual machines deployed on the same deployment module is 1, the virtual machine is deployed on the infrastructure cluster with the lowest resource utilization in the deployment module to ensure load balancing of each infrastructure cluster.
[0112] Furthermore, within the infrastructure cluster, virtual machines can be deployed on physical hosts with lower resource utilization rates based on resource utilization rates.
[0113] This embodiment determines a deployment module set for deploying virtual machines applied for an application according to the availability level requirements of the virtual machine application, and then deploys the applied virtual machines as dispersedly as possible on different deployment modules according to the number of virtual machine applications and the number of deployment modules in the deployment module set. Different levels of high availability can be achieved to cope with different levels of failures. While meeting the high availability requirements of the application, the requirements for ensuring consistent network access capabilities are minimized to avoid unbalanced virtual machine scheduling.
[0114] Through the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be implemented by combining software with a hardware platform. Based on such an understanding, all or part of the contribution of the technical solution of the present invention to the background technology can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in certain parts of the various embodiments or implementation methods of the present invention.
[0115] [Example 3]
[0116] An embodiment of the present invention provides a computer-readable storage medium, such as a hard disk, an optical disk, a flash memory, a floppy disk, a magnetic tape, etc., on which computer-readable instructions are stored. The computer-readable instructions can be executed by a processor to implement the processing of the virtual machine deployment method described in the above embodiment 1.
[0117] [Example 4]
[0118] An embodiment of the present invention provides a computer device, including:
[0119] a memory having a computer program stored thereon,
[0120] A processor can execute the computer program to implement the processing of the virtual machine deployment method described in the above embodiment 1.
[0121] [Example 5]
[0122] An embodiment of the present invention provides a computer-readable storage medium, such as a hard disk, an optical disk, a flash memory, a floppy disk, a magnetic tape, etc., on which computer-readable instructions are stored. The computer-readable instructions can be executed by a processor to implement the processing of the virtual machine deployment method described in the above embodiment 2.
[0123] [Example 6]
[0124] An embodiment of the present invention provides a computer device, including:
[0125] a memory having a computer program stored thereon,
[0126] A processor can execute the computer program to implement the processing of the virtual machine deployment method described in the above embodiment 2.
[0127] The terms and expressions used in this specification are for illustration only and are not intended to be limiting. It should be understood by those skilled in the art that various changes may be made to the details of the above embodiments without departing from the basic principles of the disclosed embodiments. Therefore, the scope of protection of the present invention is determined solely by the claims, and in the claims, unless otherwise specified, all terms should be understood in the broadest reasonable sense.
Claims
1. A virtual machine deployment method, characterized in that: The method is applied to a terminal for managing virtual machine deployment, and the method comprises: Obtaining a virtual machine application, wherein the virtual machine application carries an application identifier for the virtual machine application and an application quantity of the virtual machine; Determining the availability level of the application applying for the virtual machine according to the application identifier; When the availability level of the application exceeds a set level, obtaining the number of buildings in which the deployment module is deployed in the data center; Deploy the applied virtual machines in various buildings according to the number of buildings and the number of applied virtual machines, wherein the nth virtual machine is deployed in the n%Bth building, where n is a positive integer between 1 and N, N is the number of applied virtual machines, B is the number of buildings, and n%B is the remainder of n divided by B; When the availability level of the application does not exceed a set level, obtaining the number of computer rooms in a specified building; Distribute the applied virtual machines in the computer rooms of the designated building according to the applied number of the virtual machines and the number of computer rooms, wherein the nth virtual machine is deployed in the n%Rth computer room, wherein n is a positive integer between 1 and N, N is the applied number of virtual machines, and R is the number of computer rooms in the designated building; If there are multiple virtual machines deployed in the same computer room, the virtual machines deployed in the same computer room are deployed in various deployment modules of the computer room, wherein the qth virtual machine is deployed on the q%U1th deployment module, q is a positive integer between 1 and Q, Q is the number of virtual machines deployed in the same computer room, U1 is the number of deployment modules in the same computer room, and q%U1 is the remainder of q divided by U1; The step of determining the availability level of the application applying for the virtual machine according to the application identifier includes: Determining, according to the application identifier, a time during which a service based on the application is not allowed to be interrupted; If the service is not allowed to be interrupted for a period exceeding a set threshold, determining that the availability level of the application is high; Determine whether the application is a network connection related application according to the application identifier; If the application is an Internet connection related application, it is determined that the availability level of the application is high.
2. The virtual machine deployment method according to claim 1, characterized in that: The distributed deployment of the applied virtual machines in various buildings includes: If there are multiple virtual machines deployed in the same building, the virtual machines deployed in the same building are dispersedly deployed in each computer room of the building, wherein the pth virtual machine is deployed in the p%Rth computer room, wherein p is a positive integer between 1 and P, P is the number of virtual machines deployed in the same building, and R is the number of computer rooms in the same building; If there are multiple virtual machines deployed in the same computer room, the virtual machines deployed in the same computer room will be deployed in various deployment modules of the computer room, where the qth virtual machine is deployed on the q%U1th deployment module, q is a positive integer between 1 and Q, Q is the number of virtual machines deployed in the same computer room, U1 is the number of deployment modules in the same computer room, and q%U1 is the remainder of q divided by U1.
3. The virtual machine deployment method according to claim 1 or 2, characterized in that: The method further comprises: If there are multiple virtual machines deployed on the same deployment module, the virtual machines deployed on the same deployment module are dispersedly deployed on different infrastructure clusters of the deployment module, wherein the i-th virtual machine is deployed on the i%C-th infrastructure cluster, i is a positive integer between 1 and I, I is the number of virtual machines deployed on the same deployment module, C is the number of infrastructure clusters in a deployment module, and i%C is the remainder of i divided by C.
4. The virtual machine deployment method according to claim 1 or 2, characterized in that: The method further comprises: If the number of virtual machines deployed on the same deployment module is 1, the virtual machine is deployed on the infrastructure cluster with the lowest resource utilization rate in the deployment module.
5. The virtual machine deployment method according to claim 1, characterized in that: The method further comprises: Detect whether the virtual machine application has hardware consistency requirements for application expansion; If so, the applied virtual machines will be deployed in a dispersed manner on the deployment modules where the original virtual machines of the application are located, wherein the nth virtual machine will be deployed on the n%U2th deployment module, where n is a positive integer between 1 and N, N is the number of applied virtual machines, U2 is the number of deployment modules where the original virtual machines of the application are located, and n%U2 is the remainder of n divided by U2.
6. A virtual machine deployment method, characterized in that: The method is applied to a terminal for managing virtual machine deployment, and the method comprises: Obtaining a virtual machine application, wherein the virtual machine application carries an application identifier for the virtual machine application and an application quantity of the virtual machine; Determining the availability level of the application applying for the virtual machine according to the application identifier; Determining a deployment module set according to the availability level of the application; Deploy the applied virtual machines in various deployment modules in the deployment module set according to the applied number of the virtual machines and the number of deployment modules in the deployment module set, wherein the nth virtual machine is deployed on the n%Uth deployment module, where n is a positive integer between 1 and N, N is the applied number of virtual machines, U is the number of deployment modules in the deployment module set, and n%U is the remainder of n divided by U; When the availability level of the application exceeds a first set level, determining the deployment module set according to deployment modules in a building where deployment modules are deployed in the data center; determining the set of deployment modules according to deployment modules in a designated building when the availability level of the application does not exceed a first set level but exceeds a second set level, wherein the first set level is higher than the second set level; When the availability level of the application does not exceed a second set level, determining the deployment module set according to the deployment modules in the designated computer room; The step of determining the availability level of the application applying for the virtual machine according to the application identifier includes: Determining, according to the application identifier, a time during which a service based on the application is not allowed to be interrupted; If the service is not allowed to be interrupted for a period exceeding a set threshold, determining that the availability level of the application is high; Determine whether the application is a network connection related application according to the application identifier; If the application is an Internet connection related application, it is determined that the availability level of the application is high.
7. The virtual machine deployment method according to claim 6, characterized in that: If the application has a hardware consistency requirement for application expansion, the deployment module set is determined according to the deployment module where the original virtual machine of the application is located.
8. The virtual machine deployment method according to claim 6 or 7, characterized in that: The method further comprises: If there are multiple virtual machines deployed on the same deployment module, the virtual machines deployed on the same deployment module are dispersedly deployed on different infrastructure clusters of the deployment module, wherein the i-th virtual machine is deployed on the i%C-th infrastructure cluster, i is a positive integer between 1 and I, I is the number of virtual machines deployed on the same deployment module, C is the number of infrastructure clusters in a deployment module, and i%C is the remainder of i divided by C.
9. The virtual machine deployment method according to claim 6 or 7, characterized in that: The method further comprises: If the number of virtual machines deployed on the same deployment module is 1, the virtual machine is deployed on the infrastructure cluster with the lowest resource utilization rate in the deployment module.
10. A computer-readable storage medium having computer instructions stored thereon, characterized in that: The computer instructions may be executed by a processor to implement the method for deploying a virtual machine as described in any one of claims 1 to 5, or to implement the method for deploying a virtual machine as described in any one of claims 6 to 9.
11. A computer device comprising: a memory having a computer program stored thereon; A processor, configured to execute the computer program to implement the method for deploying a virtual machine as described in any one of claims 1 to 5, or to implement the method for deploying a virtual machine as described in any one of claims 6 to 9.
