CN109725981A - A kind of virtual machine upgrade method and relevant device - Google Patents

A kind of virtual machine upgrade method and relevant device Download PDF

Info

Publication number
CN109725981A
CN109725981A CN201711032568.1A CN201711032568A CN109725981A CN 109725981 A CN109725981 A CN 109725981A CN 201711032568 A CN201711032568 A CN 201711032568A CN 109725981 A CN109725981 A CN 109725981A
Authority
CN
China
Prior art keywords
virtual
actuator
virtual robot
virtual machine
robot arm
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.)
Granted
Application number
CN201711032568.1A
Other languages
Chinese (zh)
Other versions
CN109725981B (en
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.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201711032568.1A priority Critical patent/CN109725981B/en
Publication of CN109725981A publication Critical patent/CN109725981A/en
Application granted granted Critical
Publication of CN109725981B publication Critical patent/CN109725981B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Numerical Control (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the present application discloses a kind of virtual machine upgrade method, and the method is applied to operating system, and the operating system includes controller, actuator and scheduler, which comprises the controller sends upgrade request to the actuator;The actuator obtains the deployment information of virtual machine and Service Instance according to the upgrade request from the scheduler, and the Service Instance operates in the virtual machine;The actuator determines that the affinity coefficient of each virtual machine pair, the affinity coefficient are used to indicate the correlation between virtual machine described in every two according to the deployment information;The actuator is divided into two virtual robot arms according to the affinity coefficient, by multiple virtual machines;The scheduler successively upgrades the virtual machine in described two virtual robot arms.Using the embodiment of the present application, the upgrading efficiency of virtual machine can be improved, reduce the deployment of redundant resource.

Description

A kind of virtual machine upgrade method and relevant device
Technical field
This application involves operating system field more particularly to a kind of virtual machine upgrade method and relevant devices.
Background technique
Under cloud scene, Service Instance (e.g., handling the process of certain business) operates in different virtual machines In (Virtual Machine, VM), after system disposes completion for the first time, with business continuous service, the service in system is real Example and VM can release new version, running environment just needs to upgrade at this time due to providing new features or repairing the needs of problem.Service The upgrading of example needs to restart process, and the upgrading (operating system update run in mainly VM) of VM needs to restart VM, at this time The Service Instance run on VM can also restart simultaneously.Therefore, the business carried on VM when VM upgrades will interrupt.
Prior art provides the deployment scenario of two kinds of virtual machines.As shown in Fig. 1 (A), Fig. 1 (A) is the prior art A kind of schematic diagram for dividing the fixed deployment scenario of plane that scheme provides.Wherein, rectangle indicates that a VM, ellipse indicate one Service Instance, [S] [service type] [Service Instance number] indicate the number of the Service Instance of certain service type, such as No. 1 Service Instance of S.A1 expression A service type.Multiple VM are equally divided into two virtual robot arms (i.e. two planes), The Service Instance of different service types is evenly distributed in two planes, and one of plane is principal plane, is used for processing business Request, another plane is standby plane, and for the operation data for principal plane of backing up in realtime, but processing business is not requested.At this Under scene, upgrades standby plane first, execute plane after the completion of upgrading and switch, then upgrade original principal plane.Although upgrading effect Rate is high, but needs to dispose a large amount of redundant resource.As shown in Fig. 1 (B), Fig. 1 (B) is the another kind that prior art provides The schematic diagram of distributed dynamic deployment scenario is treated all VM as a cluster, and each VM is equal, different types of Service Instance Arbitrary distribution uses rolling upgrade mode under the scene, i.e., upgrades VM one by one to different VM.Therefore upgrading effect Rate is very low.
Summary of the invention
The embodiment of the present application provides a kind of virtual machine upgrade method and relevant device, reduces resource redundancy, improves void The upgrading efficiency of quasi- machine.
In a first aspect, the embodiment of the present application provides a kind of virtual machine upgrade method, comprising:
Controller sends upgrade request to actuator first;Then actuator is obtained from scheduler according to upgrade request The deployment information of virtual machine and Service Instance, Service Instance operate in virtual machine;According to deployment information, each virtual machine is determined Pair affinity coefficient, affinity coefficient is used to indicate correlation between every two virtual machine, according to affinity coefficient, will it is multiple virtually Machine is divided into two virtual robot arms;Last scheduler successively upgrades the virtual machine in two virtual robot arms.To final Division obtains the virtual robot arm of two compatibility equilibriums, therefore when upgrading to two virtual robot arms, it is no longer necessary to execute Virtual robot arm is switched, and is directly successively upgraded to two virtual robot arms, and can be simultaneously to the multiple of virtual robot arm Virtual machine is upgraded, to improve the upgrading efficiency of virtual machine, is reduced resource waste.
In a kind of possible design, actuator can according to affinity coefficient to multiple virtual machines to being ranked up;Then Successively two virtual machines of the virtual machine centering after sequence are assigned in two virtual robot arms;When all virtual machines are assigned to two When in a virtual robot arm, terminate distribution.Wherein, no longer right if some virtual machine has had been dispensed into some virtual robot arm The distribution of this virtual machine.
In alternatively possible design, if the number of all virtual machines is odd number, it may appear that extra one is virtual Machine can not be uniformly distributed in two virtual robot arms.In such a case, it is possible to individually the virtual machine is upgraded, or The virtual machine is divided into any one virtual robot arm.
In alternatively possible design, affinity coefficient is between every two virtual machine with the service of same services type Between the sum of quantity of example or every two virtual machine the quantity weighted average of the Service Instance of every kind of same services type it With.In addition, affinity coefficient can also be calculated and be worth divided by Service Instance quantity all in two VM for above-mentioned summing mode The sum of obtained percentage coefficient.
In alternatively possible design, actuator can be according to the sequence of affinity coefficient from small to large to multiple virtual machines To being ranked up;Or according to the sequence of affinity coefficient from big to small to multiple virtual machines to being ranked up.
In alternatively possible design, controller shows drawing for virtual robot arm in operation interface by visual means Divide result.Administrator can check the result for the virtual robot arm that controller is shown, if it is determined that division result supports that this is virtual The upgrading of machine can then click confirmation upgrading, upgrade first to virtual robot arm 1.Controller receives administrator and issues really Recognize upgrade command, and send confirmation upgrade request to actuator, confirmation upgrade request includes the mark of virtual robot arm 1 and virtual The list for the VM for needing to upgrade in unit 1.
In alternatively possible design, after upgrading successfully to the virtual machine in virtual robot arm 1, actuator receives tune The upgrading response that device is sent is spent, and sends upgrading response to controller, upgrading response upgrades for notification controller virtual robot arm 1 Success.
In alternatively possible design, controller sends confirmation upgrade request to actuator, which uses The virtual machine in virtual robot arm 2 is upgraded in notice actuator and scheduler.The confirmation upgrade request includes virtual robot arm 2 Mark and virtual robot arm 2 in the list of VM that needs to upgrade.
In alternatively possible design, after upgrading successfully to the virtual machine in virtual robot arm 2, actuator is to controller Upgrading response is sent, upgrading response is upgraded successfully for notification controller virtual robot arm 2.
In alternatively possible design, virtual machine is divided into two virtual robot arms by controller first, then determines two Service Instance in a virtual robot arm whether distributing equilibrium, it is real to the service in two virtual robot arms if being unevenly distributed weighing apparatus Example compensates, its distribution in two virtual machines is made to reach balanced, so that the upgrading efficiency of virtual machine not only can be improved, And virtual machine processing business is not influenced when upgrading on virtual machine.
In alternatively possible design, actuator obtains the Service Instance in two virtual robot arms in each virtual robot arm Distributed intelligence;According to distributed intelligence, it is determined whether compensated to virtual robot arm.
In alternatively possible design, actuator can be according to the service of every kind of service type in each virtual robot arm The quantity of example determines the distribution deviation of the Service Instance between two virtual robot arms;When distribution deviation is no more than tolerance coefficient When, actuator does not compensate virtual robot arm, and when distribution deviation is greater than tolerance coefficient, actuator mends virtual robot arm It repays.
In alternatively possible design, actuator determines that the service of every kind of service type between two virtual robot arms is real The sum of the quantity of all Service Instances in the difference of the quantity of example and two virtual robot arms;By the difference of the quantity of Service Instance with The ratio of the sum of the quantity of all Service Instances is as distribution deviation.
In alternatively possible design, actuator determines the service for the Service Instance for needing to compensate in each virtual robot arm Type and offset, output compensation list, the service type and offset of the Service Instance compensated as needed, to virtual robot arm It compensates.
In alternatively possible design, when the distribution of the Service Instance of certain service type between two virtual robot arms When deviation is greater than tolerance coefficient, which is determined as needing the service type of the Service Instance compensated by actuator;It executes The quantity of the Service Instance of the service type in two virtual robot arms in some virtual robot arm is subtracted another virtual machine by device The ratio that the difference of the quantity of the Service Instance of the service type in group is obtained divided by 2 is as offset.
In alternatively possible design, actuator will be in two virtual robot arms in some virtual robot arm according to offset The Service Instance of the service type moves to another virtual robot arm.
In alternatively possible design, controller receives the division result and compensation of the virtual robot arm of actuator transmission After list, division result and compensation list to virtual robot arm show that administrator can check the division of virtual robot arm As a result with compensation list, whether implement to compensate according to current business load and O&M is empirically determined.If it is determined that needing to void Quasi- unit compensates, and administrator can issue compensating instruction, after controller receives compensating instruction, Xiang Zhihang to controller Device sends compensation order.
In alternatively possible design, controller sends Pipelines with Single Direction Compensation to actuator and requests with embodiment artificial compensation, Compensation request includes the mark and service type of virtual robot arm, and actuator is according to offset by the corresponding void of the mark of virtual robot arm The Service Instance of service type in quasi- unit moves in another virtual robot arm.
In alternatively possible design, due to the increase with cluster scale, calculated required for partition virtual machines group Amount also will increase, therefore multiple virtual machines are divided into virtual machine fragment first, then divide in each virtual machine fragment empty Quasi- unit, to reduce the complexity of calculating, improves to successively upgrade to the virtual machine in each virtual machine fragment Virtual machine upgrades efficiency
In alternatively possible design, multiple virtual machines are divided into virtual machine fragment first, then each virtual Virtual robot arm in each virtual machine fragment is further polymerized to virtual machine set by partition virtual machines group in machine fragment, thus Finally the virtual machine in each virtual machine set is upgraded, to reduce the complexity of calculating, improves virtual machine liter Stage efficiency.
In alternatively possible design, fragment quantity that actuator divides as needed and all virtual machines it is total Number, determines the quantity of each virtual machine fragment.Further, the fragment that the sum of all virtual machines can be divided divided by needs The virtual machine quantity in each virtual machine fragment is calculated in quantity.Certain can be evenly distributed to for extra virtual machine In a little virtual machine fragments.
Second aspect, the embodiment of the present application provide a kind of virtual machine update device, which is configured For method and function performed by virtual machine update device in the above-mentioned first aspect of realization, realized by hardware/software, hardware/ Software includes unit corresponding with above-mentioned function.
The third aspect, the embodiment of the present application provide a kind of virtual machine updating apparatus, comprising: processor, memory and logical Believe bus, wherein for realizing connection communication between processor and memory, processor executes to be stored communication bus in memory A kind of virtual machine upgrade method for being provided for realizing above-mentioned first aspect of program in step.
In a possible design, virtual machine updating apparatus provided by the present application be may include for executing the above method The corresponding unit of virtual machine update device behavior in design.Unit can be software and/or be hardware.
Fourth aspect stores in computer readable storage medium this application provides a kind of computer readable storage medium There is instruction, when run on a computer, so that the method that computer executes above-mentioned various aspects.
5th aspect, this application provides a kind of computer program products comprising instruction, when it runs on computers When, so that the method that computer executes above-mentioned various aspects.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application or in background technique below will be implemented the application Attached drawing needed in example or background technique is illustrated.
Fig. 1 (A) is the schematic diagram for the fixed deployment scenario of a kind of point of plane that prior art provides;
Fig. 1 (B) is the schematic diagram for another distributed dynamic deployment scenario that prior art provides;
Fig. 2 is a kind of structural schematic diagram of virtual machine upgrade-system provided by the embodiments of the present application;
Fig. 3 is a kind of flow diagram of plane upgrade method provided by the embodiments of the present application;
Fig. 4 is the flow diagram of another plane upgrade method provided by the embodiments of the present application;
Fig. 5 is a kind of flow diagram of virtual machine upgrade method provided by the embodiments of the present application;
Fig. 6 is a kind of schematic diagram of the Service Instance deployment of virtual machine provided by the embodiments of the present application;
Fig. 7 is a kind of schematic diagram of virtual robot arm provided by the embodiments of the present application;
Fig. 8 is a kind of flow diagram for virtual machine upgrade method that another embodiment of the application provides;
Fig. 9 is a kind of schematic diagram of virtual robot arm provided by the embodiments of the present application;
Figure 10 is the schematic diagram of the virtual robot arm before a kind of compensation provided by the embodiments of the present application;
Figure 11 is a kind of schematic diagram of compensated virtual robot arm provided by the embodiments of the present application;
Figure 12 is a kind of flow diagram for virtual machine upgrade method that the another embodiment of the application provides;
Figure 13 is a kind of schematic diagram of virtual machine fragment provided by the embodiments of the present application;
Figure 14 is a kind of structural schematic diagram of virtual machine update device provided by the embodiments of the present application;
Figure 15 is a kind of structural schematic diagram for virtual machine updating apparatus that the embodiment of the present application proposes.
Specific embodiment
The embodiment of the present application is described below with reference to the attached drawing in the embodiment of the present application.
Fig. 2 is referred to, Fig. 2 is a kind of structural schematic diagram of virtual machine upgrade-system provided by the embodiments of the present application, the void Quasi- machine upgrade-system includes controller, actuator and scheduler.Wherein, for controller for being responsible for upgrading Row control, providing can Depending on the human-computer interaction interface changed, administrator completes escalation process by clicking operation.Meanwhile administrator can pass through controller It uploads software package, upload or the definition upgrading process of more highest version, check that upgrading progress, upgrading operate retract when something goes wrong Deng.Controller can be upgrading tool, delivery system etc..Actuator is the practical executor for upgrading process, usually independent fortune A capable service, the front end of actuator docks with controller, receive the control instruction of controller sending, the rear end of actuator and Scheduler docking, controls escalation process.Actuator is mainly used for being responsible for executing algorithm, receives the incoming instruction in controller interface, The information such as progress will be upgraded and be shown to interface.Actuator may include upgrading engine, publication engine etc..Scheduler is for being responsible for pipe Manage VM and VM in run Service Instance, usually with infrastructure (Infrastructure as a Service, IaaS) The resource management cooperation of layer, realizes deployment, upgrading and dilatation of Service Instance etc., such as Kubernetes, Mesos, also there is base In the scheduler of open source enhancing exploitation or entirely autonomous research and development.It should be noted that controller, actuator and scheduler can be same When be deployed in an entity device, can also be deployed in respectively in different entity devices, here without limitation.
Based on above-mentioned virtual machine upgrade-system, the embodiment of the present application provides two kinds of virtual machine upgrading modes.Such as Fig. 3 institute Show, Fig. 3 is a kind of flow diagram of plane upgrade method provided by the embodiments of the present application.This method is suitable for a point plane and fixes Deployment scenario is general to upgrade mode using by plane.Upgrade standby plane first, then upgrades principal plane.Assuming that two of deployment Plane number is respectively plane 1 and plane 2, and upgrading frontal plane 1 is principal plane, plane 2 is standby plane, and detailed process is as follows:
S301, administrator execute updating operation in the operation interface of controller, and controller sends upgrading to actuator and asks It asks, upgrade request includes the number of plane 2.
S302, for actuator to scheduler dispatches inquiry request, the inquiry request includes the number of plane 2;
S303, scheduler return to inquiry response to actuator, and the inquiry response includes the VM list in plane 2.
S304, for actuator to scheduler dispatches VM upgrade request, the VM upgrade request includes VM numbering of table.
S305, scheduler upgrade the virtual machine in plane 2 according to VM numbering of table.
S306, after virtual machine upgrades successfully, scheduler returns to plane upgrading response to actuator.
S307, actuator send plane upgrading response to controller.
S308, controller send plane to actuator and switch order.
S309, for actuator to scheduler dispatches inquiry request, the inquiry request includes the number of plane 1.
S310, scheduler send inquiry response to actuator, and the inquiry response includes the VM list in plane 1
S311, each Service Instance of the actuator into virtual machine send masterslave switchover request.
S312, after masterslave switchover is handled successfully, each Service Instance sends masterslave switchover response to actuator.
S313, actuator send masterslave switchover response to controller.
S314, controller send upgrade request to actuator, and upgrade request includes the number of plane 1.
S315 completes the virtual machine upgrading in plane 1 according to the above process.
As shown in figure 4, Fig. 4 is the flow diagram of another plane upgrade method provided by the embodiments of the present application.The party Method is suitable for distributed dynamic deployment scenario, and when carrying out updating operation to virtual machine, the Service Instance being distributed on each VM is It is uncertain, if operating multiple VM upgradings simultaneously, it may cause certain type of business and all interrupt.Therefore in this portion It affixes one's name to and generally uses rolling upgrade under scene, is i.e. VM upgrades one by one, and detailed escalation process is as follows:
S401, administrator execute updating operation in the operation interface of controller, and controller sends upgrading to actuator and asks It asks.
S402, actuator upgrade the notice of all VM to scheduler dispatches, and carry upgrading mode parameter to roll.
S403, scheduler circulation upgrade all VM, is i.e. upgrades second after the completion of First VM upgrading, and so on.
S404 after all VM are completed in scheduler upgrading, sends upgrading response to actuator.
S405, actuator send upgrading response to controller.
In conclusion for dividing plane fixed deployment scenario, it is necessary to be disposed in the way of biplane, and each service The running position of example cannot change.Under cloud scene, computing resource is as resource pool management, as long as available free CPU and memory, Service Instance can be disposed at an arbitrary position, this scheme is unable to satisfy the application characteristic under cloud scene.Together When disposed due to active and standby plane, have the Service Instance of half not processing business in system, there are the great wastings of resources.For dividing Cloth Dynamical Deployment scene, due to needing to upgrade one by one to VM, when upgrading can not multiple VM operate simultaneously, it is very low to upgrade efficiency. To solve the above-mentioned problems, following technical solution is provided.
Fig. 5 is referred to, Fig. 5 is a kind of flow diagram of virtual machine upgrade method provided by the embodiments of the present application, the party Method includes but is not limited to following steps:
S501, controller send upgrade request to actuator, and notice actuator starts partition virtual machines group.
S502 after actuator receives upgrade request, obtains the deployment letter of virtual machine and Service Instance from scheduler Breath.Wherein, deployment information includes the quantity of virtual machine, the Service Instance in virtual machine or service type of Service Instance etc..
S503, actuator determine that the affinity coefficient of each virtual machine pair, the affinity coefficient are used according to the deployment information Correlation between the virtual machine described in expression every two.Wherein, virtual machine is to the combination of two indicated between virtual machine.
Wherein, the affinity coefficient is the Service Instance between virtual machine described in every two with same services type The sum of quantity or every two described between virtual machine the Service Instance of every kind of same services type quantity weighted average The sum of value.For example, in two VM of the weighting coefficient * of the Service Instance of A service type the Service Instance of A service type number+B The clothes of the number+C service type of the Service Instance of B service type in two VM of weighting coefficient * of the Service Instance of service type The number of the Service Instance of C service type in two VM of weighting coefficient * of pragmatic example.In addition, the affinity coefficient can also be Above-mentioned summing mode is calculated and is worth the percentage coefficient obtained divided by the sum of Service Instance quantity all in two VM.
For example, as shown in fig. 6, Fig. 6 is a kind of signal of the Service Instance deployment of virtual machine provided by the embodiments of the present application Figure.The Service Instance run in VM1 includes (S.A1, S.B1, S.C1);The Service Instance run in VM2 include (S.D1, S.E1, S.B2);Operation service example includes (S.D2, S.E2, S.F1) in VM3;The Service Instance run in VM4 include (S.C2, S.F2, S.A2).The S.B2 service type that can be seen that in the S.B1 and VM2 in VM1 is identical, therefore, between VM1 and VM2 Affinity coefficient is 1.There is no the Service Instance of same services type, therefore, the affinity coefficient between VM1 and VM2 in VM1 and VM3 It is 0.In this way, successively determine that affinity coefficient of the affinity coefficient between 2, VM2 and VM3 between VM1 and VM4 is 2, Affinity coefficient of the affinity coefficient between 0, VM3 and VM4 between VM2 and VM4 is 1.
S504, actuator are divided into two virtual robot arms according to the affinity coefficient, by multiple virtual machines.Wherein, Virtual robot arm may also be referred to as virtual machine plane, more neofield or virtual machine batch etc..
In the specific implementation, actuator can according to the affinity coefficient to multiple virtual machines to being ranked up;Then Successively two virtual machines by the virtual machine centering after sequence are assigned in described two virtual robot arms;When all void When quasi- machine is assigned in described two virtual robot arms, terminate distribution.Wherein, if some virtual machine has had been dispensed into some void Quasi- unit, then no longer distribute this virtual machine.
Further, actuator can according to the sequence of the affinity coefficient from small to large to multiple virtual machines into Row sequence;Or according to the sequence of the affinity coefficient from big to small to multiple virtual machines to being ranked up.
For example, according to the sequence of affinity coefficient from small to large to virtual machine to being ranked up: VM1-VM3:0;VM2-VM4: 0;VM1-VM2:1;VM3-VM4:1;VM1-VM4:2;VM2-VM3:2.Therefore, virtual machine divides VM1-VM3 first, VM1 is assigned in virtual robot arm 1, VM3 is divided into virtual robot arm 2.Then virtual machine divides VM2-VM4, VM2 is assigned in virtual robot arm 1, VM4 is divided into virtual robot arm 2.It is of course also possible to which VM2 is assigned to virtual robot arm 2 In, VM4 is divided into virtual robot arm 1, here without limitation.Dividing two virtual machines for completing VM1-VM3 and VM2-VM4 To later, the divided completion of all virtual machines, therefore terminate to distribute.As shown in fig. 7, Fig. 7 is provided by the embodiments of the present application A kind of schematic diagram of virtual robot arm, wherein include VM1 and VM2 in virtual robot arm 1, include VM3 and VM4 in virtual robot arm 2.
For another example, according to affinity coefficient sequence from small to large to virtual machine to being ranked up: VM1-VM3:0;VM2-VM3: 0;VM1-VM4:1;VM2-VM4:1;VM3-VM4:1;VM1-VM2:2.Therefore virtual machine divides VM1-VM3 first, VM1 is assigned in virtual robot arm 1, VM3 is divided into virtual robot arm 2.Then virtual machine divides VM2-VM3, VM2 is assigned in virtual robot arm 1, since VM3 has been divided into virtual robot arm 2, no longer VM3 is divided. Finally virtual machine divides VM1-VM4, since VM1 has been divided into virtual robot arm 1, no longer to VM1 into Row divides, and VM4 is assigned in virtual robot arm 2.To the divided completion of this all virtual machine, therefore terminate to distribute, finally may be used It include VM3 and VM4 in virtual robot arm 2 to obtain including VM1 and VM2 in virtual robot arm 1.
It should be noted that if the number of all virtual machines is odd number, it may appear that an extra virtual machine can not be equal It is assigned in two virtual robot arms evenly.In such a case, it is possible to individually upgrade to the virtual machine, or this is virtual Machine is divided into any one virtual robot arm.
S505, actuator send the division result of virtual robot arm to controller.Wherein, division result includes virtual robot arm 1 Virtual machine included in the virtual machine and virtual robot arm 2 for being included.
S506, controller receive the division result of virtual robot arm, and save the division result of virtual robot arm.
S507, controller show the division result of virtual robot arm by visual means in operation interface.Administrator can To check the result of virtual robot arm that controller is shown, if it is determined that division result supports the upgrading of this virtual machine, then can be with Confirmation upgrading is clicked, virtual robot arm 1 is upgraded first.The confirmation upgrade command that controller reception administrator issues, and to Actuator sends confirmation upgrade request, needs in the mark of the confirmation upgrade request comprising virtual robot arm 1 and virtual robot arm 1 The list of the VM of upgrading.
S508, actuator confirm that upgrade request, the confirmation upgrade request include the mark of virtual robot arm 1 to scheduler dispatches Knowledge and the list for the VM for needing to upgrade.
S509, scheduler receive confirmation upgrade request after, can simultaneously to multiple virtual machines in virtual robot arm 1 into Row upgrading, can also successively upgrade multiple virtual machines in virtual robot arm 1.When institute's liter in need in virtual robot arm 1 After the virtual machine of grade upgrades successfully, stop upgrading.
S510, scheduler send upgrading response to actuator.
S511 after actuator receives the upgrading response of scheduler dispatches, sends upgrading response, the liter to controller Grade response is upgraded successfully for notification controller virtual robot arm 1.
S512, controller send confirmation upgrade request to actuator, and the confirmation upgrade request is for notifying actuator and tune Degree device upgrades the virtual machine in virtual robot arm 2.The confirmation upgrade request includes the mark and virtual machine of virtual robot arm 2 The list for the VM for needing to upgrade in group 2.
S513, actuator and scheduler are according to upgrading mode identical with virtual robot arm 1 to the virtual machine in virtual robot arm 2 Upgraded.
S514, after actuator and scheduler upgrade successfully the virtual machine in virtual robot arm 2, actuator is sent out to controller Upgrading is sent to respond, upgrading response is upgraded successfully for notification controller virtual robot arm 2.
Optionally, after completing the upgrading to virtual robot arm 1 and virtual robot arm 2, controller can be to actuator The cleaning request for sending virtual robot arm information clears up virtual robot arm information after actuator receives cleaning request, After cleaning is completed, the response that cleaning is completed is returned to controller.To avoid residual redundancy data in system.
In the embodiment of the present application, actuator obtains the deployment information of virtual machine and Service Instance first from scheduler, Then it according to deployment information, determines the affinity coefficient of each virtual machine pair, finally according to affinity coefficient, multiple virtual machines is divided For two virtual robot arms, the virtual robot arm of two compatibility equilibriums is obtained to finally divide, therefore to two virtual robot arms When being upgraded, it is no longer necessary to execute switching for virtual robot arm, directly successively upgrade to two virtual robot arms, and can be same When multiple virtual machines of one virtual robot arm are upgraded, to improve the upgrading efficiency of virtual machine, reduce resource wave Take.
Fig. 8 is referred to, Fig. 8 is a kind of flow diagram for virtual machine upgrade method that another embodiment of the application provides, This method includes but is not limited to following steps:
S801, controller send upgrade request to actuator, and notice actuator starts partition virtual machines group.Wherein, upgrade Request can carry tolerance coefficient, which can include but is not limited to 0% or 10%.
Multiple virtual machines are divided into two virtual robot arms by S802, actuator.In specific implementation and a upper embodiment S502-S504 it is identical, the embodiment of the present application repeats no more.
S803, actuator obtain the distribution letter of the Service Instance in described two virtual robot arms in each virtual robot arm Breath;According to the distributed intelligence, it is determined whether compensated to the virtual robot arm.Wherein, the distributed intelligence includes described The quantity of the Service Instance of every kind of service type in each virtual robot arm.
In the specific implementation, actuator can be real according to the service of every kind of service type in each virtual robot arm The quantity of example, determines the distribution deviation of the Service Instance between described two virtual robot arms;When the distribution deviation is little When the tolerance coefficient, actuator is not compensated the virtual robot arm, when the distribution deviation is greater than the tolerance When number, actuator compensates the virtual robot arm.Further, actuator can determine between described two virtual robot arms Every kind of service type the Service Instance quantity difference and described two virtual robot arms in all Service Instances The sum of quantity;Using the ratio of the sum of the difference of the quantity of the Service Instance and the quantity of all Service Instances as described in Distribution deviation.
For example, as shown in figure 9, the Service Instance of virtual robot arm 1 including 2 B service types, and do not deposited in virtual robot arm 2 The difference of the quantity of the Service Instance of B service type between the Service Instance of B service type, two virtual robot arms be 2, two The sum of quantity of all Service Instances is 12 in virtual robot arm, and therefore, the 16.7% conduct distribution that 2 are calculated divided by 12 is inclined Difference, due to 16.7% be greater than tolerance coefficient 10%, the Service Instance of B service type is in virtual robot arm 1 and virtual robot arm 2 In be unevenly distributed weighing apparatus, determination needs to compensate virtual robot arm.
S804, actuator determine the service type and benefit for the Service Instance for needing to compensate in each virtual robot arm Repay value, output compensation list.Wherein, the information format compensated in list can be with are as follows: [service type]: [offset].
In the specific implementation, when the distribution of the Service Instance of certain service type between described two virtual robot arms is inclined When difference is greater than the tolerance coefficient, which can be determined as the Service Instance for needing to compensate by actuator Service type;Actuator can be real by the service of the service type in described two virtual robot arms in some virtual robot arm What the difference that the quantity of example subtracts the quantity of the Service Instance of the service type in another virtual robot arm was obtained divided by 2 Ratio is as the offset.
For example, as shown in figure 9, the number of the Service Instance of B service type is the clothes of 2, C service type in virtual robot arm 1 The number of pragmatic example is 2, and the number of the Service Instance of B service type is the Service Instance of 0, C service type in virtual robot arm 2 Number be 0, therefore, it is necessary to the Service Instances of Service Instance and C service type to B service type to compensate, offset Respectively 1.In addition, the number of the Service Instance of E service type is of the Service Instance of 0, F service type in virtual robot arm 1 Number is 0, and the number of the Service Instance of E service type is 2 in virtual robot arm 2, the number of the Service Instance of F service type is 2, Therefore, it is also desirable to which the Service Instance of Service Instance and F service type to E service type compensates, and offset is respectively 1.
S805, actuator send the division result and compensation list of virtual robot arm to controller.
S806, after controller receives the division result and compensation list of the virtual robot arm of actuator transmission, to virtual The division result of unit and compensation list are shown that administrator can check the division result and compensation list of virtual robot arm, Whether implement to compensate according to current business load and O&M is empirically determined.If it is determined that being compensated to virtual robot arm, manage Member can issue compensating instruction to controller, after controller receives compensating instruction, send compensation order to actuator.
S807, actuator compensate virtual robot arm.
In the specific implementation, actuator can be according to the service type and the benefit of the Service Instance for needing to compensate Value is repaid, the virtual robot arm is compensated.It further, can be according to the offset by institute in described two virtual robot arms The Service Instance for stating the service type in some virtual robot arm moves in another described virtual robot arm.
For example, as shown in Figure 10, Figure 10 is the schematic diagram of the virtual robot arm before a kind of compensation provided by the embodiments of the present application. By S804 it is found that need the Service Instance to B service type, the Service Instance of C service type, E service type Service Instance, The Service Instance of F service type compensates, and offset is respectively 1.The S.B2 in VM2 can be deleted, is rebuild in VM3 S.B2;The S.E1 in VM3 can be deleted, S.E1 is rebuild in VM2;The S.C2 in VM2 can be deleted, S.C2 is rebuild in VM3; The S.F1 in VM3 can be deleted, S.F1 is rebuild in VM2.Of course, it is possible to which the service for deleting B service type in virtual robot arm 1 is real Example S.B1 and S.B2 in any one, then rebuild in virtual robot arm 2, delete virtual robot arm 1 in C service type service Any one in example S.C1 and S.C2, then rebuilds in virtual robot arm 2.The Service Instance and F of E service type service class The Service Instance of type is same.
Again as shown in figure 11, Figure 11 is a kind of schematic diagram of compensated virtual robot arm provided by the embodiments of the present application.By Figure is it is found that include the Service Instance of 1 A service type, 1 in compensated virtual robot arm 1 and in compensated virtual robot arm 2 The Service Instance of the Service Instance of a B service type, 1 C service type, the Service Instance of 1 D service type, 1 F service The Service Instance of the Service Instance of type and 1 F service type, therefore, the Service Instance of every kind of service type is in virtual robot arm 1 Distributing equilibrium is reached in virtual robot arm 2.
It should be noted that in practical applications, it is not required that the Service Instance of certain service type is between virtual robot arm Reach that quantity is fully equalize, is subjected to certain tolerance, i.e. distributed quantity difference of the Service Instance in two flat virtual robot arms The acceptable upper limit of ratio of the total example quantity of Zhan.
S808, actuator return to compensation result to controller, and controller is to compensated virtual robot arm 1 and virtual robot arm 2 It is shown.
By aforesaid operations, the distributing equilibrium substantially achieved between virtual robot arm, but certain service may also occur The Service Instance of type is unable to reach ideal portfolio effect between virtual robot arm.Administrator can pass through the control of controller The division result of the virtual robot arm of interface display and the compensation list for not completing compensation, it is determined whether implement artificial compensation.S809- S813 is a kind of optional artificial compensation's mode that the embodiment of the present application provides, and specific implementation step is as follows:
S809, controller send Pipelines with Single Direction Compensation request to actuator, and the compensation request includes the mark of the virtual robot arm Knowledge and service type;
S810 inquires VM idle in virtual robot arm after actuator receives compensation request.
S811, actuator are migrated to scheduler dispatches and are ordered, and the migration order is for notifying scheduler to execute Service Instance Migration.
S812, scheduler are corresponding by the mark of the virtual robot arm according to the offset for idle virtual machine The Service Instance of the service type in the virtual robot arm moves in another virtual robot arm.
S813, after the completion of Service Instance migration, actuator sends compensation result to controller.
S814 successively upgrades two virtual robot arms.Specific embodiment is identical as a upper embodiment, and the application is real Example is applied to repeat no more.
In the embodiment of the present application, virtual machine is divided into two virtual robot arms first, then determines two virtual robot arms In Service Instance whether distributing equilibrium compensates the Service Instance in two virtual robot arms if being unevenly distributed weighing apparatus, Its distribution in two virtual machines is set to reach balanced, so that the upgrading efficiency of virtual machine not only can be improved, but also to void Virtual machine processing business is not influenced when quasi- machine is upgraded.
2, Figure 12 is a kind of process signal for virtual machine upgrade method that the another embodiment of the application provides referring to Figure 1 Figure, this method includes but is not limited to following steps:
S1201, controller send fragment partition request to actuator, which includes the fragment for needing to divide Quantity.
S1202, actuator obtain the deployment information of current virtual machine and Service Instance from scheduler, are believed according to deployment It ceases multiple virtual machines and is divided at least one virtual machine fragment.Wherein, deployment information includes the quantity of virtual machine, virtual machine In Service Instance or the service type of Service Instance etc..
In the specific implementation, can according to need the fragment quantity of division and the sum of all virtual machines, each void is determined The quantity of quasi- machine fragment.Further, the fragment quantity that the sum of all virtual machines can be divided divided by needs, is calculated Virtual machine quantity in each virtual machine fragment.Certain virtual machine fragments can be evenly distributed to for extra virtual machine In.
S1203, controller send virtual robot arm partition request to actuator.
After actuator receives virtual robot arm partition request, multiple virtual machines in each virtual machine fragment are drawn by S1204 It is divided into two virtual robot arms.Specific implementation is identical as the S502-S504 in upper one embodiment, and the embodiment of the present application is no longer It repeats.
As shown in figure 13, Figure 13 is a kind of schematic diagram of virtual machine fragment provided by the embodiments of the present application.It will be multiple virtual Machine be divided into virtual machine fragment Slice1, virtual machine fragment Slice2 ..., virtual machine fragment SliceN, each virtual machine point Virtual machine in piece is divided into virtual robot arm P1 and virtual robot arm P2.
It is dividing completion virtual machine fragment and multiple virtual machines in each virtual machine fragment is divided into two virtual machines After group, virtual machine can be upgraded using following two optional way.
The first optional way:
S1205, controller send fragment upgrade request to actuator, which includes the mark of virtual machine fragment The mark of virtual robot arm in knowledge and virtual machine fragment, the mark can be number.
S1206, after actuator receives upgrading fragment request, according to the mark of virtual machine fragment and virtual machine fragment The mark of middle virtual robot arm determines destination virtual unit, then upgrades to the virtual machine in destination virtual unit.According to this Mode successively upgrades the virtual machine in the virtual robot arm in each virtual machine fragment, to finally complete all virtual machines Upgrading.Specific upgrading mode is identical as the first two embodiment, and the embodiment of the present application repeats no more.
Second of optional way:
S1207, controller send virtual robot arm aggregate requests to actuator.
Described two virtual robot arms in each virtual machine fragment are assigned to two virtual machines by S1208, actuator In set.For example, the virtual robot arm 1 of all virtual machine fragments can be polymerized to final virtual machine set 1, it will be all virtual The virtual robot arm 2 of machine fragment is polymerized to final virtual machine set 2.
S1209, actuator successively upgrade the virtual machine in two virtual machine set.Specific upgrading mode and preceding two A embodiment is identical, and the embodiment of the present application repeats no more.
In the embodiment of the present application, due to the increase with cluster scale, calculation amount required for partition virtual machines group It will increase.Therefore multiple virtual machines are divided into virtual machine fragment first by the present embodiment, are then drawn in each virtual machine fragment Divide virtual robot arm, finally successively the virtual machine in each virtual machine fragment is upgraded, or further by each virtual machine Virtual robot arm in fragment is polymerized to virtual machine set, so that finally the virtual machine in each virtual machine set is upgraded, The complexity for reducing calculating improves virtual machine upgrading efficiency.
It is above-mentioned to illustrate the method for the embodiment of the present application, the device of the embodiment of the present application is provided below.
4, Figure 14 is a kind of structural schematic diagram of virtual machine update device provided by the embodiments of the present application referring to Figure 1, should Virtual machine update device may include controller 1401, actuator 1402 and scheduler 1403, wherein each unit it is detailed It is described as follows.
Controller 1401, for sending upgrade request to the actuator;
Actuator 1402, for according to the upgrade request, obtaining virtual machine and Service Instance from scheduler 1403 Deployment information, the Service Instance operate in the virtual machine;
Actuator 1402, for determining the affinity coefficient of each virtual machine pair, the affine system according to the deployment information Number is for indicating the correlation between virtual machine described in every two;
Actuator 1402, for according to the affinity coefficient, multiple virtual machines to be divided into two virtual robot arms;
Scheduler 1403, for successively upgrading to the virtual machine in described two virtual robot arms.
Wherein, the affinity coefficient is the Service Instance between virtual machine described in every two with same services type The sum of quantity or every two described between virtual machine the Service Instance of every kind of same services type quantity weighted average The sum of value.
Optionally, actuator 1402 is used for:
According to the affinity coefficient to multiple virtual machines to being ranked up;
Successively two virtual machines by the virtual machine centering after sequence are assigned in described two virtual robot arms;
When all virtual machines are assigned in described two virtual robot arms, terminate distribution.
Optionally, actuator 1402 is used for: according to affinity coefficient sequence from small to large to multiple virtual machines To being ranked up;Or according to the sequence of the affinity coefficient from big to small to multiple virtual machines to being ranked up.
Optionally, the actuator is used for: obtaining the service in described two virtual robot arms in each virtual robot arm The distributed intelligence of example;According to the distributed intelligence, it is determined whether compensated to the virtual robot arm.
Wherein, the upgrade request includes tolerance coefficient, and the distributed intelligence includes every in each virtual robot arm The quantity of the Service Instance of kind service type;
Actuator 1402 is used for: according to the number of the Service Instance of every kind of service type in each virtual robot arm Amount, determines the distribution deviation of the Service Instance between described two virtual robot arms;When the distribution deviation is greater than the appearance When bearing coefficient, the virtual robot arm is compensated.
Optionally, actuator 1402 is used for: determining the clothes of every kind of service type between described two virtual robot arms The sum of the quantity of all Service Instances in the difference of the quantity of pragmatic example and described two virtual robot arms;By the service The ratio of the sum of the quantity of the difference of the quantity of example and all Service Instances is as the distribution deviation.
Optionally, actuator 1402 is used for: determining the Service Instance for needing to compensate in each virtual robot arm Service type and offset;According to the service type of the Service Instance for needing to compensate and the offset, to described Virtual robot arm compensates.
Optionally, actuator 1402 is used for: when the service of certain service type between described two virtual robot arms When the distribution deviation of example is greater than the tolerance coefficient, which is determined as the Service Instance for needing to compensate Service type;By the quantity of the Service Instance of the service type in described two virtual robot arms in some virtual robot arm Subtract the ratio conduct that the difference of the quantity of the Service Instance of the service type in another virtual robot arm is obtained divided by 2 The offset.
Optionally, actuator 1402 is used for: according to the offset by some is virtual described in described two virtual robot arms The Service Instance of the service type in unit moves in another described virtual robot arm.
Optionally, controller 1401 are also used to send compensation request to the actuator, and the compensation request includes described The mark and service type of virtual robot arm;Actuator 1402 is also used to according to the offset, by the mark of the virtual robot arm The Service Instance of the service type in the corresponding virtual robot arm moves in another virtual robot arm.
Optionally, actuator 1402 are also used to multiple virtual machines being divided at least one virtual machine fragment;By institute It states the virtual machine at least one virtual machine fragment in each virtual machine fragment and is divided into described two virtual robot arms;Scheduler 1403, it is also used to successively upgrade the virtual machine in two virtual robot arms described in each virtual machine fragment.
Optionally, actuator 1402 are also used to described two virtual robot arms distribution in each virtual machine fragment Into two virtual machine set;Scheduler 1403, be also used to successively to the virtual machine in described two virtual machine set into Row upgrading.
It should be noted that the realization of each unit can also be real to the method shown in Fig. 5, Fig. 8 and Figure 12 that should refer to The corresponding description of example is applied, method and function performed in above-described embodiment are executed.
It is a kind of structural representation for virtual machine updating apparatus that the embodiment of the present application proposes please continue to refer to Figure 15, Figure 15 Figure.As shown, the virtual machine updating apparatus may include: at least one processor 1501, at least one communication interface 1502, At least one processor 1503 and at least one communication bus 1504.
Wherein, processor 1501 can be central processor unit, general processor, digital signal processor, dedicated collection At circuit, field programmable gate array or other programmable logic device, transistor logic, hardware component or its Meaning combination.Its may be implemented or execute combine present disclosure described in various illustrative logic blocks, module and Circuit.The processor is also possible to realize the combination of computing function, such as combines comprising one or more microprocessors, number Signal processor and the combination of microprocessor etc..Communication bus 1504 can be Peripheral Component Interconnect standard PCI bus or expansion Open up industrial standard architectures eisa bus etc..The bus can be divided into address bus, data/address bus, control bus etc..For convenient for It indicates, is only indicated with a thick line in Figure 15, it is not intended that an only bus or a type of bus.Communication bus 1504 for realizing the connection communication between these components.Wherein, the communication interface 1502 of equipment is used in the embodiment of the present application The communication of signaling or data is carried out with other node devices.Memory 1503 may include volatile memory, such as non-volatile Property dynamic random access memory (Nonvolatile Random Access Memory, NVRAM), phase change random access memory (Phase Change RAM, PRAM), magnetic-resistance random access memory (Magetoresistive RAM, MRAM) etc., can be with Including nonvolatile memory, for example, at least a disk memory, Electrical Erasable programmable read only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), flush memory device, such as instead Or flash memory (NOR flash memory) or anti-and flash memory (NAND flash memory), semiconductor devices, such as solid-state is hard Disk (Solid State Disk, SSD) etc..Memory 1503 optionally can also be that at least one is located remotely from aforementioned processor 1501 storage device.Batch processing code is stored in memory 1503, and processor 1501 executes the journey in memory 1503 Sequence.
Upgrade request is sent to the actuator;
According to the upgrade request, the deployment information of virtual machine and Service Instance is obtained from scheduler, the service is real Example operates in the virtual machine;
According to the deployment information, the affinity coefficient of each virtual machine pair is determined, the affinity coefficient is for indicating every two Correlation between a virtual machine;
According to the affinity coefficient, multiple virtual machines are divided into two virtual robot arms;
Successively the virtual machine in described two virtual robot arms is upgraded.
Wherein, the affinity coefficient is the Service Instance between virtual machine described in every two with same services type The sum of quantity or every two described between virtual machine the Service Instance of every kind of same services type quantity weighted average The sum of value.
Optionally, processor 1501 is also used to perform the following operations:
According to the affinity coefficient to multiple virtual machines to being ranked up;
Successively two virtual machines by the virtual machine centering after sequence are assigned in described two virtual robot arms;
When all virtual machines are assigned in described two virtual robot arms, terminate distribution.
Optionally, processor 1501 is also used to perform the following operations:
According to the sequence of the affinity coefficient from small to large to multiple virtual machines to being ranked up;Or
According to the sequence of the affinity coefficient from big to small to multiple virtual machines to being ranked up.
Optionally, processor 1501 is also used to perform the following operations:
Obtain the distributed intelligence of the Service Instance in described two virtual robot arms in each virtual robot arm;
According to the distributed intelligence, it is determined whether compensated to the virtual robot arm.
Optionally, processor 1501 is also used to perform the following operations:
According to the quantity of the Service Instance of every kind of service type in each virtual robot arm, determine described two The distribution deviation of the Service Instance between virtual robot arm;
When the distribution deviation is greater than the tolerance coefficient, the virtual robot arm is compensated.
Optionally, processor 1501 is also used to perform the following operations:
Determine difference, the Yi Jisuo of the quantity of the Service Instance of every kind of service type between described two virtual robot arms State the sum of the quantity of all Service Instances in two virtual robot arms;
Using the ratio of the sum of the difference of the quantity of the Service Instance and the quantity of all Service Instances as described point Cloth deviation.
Optionally, processor 1501 is also used to perform the following operations:
Determine the service type and offset of the Service Instance for needing to compensate in each virtual robot arm;
According to the service type of the Service Instance for needing to compensate and the offset, to the virtual robot arm into Row compensation.
Optionally, processor 1501 is also used to perform the following operations:
Described in being greater than when the distribution deviation of the Service Instance of certain service type between described two virtual robot arms When tolerating coefficient, which is determined as to the service type of the Service Instance for needing to compensate;
The quantity of the Service Instance of the service type in described two virtual robot arms in some virtual robot arm is subtracted The ratio that the difference of the quantity of the Service Instance for the service type gone in another virtual robot arm is obtained divided by 2 is as institute State offset.
Optionally, processor 1501 is also used to perform the following operations:
According to the offset by the institute of the service type in some virtual robot arm described in described two virtual robot arms Service Instance is stated to move in another described virtual robot arm.
Optionally, processor 1501 is also used to perform the following operations:
Compensation request is sent to the actuator, the compensation request includes the mark and service class of the virtual robot arm Type;
According to the offset, by the service type in the corresponding virtual robot arm of mark of the virtual robot arm The Service Instance move in another virtual robot arm.
Optionally, processor 1501 is also used to perform the following operations:
Multiple virtual machines are divided at least one virtual machine fragment;
Virtual machine at least one described virtual machine fragment in each virtual machine fragment is divided into described two virtual Unit;
Successively the virtual machine in two virtual robot arms described in each virtual machine fragment is upgraded.
Optionally, processor 1501 is also used to perform the following operations:
Described two virtual robot arms in each virtual machine fragment are assigned in two virtual machine set;
Successively the virtual machine in described two virtual machine set is upgraded.
Further, processor can also be matched with memory and communication interface, be executed in above-mentioned application embodiment Operation.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program Product includes one or more computer instructions.When loading on computers and executing the computer program instructions, all or It partly generates according to process or function described in the embodiment of the present application.The computer can be general purpose computer, dedicated meter Calculation machine, computer network or other programmable devices.The computer instruction can store in computer readable storage medium In, or from a computer readable storage medium to the transmission of another computer readable storage medium, for example, the computer Instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center User's line (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or Data center is transmitted.The computer readable storage medium can be any usable medium that computer can access or It is comprising data storage devices such as one or more usable mediums integrated server, data centers.The usable medium can be with It is magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or semiconductor medium (such as solid state hard disk Solid State Disk (SSD)) etc..
Above-described specific embodiment has carried out further the purpose of the application, technical scheme and beneficial effects It is described in detail.Within the spirit and principles of this application, any modification, equivalent replacement, improvement and so on should be included in Within the protection scope of the application.

Claims (28)

1. a kind of virtual machine upgrade method, which is characterized in that the described method includes:
Controller sends upgrade request to actuator;
The actuator obtains the deployment information of virtual machine and Service Instance according to the upgrade request from scheduler, described Service Instance operates in the virtual machine;
The actuator determines that the affinity coefficient of each virtual machine pair, the affinity coefficient are used for table according to the deployment information Show the correlation between virtual machine described in every two;
The actuator is divided into two virtual robot arms according to the affinity coefficient, by multiple virtual machines;
The scheduler successively upgrades the virtual machine in described two virtual robot arms.
2. the method as described in claim 1, which is characterized in that the affinity coefficient is to have between virtual machine described in every two Every kind of same services type between virtual machine described in the sum of quantity of the Service Instance of same services type or every two The sum of quantity weighted average of the Service Instance.
3. method according to claim 1 or 2, which is characterized in that the actuator is according to the affinity coefficient, by multiple institutes It states virtual machine and is divided into two virtual robot arms and include:
The actuator is according to the affinity coefficient to multiple virtual machines to being ranked up;
Two virtual machines of the actuator successively by the virtual machine centering after sequence are assigned to described two virtual robot arms In;
When all virtual machines are assigned in described two virtual robot arms, the actuator terminates to distribute.
4. method as claimed in claim 3, which is characterized in that it is described according to the affinity coefficient to multiple virtual machines pair It is ranked up and includes:
The actuator is according to affinity coefficient sequence from small to large to multiple virtual machines to being ranked up;Or
The actuator is according to affinity coefficient sequence from big to small to multiple virtual machines to being ranked up.
5. method according to any of claims 1-4, which is characterized in that the actuator, will according to the affinity coefficient Multiple virtual machines are divided into after two virtual robot arms, further includes:
The actuator obtains the distributed intelligence of the Service Instance in described two virtual robot arms in each virtual robot arm;
The actuator is according to the distributed intelligence, it is determined whether compensates to the virtual robot arm.
6. method as claimed in claim 5, which is characterized in that the upgrade request includes tolerance coefficient, the distributed intelligence The quantity of the Service Instance including every kind of service type in each virtual robot arm;
It is described according to the distributed intelligence, it is determined whether the virtual robot arm compensated include:
The actuator determines institute according to the quantity of the Service Instance of every kind of service type in each virtual robot arm State the distribution deviation of the Service Instance between two virtual robot arms;
When the distribution deviation is greater than the tolerance coefficient, the actuator compensates the virtual robot arm.
7. method as claimed in claim 6, which is characterized in that every kind of service class according in each virtual robot arm The quantity of the Service Instance of type determines that the distribution deviation of the Service Instance between described two virtual robot arms includes:
The actuator determine the quantity of the Service Instance of every kind of service type between described two virtual robot arms difference, And in described two virtual robot arms all Service Instances the sum of quantity;
The actuator using the ratio of the sum of the quantity of the difference of the quantity of the Service Instance and all Service Instances as The distribution deviation.
8. method as claimed in claim 6, which is characterized in that the actuator, which compensates the virtual robot arm, includes:
The actuator determines the service type and offset for the Service Instance for needing to compensate in each virtual robot arm;
Service type and the offset of the actuator according to the Service Instance for needing to compensate, to described virtual Unit compensates.
9. method according to claim 8, which is characterized in that the actuator determines to be needed to mend in each virtual robot arm The service type and offset for the Service Instance repaid include:
When the distribution deviation of the Service Instance of certain service type between described two virtual robot arms is greater than the tolerance When coefficient, which is determined as the service type of the Service Instance for needing to compensate by the actuator;
The actuator is by the Service Instance of the service type in described two virtual robot arms in some virtual robot arm Quantity subtracts the ratio that the difference of the quantity of the Service Instance of the service type in another virtual robot arm is obtained divided by 2 As the offset.
10. method as claimed in claim 8 or 9, which is characterized in that the actuator is according to the clothes for needing to compensate The service type and offset of pragmatic example, compensate the virtual robot arm and include:
The actuator is according to the offset by the service class in some virtual robot arm described in described two virtual robot arms The Service Instance of type moves in another described virtual robot arm.
11. such as the described in any item methods of claim 8-10, which is characterized in that the actuator carries out the virtual robot arm After compensation, further includes:
The controller sends compensation request to the actuator, and the compensation request includes the mark kimonos of the virtual robot arm Service type;
The actuator is according to the offset, by the clothes in the corresponding virtual robot arm of mark of the virtual robot arm The Service Instance of service type moves in another virtual robot arm.
12. such as the described in any item methods of claim 1-11, which is characterized in that the method also includes:
Multiple virtual machines are divided at least one virtual machine fragment by the actuator;
Virtual machine at least one described virtual machine fragment in each virtual machine fragment is divided into described two by the actuator A virtual robot arm;
The scheduler successively rises the virtual machine in two virtual robot arms described in each virtual machine fragment Grade.
13. method as claimed in claim 12, which is characterized in that the method also includes:
Described two virtual robot arms in each virtual machine fragment are assigned in two virtual machine set by the actuator;
The scheduler successively upgrades the virtual machine in described two virtual machine set.
14. a kind of virtual machine update device, which is characterized in that described device includes controller, actuator and scheduler, in which:
The controller, for sending upgrade request to the actuator;
The actuator, for obtaining the deployment of virtual machine and Service Instance from the scheduler according to the upgrade request Information, the Service Instance operate in the virtual machine;
The actuator, for determining that the affinity coefficient of each virtual machine pair, the affinity coefficient are used according to the deployment information Correlation between the virtual machine described in expression every two;
The actuator, for according to the affinity coefficient, multiple virtual machines to be divided into two virtual robot arms;
The scheduler, for successively upgrading to the virtual machine in described two virtual robot arms.
15. device as claimed in claim 14, which is characterized in that the affinity coefficient is to have between virtual machine described in every two There is every kind of same services type between virtual machine described in the sum of quantity of the Service Instance of same services type or every two The sum of the quantity weighted average of the Service Instance.
16. the device as described in claims 14 or 15, which is characterized in that the actuator is used for:
According to the affinity coefficient to multiple virtual machines to being ranked up;
Successively two virtual machines by the virtual machine centering after sequence are assigned in described two virtual robot arms;
When all virtual machines are assigned in described two virtual robot arms, terminate distribution.
17. device as claimed in claim 16, which is characterized in that the actuator is used for:
According to the sequence of the affinity coefficient from small to large to multiple virtual machines to being ranked up;Or
According to the sequence of the affinity coefficient from big to small to multiple virtual machines to being ranked up.
18. such as the described in any item devices of claim 14-17, which is characterized in that the actuator is used for:
Obtain the distributed intelligence of the Service Instance in described two virtual robot arms in each virtual robot arm;
According to the distributed intelligence, it is determined whether compensated to the virtual robot arm.
19. device as claimed in claim 18, which is characterized in that the upgrade request includes tolerance coefficient, the distribution letter Breath includes the quantity of the Service Instance of every kind of service type in each virtual robot arm;
The actuator is used for:
According to the quantity of the Service Instance of every kind of service type in each virtual robot arm, determine described two virtual The distribution deviation of the Service Instance between unit;
When the distribution deviation is greater than the tolerance coefficient, the virtual robot arm is compensated.
20. device as claimed in claim 19, which is characterized in that the actuator is used for:
Determine the difference and described two of the quantity of the Service Instance of every kind of service type between described two virtual robot arms The sum of the quantity of all Service Instances in a virtual robot arm;
The ratio of the sum of the difference of the quantity of the Service Instance and the quantity of all Service Instances is inclined as the distribution Difference.
21. device as claimed in claim 19, which is characterized in that the actuator is used for:
Determine the service type and offset of the Service Instance for needing to compensate in each virtual robot arm;
According to the service type of the Service Instance for needing to compensate and the offset, the virtual robot arm is mended It repays.
22. device as claimed in claim 21, which is characterized in that the actuator is used for:
When the distribution deviation of the Service Instance of certain service type between described two virtual robot arms is greater than the tolerance When coefficient, which is determined as to the service type of the Service Instance for needing to compensate;
The quantity of the Service Instance of the service type in described two virtual robot arms in some virtual robot arm is subtracted separately The ratio that the difference of the quantity of the Service Instance of the service type in one virtual robot arm is obtained divided by 2 is as the benefit Repay value.
23. the device as described in claim 21 or 22, which is characterized in that the actuator is used for:
According to the offset by the clothes of the service type in some virtual robot arm described in described two virtual robot arms Pragmatic example moves in another described virtual robot arm.
24. such as the described in any item devices of claim 21-23, which is characterized in that
The controller is also used to send compensation request to the actuator, and the compensation request includes the virtual robot arm Mark and service type;
The actuator is also used to according to the offset, will be in the corresponding virtual robot arm of the mark of the virtual robot arm The Service Instance of the service type move in another virtual robot arm.
25. such as the described in any item devices of claim 14-24, which is characterized in that
The actuator is also used to multiple virtual machines being divided at least one virtual machine fragment;Will it is described at least one Virtual machine in virtual machine fragment in each virtual machine fragment is divided into described two virtual robot arms;
The scheduler is also used to successively to the virtual machine in two virtual robot arms described in each virtual machine fragment Upgraded.
26. device as claimed in claim 25, which is characterized in that
The actuator is also used to described two virtual robot arms in each virtual machine fragment being assigned to two virtual machines In set;
The scheduler is also used to successively upgrade the virtual machine in described two virtual machine set.
27. a kind of virtual machine updating apparatus characterized by comprising memory, communication bus and processor, wherein described Memory is executed for calling said program code as claim 1-13 is any for storing program code, the processor Method described in.
28. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has a plurality of finger It enables, described instruction is suitable for being loaded by processor and being executed such as the described in any item methods of claim 1-13.
CN201711032568.1A 2017-10-27 2017-10-27 Virtual machine upgrading method and related equipment Active CN109725981B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711032568.1A CN109725981B (en) 2017-10-27 2017-10-27 Virtual machine upgrading method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711032568.1A CN109725981B (en) 2017-10-27 2017-10-27 Virtual machine upgrading method and related equipment

Publications (2)

Publication Number Publication Date
CN109725981A true CN109725981A (en) 2019-05-07
CN109725981B CN109725981B (en) 2022-12-06

Family

ID=66291773

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711032568.1A Active CN109725981B (en) 2017-10-27 2017-10-27 Virtual machine upgrading method and related equipment

Country Status (1)

Country Link
CN (1) CN109725981B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111258609A (en) * 2020-01-19 2020-06-09 北京百度网讯科技有限公司 Upgrading method and device of Kubernetes cluster, electronic equipment and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103634128A (en) * 2012-08-21 2014-03-12 中兴通讯股份有限公司 A configuration method of a virtual machine placing strategy and an apparatus
CN106534318A (en) * 2016-11-15 2017-03-22 浙江大学 OpenStack cloud platform resource dynamic scheduling system and method based on flow affinity

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103634128A (en) * 2012-08-21 2014-03-12 中兴通讯股份有限公司 A configuration method of a virtual machine placing strategy and an apparatus
CN106534318A (en) * 2016-11-15 2017-03-22 浙江大学 OpenStack cloud platform resource dynamic scheduling system and method based on flow affinity

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
RODRIGO A.C.DA SILVA: "Topology-Aware Virtual Machine Placement in Data Centers", 《J GRID COMPUTING》 *
刘秀等: "云计算环境下资源评级的虚拟机部署算法", 《电子科技》 *
李中科等: "实现VNF业务连续的VNF虚拟机更新方法研究", 《通信技术》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111258609A (en) * 2020-01-19 2020-06-09 北京百度网讯科技有限公司 Upgrading method and device of Kubernetes cluster, electronic equipment and medium
CN111258609B (en) * 2020-01-19 2023-08-01 北京百度网讯科技有限公司 Upgrading method and device of Kubernetes cluster, electronic equipment and medium

Also Published As

Publication number Publication date
CN109725981B (en) 2022-12-06

Similar Documents

Publication Publication Date Title
JP6738960B2 (en) System and method for performing live migration of software containers
US9671967B2 (en) Method and system for implementing a distributed operations log
US20180129570A1 (en) Saving program execution state
CN102834822B (en) By trooping of sharing of virtual machine quick-full backup
US8875133B2 (en) Migration of virtual machines
US8458284B2 (en) Systems and methods for efficient live application migration within bandwidth constrained networks
US8572614B2 (en) Processing workloads using a processor hierarchy system
CN102594858B (en) Mirror solution in cloud storage environment
US20120284709A1 (en) Dynamic virtual machine domain configuration and virtual machine relocation management
CN104636181A (en) Method and system for migrating virtual machine
US9916215B2 (en) System and method for selectively utilizing memory available in a redundant host in a cluster for virtual machines
CN102193824A (en) Virtual machine homogenization to enable migration across heterogeneous computers
US20230362203A1 (en) Implementing a service mesh in the hypervisor
US8813076B2 (en) Virtual machine updates
CN102597963B (en) Dynamic copies volume in cluster exchanges
CN111124475A (en) Method for storage management, electronic device and computer-readable storage medium
US20170177225A1 (en) Mid-level controllers for performing flash management on solid state drives
CN110413369B (en) System and method for backup in virtualized environments
US8738873B2 (en) Interfacing with a point-in-time copy service architecture
CN109725981A (en) A kind of virtual machine upgrade method and relevant device
US11057263B2 (en) Methods and subsystems that efficiently distribute VM images in distributed computing systems
US10942821B1 (en) Method and apparatus for dynamic binding and unbinding thin logical storage volumes to snapshots of a file system
CN107783826A (en) A kind of virtual machine migration method, apparatus and system
US9674105B2 (en) Applying a platform code level update to an operational node
US10599479B2 (en) Resource sharing management of a field programmable 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
TA01 Transfer of patent application right

Effective date of registration: 20220211

Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Applicant after: Huawei Cloud Computing Technologies Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Applicant before: HUAWEI TECHNOLOGIES Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant