CN111045790A - Virtual machine deployment method and device - Google Patents

Virtual machine deployment method and device Download PDF

Info

Publication number
CN111045790A
CN111045790A CN201911285247.1A CN201911285247A CN111045790A CN 111045790 A CN111045790 A CN 111045790A CN 201911285247 A CN201911285247 A CN 201911285247A CN 111045790 A CN111045790 A CN 111045790A
Authority
CN
China
Prior art keywords
deployment
sub
area
available
resource
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911285247.1A
Other languages
Chinese (zh)
Inventor
单伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201911285247.1A priority Critical patent/CN111045790A/en
Publication of CN111045790A publication Critical patent/CN111045790A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances

Abstract

The invention provides a virtual machine deployment method and device, and belongs to the technical field of computers. The method includes the steps of receiving a deployment application sent by a terminal, wherein the deployment application includes a designated area, the number M of virtual machines to be deployed and the deployment resource amount required by a single virtual machine to be deployed, then determining the available resource amount currently provided by alternative sub-areas in the designated area, then taking the alternative sub-areas meeting the deployment requirement of the deployment application as available sub-areas according to the available resource amount, the deployment resource amount and the M of the alternative sub-areas, finally selecting one available sub-area from the available sub-areas as a target sub-area, and deploying the M virtual machines in the target sub-area. Therefore, the virtual machine deployment can be automatically carried out when the resources in the designated area selected by the user are in a sufficient state without manual deployment of operation and maintenance personnel, the efficiency is improved, and the cost is reduced.

Description

Virtual machine deployment method and device
Technical Field
The present invention belongs to the field of computer technology, and is especially virtual machine deploying method and device.
Background
In the field of virtual machine deployment, users often need to apply for resources to deploy virtual machines to implement various services, such as video playing services, user group discussion services, mall services, and the like. In order to facilitate user selection, the resource provider may regard the entire area capable of providing the resource as a large area, and divide the large area into a plurality of available areas, each of which is divided into a plurality of sub-areas. The resource server cluster is deployed in the available area, and the resource servers in the resource server cluster are distributed in each sub-area of the available area.
Accordingly, in the prior art, the available areas are displayed to the user, and the user selects one available area from the available areas for deployment of the virtual machine. Since the resources in the available area selected by the user are not always in a sufficient state, after the user makes an application, the operation and maintenance personnel are often required to manually select a sub-area from the available area and perform deployment. This manual mode, efficiency is lower and the cost is great.
Disclosure of Invention
The invention provides a virtual machine deployment method and a virtual machine deployment device, which are used for solving the problems of low determination efficiency and high cost.
In a first aspect of the implementation of the present invention, there is first provided a virtual machine deployment method applied to a management device, the method including:
receiving a deployment application; the deployment application comprises a designated area, the number M of the virtual machines to be deployed and the deployment resource amount required by a single virtual machine to be deployed; m is an integer not less than 1;
determining the available resource amount currently available by the alternative sub-area in the designated area;
according to the available resource amount of the alternative sub-areas, the deployment resource amount and the number M of the virtual machines to be deployed, taking the alternative sub-areas meeting the deployment requirements of the deployment application as the available sub-areas;
and selecting one available sub-area from the available sub-areas as a target sub-area, and deploying M virtual machines in the target sub-area.
In a second aspect of the present invention, there is also provided a virtual machine deployment apparatus, which is applied to a management device, and includes:
the first receiving module is used for receiving a deployment application; the deployment application comprises a designated area, the number M of the virtual machines to be deployed and the deployment resource amount required by a single virtual machine to be deployed; m is an integer not less than 1;
the first determining module is used for determining the available resource amount currently available by the alternative sub-area in the designated area;
a second determining module, configured to use the candidate sub-regions that meet the deployment requirement of the deployment application as available sub-regions according to the available resource amount of the candidate sub-regions, the deployment resource amount, and the number M of virtual machines to be deployed;
and the deployment module is used for selecting one available sub-area from the available sub-areas as a target sub-area and deploying M virtual machines in the target sub-area.
In yet another aspect of the present invention, there is also provided a computer-readable storage medium having stored therein instructions, which when executed on a computer, cause the computer to perform any of the virtual machine deployment methods described above.
In yet another aspect of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the virtual machine deployment methods described above.
In the virtual machine deployment method provided by the embodiment of the present invention, a management device receives a deployment application sent by a terminal, where the deployment application includes a specified region, a number M of virtual machines to be deployed, and a deployment resource amount required by a single virtual machine to be deployed, then determines an available resource amount currently available by a candidate sub-region in the specified region, then, according to the available resource amount, the deployment resource amount, and M of the candidate sub-region, takes the candidate sub-region that meets the deployment requirement of the deployment application as an available sub-region, and finally, selects one available sub-region from the available sub-region as a target sub-region, and deploys M virtual machines in the target sub-region. Therefore, the virtual machine deployment can be automatically carried out when the resources in the designated area selected by the user are in a sufficient state without manual deployment of operation and maintenance personnel, the efficiency is improved, and the cost is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
FIG. 1 is a flowchart illustrating steps of a method for deploying a virtual machine according to an embodiment of the present invention;
FIG. 2-1 is a flowchart illustrating steps of a method for deploying a virtual machine according to an embodiment of the present invention;
FIG. 2-2 is a schematic diagram of a flow engine according to an embodiment of the present invention;
fig. 3 is a block diagram of a virtual machine deployment apparatus according to an embodiment of the present invention;
fig. 4 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
First, a virtual machine deployment method according to an embodiment of the present invention will be described in detail. Specifically, the virtual machine deployment method may be applied to a scenario in which the entire resource-providable region is defined as one large region, and the large region is divided into a plurality of usable regions, each of which is divided into a plurality of sub-regions. In the method, the management device may receive a deployment application including a designated area, a designated service, the number M of virtual machines to be deployed, and the amount of deployment resources required by a single virtual machine to be deployed, and then may confirm to a user whether a preset resource quota corresponding to the designated service is sufficient, and further determine whether the designated area is currently used for providing resources for constructing the virtual machine, if the preset resource quota is sufficient. And under the condition that the specified area is currently used for providing the resources for building the virtual machine, determining the server cluster currently used for providing the resources for building the virtual machine in the specified area as an alternative server cluster.
Then, the management device may use, as an available server cluster, an alternative server cluster whose available resource amount meets a preset requirement according to the available resource amount and the deployment resource amount currently available by each alternative server cluster. The available resource quantity meeting the preset requirement means that after M virtual machines are deployed by using available resources of the alternative server cluster according to the deployed resource quantity, the remaining resource quantity can ensure that the alternative server cluster normally operates. Then, a sub-region currently used for providing resources for building a virtual machine in the sub-regions of the resource server distribution of the optional server cluster may be determined as an alternative sub-region. And determining the alternative sub-region meeting the deployment requirement according to the available resource amount, the deployment resource amount and the M of the alternative sub-region, and determining the alternative sub-region meeting the deployment requirement as the available sub-region. And finally, selecting one available sub-area from the available sub-areas as a target sub-area, and deploying the M virtual machines in the target sub-area. Therefore, unnecessary deployment operation can be avoided by multi-level judgment, and meanwhile, by automatically selecting the sub-areas meeting the deployment requirements of the deployment application for deployment, the virtual machine can be automatically deployed only when the resources in the designated area selected by the user are in a sufficient state, so that the deployment efficiency is improved, and the deployment cost is reduced. The following describes a virtual machine deployment method according to an embodiment of the present invention in detail with reference to the accompanying drawings.
Fig. 1 is a flowchart of steps of a virtual machine deployment method provided by an embodiment of the present invention, which is applied to a management device, and as shown in fig. 1, the method may include:
step 101, receiving a deployment application; the deployment application comprises a designated area, the number M of the virtual machines to be deployed and the deployment resource amount required by a single virtual machine to be deployed; and M is an integer not less than 1.
In the embodiment of the invention, the terminal can be a computer, a mobile phone, a portable computing device and the like. The deployment application is used for applying for deploying the virtual machine, and the deployment application can be sent to the management device through the terminal when the user needs to deploy the virtual machine. The management device may be a server, a computer, a portable computing device, or the like.
Further, the designated area may be selected from the available area by the user according to the own requirement, the number M of the virtual machines to be deployed may be set by the user according to the own requirement, and the deployment resource amount required by a single virtual machine to be deployed may be specifically the required number of CPU cores, the required memory space, and the like. For example, the terminal may display an application interface, each available area may be displayed in the application interface for a user to select, and a parameter input area may also be displayed in the application interface, where the parameter input area may be used to receive the number M of virtual machines to be deployed and the deployment resource amount required by a single virtual machine to be deployed, which are input by the user. Accordingly, the user can realize that the control terminal sends the deployment application by selecting and inputting the application interface.
And 102, determining the available resource amount currently available by the alternative sub-area in the specified area.
In this embodiment of the present invention, the alternative sub-region may belong to a sub-region in the designated region, and specifically, the alternative sub-region may be all sub-regions in the designated region, or may also be a part of specific sub-regions in the designated region, which is not limited in this embodiment of the present invention.
The amount of available resources currently available for an alternative sub-area may be the sum of the amounts of available resources currently available for all resource servers distributed within the sub-area. Since the resource server may also handle other tasks, the amount of available resources that the resource server is able to provide may not be the same over time. Therefore, in the embodiment of the present invention, the available resource amount currently provided by the candidate sub-region may be automatically determined before each deployment, so that, compared with periodically determining the available resource amount and using the latest detected available resource amount to perform the determination before the deployment, in the embodiment of the present invention, the determination is performed in real time when the available resource amount needs to be used, and the accuracy of the data may be ensured to a certain extent.
Specifically, the management device may send a detection request to all resource servers in the candidate sub-region, after receiving the detection request, the resource server may return the current available resource amount to the management device, and the management device may calculate a sum of the available resource amounts returned by all resource servers in the candidate sub-region, thereby obtaining the available resource amount currently provided by the candidate sub-region.
Step 103, according to the available resource amount of the candidate sub-region, the deployment resource amount and the M, the candidate sub-region which meets the deployment requirement of the deployment application is used as the available sub-region.
In the embodiment of the present invention, the candidate sub-region that meets the deployment requirement of the deployment application may be a candidate sub-region in which the current available resource amount can deploy the virtual machine that needs to be deployed by the deployment application. In this way, by using the alternative sub-regions that satisfy the deployment requirements of the deployment application as the available sub-regions, it can be ensured that each available sub-region is a sub-region whose resources are in a sufficient state.
And 104, selecting one available sub-area from the available sub-areas as a target sub-area, and deploying M virtual machines in the target sub-area.
In the embodiment of the invention, the available sub-areas are selected sub-areas with sufficient resources, so that the target sub-areas selected from the available sub-areas are used for deployment, and successful deployment can be ensured. Specifically, when deployment is performed, one virtual machine can be constructed by using available resources in the target sub-region according to the deployment resource amount required by a single virtual machine to be deployed until M virtual machines are constructed. Finally, the M virtual machines are deployed in the resource server of the target sub-region, wherein a specific manner of constructing one virtual machine according to the deployment resource amount required by a single virtual machine to be deployed may refer to related technologies, which is not described herein in detail in the embodiments of the present invention.
In summary, in the virtual machine deployment method provided in the embodiment of the present invention, the management device may receive a deployment application, where the deployment application includes a specified area, a number M of virtual machines to be deployed, and a deployment resource amount required by a single virtual machine to be deployed, then determine an available resource amount currently available by a candidate sub-area in the specified area, then, according to the available resource amount, the deployment resource amount, and M of the candidate sub-area, use the candidate sub-area that meets the deployment requirement of the deployment application as an available sub-area, and finally, select one available sub-area from the available sub-area as a target sub-area, and deploy M virtual machines in the target sub-area. Therefore, the virtual machine deployment can be automatically carried out when the resources in the designated area selected by the user are in a sufficient state without manual deployment of operation and maintenance personnel, the efficiency is improved, and the cost is reduced.
Fig. 2-1 is a flowchart of steps of a virtual machine deployment method provided by an embodiment of the present invention, which is applied to a management device, and as shown in fig. 2-1, the method may include:
step 201, receiving a deployment application; the deployment application comprises a designated area, the number M of the virtual machines to be deployed and the deployment resource amount required by a single virtual machine to be deployed; and M is an integer not less than 1.
Specifically, the step 101 may be referred to in an implementation manner of this step, which is not limited in this embodiment of the present invention.
Step 202, determining a preset resource quota corresponding to the specified service according to a preset service and resource quota corresponding relationship.
In an actual application scenario, often, in order to implement each service function of an application program, a virtual machine is deployed. However, the types of services to be implemented in one application are many, and accordingly, it is necessary to deploy corresponding virtual machines for various services to ensure that the entire application can operate normally. For example, assuming that the application a includes a video playing function, a user social function, and an official mall function, it is accordingly necessary to deploy a virtual machine for implementing a video playing service, a virtual machine for implementing a user social service, and a virtual machine for implementing an official mall service, so as to ensure that each function of the application a can operate normally.
Therefore, in order to ensure that each service can be normally developed, in the embodiment of the present invention, a default resource QUOTA (QUOTA) may be defined for each service in advance, and then a preset corresponding relationship between the service and the resource QUOTA is established based on the default resource QUOTA corresponding to each service. The resource quota corresponding to the service refers to the maximum resource amount called by the management device each time the management device deploys the service. When a default resource quota is defined for each service, a higher default resource quota may be defined for a service with a higher importance level in an application program, so as to preferentially ensure that an important service can be realized.
Specifically, when the preset resource quota corresponding to the specified service is determined, the specified service may be matched with each service in the corresponding relationship to search for a service matching with the specified service, and then, the resource quota corresponding to the matched service is determined as the preset resource quota corresponding to the specified service.
Step 203, confirming whether the preset resource quota is sufficient or not to the user sending the deployment application.
In this step, the management device may send a quota confirmation message to the terminal when the deployment application is sent by the user through the terminal, where the quota confirmation message includes the preset resource quota. Specifically, the quota confirmation message may be sent to the terminal through a connection channel pre-established with the terminal. In this way, by returning a quota confirmation message including the preset resource quota to the terminal, the user of the terminal can know the resource quota allocated to the specified service this time in advance before deployment, and further, the user can determine whether the user can meet the deployment requirement this time based on the preset resource quota first. Correspondingly, the terminal can extract the preset resource quota in the quota confirmation message, then display the preset resource quota, correspondingly, if the user thinks that the current resource quota can meet the deployment requirement of the user, the terminal can send a confirmation sufficiency message to the management device, and if the user thinks that the current resource quota cannot meet the deployment requirement of the user, the terminal can send a quota improvement request to the management device within the preset time length. In this step, the management device may directly display the quota confirmation message when the deployment application is sent by the user through the management device. Accordingly, the user can send a confirmation sufficiency message through the management apparatus.
And step 204, if the message of sufficient confirmation is received, determining the available resource amount currently available by the alternative sub-area in the specified area.
If the management device receives the message of confirming sufficiency, the management device can confirm that the resource quota allocated to the specified service is sufficient, and therefore, the management device can perform the operation of determining the available resource amount currently available in the alternative sub-area in the specified area, so as to facilitate deployment in the subsequent step.
Further, if a quota increasing request is received, increasing a preset resource quota according to a preset quota increment, and executing an operation of confirming whether the preset resource quota is sufficient to a user sending the deployment application.
Specifically, if the management device receives the quota improvement request, it may determine that the resource quota allocated to the specified service is insufficient for the user, and therefore, the management device may increase the preset resource quota according to a preset quota increment, and continue to send a quota confirmation message to determine whether the increased resource quota is sufficient for the user. The preset quota increment may be set according to an actual requirement, which is not limited in the embodiment of the present invention. Further, the management device may return the deployment demand adjustment information to the user when the preset resource quota is increased to the preset maximum quota and the sufficient confirmation message is not received.
The preset maximum quota may be a maximum quota that can be provided to the service in a large area, and the deployment requirement adjustment information may be used to prompt the user to adjust the deployment requirement. Specifically, if the preset resource quota is increased to the preset maximum quota and the sufficient confirmation message is not received, it can be considered that the deployment requirement of the user still cannot be met even if the preset resource quota allocated to the specified service has reached the preset quota, and therefore, the management device can return deployment requirement adjustment information to the user, so that the user can adjust the deployment requirement in time, and normal operation of the deployment operation is ensured.
Step 205, according to the available resource amount of the candidate sub-region, the deployment resource amount and the M, the candidate sub-region which meets the deployment requirement of the deployment application is used as the available sub-region.
Specifically, the management device may first calculate a ratio of the available resource amount of the candidate sub-region to the deployment resource amount, to obtain the second number of the virtual machines that can be built in the candidate sub-region. Wherein, the available resource amount of the alternative sub-area may be the sum of the resource amounts available by all resource servers in the sub-area. Then, if the number of the second virtual machines that can be built is not less than M, that is, M virtual machines can be deployed in the candidate sub-region to meet the deployment requirement of the user, so that the candidate sub-region can be determined as an available sub-region. In the embodiment of the invention, the ratio of the available resource amount of the alternative sub-region to the deployment resource amount is calculated, and the available sub-region which can meet the deployment requirement can be accurately screened out according to the size relationship between the ratio and the number M of the virtual machines to be deployed, so that the successful deployment based on the available sub-region in the subsequent step is ensured.
Optionally, in the embodiment of the present invention, the following steps a to C may also be performed in advance:
step A, receiving a closing instruction; the closing instruction comprises an object identifier used for indicating an object to be closed.
In this step, the object to be closed may be any one of an available area, a resource server cluster, or a sub-area. The shutdown instruction may be sent by a manager in a case where the conditions of a certain available area, resource server cluster, or sub-area are not suitable for deploying the virtual machine. Specifically, the management device may display all objects to the manager: and the option switches corresponding to the available region, the resource server cluster and the sub-region can be turned off by the manager, so that the manager can turn off the option switch of the object with the condition unsuitable for deploying the virtual machine, and further realize the sending of the turn-off instruction. The object with the condition unsuitable for deploying the virtual machine can be an object with a fault and resource shortage, and the object with the option switch turned off by the user is the object to be turned off. Therefore, by setting the option switch, an administrator can close the automatic construction of certain granularity in advance according to the actual situation, and unnecessary wrong construction of the management equipment in the subsequent steps is further reduced.
And B, extracting the object identification in the closing instruction.
In this step, the object identifier may be used to uniquely indicate an object, and the management device may parse the closing instruction and then extract the object identifier from the closing instruction, so as to determine the object to be closed.
Step C, setting a closing mark for the object to be closed indicated by the object identification; the closing mark is used for indicating that the object to be closed is not used for providing resources for building the virtual machine.
In this step, a closing flag indicating that the object to be closed is not used for providing resources for constructing the virtual machine is set for the object to be closed, so that the management device can quickly avoid the object which is not suitable for virtual machine deployment when the virtual machine is subsequently deployed, and further the deployment efficiency is improved.
Accordingly, the management device may perform the following operations prior to this step to enable determination of alternative sub-areas: specifically, the management apparatus may first determine whether the specified area is provided with the off flag. Specifically, the designated area may be searched in all areas provided with the closing mark, and if the designated area is found, the designated area may be considered to be provided with the closing mark, otherwise, the designated area may be considered to be not provided with the closing mark. Accordingly, if the designated area is provided with the shutdown flag, it may be considered that the designated area cannot currently deploy the virtual machine, and therefore, the terminal may return a designated area replacement message, which may be used to instruct the user to replace the designated area. Or, the management personnel can deploy the target object in other deployable areas in a manual deployment mode. Further, if the specified area is not provided with the closing flag, it may be considered that the specified area can currently deploy the virtual machine, and therefore, the resource server cluster in the specified area that is not provided with the closing flag may be further determined, and the candidate server cluster is obtained. Specifically, the resource server cluster in the designated area may be searched among all resource server clusters with the shutdown flag set, so as to determine whether the resource server cluster is set with the shutdown flag.
After the alternative server clusters are determined, for each alternative server cluster, the first number of the virtual machines which can be established in the alternative server cluster can be determined according to the deployment resource amount and the available resource amount which can be currently provided by the alternative server cluster. Specifically, the management device may first calculate a sum of available resource amounts of all the alternative servers in the alternative server cluster to obtain an available resource amount of the alternative server cluster, and then calculate a ratio of the available resource amount of the alternative server cluster to the deployment resource amount to obtain a first number of the virtual machines that can be built in the alternative server cluster.
Then, a difference value between the number of the first configurable virtual machines and M may be determined, and a candidate server cluster of which the corresponding difference value is not less than a preset difference value threshold value corresponding to the deployment resource amount is determined as an optional server cluster.
The preset difference threshold (BUFFER) corresponding to the amount of the deployment resource may be preset according to an actual requirement. In an actual application scenario, the deployment resource amounts included in the deployment applications sent by different users often have a small difference, so the preset difference threshold corresponding to the deployment resource amounts may be a fixed value, that is, different deployment resource amounts correspond to the same preset difference threshold.
If the difference between the first number of the virtual machines that can be built and M is not less than the preset difference threshold, it may be considered that after the M virtual machines are deployed in the alternative server cluster, the alternative server still has sufficient resources to ensure that the alternative server cluster can normally operate, and therefore, in this step, the alternative server cluster may be determined as the optional server cluster. Correspondingly, if there is no alternative server cluster whose corresponding difference is not less than the preset difference threshold corresponding to the deployed resource amount, the management device may send a capacity expansion reminder to the administrator, where the capacity expansion reminder may be used to prompt the administrator to expand the resource amount of the specified area. Accordingly, the administrator may manually perform capacity expansion, and after determining that the resources are sufficient, send a capacity expansion completion instruction to the management device, so that the management device continues to execute the deployment process after the resources are sufficient. In the embodiment of the invention, the preset difference threshold value is set, and the alternative server cluster which can still normally run after being deployed is screened out as the optional server cluster based on the difference value and the preset difference threshold value, so that the problem that resources of the server cluster are exhausted due to the deployment of the virtual machine, and the resources cannot be provided for the most important operation service can be avoided. Meanwhile, the capacity expansion reminding is sent under the condition that no optional server cluster exists, so that the virtual machine can be continuously deployed in the subsequent process.
Finally, the management device may determine, as the candidate sub-region, a sub-region in which the shutdown flag is not set, among the sub-regions of the resource server distribution of the optional server cluster. In this way, by determining the sub-region for which the close flag is not set as the candidate sub-region, it can be ensured that each candidate sub-region is a sub-region that can be used to provide resources for building the virtual machine, thereby ensuring reliability of selection from the candidate sub-regions in the subsequent step.
And step 206, selecting one available sub-area from the available sub-areas as a target sub-area, and deploying M virtual machines in the target sub-area.
Specifically, in this step, the management device may randomly select one of the available sub-areas as the target area by using a random selection algorithm. Compared with the mode of selecting the optimal available sub-region as the target sub-region according to the optimal resource scheduling strategy, the method and the device have the advantages that the target region is selected in a random selection mode, the problem that the optimal available sub-region is frequently utilized but other available sub-regions cannot be utilized to cause resource fragments can be reduced to the maximum extent, and accordingly the overall resource utilization efficiency can be improved. Of course, in an actual application scenario, the optimal resource scheduling policy may also be used according to actual requirements: the sub-region selection algorithm with sufficient priority resources or the sub-region selection algorithm with the minimum priority resources selects the available sub-region as the target region, which is not limited in the embodiment of the present invention.
It should be noted that the management device may use a general form processing flow engine to implement the above operations, and the deployment application may enter the flow engine and be processed by the flow engine. The flow engine can perform differentiated processing aiming at different tasks, such as virtual machine deployment, load balancing and the like. For example, fig. 2-2 is a schematic structural diagram of a flow ENGINE provided in an embodiment of the present invention, as shown in fig. 2-2, the flow ENGINE may include a "WEB CONTROLLER" layer, a "common ENGINE MODULE" layer, and a "SERVICE LAYER" layer, where the "SERVICE LAYER" layer may include a "load bandwidth" MODULE, a "VIRTUAL MACHINE" MODULE, an "OTHER resource" MODULE, and the "VIRTUAL MACHINE resource" MODULE, which may be connected to the "available resource-based scheduling algorithm MODULE", and the "available resource-based scheduling algorithm MODULE" is used to implement the above process of selecting the target sub-area, and the available resource-based scheduling algorithm MODULE "may be connected to the" OPENSTACK resource providing layer ", and the" OPENSTACK resource providing layer "may be used to implement deployment of the VIRTUAL MACHINE in the target sub-area.
Further, in an actual application scenario, there may exist a server cluster that is not classified into a large area and still distributed in a data center (IDC) machine room, so that the present invention is still away, and after receiving a deployment application, it may be determined whether the type of the deployment resource applied by the deployment application is a resource based on the large area, and if so, the processing is performed according to the above steps in the embodiment of the present invention. Otherwise, if not, the traditional algorithm for the machine room shape can be used for deployment.
In summary, in the virtual machine deployment method provided in the embodiment of the present invention, the management device may receive a deployment application, where the deployment application includes a specified area, a number M of virtual machines to be deployed, and a deployment resource amount required by a single virtual machine to be deployed, then determine an available resource amount currently available by a candidate sub-area in the specified area, then, according to the available resource amount, the deployment resource amount, and M of the candidate sub-area, use the candidate sub-area that meets the deployment requirement of the deployment application as an available sub-area, and finally, select one available sub-area from the available sub-area as a target sub-area, and deploy M virtual machines in the target sub-area. Therefore, the virtual machine deployment can be automatically carried out when the resources in the designated area selected by the user are in a sufficient state without manual deployment of operation and maintenance personnel, the efficiency is improved, and the cost is reduced.
Fig. 3 is a block diagram of a virtual machine deployment apparatus provided in an embodiment of the present invention, and is applied to a management device, as shown in fig. 3, the apparatus 30 may include:
a first receiving module 301, configured to receive a deployment application; the deployment application comprises a designated area, the number M of the virtual machines to be deployed and the deployment resource amount required by a single virtual machine to be deployed; and M is an integer not less than 1.
A first determining module 302, configured to determine an available resource amount currently available by the alternative sub-area in the designated area.
A second determining module 303, configured to use the candidate sub-region that meets the deployment requirement of the deployment application as an available sub-region according to the available resource amount of the candidate sub-region, the deployment resource amount, and the number M of virtual machines to be deployed.
A deployment module 304, configured to select one available sub-region from the available sub-regions as a target sub-region, and deploy M virtual machines in the target sub-region.
Optionally, the designated area is any available area; the available area comprises resource server clusters, and resource servers in the resource server clusters are distributed in different sub-areas.
The device 30 further comprises:
the second receiving module is used for receiving a closing instruction; the closing instruction comprises an object identifier used for indicating an object to be closed; the object to be closed is the available area, the resource server cluster or the sub-area.
And the extracting module is used for extracting the object identification in the closing instruction.
The setting module is used for setting a closing mark for the object to be closed indicated by the object identification; the closing mark is used for indicating that the object to be closed is not used for providing resources for building the virtual machine.
Optionally, the apparatus 30 further includes:
and the judging module is used for judging whether the specified area is provided with a closing mark or not.
And a third determining module, configured to determine, if the specified area is not provided with the closing flag, a resource server cluster that is not provided with the closing flag in the specified area, so as to obtain an alternative server cluster.
And a fourth determining module, configured to determine, for each alternative server cluster, the number of first virtual machines that can be established in the alternative server cluster according to the deployment resource amount and the available resource amount currently provided by the alternative server cluster.
A fifth determining module, configured to determine a difference between the number of the first virtual machines that can be created and the M.
A sixth determining module, configured to determine, as an optional server cluster, a candidate server cluster whose corresponding difference is not smaller than a preset difference threshold corresponding to the deployment resource amount.
A seventh determining module, configured to determine, as the candidate sub-area, a sub-area in which a shutdown flag is not set in sub-areas of resource server distribution of the selectable server cluster.
Optionally, the apparatus 30 further includes:
the first sending module is used for sending a capacity expansion reminding to an administrator if the corresponding alternative server cluster with the difference value not smaller than the preset difference value threshold value corresponding to the deployment resource amount does not exist; the capacity expansion reminding is used for prompting the administrator to expand the resource amount of the specified area.
Optionally, the second determining module 303 is specifically configured to:
and calculating the ratio of the available resource quantity of the candidate sub-area to the deployment resource quantity to obtain the second quantity of the virtual machines which can be built in the candidate sub-area.
And if the second quantity of the virtual machines which can be built is not less than M, determining the alternative sub-area as the available sub-area.
Optionally, the deployment application further includes a specific service, where the specific service is a service for implementing the virtual machine to be deployed.
The device 30 further comprises:
and the eighth determining module is used for determining the preset resource quota corresponding to the specified service according to the corresponding relation between the preset service and the resource quota.
And the resource quota confirming module is used for confirming whether the preset resource quota is sufficient or not to the user sending the deployment application.
And the execution module is used for executing the operation of determining the available resource amount currently available by the alternative sub-area in the designated area if the sufficient confirmation message is received.
Optionally, the apparatus 30 further includes:
and the increasing module is used for increasing the preset resource quota according to a preset quota increment if a quota increasing request is received, and executing the operation of confirming whether the preset resource quota is sufficient to the user sending the deployment application.
A return module, configured to return deployment demand adjustment information to the user when the preset resource quota is increased to a preset maximum quota and the sufficient confirmation message is not received; the deployment requirement adjustment information is used for prompting the user to adjust the deployment requirement.
Optionally, the deployment module 304 is specifically configured to:
randomly selecting one of the available sub-regions as the target region using a random selection algorithm.
In summary, in the virtual machine deployment apparatus provided in the embodiment of the present invention, the first receiving module receives a deployment application, where the deployment application includes a specified area, a number M of virtual machines to be deployed, and a deployment resource amount required by a single virtual machine to be deployed, then the first determining module determines an available resource amount currently available by a candidate sub-area in the specified area, then the second determining module takes the candidate sub-area satisfying the deployment requirement of the deployment application as an available sub-area according to the available resource amount, the deployment resource amount, and M of the candidate sub-area, and finally the deployment module selects one available sub-area from the available sub-areas as a target sub-area, and deploys M virtual machines in the target sub-area. Therefore, the virtual machine deployment can be automatically carried out when the resources in the designated area selected by the user are in a sufficient state without manual deployment of operation and maintenance personnel, the efficiency is improved, and the cost is reduced.
For the above device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant points, refer to the partial description of the method embodiment.
An embodiment of the present invention further provides an electronic device, as shown in fig. 4, including a processor 401, a communication interface 402, a memory 403, and a communication bus 404, where the processor 401, the communication interface 402, and the memory 403 complete mutual communication through the communication bus 404,
a memory 403 for storing a computer program;
the processor 401, when executing the program stored in the memory 403, implements the following steps:
receiving a deployment application; the deployment application comprises a designated area, the number M of the virtual machines to be deployed and the deployment resource amount required by a single virtual machine to be deployed; m is an integer not less than 1;
determining the available resource amount currently available by the alternative sub-area in the designated area;
according to the available resource amount of the alternative sub-areas, the deployment resource amount and the number M of the virtual machines to be deployed, taking the alternative sub-areas meeting the deployment requirements of the deployment application as the available sub-areas;
and selecting one available sub-area from the available sub-areas as a target sub-area, and deploying M virtual machines in the target sub-area.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, which has instructions stored therein, which when executed on a computer, cause the computer to perform the virtual machine deployment method described in any of the above embodiments.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of virtual machine deployment as described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (12)

1. A virtual machine deployment method applied to a management device, the method comprising:
receiving a deployment application; the deployment application comprises a designated area, the number M of the virtual machines to be deployed and the deployment resource amount required by a single virtual machine to be deployed; m is an integer not less than 1;
determining the available resource amount currently available by the alternative sub-area in the designated area;
according to the available resource amount of the alternative sub-areas, the deployment resource amount and the number M of the virtual machines to be deployed, taking the alternative sub-areas meeting the deployment requirements of the deployment application as the available sub-areas;
and selecting one available sub-area from the available sub-areas as a target sub-area, and deploying M virtual machines in the target sub-area.
2. The method of claim 1, wherein the designated area is any available area; the available area comprises a resource server cluster, and resource servers in the resource server cluster are distributed in different sub-areas;
the method further comprises the following steps:
receiving a closing instruction; the closing instruction comprises an object identifier used for indicating an object to be closed; the object to be closed is the available area, the resource server cluster or the sub-area;
extracting an object identifier in the closing instruction;
setting a closing mark for the object to be closed indicated by the object identifier; the closing mark is used for indicating that the object to be closed is not used for providing resources for building the virtual machine.
3. The method according to claim 2, wherein before the candidate sub-areas satisfying the deployment requirement of the deployment application are used as the available sub-areas according to the available resource amount of the candidate sub-areas, the deployment resource amount, and the number M of virtual machines to be deployed, the method further comprises:
judging whether the designated area is provided with a closing mark or not;
if the designated area is not provided with the closing mark, determining a resource server cluster which is not provided with the closing mark in the designated area, and obtaining an alternative server cluster;
for each alternative server cluster, determining the number of first virtual machines which can be built in the alternative server cluster according to the deployment resource amount and the available resource amount which can be provided currently by the alternative server cluster;
determining a difference value between the first quantity of the virtual machines capable of being built and the M;
determining the alternative server cluster of which the corresponding difference value is not less than a preset difference value threshold value corresponding to the deployment resource amount as an optional server cluster;
and determining a sub-area without a closing mark in the sub-areas of the resource server distribution of the selectable server cluster as the candidate sub-area.
4. The method according to any one of claims 1 to 3, wherein the step of taking the candidate sub-region that meets the deployment requirement of the deployment application as an available sub-region according to the available resource amount of the candidate sub-region, the deployment resource amount, and the number M of virtual machines to be deployed comprises:
calculating the ratio of the available resource quantity of the candidate sub-area to the deployment resource quantity to obtain the second quantity of the virtual machines which can be built in the candidate sub-area;
and if the second quantity of the virtual machines which can be built is not less than M, determining the alternative sub-area as the available sub-area.
5. The method according to claim 1 or 3, wherein the deployment application further includes a specific service, and the specific service is a service used by the virtual machine to be deployed for implementation;
before determining the available resource amount currently available by the alternative sub-area in the designated area, the method further comprises:
determining a preset resource quota corresponding to the specified service according to a preset service and resource quota corresponding relation;
confirming whether the preset resource quota is sufficient or not to a user sending the deployment application;
and if the message of sufficient confirmation is received, executing the operation of determining the available resource amount currently provided by the alternative sub-area in the specified area.
6. The method of claim 5, further comprising:
if a quota improvement request is received, increasing the preset resource quota according to a preset quota increment, and executing the operation of confirming whether the preset resource quota is sufficient to the user sending the deployment application;
returning deployment demand adjustment information to the user when the preset resource quota is increased to a preset maximum quota and the sufficient confirmation message is not received; the deployment requirement adjustment information is used for prompting a user to adjust the deployment requirement.
7. A virtual machine deployment device applied to a management device, the device comprising:
the first receiving module is used for receiving a deployment application; the deployment application comprises a designated area, the number M of the virtual machines to be deployed and the deployment resource amount required by a single virtual machine to be deployed; m is an integer not less than 1;
the first determining module is used for determining the available resource amount currently available by the alternative sub-area in the designated area;
a second determining module, configured to use the candidate sub-regions that meet the deployment requirement of the deployment application as available sub-regions according to the available resource amount of the candidate sub-regions, the deployment resource amount, and the number M of virtual machines to be deployed;
and the deployment module is used for selecting one available sub-area from the available sub-areas as a target sub-area and deploying M virtual machines in the target sub-area.
8. The apparatus of claim 7, wherein the designated area is any available area; the available area comprises a resource server cluster, and resource servers in the resource server cluster are distributed in different sub-areas;
the device further comprises:
the second receiving module is used for receiving a closing instruction; the closing instruction comprises an object identifier used for indicating an object to be closed; the object to be closed is the available area, the resource server cluster or the sub-area;
the extracting module is used for extracting the object identification in the closing instruction;
the setting module is used for setting a closing mark for the object to be closed indicated by the object identification; the closing mark is used for indicating that the object to be closed is not used for providing resources for building the virtual machine.
9. The apparatus of claim 8, further comprising:
the judging module is used for judging whether the specified area is provided with a closing mark or not;
a third determining module, configured to determine, if the designated area is not provided with the closing flag, a resource server cluster that is not provided with the closing flag in the designated area, so as to obtain an alternative server cluster;
a fourth determining module, configured to determine, for each alternative server cluster, the number of first virtual machines that can be established in the alternative server cluster according to the deployment resource amount and the available resource amount that can be currently provided by the alternative server cluster;
a fifth determining module, configured to determine a difference between the number of the first configurable virtual machines and the number M;
a sixth determining module, configured to determine, as an optional server cluster, a candidate server cluster whose corresponding difference is not smaller than a preset difference threshold corresponding to the deployment resource amount;
a seventh determining module, configured to determine, as the candidate sub-area, a sub-area in which a shutdown flag is not set in sub-areas of resource server distribution of the selectable server cluster.
10. The apparatus according to any one of claims 7 to 9, wherein the second determining module is specifically configured to:
calculating the ratio of the available resource quantity of the candidate sub-area to the deployment resource quantity to obtain the second quantity of the virtual machines which can be built in the candidate sub-area;
and if the second quantity of the virtual machines which can be built is not less than M, determining the alternative sub-area as the available sub-area.
11. The apparatus according to claim 7 or 9, wherein the deployment application further includes a specific service, and the specific service is a service used by the virtual machine to be deployed for implementation;
the device further comprises:
an eighth determining module, configured to determine, according to a preset correspondence between a service and a resource quota, a preset resource quota corresponding to the specified service;
a resource quota confirming module, configured to confirm whether the preset resource quota is sufficient or not to a user sending the deployment application;
and the execution module is used for executing the operation of determining the available resource amount currently available by the alternative sub-area in the specified area if the sufficient confirmation message is received.
12. The apparatus of claim 11, further comprising:
the increasing module is used for increasing the preset resource quota according to a preset quota increment if a quota increasing request is received, and executing the operation of confirming whether the preset resource quota is sufficient to the user sending the deployment application;
a return module, configured to return deployment demand adjustment information to the user when the preset resource quota is increased to a preset maximum quota and the sufficient confirmation message is not received; the deployment requirement adjustment information is used for prompting the user to adjust the deployment requirement.
CN201911285247.1A 2019-12-13 2019-12-13 Virtual machine deployment method and device Pending CN111045790A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911285247.1A CN111045790A (en) 2019-12-13 2019-12-13 Virtual machine deployment method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911285247.1A CN111045790A (en) 2019-12-13 2019-12-13 Virtual machine deployment method and device

Publications (1)

Publication Number Publication Date
CN111045790A true CN111045790A (en) 2020-04-21

Family

ID=70236284

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911285247.1A Pending CN111045790A (en) 2019-12-13 2019-12-13 Virtual machine deployment method and device

Country Status (1)

Country Link
CN (1) CN111045790A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024027160A1 (en) * 2022-07-30 2024-02-08 华为云计算技术有限公司 Application deployment method and system, and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103200020A (en) * 2012-01-04 2013-07-10 中兴通讯股份有限公司 Resource allocating method and resource allocating system
CN107395401A (en) * 2017-07-04 2017-11-24 华南师范大学 Multicompartment application cloud dispositions method based on network service domain and resource balancing degree
CN108763090A (en) * 2018-05-31 2018-11-06 上海陆家嘴国际金融资产交易市场股份有限公司 Test environment dispositions method, device, computer equipment and storage medium
WO2019159875A1 (en) * 2018-02-13 2019-08-22 日本電信電話株式会社 Arrangement constitution device and arrangement constitution method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103200020A (en) * 2012-01-04 2013-07-10 中兴通讯股份有限公司 Resource allocating method and resource allocating system
CN107395401A (en) * 2017-07-04 2017-11-24 华南师范大学 Multicompartment application cloud dispositions method based on network service domain and resource balancing degree
WO2019159875A1 (en) * 2018-02-13 2019-08-22 日本電信電話株式会社 Arrangement constitution device and arrangement constitution method
CN108763090A (en) * 2018-05-31 2018-11-06 上海陆家嘴国际金融资产交易市场股份有限公司 Test environment dispositions method, device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024027160A1 (en) * 2022-07-30 2024-02-08 华为云计算技术有限公司 Application deployment method and system, and device

Similar Documents

Publication Publication Date Title
CN110049130B (en) Service deployment and task scheduling method and device based on edge computing
CN108370341B (en) Resource allocation method, virtual network function manager and network element management system
CN108055264A (en) Dispatching device, method and the computer readable storage medium of stream pushing server
US20190281503A1 (en) Management Method, Management Unit, and System
CN107341029B (en) Method and device for acquiring system resource deployment strategy and electronic equipment
CN107819797B (en) Access request processing method and device
CN110933178B (en) Method for adjusting node configuration in cluster system and server
CN114302429B (en) NWDAF network element determination method, device, equipment and storage medium
CN109921925B (en) Dial testing method and device
CN103095824A (en) File uploading control method and system
CN114356557A (en) Cluster capacity expansion method and device
CN113886069A (en) Resource allocation method and device, electronic equipment and storage medium
CN109039694B (en) Global network resource allocation method and device for service
CN111045790A (en) Virtual machine deployment method and device
CN110392413B (en) Channel scanning method and device
US20180322412A1 (en) Ticket Routing
CN114844791B (en) Cloud service automatic management and distribution method and system based on big data and storage medium
CN110545336A (en) IP address replacing method, device, computer equipment and storage medium
CN114040378B (en) Method, device, computer equipment and storage medium for arranging application
CN113258679B (en) Power grid monitoring system channel distribution method based on server instance capacity reduction
CN109522118B (en) Service processing method, device, server and readable storage medium
CN111294374B (en) Heterogeneous equipment starting system, method and device and electronic equipment
CN114302351A (en) Short message service processing method and device, computer equipment and storage medium
GB2570149A (en) Scaling network functions
CN111030874B (en) Service arranging method, equipment, storage medium and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination