WO2016134542A1 - Virtual machine migration method, apparatus and device - Google Patents

Virtual machine migration method, apparatus and device Download PDF

Info

Publication number
WO2016134542A1
WO2016134542A1 PCT/CN2015/073422 CN2015073422W WO2016134542A1 WO 2016134542 A1 WO2016134542 A1 WO 2016134542A1 CN 2015073422 W CN2015073422 W CN 2015073422W WO 2016134542 A1 WO2016134542 A1 WO 2016134542A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
resources
virtual machine
migration
usage rate
Prior art date
Application number
PCT/CN2015/073422
Other languages
French (fr)
Chinese (zh)
Inventor
徐杰
周伟
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2015/073422 priority Critical patent/WO2016134542A1/en
Priority to CN201580001989.0A priority patent/CN106133693B/en
Publication of WO2016134542A1 publication Critical patent/WO2016134542A1/en

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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]

Definitions

  • the present invention relates to the field of data processing technologies, and in particular, to a method, an apparatus, and a device for migrating a virtual machine.
  • Migrating a virtual machine is the process of moving a virtual machine from one host or storage location to another.
  • Live migration is the move of a powered-on virtual machine to a new host. With live migration, you can move a virtual machine to a new host without disrupting virtual machine availability.
  • the resource manager detects the resource utilization of each host, such as monitoring the usage rate of resources such as CPU, memory, and network bandwidth, and assigns the same weight to each of the above resources or pre-defined a fixed weight.
  • the host When the host is overloaded, calculate the volume of each virtual machine running on the host (the reciprocal of the product of the various resource idle rate), and sort all the volumes in descending order, and finally select the virtual machine with the largest volume to migrate. If the above host is still overloaded at this time, the next-largest virtual machine will continue to be selected for migration until the host is no longer overloaded.
  • VM virtual machine
  • U 1 CPU usage rate
  • M 1 memory usage rate
  • B 1 bandwidth usage rate
  • VM load calculation method three kinds of resource is free reciprocal of a sum of products
  • a virtual machine (VM) can be calculated the volume of 1 L 1 is 12.5; the virtual machine VM U 2, M 2 2 a, B 2 respectively, 0.2,0.8, 0.5, and the virtual machine (VM) can be calculated volume of 2 L 2 of 12.5.
  • VM 1 and VM 2 have the same chance of selection when migrating, but when VM 2 is selected for migration, the CPU usage of VM 2 is only 0.2. Therefore, it does not solve the problem of host CPU overload, so VM 1 needs to be migrated. In addition, since VM 2 has a memory usage of 0.8, this will seriously affect the migration time of the VM.
  • the embodiments of the present invention provide a method, an apparatus, and a device for migrating a virtual machine, so as to solve the problem of assigning the same weight to the different types of resources of the virtual machine or pre-defining the fixed weights in the prior art, thereby affecting the selection of the virtual machine to be migrated. Correctness, resulting in an increase in the number of migrations and a large migration overhead.
  • a method for migrating a virtual machine comprising:
  • the resource manager obtains usage rates of multiple types of resources of each virtual machine in the source host, and determines usage rates of multiple types of resources of the source host according to usage rates of multiple types of resources of the virtual machines;
  • each of the virtual machines has the same type of resources, and the determining, according to the usage rates of the multiple types of resources of the virtual machines, determining The usage rates of the multiple types of resources of the source host include:
  • the source host is configured according to a usage rate of multiple types of resources of the source host
  • the types of resources are classified into overloaded resources and unoverloaded resources including:
  • the usage rate of the first type of resource is not greater than a preset threshold, the first type of resource is determined as an unoverloaded resource.
  • the second migration weight of the un-allocated resource includes:
  • the usage rate of the multiple types of resources according to the each virtual machine, The first migration weight of the overload resource and the second migration weight of the un-overloaded resource, the virtual machine to be migrated from the virtual machine includes:
  • the usage rate of the multiple types of resources according to the The first migration weight of the overload resource and the second migration weight of the un-overloaded resource, the virtual machine to be migrated from the virtual machine includes:
  • the second migration value of each virtual machine is compared, and the virtual machine corresponding to the smallest second migration value is determined as the virtual machine to be migrated.
  • the method before the acquiring the first migration generation value of the each virtual machine, the method further includes:
  • the usage rate of the multiple types of resources of the each virtual machine, the first migration weight of the overload resource, and The second migration weight of the un-overloaded resource, and obtaining the first migration value of each virtual machine includes:
  • D i is the first migration value of the i-th virtual machine
  • n is the number of overload resource types of the source host
  • a t is the first migration weight of the t-type overload resource of the source host, A t >1, S it is the usage rate of the t-th type resource of the i-th virtual machine
  • P t is the target usage rate of the t-type overload resource of the source host
  • m is the source host
  • B l is the second migration weight of the first type of un-overloaded resources of the source host, 0 ⁇ B l ⁇ 1
  • T il is the use of the first type of resources of the i-th virtual machine.
  • Rate, Q l is the target usage rate of the first type of un-overloaded resources of the source host
  • n+m is the number of resource types of the source host.
  • a second aspect provides a virtual machine migration apparatus, where the apparatus includes: an obtaining unit, a dividing unit, a selecting unit, and a sending unit;
  • the obtaining unit is configured to obtain usage rates of multiple types of resources of each virtual machine in the source host, and determine usage of multiple types of resources of the source host according to usage rates of multiple types of resources of the virtual machines. rate;
  • the dividing unit is configured to divide, according to the usage rate of the multiple types of resources of the source host determined by the acquiring unit, the multiple types of resources of the source host into an overload resource and an un-overload resource, and determine the a first migration weight of the overloaded resource and a second migration weight of the unoverloaded resource;
  • the selecting unit is configured to select, according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overload resource, and the second migration weight of the un-overloaded resource, from the virtual machine The virtual machine to be migrated;
  • the sending unit is configured to send a migration instruction to the monitor of the source host, so that the monitor migrates the to-be-migrated virtual machine selected by the selecting unit to the target host according to the migration instruction.
  • each of the virtual machines has the same type of resources, and the acquiring unit is specifically configured to:
  • the size of the type resource allocated by the virtual machine determines the usage rate of the type resource of the source host; until the usage rate of each type resource of the source host is determined.
  • the dividing unit is specifically configured to:
  • the usage rate of the first type of resource is not greater than a preset threshold, the first type of resource is determined as an unoverloaded resource.
  • the dividing unit is specifically configured to:
  • the selecting unit is specifically configured to:
  • the first migration value of each virtual machine is compared, and the virtual machine corresponding to the smallest first migration value is determined as the virtual machine to be migrated.
  • the selecting unit is specifically configured to:
  • the second migration value of each virtual machine is compared, and the virtual machine corresponding to the smallest second migration value is determined as the virtual machine to be migrated.
  • the device further includes: a comparison unit, configured to use the source host Each type of overload resource in the overload resource compares the usage rate of the type of overload resource of each virtual machine, and uses the maximum overload resource usage rate as the target usage rate of the type of overload resource;
  • the selecting unit is specifically configured to:
  • D i is the first migration value of the i-th virtual machine
  • n is the number of overload resource types of the source host
  • a t is the first migration weight of the t-type overload resource of the source host, A t >1, S it is the usage rate of the t-th type resource of the i-th virtual machine
  • P t is the target usage rate of the t-type overload resource of the source host
  • m is the source host
  • B l is the second migration weight of the first type of un-overloaded resources of the source host, 0 ⁇ B l ⁇ 1
  • T il is the use of the first type of resources of the i-th virtual machine.
  • Rate, Q l is the target usage rate of the first type of un-overloaded resources of the source host
  • n+m is the number of resource types of the source host.
  • a migration device for a virtual machine where the migration device includes:
  • processor a processor, a memory, a communication interface, and a bus, wherein the processor, the memory, and The communication interface communicates via the bus;
  • the communication interface is configured to communicate with a switch or a control server
  • the memory is used to store a program
  • the processor is configured to execute the program stored by the memory to perform the migration method of the virtual machine described in the first aspect above.
  • the method, device, and device for migrating a virtual machine acquires usage rates of multiple types of resources of each virtual machine in the source host, and determines various types of source hosts according to usage rates of multiple types of resources of the virtual machine. Usage of type resources; according to the usage rate of multiple types of resources of the source host, the multiple types of resources of the source host are divided into overloaded resources and un-overloaded resources, and the first migration weight of the overloaded resources and the un-overloaded resources are determined.
  • the migration weight is selected according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overloaded resource, and the second migration weight of the unoverloaded resource, and the virtual machine to be migrated is selected from the virtual machine; Migrate instructions so that the monitor migrates the virtual machine to be migrated to the target host. Therefore, the correctness of the selection of the virtual machine to be migrated can be improved, so that the problem of overloading the source host can be quickly solved, and the purpose of saving computer resources is achieved.
  • FIG. 1 is an application scenario diagram of a method for migrating a virtual machine according to the present invention
  • FIG. 2 is a flowchart of a method for migrating a virtual machine according to Embodiment 1 of the present invention
  • FIG. 3 is a schematic diagram of a method for determining a weight of a resource provided by the present invention.
  • FIG. 4 is a flowchart of a method for migrating a virtual machine according to Embodiment 2 of the present invention.
  • FIG. 5 is a schematic diagram of a virtual machine migration apparatus according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a migration device of a virtual machine according to an embodiment of a device according to the present invention.
  • FIG. 1 is an application scenario diagram of a migration method of a virtual machine provided by the present invention.
  • VM 1 , VM 2 ... VM m respectively represent a virtual machine, and the virtual machine refers to a running with software function and having a complete hardware system function.
  • Virtual machine resources involve multiple aspects: Central Processing Unit (CPU), Memory (MEM), Network Bandwidth (BW), and disk. The relationship between these resources should be considered when planning a virtual machine.
  • CPU Central Processing Unit
  • MEM Memory
  • BW Network Bandwidth
  • Physical Machine (PM) 1 , PM 2 ... PM n respectively represent n hosts, wherein each host has a virtual machine monitor (VMM), which is also called a hypervisor.
  • VMM virtual machine monitor
  • VMM not only coordinates access to these hardware resources, but also protects between virtual machines. When a physical machine boots and executes VMM, it loads the operating system of all virtual machine clients and allocates the appropriate amount of memory, CPU, network, and disk to each virtual machine.
  • VMM is at the heart of all virtualization technologies, and the ability to support multi-workload migration non-disruptively is a fundamental feature of VMM.
  • Virtual machine migration is an extremely powerful tool for data center and cluster administrators to improve system performance and increase resource allocation flexibility, and is used in many important areas:
  • Load balancing periodically collect the resource usage rate, redistribute the virtual machine to the physical machine in the data center or cluster, and migrate some virtual machines on the overloaded physical machine to the light load physical machine to evenly distribute the workload to avoid Load imbalances are caused by frequent deployment and termination of virtual machines.
  • Active Fault Tolerance Monitor the health status of the node, such as temperature or disk error log. If a physical machine is about to fail, the virtual machine on it actively migrates to a more secure location, which reduces the probability of the user perceiving the failure and improves the reliability of the system.
  • Resource optimization and power management adjust the resource allocation of the data center or cluster, optimize the use of resources, and integrate virtual machines from lightly loaded hosts to heavily loaded hosts. Once the migration is complete, the hosts that previously ran the migrated virtual machines can be shut down, helping to reduce costs and save energy.
  • the migration of virtual machines improves the ability to manage and provide services in data centers and clusters, realizes flexible allocation of resources, improves system reliability, and enables more powerful computing power, larger memory, and faster communication. Ability to save energy.
  • the resource management algorithm in Figure 1 generally includes three phases: a pre-allocation phase, a migration planning phase, and a migration execution phase. The specific functions of each phase are described as follows:
  • Pre-allocation phase The resource manager collects resource usage data from the running host through the VMM within a specific measurement interval. The details of the sampled data are highly dependent on the virtualization technology used and the type of data that needs to be collected. With this data, the resource manager has a general understanding of the performance level of the running host. For the previously set trigger condition, if the monitoring information shows that a conflict occurs at this time, the resource reallocation is triggered.
  • the foregoing triggering conditions may include two situations: the first case is that the virtual machine in the host is overloaded due to the competition for resources; the second case is that the host needs to be online maintained or powered. management. In the second case, the host's resources are usually not overloaded, and all virtual machines on the host need to be migrated out.
  • Migration planning phase This phase is the most critical part of the entire process. The resource manager's responsibility is to generate appropriate migration scenarios or instructions for new virtual machine deployments to eliminate or minimize the behavior of illegal trigger conditions.
  • the migration plan usually includes three important components: the source host, the virtual machine to be migrated, and the target host.
  • Migration execution phase According to the migration plan and instructions generated by the resource manager, the VMM implements the specific migration work. The specific details of the phase are mainly determined by the virtualization technology adopted.
  • FIG. 2 is a flowchart of a method for migrating a virtual machine according to Embodiment 1 of the present invention.
  • the method is applicable to the virtual machine to be migrated involved in the migration planning phase when the trigger condition in FIG. 1 is the first case.
  • the problem as shown in FIG. 2, may specifically include:
  • the resource manager obtains usage rates of multiple types of resources of each virtual machine in the source host, and determines usage rates of multiple types of resources of the source host according to usage rates of multiple types of resources of the virtual machines.
  • each of the virtual machines has the same type of resources, and the step S210 may specifically include:
  • the multiple types of resources of the source host may include, but are not limited to, CPU, memory, network bandwidth, and disk. It can be understood that multiple types of resources of the virtual machine running on the source host may include but are not limited to: CPU. , memory, network bandwidth, and disk. In this specification, each virtual machine includes three types of resources: CPU, memory, and network bandwidth as an example.
  • the CPU size of the source host is assumed to be 10G, wherein the size of the CPU allocated to VM 1 is 6G in advance, and VM 2 is allocated in advance. If the size of the CPU is 4G, if the resource manager obtains the CPU usage of the virtual machine VM 1 in the host at 0.6, and the CPU usage of the virtual machine VM 2 is 0.4, then the source host The usage rate of the CPU is 0.52 ((6 ⁇ 0.6+4 ⁇ 0.4)/10); similarly, the usage rate of other types of resources of the source host can be obtained.
  • the usage rate of the foregoing resources refers to the consumption of resources by related applications carried on the virtual machine. Therefore, the resource usage rate of the virtual machine is a dynamic value. , which dynamically changes with the performance of the application; accordingly, another concept needs to be described in the present invention: the size of the resources allocated in advance for each virtual machine, which is determined when the virtual machine is created, It can be regarded as a static value, and generally does not change later.
  • the CPU size of the above source host is 10G
  • the size of the CPU allocated to VM 1 in advance is 6G.
  • the multiple types of resources of the source host are divided into overload resources and non-overload resources according to the usage rate of the multiple types of resources of the source host, and the first migration weight of the overload resource and the The second migration weight of the overloaded resource.
  • the dividing the plurality of types of resources of the source host into overload resources and un-overloaded resources according to the usage rate of the multiple types of resources of the source host includes:
  • the usage rate of the first type of resource is not greater than a preset threshold, the first type of resource is determined as an unoverloaded resource.
  • the usage rates of the three types of resources of the source host are 0.9, 0.4, and 0.3, respectively, according to the method in the foregoing example, and the foregoing three types are preset.
  • the thresholds of type resources are 0.85, 0.8, and 0.7, respectively, because 0.9>0.85, so the CPU of the source host is overloaded, and since 0.4 ⁇ 0.8, 0.3 ⁇ 0.7, the memory and network of the source host.
  • the bandwidth is not overloaded, that is, the number of overload resource types of the source host is 1, and the number of un-overloaded resource types of the source host is 2.
  • the three different threshold values are set in advance for three different types of resources, and those skilled in the art may also set one or two thresholds in advance.
  • the invention is not limited thereto.
  • the degree of resource strain may be different.
  • this factor should be taken into account, that is, the method of assigning migration weight to each resource according to the host resource demand degree. For overloaded hosts, it is often desirable to migrate several virtual machines on them to quickly reduce their load.
  • the source host CPU when the source host CPU is overloaded, then it is desirable to migrate the virtual machine with the highest CPU to release the load of the host as soon as possible; for the unoverloaded resources, there is no need to reduce the usage of the resources on the host.
  • the virtual machine with the lowest usage rate of resources corresponding to the un-overloaded resource is selected. Considering these two situations together, the migration weights of the overloaded resources and the unoverloaded resources are determined according to different algorithms.
  • the present invention does not limit the foregoing preset first algorithm and the preset second algorithm, but requires the first migration weight and the un-overloaded resource of the loaded resource determined according to the preset first algorithm and the preset second algorithm.
  • the second migration weight has the following four characteristics:
  • the first migration weight of the overloaded resource is always greater than 1, and the second migration weight of the unloaded resource is always less than 1, that is, the first migration weight of the overloaded resource is always greater than the second migration weight of the unoverloaded resource.
  • the first migration weight of the overloaded resource has a nonlinear relationship with respect to the usage rate of the overloaded resource
  • the second migration weight of the unoverloaded resource has a linear relationship with respect to the usage rate of the unoverloaded resource.
  • the usage rate of multiple types of resources of the host dynamically changes with time, and the migration weight of the resources determined according to the above algorithm also dynamically changes.
  • To resources present invention provides a method of weight determination schematic FIG. 3, FIG. 3, 301, 302 and 303 respectively at time t 1, PM's CPU, MEM and BW usage, 307, 308 and 309 respectively at time t, the right to migrate CPU, MEM and BW weight.
  • CPU utilization rate greater than a predetermined threshold value i.e. CPU resources belonging to the overload
  • MEM and BW usage threshold value not greater than a predetermined set i.e. MEM and BW belongs to the un-overloaded resource.
  • the higher resource usage rate causes it to be assigned a higher migration weight, while for the un-overloaded resource, the higher resource usage rate.
  • the migration weight is lower.
  • the usage rate of BW is greater than the usage rate of MEM, and the migration weight of BW is smaller than the migration weight of MEM. Therefore, when the virtual machine to be migrated is selected, since the usage rate of the overloaded resource is high, it has a higher priority for resource migration to balance resource utilization. Moreover, since the migration weight of the allocated resource is always greater than the migration weight of the unoverloaded resource allocation, the overloaded resource always has a higher priority to be migrated out.
  • 304, 305, and 306 respectively indicate the usage rates of the CPU, MEM, and BW of the PM at times t 1 + ⁇ t
  • 310, 311, and 312 indicate the CPU, MEM at time t 1 + ⁇ t, respectively.
  • the migration weight of the BW that is, the migration weights of the CPU, MEM, and BW are different at different times.
  • the method for determining the migration weight of the present invention can dynamically update the migration weight of the resource of the host when the usage rate of the resource of the host changes with time, that is, the method for determining the migration weight of the present invention is a dynamic weight determination method. Therefore, the method for determining the migration weight of the present invention can reflect the load condition of the host in real time, thereby quickly reducing the host load and making full use of the resources of the host.
  • step S230 may further include:
  • the first migration value of each virtual machine is compared, and the virtual machine corresponding to the smallest first migration value is determined as the virtual machine to be migrated.
  • the multi-dimensional decision matrix may be first established according to the usage rate of multiple types of resources of each virtual machine.
  • the three types of resources for each of the five virtual machines are: CPU, memory, and network.
  • the bandwidth of the overloaded resource is the CPU
  • the unloaded resource is the memory and the network bandwidth.
  • the first migration weight of the overload resource CPU determined according to the method of step S220 is 5, and the second overloaded resource memory is the second.
  • the migration weight is 0.2
  • the second migration weight of the unoverloaded resource network bandwidth is 0.3. It is also assumed that the usage rates of the above three types of resources of each virtual machine are as shown in Table 1:
  • the usage rates of the three types of resources in the above table are all normative values, that is, the range is between 0-1. If the usage rate of the foregoing resource is not the normative value, the usage rate of the resource may be obtained. Normalize it.
  • a multi-dimensional decision matrix is established, and an ideal migration virtual machine is selected according to the established multi-dimensional decision matrix.
  • the determination process of the ideal virtual machine is as follows:
  • the overload resource of the source host includes only the CPU, and the CPU usage of the virtual machines VM 1 , VM 2 , VM 3 , VM 4 , and VM 5 are compared because 0.9 (corresponding to VM 5 )>0.8>0.3>0.2>0.1, so the CPU usage of VM 5 is the target usage rate of the CPU of the source host; and the un-overloaded resources of the source host include memory and network bandwidth, first VM 1 , VM 2 , VM 3 , The memory usage of VM 4 and VM 5 is compared, because 0.2 (corresponding to VM 1 ) ⁇ 0.3 ⁇ 0.5 ⁇ 0.6, so the memory usage of VM 1 is 0.2 as the target usage of the source host's memory; The network bandwidth usage ratios of VM 1 , VM 2 , VM 3 , VM 4 , and VM 5 are compared because 0.2 (corresponding to VM 4 ) ⁇ 0.3 ⁇ 0.6 ⁇ 0.7 ⁇ 0.9, so the network bandwidth usage of
  • the Euclidean distance between each virtual machine and the ideal virtual machine can be calculated, that is, the first migration value of each virtual machine is obtained.
  • the first migration value of each virtual machine is calculated according to formula 1:
  • D i is the first migration value of the i-th virtual machine
  • n is the number of overload resource types of the source host.
  • a t is the t-type overload resource of the source host.
  • P t is the target usage rate of the t-type overload resource of the source host
  • m is The number of un-overloaded resource types of the source host
  • B l is the second migration weight of the first type of un-overloaded resources of the source host, 0 ⁇ B l ⁇ 1
  • T il is the lth of the i-th virtual machine.
  • the virtual machine VM 5 can be determined as the virtual machine to be migrated.
  • the CPU usage of the VM 5 is 0.9. Therefore, after the virtual machine VM 5 is migrated to the target host, the problem of overloading the source host CPU can be quickly solved, and the number of migrations can be reduced.
  • the monitor of the source host is a VMM
  • the foregoing migration instruction may include source location information of the virtual machine to be migrated and target location information, where the target location information is determined by the resource manager according to the placement policy, and the determining method thereof is determined. It belongs to the prior art and will not be described here.
  • the first embodiment of the method provided by the present invention first, according to a preset threshold, multiple types of resources on the source host are divided into an overload resource and an un-overload resource, and different algorithms are used for the overload resource and the non-overload resource respectively. Determine the migration weights, and the migration weight of these resources will be taken into consideration for the subsequent selection of the virtual machine to be migrated.
  • the corresponding first migration weight is always greater than 1, and the higher the usage rate of the resource, the larger the corresponding first migration weight; for the non-overloaded resource, the corresponding second migration weight is always less than 1, and the resource is always The higher the usage rate, the smaller the corresponding second migration weight.
  • the ideal virtual machine is selected, and then the Euclidean distance between each virtual machine and the ideal virtual machine is calculated, and the first migration weight and the overload of the overload resource determined by the dynamic weight method are not overloaded.
  • the second migration weight of the resource is taken into account to determine the virtual machine to be migrated.
  • the overload resource when the virtual machine is migrated, the overload resource has a higher priority, so it always has a higher priority for resource balancing, and the un-allocated resource is due to its The resource usage rate does not exceed the preset threshold, so in order to make full use of resources, the migration weight is lower when migrating. Therefore, the virtual machine with a large usage rate of overload resources and a small usage rate of the non-overloaded resources will have a greater chance of being selected in the method of the first embodiment, thereby rapidly reducing the host load and reducing the virtual The number of machine migrations. Compared with the prior art, only the virtual machine with the largest virtual machine volume is selected for migration.
  • the decision matrix when the virtual machine is selected, the decision matrix is used to accurately allocate resources in multiple resource dimensions such as CPU, memory, and network bandwidth. Matching, can find the most suitable virtual machine for migration, so it makes full use of the resources of each dimension and improves the utilization rate of resources.
  • the first embodiment of the method provided by the present invention is an example in which the trigger condition is the first case, when the trigger condition is the second case, since the resource of the host is not overloaded, it is easy for a person skilled in the art. I think that the resources of the host are not divided, and the migration weight of each resource is determined directly according to the resource usage rate and the preset third algorithm.
  • the present invention also does not limit the preset third algorithm, but requires that the migration weight of each resource determined according to the preset third algorithm has the following five characteristics:
  • Each virtual machine determines the migration weight of each type of resource according to its own demand preference for various types of resources. Therefore, different virtual machines have different migration weights of various types of resources.
  • the usage rate of various types of resources changes dynamically with time.
  • the migration weight of the corresponding resources also dynamically changes.
  • the virtual machine pair can be quantitatively determined by determining the migration weight of the resource according to the performance preference of the virtual machine itself for various types of resources.
  • the demand situation of type resources provides effective help for later redistribution of data center resources and redeployment of the virtual machine.
  • the migration method of the virtual machine provided in the first embodiment of the method of the present invention is applicable to the case where the network bandwidth required for migrating the virtual machine is sufficiently large, and the memory of the virtual machine is not a main consideration; when the network bandwidth required for migrating the virtual machine is relatively tight In this case, the time required to migrate one virtual machine may be longer.
  • the long migration time means that the performance of the application running on the virtual machine may be affected. Therefore, the present invention also provides a virtual machine migration method.
  • the method of the example takes into account the performance of the application on the virtual machine and the utilization of resources.
  • FIG. 4 is a flowchart of a method for migrating a virtual machine according to Embodiment 2 of the present invention.
  • the method is applicable to the solution in the migration planning phase when the trigger condition in FIG. 1 is the first case and the migration performance is considered at the same time.
  • the problem of the virtual machine to be migrated During virtual machine migration, migration time and downtime can affect migration performance, and virtual machine memory size and network bandwidth are important factors affecting migration time and downtime. Therefore, on the same host, if the virtual machine migration bandwidth allocation is insufficient and all virtual machine dynamic migration uses the same network bandwidth, selecting a virtual machine that occupies less memory for migration can improve migration performance.
  • the method may specifically include:
  • the resource manager obtains usage rates of multiple types of resources of each virtual machine in the source host, where each virtual machine has the same type of resources.
  • the type resource is divided into an overload resource and an un-overload resource, and determines a first migration weight of the overload resource and a second migration weight of the un-overload resource.
  • S450 Determine a second mobility value of each virtual machine according to a first migration value of each virtual machine and a size of a memory allocated in advance for each virtual machine.
  • each virtual machine VM 1, VM 2, VM 3 , VM 4 and memory size VM 5 assigned respectively 1G, 2G, 3G, 2G, and 2G; preferably
  • the size of the memory of each virtual machine is normalized separately, and the relative values obtained after the normalization process are 0.1, 0.2, 0.3, 0.2, and 0.2.
  • the first migration values of VM 1 , VM 2 , VM 3 , VM 4 , and VM 5 obtained by the method according to the first embodiment of the present invention are: 4.01, 3.50, 3.00, 0.506, and 0.085, respectively;
  • the relative values obtained by normalizing the size of the memory allocated in advance for each of the virtual machines VM 1 , VM 2 , VM 3 , VM 4 , and VM 5 in the source host are: 0.1, 0.2, 0.3, 0.2, and 0.2, respectively.
  • the second migration value of VM 1 , VM 2 , VM 3 , VM 4 and VM 5 are: 4.01 ⁇ 0.1, 3.50 ⁇ 0.2, 3.00 ⁇ 0.3, 0.506 ⁇ 0.2, 0.085 ⁇ 0.2, ie VM 1
  • the second migration values of VM 2 , VM 3 , VM 4 , and VM 5 are: 0.401, 0.7, 0.9, 0.1012, and 0.017, respectively.
  • the pre-allocated memory is small, which means that it takes less time to migrate the virtual machine (because the memory of the virtual machine needs to be copied repeatedly during the migration process). Pages, small memory means a small amount of data to be copied, which reduces migration overhead and reduces the impact of migration operations on the performance of related applications hosted on virtual machines.
  • the virtual machine VM 5 has the smallest network bandwidth and is pre-allocated with smaller memory, and the network bandwidth and memory are affecting the migration performance. Factor, so virtual machine VM 5 as a virtual machine to be migrated, can improve the performance of virtual machine migration.
  • the migration cost of each virtual machine is taken into consideration, and the migration performance can be further improved on the basis of reducing the number of virtual machine migrations and increasing the resource utilization rate. (ie, reduce migration overhead), reducing the possibility of migration causing user service level agreement (SLA) violations.
  • SLA user service level agreement
  • FIG. 5 is a schematic diagram of a device for migrating a virtual machine according to an embodiment of the present invention.
  • the device may be used to perform the method described in FIG. 2 or FIG. 4.
  • the device includes: an obtaining unit 501, a dividing unit 502, The unit 503 and the transmitting unit 504 are selected.
  • the obtaining unit 501 is configured to obtain usage rates of multiple types of resources of each virtual machine in the source host, and determine usage rates of multiple types of resources of the source host according to usage rates of multiple types of resources of the virtual machines. .
  • each of the virtual machines has the same type of resources, and the obtaining unit 501 is specifically configured to:
  • the dividing unit 502 is configured to divide the multiple types of resources of the source host into overload resources and non-overload resources according to the usage rate of the multiple types of resources of the source host determined by the obtaining unit 501, and determine the overload resources.
  • the first migration weight and the second migration weight of the unoverloaded resource are configured to divide the multiple types of resources of the source host into overload resources and non-overload resources according to the usage rate of the multiple types of resources of the source host determined by the obtaining unit 501, and determine the overload resources. The first migration weight and the second migration weight of the unoverloaded resource.
  • the dividing unit 502 is specifically configured to: when the usage rate of the first type resource is greater than a preset threshold, the first type is used.
  • the resource is determined to be an overload resource;
  • the usage rate of the first type of resource is not greater than a preset threshold, the first type of resource is determined as an unoverloaded resource.
  • the dividing unit 502 is further configured to determine, according to the usage rate of the overload resource and a preset first algorithm, the first migration weight of the overload resource, where the overload resource is used;
  • the selecting unit 503 is configured to select, according to the usage rate of the multiple types of resources of the respective virtual machines, the first migration weight of the overloaded resource, and the second migration weight of the un-overloaded resource, from the virtual machine. Migrate virtual machines.
  • the selecting unit 503 is specifically configured to: acquire the virtual machines according to the usage rate of the multiple types of resources of the virtual machines, the first migration weight of the overloaded resources, and the second migration weight of the un-overloaded resources. First migration value;
  • the first migration value of each virtual machine is compared, and the virtual machine corresponding to the smallest first migration value is determined as the virtual machine to be migrated.
  • the sending unit 504 is configured to send a migration instruction to the monitor of the source host, so that the monitor migrates the to-be-migrated virtual machine selected by the selecting unit 503 to the target host according to the migration instruction.
  • the selecting unit 503 is further specifically configured to:
  • the second migration value of each virtual machine is compared, and the virtual machine corresponding to the smallest second migration value is determined as the virtual machine to be migrated.
  • the device further includes: a comparing unit 505, configured to compare, for each type of overload resource in the overload resource of the source host, a usage rate of the type of overload resource of each virtual machine The maximum utilization rate of the overload resource is used as the target usage rate of the overload resource of the type;
  • the selecting unit 503 is specifically configured to: calculate a first migration value of each virtual machine according to the following formula:
  • D i is the first migration value of the i-th virtual machine
  • n is the number of overload resource types of the source host
  • a t is the first migration weight of the t-type overload resource of the source host, A t >1, S it is the usage rate of the t-th type resource of the i-th virtual machine
  • P t is the target usage rate of the t-type overload resource of the source host
  • m is the source host
  • B l is the second migration weight of the first type of un-overloaded resources of the source host, 0 ⁇ B l ⁇ 1
  • T il is the use of the first type of resources of the i-th virtual machine.
  • Rate, Q l is the target usage rate of the first type of un-overloaded resources of the source host
  • n+m is the number of resource types of the source host.
  • the device provided in the embodiment of the present invention is embedded in the method provided by the method embodiment of the present invention. Therefore, the specific working process of the device provided by the present invention is not described herein.
  • the obtaining unit 501 acquires the usage rate of the multiple types of resources of each virtual machine in the source host, and determines the usage rate according to the usage rate of the multiple types of resources of the virtual machines.
  • the usage rate of the multiple types of resources of the source host the dividing unit 502 divides the multiple types of resources of the source host into overload resources and non-overload resources according to the usage rate of the multiple types of resources of the source host, and determines a first migration weight of the overload resource and a second migration weight of the overloaded resource; the selecting unit 503, according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overload resource, and the Second migration right of unoverloaded resources Selecting a virtual machine to be migrated from the virtual machine; the sending unit 504 sends a migration instruction to the monitor of the source host, so that the monitor migrates the virtual machine to be migrated to the migration instruction according to the migration instruction Target host. Therefore, the correctness of the selection of the virtual machine to be migrated can be improved, so that the problem of overloading the source host can be quickly solved, and the purpose of saving computer resources is achieved.
  • FIG. 6 is a schematic diagram of a migration device of a virtual machine according to an embodiment of a device according to the present invention.
  • the migration device 600 includes a processor 602, a memory 604, a communication interface 606, and a bus 608.
  • the processor 602, the memory 604, and the communication interface 606 implement a communication connection with each other through the bus 608.
  • the processor 602 can be a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits for executing related programs.
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • the memory 604 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM).
  • Memory 604 can store operating systems and other applications.
  • the program code for implementing any of the optional technical solutions provided by the foregoing method embodiments of the present invention is stored in the memory 604 and executed by the processor 602. .
  • Communication interface 606 is used to communicate with other switches or control servers in the SDN network.
  • Bus 608 can include a path for communicating information between various components of migration device 600, such as processor 602, memory 604, and communication interface 606.
  • the migration device of the virtual machine provided by the device embodiment of the present invention can improve the correctness of the selection of the virtual machine to be migrated, thereby quickly solving the problem of overloading the source host and achieving the purpose of saving computer resources.
  • the steps of a method or algorithm described in connection with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both.
  • the software module can be placed in random access memory (RAM), memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or technical field. Any other form of storage medium known.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A virtual machine migration method, apparatus and device, comprising: acquiring the usage rate of a plurality of types of resources of various virtual machines in a source host, and according to the usage rate of the plurality of types of resources of the virtual machines, determining the usage rate of the plurality of types of resources of the source host (S210);according to the usage rate of the plurality of types of resources of the source host, dividing the plurality of types of resources of the source host into an overloaded resource and a non-overloaded resource, and determining a first migration weight of the overloaded resource and a second migration weight of the non-overloaded resource (S220);according to the usage rate of the plurality of types of resources of the virtual machines, the first migration weight of the overloaded resource and the second migration weight of the non-overloaded resource, selecting a virtual machine to be migrated from the virtual machines (S230); and sending a migration instruction to a monitor of the source host, so that the monitor migrates the virtual machine to be migrated to a target host (S240).Therefore, the accuracy of selecting a virtual machine to be migrated can be improved, such that the problem of the overload of a source host can be solved quickly, thereby achieving the purpose of saving computer resources.

Description

虚拟机的迁移方法、装置及设备Virtual machine migration method, device and device 技术领域Technical field
本发明涉及数据处理技术领域,尤其涉及一种虚拟机的迁移方法、装置及设备。The present invention relates to the field of data processing technologies, and in particular, to a method, an apparatus, and a device for migrating a virtual machine.
背景技术Background technique
随着虚拟化技术的蓬勃发展,数据中心越来越多的采用虚拟机提供服务。为了使数据中心的负载平衡或者有效利用服务器资源常常需要迁移虚拟机。迁移虚拟机是指将虚拟机从一个主机或存储位置移至另一个主机或存储位置的过程。实时迁移是将已打开电源的虚拟机移至新的主机,通过实时迁移,可以在不中断虚拟机可用性的情况下将虚拟机移至新的主机。With the rapid development of virtualization technology, data centers are increasingly using virtual machines to provide services. In order to load balance the data center or effectively utilize server resources, it is often necessary to migrate virtual machines. Migrating a virtual machine is the process of moving a virtual machine from one host or storage location to another. Live migration is the move of a powered-on virtual machine to a new host. With live migration, you can move a virtual machine to a new host without disrupting virtual machine availability.
现有技术中,资源管理器检测每个主机的资源利用情况,如监控CPU、内存、网络带宽等资源的使用率,且给上述每种资源分配相同的权重或者预先定义固定的权重,当某个主机出现过载情况时,计算该主机上运行的每个虚拟机的体积(各种资源空闲率乘积之倒数),并对所有的体积作降序排列,最终选择体积最大的虚拟机进行迁移。如果此时上述主机依然过载,则会继续选择体积次大的虚拟机进行迁移直到上述主机不再过载。举例来说,在一个CPU过载的主机上,虚拟机VM1的U1(CPU使用率)、M1(内存使用率)、B1(带宽使用率)分别为0.8、0.2、0.5,根据上述虚拟机负载计算方法(3种资源空闲率乘积之倒数),可以计算出虚拟机VM1的体积L1为12.5;而虚拟机VM2的U2、M2、B2分别为0.2、0.8、0.5,且可以计算出虚拟机VM2的体积L2为12.5。因此,如果按照上述方法根据虚拟机的体积排序选择虚拟机的话,迁移的时候,VM1和VM2具有同等的选择机会,然而当选择VM2进行迁移时,由 于VM2的CPU使用率只有0.2,因此,并不能解决主机CPU过载的问题,因此还需要对VM1进行迁移;此外,由于VM2的内存使用率为0.8,这会严重影响虚拟机的迁移时间。In the prior art, the resource manager detects the resource utilization of each host, such as monitoring the usage rate of resources such as CPU, memory, and network bandwidth, and assigns the same weight to each of the above resources or pre-defined a fixed weight. When the host is overloaded, calculate the volume of each virtual machine running on the host (the reciprocal of the product of the various resource idle rate), and sort all the volumes in descending order, and finally select the virtual machine with the largest volume to migrate. If the above host is still overloaded at this time, the next-largest virtual machine will continue to be selected for migration until the host is no longer overloaded. For example, on a CPU overloaded host, U 1 (CPU usage rate), M 1 (memory usage rate), and B 1 (bandwidth usage rate) of virtual machine VM 1 are 0.8, 0.2, and 0.5, respectively, according to the above. VM load calculation method (three kinds of resource is free reciprocal of a sum of products), a virtual machine (VM) can be calculated the volume of 1 L 1 is 12.5; the virtual machine VM U 2, M 2 2 a, B 2 respectively, 0.2,0.8, 0.5, and the virtual machine (VM) can be calculated volume of 2 L 2 of 12.5. Therefore, if the virtual machine is selected according to the volume order of the virtual machine as described above, VM 1 and VM 2 have the same chance of selection when migrating, but when VM 2 is selected for migration, the CPU usage of VM 2 is only 0.2. Therefore, it does not solve the problem of host CPU overload, so VM 1 needs to be migrated. In addition, since VM 2 has a memory usage of 0.8, this will seriously affect the migration time of the VM.
由上述可知,现有技术中为虚拟机的不同类型资源分配相同的权重或者预先定义固定的权重,这影响了迁移虚拟机选择的正确性,从而增加了虚拟机迁移的次数和虚拟机迁移的开销。It can be seen from the above that in the prior art, different types of resources of a virtual machine are assigned the same weight or a fixed weight is predefined, which affects the correctness of the migration virtual machine selection, thereby increasing the number of virtual machine migrations and virtual machine migration. Overhead.
发明内容Summary of the invention
本发明实施例提供了一种虚拟机的迁移方法、装置及设备,以解决现有技术中为虚拟机的不同类型资源分配相同的权重或者预先定义固定的权重,从而影响待迁移虚拟机选择的正确性,进而导致的迁移次数增加,迁移开销大的问题。The embodiments of the present invention provide a method, an apparatus, and a device for migrating a virtual machine, so as to solve the problem of assigning the same weight to the different types of resources of the virtual machine or pre-defining the fixed weights in the prior art, thereby affecting the selection of the virtual machine to be migrated. Correctness, resulting in an increase in the number of migrations and a large migration overhead.
第一方面,提供了一种虚拟机的迁移方法,该方法包括:In a first aspect, a method for migrating a virtual machine is provided, the method comprising:
资源管理器获取源主机中各个虚拟机的多种类型资源的使用率,根据所述各个虚拟机的多种类型资源的使用率,确定所述源主机的多种类型资源的使用率;The resource manager obtains usage rates of multiple types of resources of each virtual machine in the source host, and determines usage rates of multiple types of resources of the source host according to usage rates of multiple types of resources of the virtual machines;
根据所述源主机的多种类型资源的使用率,将所述源主机的多种类型资源划分为过载资源和未过载资源,并确定所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重;Dividing, according to the usage rate of the multiple types of resources of the source host, the multiple types of resources of the source host into an overload resource and an un-overload resource, and determining a first migration weight of the overload resource and the un-overloaded resource. Second migration weight;
根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,从所述虚拟机中选取待迁移虚拟机;Selecting a virtual machine to be migrated from the virtual machine according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overloaded resource, and the second migration weight of the unoverloaded resource;
向所述源主机的监视器发送迁移指令,以使所述监视器根据所述迁移指令,将所述待迁移虚拟机迁移至目标主机。Sending a migration instruction to the monitor of the source host, so that the monitor migrates the virtual machine to be migrated to the target host according to the migration instruction.
结合第一方面,在第一方面的第一种实现方式中,所述各个虚拟机具有相同类型的资源,所述根据所述各个虚拟机的多种类型资源的使用率,确定 所述源主机的多种类型资源的使用率包括:With reference to the first aspect, in a first implementation manner of the first aspect, each of the virtual machines has the same type of resources, and the determining, according to the usage rates of the multiple types of resources of the virtual machines, determining The usage rates of the multiple types of resources of the source host include:
依次根据所述各个虚拟机的相同类型资源的使用率以及预先为所述各个虚拟机分配的所述类型资源的大小,确定所述源主机的所述类型资源的使用率;直至确定所述源主机的每种类型资源的使用率。Determining the usage rate of the type resource of the source host according to the usage rate of the same type of resources of the respective virtual machines and the size of the type resources allocated to the respective virtual machines in advance; until the source is determined The usage rate of each type of resource for the host.
结合第一方面或第一方面的第一种实现方式,在第一方面的第二种实现方式中,所述根据所述源主机的多种类型资源的使用率,将所述源主机的多种类型资源划分为过载资源和未过载资源包括:With reference to the first aspect, or the first implementation manner of the first aspect, in a second implementation manner of the first aspect, the source host is configured according to a usage rate of multiple types of resources of the source host The types of resources are classified into overloaded resources and unoverloaded resources including:
对所述源主机的多种类型资源中第一类型资源,当所述第一类型资源的使用率大于预先设定的门限值时,则将所述第一类型资源确定为过载资源;And determining, by the first type of resources, the first type of resources, when the usage rate of the first type of resources is greater than a preset threshold, determining the first type of resources as an overload resource;
当所述第一类型资源的使用率不大于预先设定的门限值时,则将所述第一类型资源确定为未过载资源。When the usage rate of the first type of resource is not greater than a preset threshold, the first type of resource is determined as an unoverloaded resource.
结合第一方面或第一方面的第一种实现方式或第一方面的第二种实现方式,在第一方面的第三种实现方式中,所述确定所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重包括:With reference to the first aspect, or the first implementation manner of the first aspect, or the second implementation manner of the first aspect, in a third implementation manner of the first aspect, the determining, The second migration weight of the un-allocated resource includes:
对所述过载资源,根据所述过载资源的使用率和预设的第一算法,确定所述过载资源的第一迁移权重;Determining, by the overload resource, a first migration weight of the overload resource according to the usage rate of the overload resource and a preset first algorithm;
对所述未过载资源,根据所述未过载资源的使用率和预设的第二算法,确定所述未过载资源的第二迁移权重。And determining, by the un-overloaded resource, a second migration weight of the un-overloaded resource according to the usage rate of the un-overloaded resource and a preset second algorithm.
结合第一方面或第一方面的上述三种实现方式中任一种实现方式,在第一方面的第四种实现方式中,所述根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,从所述虚拟机中选取待迁移虚拟机包括:With reference to the first aspect, or any one of the foregoing three implementation manners of the first aspect, in a fourth implementation manner of the first aspect, the usage rate of the multiple types of resources according to the each virtual machine, The first migration weight of the overload resource and the second migration weight of the un-overloaded resource, the virtual machine to be migrated from the virtual machine includes:
根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,获取所述各个虚拟机的第一迁移代价值;Acquiring, according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overloaded resource, and the second migration weight of the un-overloaded resource, acquiring a first migration value of each virtual machine;
将所述各个虚拟机的第一迁移代价值进行比对,将最小的第一迁移代价值 对应的虚拟机确定为待迁移虚拟机。Comparing the first migration value of each virtual machine, and the smallest first migration value The corresponding virtual machine is determined to be the virtual machine to be migrated.
结合第一方面或第一方面的前三种实现方式中任一种实现方式,在第一方面的第五种实现方式中,所述根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,从所述虚拟机中选取待迁移虚拟机包括:With reference to the first aspect, or any one of the first three implementation manners of the first aspect, in a fifth implementation manner of the first aspect, the usage rate of the multiple types of resources according to the The first migration weight of the overload resource and the second migration weight of the un-overloaded resource, the virtual machine to be migrated from the virtual machine includes:
根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,获取所述各个虚拟机的第一迁移代价值;Acquiring, according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overloaded resource, and the second migration weight of the un-overloaded resource, acquiring a first migration value of each virtual machine;
根据所述各个虚拟机的第一迁移代价值和预先为所述各个虚拟机分配的内存的大小,确定所述各个虚拟机的第二迁移代价值;Determining, according to a first migration value of each of the virtual machines and a size of memory allocated to the respective virtual machines in advance, a second migration value of each of the virtual machines;
将所述各个虚拟机的第二迁移代价值进行比对,将最小的第二迁移代价值对应的虚拟机确定为待迁移虚拟机。The second migration value of each virtual machine is compared, and the virtual machine corresponding to the smallest second migration value is determined as the virtual machine to be migrated.
结合第一方面的第四种实现方式或者第一方面的第五种实现方式,在第一方面的第六种实现方式中,在所述获取所述各个虚拟机的第一迁移代价值之前,所述方法还包括:With reference to the fourth implementation manner of the first aspect, or the fifth implementation manner of the first aspect, in the sixth implementation manner of the first aspect, before the acquiring the first migration generation value of the each virtual machine, The method further includes:
对所述源主机的过载资源中每种类型过载资源,将所述各个虚拟机的所述类型过载资源的使用率进行比对,将最大的过载资源的使用率作为所述类型过载资源的目标使用率;Comparing the usage rate of the type of overload resources of each virtual machine to each type of overload resource in the overload resource of the source host, and using the maximum overload resource usage rate as the target of the type overload resource Usage rate
对所述源主机的未过载资源中每种未过载资源,将所述各个虚拟机的所述类型未过载资源的使用率进行比对,将最小的过载资源的使用率作为所述类型未过载资源的目标使用率。Comparing the usage rates of the types of non-overloaded resources of the virtual machines to each of the un-overloaded resources of the source host, and using the minimum overload resource usage rate as the type is not overloaded. The target usage rate of the resource.
结合第一方面的第六种实现方式,在第一方面的第七种实现方式中,所述根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,获取所述各个虚拟机的第一迁移代价值包括:With reference to the sixth implementation manner of the first aspect, in a seventh implementation manner of the first aspect, the usage rate of the multiple types of resources of the each virtual machine, the first migration weight of the overload resource, and The second migration weight of the un-overloaded resource, and obtaining the first migration value of each virtual machine includes:
根据如下公式计算所述各个虚拟机的第一迁移代价值: Calculating the first migration value of each virtual machine according to the following formula:
Figure PCTCN2015073422-appb-000001
Figure PCTCN2015073422-appb-000001
其中,Di为第i个虚拟机的第一迁移代价值,n为所述源主机的过载资源类型的数目,At为所述源主机的第t种类型过载资源的第一迁移权重,At>1,Sit为第i个虚拟机的第t种类型资源的使用率,Pt为所述源主机的第t种类型过载资源的目标使用率,m为所述源主机的未过载资源类型的数目,Bl为所述源主机的第l种类型未过载资源的第二迁移权重,0<Bl<1,Til为第i个虚拟机的第l种类型资源的使用率,Ql为所述源主机的第l种类型未过载资源的目标使用率,n+m为所述源主机的资源类型的数目。Wherein, D i is the first migration value of the i-th virtual machine, n is the number of overload resource types of the source host, and A t is the first migration weight of the t-type overload resource of the source host, A t >1, S it is the usage rate of the t-th type resource of the i-th virtual machine, P t is the target usage rate of the t-type overload resource of the source host, and m is the source host The number of overload resource types, B l is the second migration weight of the first type of un-overloaded resources of the source host, 0<B l <1, and T il is the use of the first type of resources of the i-th virtual machine. Rate, Q l is the target usage rate of the first type of un-overloaded resources of the source host, and n+m is the number of resource types of the source host.
第二方面,提供了一种虚拟机的迁移装置,该装置包括:获取单元、划分单元、选取单元和发送单元;A second aspect provides a virtual machine migration apparatus, where the apparatus includes: an obtaining unit, a dividing unit, a selecting unit, and a sending unit;
所述获取单元,用于获取源主机中各个虚拟机的多种类型资源的使用率,根据所述各个虚拟机的多种类型资源的使用率,确定所述源主机的多种类型资源的使用率;The obtaining unit is configured to obtain usage rates of multiple types of resources of each virtual machine in the source host, and determine usage of multiple types of resources of the source host according to usage rates of multiple types of resources of the virtual machines. rate;
所述划分单元,用于根据所述获取单元确定的所述源主机的多种类型资源的使用率,将所述源主机的多种类型资源划分为过载资源和未过载资源,并确定所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重;And the dividing unit is configured to divide, according to the usage rate of the multiple types of resources of the source host determined by the acquiring unit, the multiple types of resources of the source host into an overload resource and an un-overload resource, and determine the a first migration weight of the overloaded resource and a second migration weight of the unoverloaded resource;
所述选取单元,用于根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,从所述虚拟机中选取待迁移虚拟机;The selecting unit is configured to select, according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overload resource, and the second migration weight of the un-overloaded resource, from the virtual machine The virtual machine to be migrated;
所述发送单元,用于向所述源主机的监视器发送迁移指令,以使所述监视器根据所述迁移指令,将所述选取单元选取的所述待迁移虚拟机迁移至目标主机。The sending unit is configured to send a migration instruction to the monitor of the source host, so that the monitor migrates the to-be-migrated virtual machine selected by the selecting unit to the target host according to the migration instruction.
结合第二方面,第二方面的第一种实现方式中,所述各个虚拟机具有相同类型的资源,所述获取单元具体用于:With reference to the second aspect, in a first implementation manner of the second aspect, each of the virtual machines has the same type of resources, and the acquiring unit is specifically configured to:
依次根据所述各个虚拟机的相同类型资源的使用率以及预先为所述各个 虚拟机分配的所述类型资源的大小,确定所述源主机的所述类型资源的使用率;直至确定所述源主机的每种类型资源的使用率。According to the usage rate of the same type of resources of the respective virtual machines, and in advance The size of the type resource allocated by the virtual machine determines the usage rate of the type resource of the source host; until the usage rate of each type resource of the source host is determined.
结合第二方面或第二方面的第一种实现方式,在第二方面的第二种实现方式中,所述划分单元具体用于:With reference to the second aspect or the first implementation manner of the second aspect, in the second implementation manner of the second aspect, the dividing unit is specifically configured to:
对所述源主机的多种类型资源中第一类型资源,当所述第一类型资源的使用率大于预先设定的门限值时,则将所述第一类型资源确定为过载资源;And determining, by the first type of resources, the first type of resources, when the usage rate of the first type of resources is greater than a preset threshold, determining the first type of resources as an overload resource;
当所述第一类型资源的使用率不大于预先设定的门限值时,则将所述第一类型资源确定为未过载资源。When the usage rate of the first type of resource is not greater than a preset threshold, the first type of resource is determined as an unoverloaded resource.
结合第二方面或第二方面的第一种实现方式或第二方面的第二种实现方式,在第二方面的第三种实现方式中,所述划分单元具体用于:With reference to the second aspect, or the first implementation manner of the second aspect, or the second implementation manner of the second aspect, in the third implementation manner of the second aspect, the dividing unit is specifically configured to:
对所述过载资源,根据所述过载资源的使用率和预设的第一算法,确定所述过载资源的第一迁移权重;Determining, by the overload resource, a first migration weight of the overload resource according to the usage rate of the overload resource and a preset first algorithm;
对所述未过载资源,根据所述未过载资源的使用率和预设的第二算法,确定所述未过载资源的第二迁移权重。And determining, by the un-overloaded resource, a second migration weight of the un-overloaded resource according to the usage rate of the un-overloaded resource and a preset second algorithm.
结合第二方面或第二方面的上述三种实现方式中任一种实现方式,在第二方面的第四种实现方式中,所述选取单元具体用于:With reference to the second aspect, or any one of the foregoing three implementation manners of the second aspect, in the fourth implementation manner of the second aspect, the selecting unit is specifically configured to:
根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,获取所述各个虚拟机的第一迁移代价值;Acquiring, according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overloaded resource, and the second migration weight of the un-overloaded resource, acquiring a first migration value of each virtual machine;
将所述各个虚拟机的第一迁移代价值进行比对,将最小的第一迁移代价值对应的虚拟机确定为待迁移虚拟机。The first migration value of each virtual machine is compared, and the virtual machine corresponding to the smallest first migration value is determined as the virtual machine to be migrated.
结合第二方面或第二方面的前三种实现方式中任一种实现方式,在第二方面的第五种实现方式中,所述选取单元具体用于:With reference to the second aspect, or any one of the first three implementation manners of the second aspect, in the fifth implementation manner of the second aspect, the selecting unit is specifically configured to:
根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,获取所述各个虚拟机的第一迁移代价值; Acquiring, according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overloaded resource, and the second migration weight of the un-overloaded resource, acquiring a first migration value of each virtual machine;
根据所述各个虚拟机的第一迁移代价值和预先为所述各个虚拟机分配的内存的大小,确定所述各个虚拟机的第二迁移代价值;Determining, according to a first migration value of each of the virtual machines and a size of memory allocated to the respective virtual machines in advance, a second migration value of each of the virtual machines;
将所述各个虚拟机的第二迁移代价值进行比对,将最小的第二迁移代价值对应的虚拟机确定为待迁移虚拟机。The second migration value of each virtual machine is compared, and the virtual machine corresponding to the smallest second migration value is determined as the virtual machine to be migrated.
结合第二方面的第四种实现方式或者第二方面的第五种实现方式,在第二方面的第六种实现方式中,所述装置还包括:比对单元,用于对所述源主机的过载资源中每种类型过载资源,将所述各个虚拟机的所述类型过载资源的使用率进行比对,将最大的过载资源的使用率作为所述类型过载资源的目标使用率;With reference to the fourth implementation manner of the second aspect, or the fifth implementation manner of the second aspect, in a sixth implementation manner of the second aspect, the device further includes: a comparison unit, configured to use the source host Each type of overload resource in the overload resource compares the usage rate of the type of overload resource of each virtual machine, and uses the maximum overload resource usage rate as the target usage rate of the type of overload resource;
对所述源主机的未过载资源中每种未过载资源,将所述各个虚拟机的所述类型未过载资源的使用率进行比对,将最小的过载资源的使用率作为所述类型未过载资源的目标使用率。Comparing the usage rates of the types of non-overloaded resources of the virtual machines to each of the un-overloaded resources of the source host, and using the minimum overload resource usage rate as the type is not overloaded. The target usage rate of the resource.
结合第二方面的第六种实现方式,在第二方面的第七种实现方式中,所述选取单元具体用于:With reference to the sixth implementation manner of the second aspect, in the seventh implementation manner of the second aspect, the selecting unit is specifically configured to:
根据如下公式计算所述各个虚拟机的第一迁移代价值:Calculating the first migration value of each virtual machine according to the following formula:
Figure PCTCN2015073422-appb-000002
Figure PCTCN2015073422-appb-000002
其中,Di为第i个虚拟机的第一迁移代价值,n为所述源主机的过载资源类型的数目,At为所述源主机的第t种类型过载资源的第一迁移权重,At>1,Sit为第i个虚拟机的第t种类型资源的使用率,Pt为所述源主机的第t种类型过载资源的目标使用率,m为所述源主机的未过载资源类型的数目,Bl为所述源主机的第l种类型未过载资源的第二迁移权重,0<Bl<1,Til为第i个虚拟机的第l种类型资源的使用率,Ql为所述源主机的第l种类型未过载资源的目标使用率,n+m为所述源主机的资源类型的数目。Wherein, D i is the first migration value of the i-th virtual machine, n is the number of overload resource types of the source host, and A t is the first migration weight of the t-type overload resource of the source host, A t >1, S it is the usage rate of the t-th type resource of the i-th virtual machine, P t is the target usage rate of the t-type overload resource of the source host, and m is the source host The number of overload resource types, B l is the second migration weight of the first type of un-overloaded resources of the source host, 0<B l <1, and T il is the use of the first type of resources of the i-th virtual machine. Rate, Q l is the target usage rate of the first type of un-overloaded resources of the source host, and n+m is the number of resource types of the source host.
第三方面,提供了一种虚拟机的迁移设备,该迁移设备包括:In a third aspect, a migration device for a virtual machine is provided, where the migration device includes:
处理器,存储器,通信接口和总线,其中,所述处理器、所述存储器和 所述通信接口通过所述总线通信;a processor, a memory, a communication interface, and a bus, wherein the processor, the memory, and The communication interface communicates via the bus;
所述通信接口用于与交换机或控制服务器通信;The communication interface is configured to communicate with a switch or a control server;
所述存储器用于存放程序;The memory is used to store a program;
当所述迁移设备运行时,所述处理器用于执行所述存储器存储的所述程序,以执行上述第一方面所述的虚拟机的迁移方法。When the migration device is running, the processor is configured to execute the program stored by the memory to perform the migration method of the virtual machine described in the first aspect above.
本发明实施例提供的虚拟机的迁移方法、装置及设备,获取源主机中各个虚拟机的多种类型资源的使用率,根据虚拟机的多种类型资源的使用率,确定源主机的多种类型资源的使用率;根据源主机的多种类型资源的使用率,将源主机的多种类型资源划分为过载资源和未过载资源,并确定过载资源的第一迁移权重以及未过载资源的第二迁移权重;根据虚拟机的多种类型资源的使用率、过载资源的第一迁移权重以及未过载资源的第二迁移权重,从虚拟机中选取待迁移虚拟机;向源主机的监视器发送迁移指令,以使监视器将待迁移虚拟机迁移至目标主机。由此,可以提高待迁移虚拟机选择的正确性,从而可以快速解决源主机过载的问题,达到了节约计算机资源的目的。The method, device, and device for migrating a virtual machine provided by the embodiment of the present invention acquires usage rates of multiple types of resources of each virtual machine in the source host, and determines various types of source hosts according to usage rates of multiple types of resources of the virtual machine. Usage of type resources; according to the usage rate of multiple types of resources of the source host, the multiple types of resources of the source host are divided into overloaded resources and un-overloaded resources, and the first migration weight of the overloaded resources and the un-overloaded resources are determined. The migration weight is selected according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overloaded resource, and the second migration weight of the unoverloaded resource, and the virtual machine to be migrated is selected from the virtual machine; Migrate instructions so that the monitor migrates the virtual machine to be migrated to the target host. Therefore, the correctness of the selection of the virtual machine to be migrated can be improved, so that the problem of overloading the source host can be quickly solved, and the purpose of saving computer resources is achieved.
附图说明DRAWINGS
图1为本发明提供的虚拟机的迁移方法的应用场景图;1 is an application scenario diagram of a method for migrating a virtual machine according to the present invention;
图2为本发明方法实施例一提供的虚拟机的迁移方法流程图;2 is a flowchart of a method for migrating a virtual machine according to Embodiment 1 of the present invention;
图3为本发明提供的资源的权重确定方法示意图;3 is a schematic diagram of a method for determining a weight of a resource provided by the present invention;
图4为本发明方法实施例二提供的虚拟机的迁移方法流程图;4 is a flowchart of a method for migrating a virtual machine according to Embodiment 2 of the present invention;
图5为本发明装置实施例提供的虚拟机的迁移装置示意图;FIG. 5 is a schematic diagram of a virtual machine migration apparatus according to an embodiment of the present invention;
图6为本发明设备实施例提供的虚拟机的迁移设备示意图。FIG. 6 is a schematic diagram of a migration device of a virtual machine according to an embodiment of a device according to the present invention.
具体实施方式detailed description
下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。The technical solution of the present invention will be further described in detail below through the accompanying drawings and embodiments.
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发 明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the following will be combined with the present invention. The technical solutions in the embodiments of the present invention are clearly and completely described in the drawings, and the embodiments are described as a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
为便于对本发明实施例的理解,下面将结合附图以具体实施例做进一步的解释说明,实施例并不构成对本发明实施例的限定。In order to facilitate the understanding of the embodiments of the present invention, the embodiments of the present invention are not to be construed as limiting.
图1为本发明提供的虚拟机的迁移方法的应用场景图,图1中,VM1、VM2…VMm分别表示虚拟机,虚拟机是指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统。用户可以在一台主机上模拟出另一台或多台虚拟的计算机,这些虚拟机完全就像真正的计算机那样进行工作。对于用户而言,它只是运行在物理机上的一个应用程序,但是对于在虚拟机中运行的应用程序而言,它就是一台真正的计算机。虚拟机的资源涉及多个方面:中央处理器(Central Processing Unit,CPU)、内存(Memory MEM)、网络带宽(Bandwidth,BW)以及磁盘等。在规划虚拟机时应该考虑这些资源之间的关系,否则,分配的资源不合理将导致虚拟机内的应用程序性能表现不佳。物理机(Physical Machine,PM)1、PM2…PMn分别表示n个主机,其中,每个主机上都有一个虚拟机监视器(Virtual Machine Monitor,VMM),VMM也称管理程序,是一种运行在基础物理机和操作系统之间的中间软件层,可允许多个操作系统和应用共享硬件,其可以访问物理机上包括磁盘和内存在内的所有物理设备。VMM不但协调着这些硬件资源的访问,也同时在各个虚拟机之间施加防护。当物理机启动并执行VMM时,它会加载所有虚拟机客户端的操作系统同时会分配给每一台虚拟机适量的内存,CPU,网络和磁盘。VMM是所有虚拟化技术的核心,非中断地支持多工作负载迁移的能力是VMM的基本功能。1 is an application scenario diagram of a migration method of a virtual machine provided by the present invention. In FIG. 1, VM 1 , VM 2 ... VM m respectively represent a virtual machine, and the virtual machine refers to a running with software function and having a complete hardware system function. A complete computer system in a completely isolated environment. Users can simulate another or multiple virtual machines on a single host, and these virtual machines work exactly like real computers. For the user, it's just an application running on a physical machine, but for an application running in a virtual machine, it's a real computer. Virtual machine resources involve multiple aspects: Central Processing Unit (CPU), Memory (MEM), Network Bandwidth (BW), and disk. The relationship between these resources should be considered when planning a virtual machine. Otherwise, the unreasonable allocation of resources will result in poor application performance in the virtual machine. Physical Machine (PM) 1 , PM 2 ... PM n respectively represent n hosts, wherein each host has a virtual machine monitor (VMM), which is also called a hypervisor. An intermediate software layer running between the underlying physical machine and the operating system that allows multiple operating systems and applications to share hardware that can access all physical devices on the physical machine, including disks and memory. VMM not only coordinates access to these hardware resources, but also protects between virtual machines. When a physical machine boots and executes VMM, it loads the operating system of all virtual machine clients and allocates the appropriate amount of memory, CPU, network, and disk to each virtual machine. VMM is at the heart of all virtualization technologies, and the ability to support multi-workload migration non-disruptively is a fundamental feature of VMM.
图1中,在多个主机连接到相同的共享存储时,可以支持实时迁移虚拟机,即将虚拟机从一台主机迁移至另一台主机,在迁移过程中,不会影响到 迁移虚拟机的正常通信以及其上的应用。In Figure 1, when multiple hosts are connected to the same shared storage, real-time migration of virtual machines can be supported, that is, the migration of virtual machines from one host to another does not affect the migration process. Migrate the normal communication of the virtual machine and the applications on it.
虚拟机的迁移是数据中心和集群管理员极其强大的工具,能够改善系统的性能,提高资源配置的灵活性,被应用于很多重要方面:Virtual machine migration is an extremely powerful tool for data center and cluster administrators to improve system performance and increase resource allocation flexibility, and is used in many important areas:
1)负载均衡:定期收集资源的使用率,把虚拟机重新分配到数据中心或集群中的物理机上,把超负载物理机上的一些虚拟机迁移到轻负载物理机上,均匀地分配工作负载,避免由于频繁地部署和终止虚拟机引起负载不平衡。1) Load balancing: periodically collect the resource usage rate, redistribute the virtual machine to the physical machine in the data center or cluster, and migrate some virtual machines on the overloaded physical machine to the light load physical machine to evenly distribute the workload to avoid Load imbalances are caused by frequent deployment and termination of virtual machines.
2)在线维护:有时需要对物理机机进行维护或者升级,利用迁移可在进行维护时把虚拟机迁移到其他物理机上,而不必关闭虚拟机,提高系统的可维护性。2) Online maintenance: Sometimes the physical machine needs to be maintained or upgraded. The migration can be used to migrate the virtual machine to other physical machines during maintenance without shutting down the virtual machine and improving the maintainability of the system.
3)主动容错:监测节点的健康状态,如温度或者磁盘错误日志等。如果某个物理机可能将要出现故障,其上的虚拟机主动迁移到更安全的位置,这样能减少用户察觉到故障的概率,提高系统的可靠性。3) Active Fault Tolerance: Monitor the health status of the node, such as temperature or disk error log. If a physical machine is about to fail, the virtual machine on it actively migrates to a more secure location, which reduces the probability of the user perceiving the failure and improves the reliability of the system.
4)资源优化和电源管理:调节数据中心或集群的资源分配,优化资源的使用,可将虚拟机从轻负载的主机整合到重负载的主机上。一旦迁移完成,之前运行这些被迁移的虚拟机的主机就可以关闭,有助于降低成本,节省能源消耗。4) Resource optimization and power management: adjust the resource allocation of the data center or cluster, optimize the use of resources, and integrate virtual machines from lightly loaded hosts to heavily loaded hosts. Once the migration is complete, the hosts that previously ran the migrated virtual machines can be shut down, helping to reduce costs and save energy.
总之,虚拟机的迁移提高了数据中心和集群的管理及提供服务的能力,实现了资源的灵活分配,提高了系统的可靠性,可以获得更强大的计算能力、更大的内存、快速的通信能力,节省能源。In short, the migration of virtual machines improves the ability to manage and provide services in data centers and clusters, realizes flexible allocation of resources, improves system reliability, and enables more powerful computing power, larger memory, and faster communication. Ability to save energy.
图1中的资源管理算法一般包括3个阶段:预分配阶段、迁移规划阶段以及迁移执行阶段。每个阶段的具体职能描述如下:The resource management algorithm in Figure 1 generally includes three phases: a pre-allocation phase, a migration planning phase, and a migration execution phase. The specific functions of each phase are described as follows:
1)预分配阶段:资源管理器通过VMM在特定的测量间隔内从正在运行的主机上收集资源使用数据。采样数据的详细情况很大程度上取决于所使用的虚拟化技术以及所需要采集的数据类型。通过这些数据,资源管理器能够对正在运行的主机的性能水平有一个大致的了解。对于之前就设定好的触发条件,如果此时监控信息显示有冲突发生,就触发资源的重新分配。 1) Pre-allocation phase: The resource manager collects resource usage data from the running host through the VMM within a specific measurement interval. The details of the sampled data are highly dependent on the virtualization technology used and the type of data that needs to be collected. With this data, the resource manager has a general understanding of the performance level of the running host. For the previously set trigger condition, if the monitoring information shows that a conflict occurs at this time, the resource reallocation is triggered.
需要说明的是,上述触发条件可以包括两种情况:第一种情况是,主机中的虚拟机因为竞争资源而造成的负载过高的情况;第二种情况是,需要对主机在线维护或者电源管理。在第二种情况下,主机的资源通常没有发生过载,且主机上的所有虚拟机需要全部迁移出去。It should be noted that the foregoing triggering conditions may include two situations: the first case is that the virtual machine in the host is overloaded due to the competition for resources; the second case is that the host needs to be online maintained or powered. management. In the second case, the host's resources are usually not overloaded, and all virtual machines on the host need to be migrated out.
2)迁移规划阶段:该阶段是整个处理流程当中最为关键的部分,资源管理器的职责是对于新的虚拟机部署产生合适的迁移方案或指令以消除或者最小化违法触发条件的行为。迁移方案通常包括源主机,待迁移虚拟机以及目标主机三个重要组成部分。2) Migration planning phase: This phase is the most critical part of the entire process. The resource manager's responsibility is to generate appropriate migration scenarios or instructions for new virtual machine deployments to eliminate or minimize the behavior of illegal trigger conditions. The migration plan usually includes three important components: the source host, the virtual machine to be migrated, and the target host.
3)迁移执行阶段:根据资源管理器产生的迁移方案和指令,VMM实现具体的迁移工作,该阶段的具体细节步骤主要取决于采用的虚拟化技术。3) Migration execution phase: According to the migration plan and instructions generated by the resource manager, the VMM implements the specific migration work. The specific details of the phase are mainly determined by the virtualization technology adopted.
方法实施例Method embodiment
图2为本发明方法实施例一提供的虚拟机的迁移方法流程图,所述方法适用于解决图1中触发条件为第一种情况时,在迁移规划阶段所涉及的待迁移虚拟机选择的问题,如图2所示,所述方法具体可以包括:FIG. 2 is a flowchart of a method for migrating a virtual machine according to Embodiment 1 of the present invention. The method is applicable to the virtual machine to be migrated involved in the migration planning phase when the trigger condition in FIG. 1 is the first case. The problem, as shown in FIG. 2, may specifically include:
S210,资源管理器获取源主机中各个虚拟机的多种类型资源的使用率,根据所述各个虚拟机的多种类型资源的使用率,确定所述源主机的多种类型资源的使用率。S210: The resource manager obtains usage rates of multiple types of resources of each virtual machine in the source host, and determines usage rates of multiple types of resources of the source host according to usage rates of multiple types of resources of the virtual machines.
进一步地,所述各个虚拟机具有相同类型的资源,所述步骤S210具体可以包括:Further, each of the virtual machines has the same type of resources, and the step S210 may specifically include:
依次根据所述各个虚拟机的相同类型资源的使用率以及预先为所述各个虚拟机分配的所述类型资源的大小,确定所述源主机的所述类型资源的使用率;直至确定所述源主机的每种类型资源的使用率。Determining the usage rate of the type resource of the source host according to the usage rate of the same type of resources of the respective virtual machines and the size of the type resources allocated to the respective virtual machines in advance; until the source is determined The usage rate of each type of resource for the host.
此处,源主机的多种类型资源可以包括但不限于:CPU、内存、网络带宽和磁盘等,可以理解的是,源主机上运行的虚拟机的多种类型资源可以包括但不限于:CPU、内存、网络带宽和磁盘等。在此说明书中,以每个虚拟机包括三种类型资源:CPU、内存和网络带宽为例进行说明。 Here, the multiple types of resources of the source host may include, but are not limited to, CPU, memory, network bandwidth, and disk. It can be understood that multiple types of resources of the virtual machine running on the source host may include but are not limited to: CPU. , memory, network bandwidth, and disk. In this specification, each virtual machine includes three types of resources: CPU, memory, and network bandwidth as an example.
举例来说,假设源主机上运行两个虚拟机:VM1和VM2,且假设该源主机的CPU大小为10G,其中,预先为VM1分配的CPU的大小为6G,预先为VM2分配的CPU的大小为4G,则如果资源管理器在t时刻获取到主机中虚拟机VM1的CPU的使用率为0.6,而虚拟机VM2的CPU的使用率为0.4时,则上述源主机的CPU的使用率为0.52((6×0.6+4×0.4)/10);同理可以获取到源主机的其它类型资源的使用率。For example, suppose that two virtual machines are running on the source host: VM 1 and VM 2 , and the CPU size of the source host is assumed to be 10G, wherein the size of the CPU allocated to VM 1 is 6G in advance, and VM 2 is allocated in advance. If the size of the CPU is 4G, if the resource manager obtains the CPU usage of the virtual machine VM 1 in the host at 0.6, and the CPU usage of the virtual machine VM 2 is 0.4, then the source host The usage rate of the CPU is 0.52 ((6×0.6+4×0.4)/10); similarly, the usage rate of other types of resources of the source host can be obtained.
需要说明的是,上述资源的使用率(CPU、内存、网络带宽和磁盘等)是指虚拟机上承载的相关应用程序对资源的消耗情况,因此,虚拟机的资源的使用率是一个动态值,其会随着应用程序的性能的变化而动态变化;相应的,本发明中还需要说明另一个概念:预先为各个虚拟机分配的资源的大小,其在虚拟机创建的时候就已确定,可以将其看成是一个静态值,后期一般不会再变化,如,上述源主机的CPU大小为10G,预先为VM1分配的CPU的大小为6G。It should be noted that the usage rate of the foregoing resources (CPU, memory, network bandwidth, and disk, etc.) refers to the consumption of resources by related applications carried on the virtual machine. Therefore, the resource usage rate of the virtual machine is a dynamic value. , which dynamically changes with the performance of the application; accordingly, another concept needs to be described in the present invention: the size of the resources allocated in advance for each virtual machine, which is determined when the virtual machine is created, It can be regarded as a static value, and generally does not change later. For example, the CPU size of the above source host is 10G, and the size of the CPU allocated to VM 1 in advance is 6G.
S220,根据所述源主机的多种类型资源的使用率,将所述源主机的多种类型资源划分为过载资源和未过载资源,并确定所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重。S220. The multiple types of resources of the source host are divided into overload resources and non-overload resources according to the usage rate of the multiple types of resources of the source host, and the first migration weight of the overload resource and the The second migration weight of the overloaded resource.
所述根据所述源主机的多种类型资源的使用率,将所述源主机的多种类型资源划分为过载资源和未过载资源包括:The dividing the plurality of types of resources of the source host into overload resources and un-overloaded resources according to the usage rate of the multiple types of resources of the source host includes:
对所述源主机的多种类型资源中第一类型资源,当所述第一类型资源的使用率大于预先设定的门限值时,则将所述第一类型资源确定为过载资源;And determining, by the first type of resources, the first type of resources, when the usage rate of the first type of resources is greater than a preset threshold, determining the first type of resources as an overload resource;
当所述第一类型资源的使用率不大于预先设定的门限值时,则将所述第一类型资源确定为未过载资源。When the usage rate of the first type of resource is not greater than a preset threshold, the first type of resource is determined as an unoverloaded resource.
举例来说,假设依据前述例子中的方法获取到源主机的三种类型资源(依次为:CPU、内存和网络带宽)的使用率分别为0.9、0.4、0.3,而预先设定的上述三种类型资源的门限值分别为0.85、0.8和0.7,因为0.9>0.85,所以源主机的CPU过载,而由于0.4<0.8,0.3<0.7,所以源主机的内存和网络 带宽均未过载,也即上述源主机的过载资源类型的数目为1,而源主机的未过载资源类型的数目为2。For example, assume that the usage rates of the three types of resources of the source host (in order: CPU, memory, and network bandwidth) are 0.9, 0.4, and 0.3, respectively, according to the method in the foregoing example, and the foregoing three types are preset. The thresholds of type resources are 0.85, 0.8, and 0.7, respectively, because 0.9>0.85, so the CPU of the source host is overloaded, and since 0.4<0.8, 0.3<0.7, the memory and network of the source host. The bandwidth is not overloaded, that is, the number of overload resource types of the source host is 1, and the number of un-overloaded resource types of the source host is 2.
需要说明的是,虽然上述例子中以预先对三种不同类型资源设定三个不同的门限值为例进行说明,本领域技术人员也可以只预先设定一个或者两个门限值,本发明对此不作限定。It should be noted that, in the above example, the three different threshold values are set in advance for three different types of resources, and those skilled in the art may also set one or two thresholds in advance. The invention is not limited thereto.
考虑到同一主机上不同类型的资源其资源紧张的程度可能不一样,选择待迁移虚拟机的时候,应该将这一因素考虑进去,即根据主机资源需求度来对每种资源分配迁移权重的方法,对于过载的主机来说,往往希望将其上的若干虚拟机迁移出去以快速的降低其负载。Considering the different types of resources on the same host, the degree of resource strain may be different. When selecting a virtual machine to be migrated, this factor should be taken into account, that is, the method of assigning migration weight to each resource according to the host resource demand degree. For overloaded hosts, it is often desirable to migrate several virtual machines on them to quickly reduce their load.
如前述例子,当源主机CPU过载时,那么就希望把CPU最高的虚拟机迁移出去以尽快的释放主机的负载;对于未过载资源,就没有必要减少它在主机上的资源的使用率,因此为了充分利用资源,迁移的时候就选择未过载资源对应的资源的使用率最低的虚拟机。将这两种情况结合起来考虑,分别对过载资源和未过载资源按照不同的算法确定其迁移权重。As in the previous example, when the source host CPU is overloaded, then it is desirable to migrate the virtual machine with the highest CPU to release the load of the host as soon as possible; for the unoverloaded resources, there is no need to reduce the usage of the resources on the host. In order to make full use of resources, when migrating, the virtual machine with the lowest usage rate of resources corresponding to the un-overloaded resource is selected. Considering these two situations together, the migration weights of the overloaded resources and the unoverloaded resources are determined according to different algorithms.
具体地,对所述过载资源,根据所述过载资源的使用率和预设的第一算法,确定所述过载资源的第一迁移权重;Specifically, determining, by the overload resource, a first migration weight of the overload resource according to a usage rate of the overload resource and a preset first algorithm;
对所述未过载资源,根据所述未过载资源的使用率和预设的第二算法,确定所述未过载资源的第二迁移权重。And determining, by the un-overloaded resource, a second migration weight of the un-overloaded resource according to the usage rate of the un-overloaded resource and a preset second algorithm.
本发明不对上述预设的第一算法和预设的第二算法进行限定,但要求根据上述预设的第一算法和预设的第二算法确定的载资源的第一迁移权重和未过载资源的第二迁移权重同时具有如下四个特征:The present invention does not limit the foregoing preset first algorithm and the preset second algorithm, but requires the first migration weight and the un-overloaded resource of the loaded resource determined according to the preset first algorithm and the preset second algorithm. The second migration weight has the following four characteristics:
1)过载资源的第一迁移权重始终大于1,未过载资源的第二迁移权重始终小于1,即过载资源的第一迁移权重始终大于未过载资源的第二迁移权重。1) The first migration weight of the overloaded resource is always greater than 1, and the second migration weight of the unloaded resource is always less than 1, that is, the first migration weight of the overloaded resource is always greater than the second migration weight of the unoverloaded resource.
2)过载资源的第一迁移权重关于过载资源的使用率呈非线性关系,未过载资源的第二迁移权重关于未过载资源的使用率呈线性关系。2) The first migration weight of the overloaded resource has a nonlinear relationship with respect to the usage rate of the overloaded resource, and the second migration weight of the unoverloaded resource has a linear relationship with respect to the usage rate of the unoverloaded resource.
3)过载资源的使用率越高,其对应的第一迁移权重越大,未过载资源的 使用率越高,其对应的第二迁移权重越小。3) The higher the usage rate of the overloaded resource, the larger the corresponding first migration weight, and the less overloaded resources. The higher the usage rate, the smaller the corresponding second migration weight.
4)主机的多种类型资源的使用率随着时间动态变化,按照上述算法确定的资源的迁移权重也动态改变。4) The usage rate of multiple types of resources of the host dynamically changes with time, and the migration weight of the resources determined according to the above algorithm also dynamically changes.
图3为本发明提供的资源的权重确定方法示意图,如图3所示,301、302以及303分别表示在t1时刻,PM的CPU、MEM以及BW的使用率,307、308以及309分别表示在t1时刻,CPU、MEM以及BW的迁移权重。假设在t1时刻,CPU的使用率大于预先设定的门限值,也即CPU属于对于过载资源,而MEM以及BW的使用率均不大于预设设定的门限值,也即MEM以及BW属于未过载资源,则从图3中可以看出,对于过载资源,较高的资源的使用率导致其被分配了较高的迁移权重,而对于未过载资源,较高的资源的使用率导致其迁移权重较低,如,BW的使用率大于MEM的使用率,而BW的迁移权重则小于MEM的迁移权重。因此,在选择待迁移虚拟机的时候,由于过载资源的使用率较高,所以其具有更高的优先级进行资源的迁移以平衡资源利用。并且由于过载资源其分配的迁移权重始终大于未过载资源分配的迁移权重,因此,过载资源总是有更高的优先级被迁移出去。To resources present invention provides a method of weight determination schematic FIG. 3, FIG. 3, 301, 302 and 303 respectively at time t 1, PM's CPU, MEM and BW usage, 307, 308 and 309 respectively at time t, the right to migrate CPU, MEM and BW weight. Suppose at time T 1, CPU utilization rate greater than a predetermined threshold value, i.e. CPU resources belonging to the overload, and the MEM and BW usage threshold value not greater than a predetermined set, i.e. MEM and BW belongs to the un-overloaded resource. As can be seen from Figure 3, for overloaded resources, the higher resource usage rate causes it to be assigned a higher migration weight, while for the un-overloaded resource, the higher resource usage rate. As a result, the migration weight is lower. For example, the usage rate of BW is greater than the usage rate of MEM, and the migration weight of BW is smaller than the migration weight of MEM. Therefore, when the virtual machine to be migrated is selected, since the usage rate of the overloaded resource is high, it has a higher priority for resource migration to balance resource utilization. Moreover, since the migration weight of the allocated resource is always greater than the migration weight of the unoverloaded resource allocation, the overloaded resource always has a higher priority to be migrated out.
此外,图3中,304、305以及306分别表示在t1+△t时刻,PM的CPU、MEM以及BW的使用率,310、311以及312分别表示在t1+△t时刻,CPU、MEM以及BW的迁移权重,即在不同的时刻,CPU、MEM以及BW的迁移权重是不相同的。由此可以看出,本发明的迁移权重的确定方法在主机的资源的使用率随时间变化时,可以动态更新主机的资源的迁移权重,也即本发明的迁移权重确定方法为动态权重确定方法,所以,本发明的迁移权重的确定方法可以实时的反映主机的负载情况,从而快速的减轻主机负载,并且充分利用了主机的资源。In addition, in FIG. 3, 304, 305, and 306 respectively indicate the usage rates of the CPU, MEM, and BW of the PM at times t 1 + Δt, and 310, 311, and 312 indicate the CPU, MEM at time t 1 + Δt, respectively. And the migration weight of the BW, that is, the migration weights of the CPU, MEM, and BW are different at different times. It can be seen that the method for determining the migration weight of the present invention can dynamically update the migration weight of the resource of the host when the usage rate of the resource of the host changes with time, that is, the method for determining the migration weight of the present invention is a dynamic weight determination method. Therefore, the method for determining the migration weight of the present invention can reflect the load condition of the host in real time, thereby quickly reducing the host load and making full use of the resources of the host.
S230,根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,从所述虚拟机中选取待迁移虚拟机。 S230. Select a virtual machine to be migrated from the virtual machine according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overloaded resource, and the second migration weight of the un-overloaded resource.
进一步地,所述步骤S230还可以进一步包括:Further, the step S230 may further include:
根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,获取所述各个虚拟机的第一迁移代价值;Acquiring, according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overloaded resource, and the second migration weight of the un-overloaded resource, acquiring a first migration value of each virtual machine;
将所述各个虚拟机的第一迁移代价值进行比对,将最小的第一迁移代价值对应的虚拟机确定为待迁移虚拟机。The first migration value of each virtual machine is compared, and the virtual machine corresponding to the smallest first migration value is determined as the virtual machine to be migrated.
此处,在获取所述各个虚拟机的第一迁移代价值之前,可以根据各个虚拟机的多种类型资源的使用率,先建立多维度决策矩阵。Here, before acquiring the first migration value of each virtual machine, the multi-dimensional decision matrix may be first established according to the usage rate of multiple types of resources of each virtual machine.
举例来说,假设源主机上运行5个虚拟机:VM1、VM2、VM3、VM4和VM5,5个虚拟机中每个虚拟机的三种类型资源为:CPU、内存和网络带宽;且根据步骤S220的方法划分的过载资源为CPU,未过载资源为:内存和网络带宽,根据步骤S220的方法确定的过载资源CPU的第一迁移权重为5,未过载资源内存的第二迁移权重为0.2,未过载资源网络带宽的第二迁移权重为0.3;还假设获取到的各个虚拟机的上述三种类型资源的使用率如表1所示:For example, suppose that five virtual machines are running on the source host: VM 1 , VM 2 , VM 3 , VM 4 , and VM 5 . The three types of resources for each of the five virtual machines are: CPU, memory, and network. The bandwidth of the overloaded resource is the CPU, and the unloaded resource is the memory and the network bandwidth. The first migration weight of the overload resource CPU determined according to the method of step S220 is 5, and the second overloaded resource memory is the second. The migration weight is 0.2, and the second migration weight of the unoverloaded resource network bandwidth is 0.3. It is also assumed that the usage rates of the above three types of resources of each virtual machine are as shown in Table 1:
表1Table 1
  CPU的使用率CPU usage 内存的使用率Memory usage 网络带宽的使用率Network bandwidth usage
VM1 VM 1 0.10.1 0.20.2 0.90.9
VM2 VM 2 0.20.2 0.30.3 0.60.6
VM3 VM 3 0.30.3 0.50.5 0.70.7
VM4 VM 4 0.80.8 0.60.6 0.20.2
VM5 VM 5 0.90.9 0.60.6 0.30.3
需要说明的是,上述表格中三种类型资源的使用率均为规范值,即其范围在0-1之间,如果上述资源的使用率不是规范值,则可以在获取到资源的使用率之后对其进行归一化处理。It should be noted that the usage rates of the three types of resources in the above table are all normative values, that is, the range is between 0-1. If the usage rate of the foregoing resource is not the normative value, the usage rate of the resource may be obtained. Normalize it.
对各个虚拟机的三种类型资源的使用率进行规范化处理之后,就可以根 据上述表格的内容建立多维度决策矩阵,并根据建立的多维度决策矩阵,选取理想迁移虚拟机,其中,理想虚拟机的确定过程如下:After normalizing the usage rate of the three types of resources of each virtual machine, you can root According to the content of the above table, a multi-dimensional decision matrix is established, and an ideal migration virtual machine is selected according to the established multi-dimensional decision matrix. The determination process of the ideal virtual machine is as follows:
对所述源主机的过载资源中每种类型过载资源,将所述各个虚拟机的所述类型过载资源的使用率进行比对,将最大的过载资源的使用率作为所述类型过载资源的目标使用率;Comparing the usage rate of the type of overload resources of each virtual machine to each type of overload resource in the overload resource of the source host, and using the maximum overload resource usage rate as the target of the type overload resource Usage rate
对所述源主机的未过载资源中每种未过载资源,将所述各个虚拟机的所述类型未过载资源的使用率进行比对,将最小的过载资源的使用率作为所述类型未过载资源的目标使用率。Comparing the usage rates of the types of non-overloaded resources of the virtual machines to each of the un-overloaded resources of the source host, and using the minimum overload resource usage rate as the type is not overloaded. The target usage rate of the resource.
如前述例子中,源主机的过载资源只包括CPU,将虚拟机VM1、VM2、VM3、VM4和VM5的CPU的使用率进行比对,因为0.9(对应VM5)>0.8>0.3>0.2>0.1,所以将VM5的CPU的使用率0.9作为源主机的CPU的目标使用率;而源主机的未过载资源包括内存和网络带宽,首先将VM1、VM2、VM3、VM4和VM5的内存的使用率进行比对,因为0.2(对应VM1)<0.3<0.5<0.6,所以将VM1的内存的使用率0.2作为源主机的内存的目标使用率;然后将VM1、VM2、VM3、VM4和VM5的网络带宽的使用率进行比对,因为0.2(对应VM4)<0.3<0.6<0.7<0.9,所以将VM4的网络带宽的使用率0.2作为源主机的网络带宽的目标使用率;且将CPU的使用率0.9,内存的使用率0.2以及网络带宽的使用率0.2选取为理想虚拟机。As in the foregoing example, the overload resource of the source host includes only the CPU, and the CPU usage of the virtual machines VM 1 , VM 2 , VM 3 , VM 4 , and VM 5 are compared because 0.9 (corresponding to VM 5 )>0.8>0.3>0.2>0.1, so the CPU usage of VM 5 is the target usage rate of the CPU of the source host; and the un-overloaded resources of the source host include memory and network bandwidth, first VM 1 , VM 2 , VM 3 , The memory usage of VM 4 and VM 5 is compared, because 0.2 (corresponding to VM 1 ) <0.3<0.5<0.6, so the memory usage of VM 1 is 0.2 as the target usage of the source host's memory; The network bandwidth usage ratios of VM 1 , VM 2 , VM 3 , VM 4 , and VM 5 are compared because 0.2 (corresponding to VM 4 ) < 0.3 < 0.6 < 0.7 < 0.9, so the network bandwidth usage of VM 4 is used. 0.2 is the target usage rate of the network bandwidth of the source host; and the CPU usage rate 0.9, the memory usage rate 0.2, and the network bandwidth usage rate 0.2 are selected as ideal virtual machines.
在选取理想虚拟机之后,就可以计算各个虚拟机与理想虚拟机的欧几里德距离,也即获取所述各个虚拟机的第一迁移代价值。具体地,根据公式1计算各个虚拟机的第一迁移代价值:After the ideal virtual machine is selected, the Euclidean distance between each virtual machine and the ideal virtual machine can be calculated, that is, the first migration value of each virtual machine is obtained. Specifically, the first migration value of each virtual machine is calculated according to formula 1:
Figure PCTCN2015073422-appb-000003
        (公式1)
Figure PCTCN2015073422-appb-000003
(Formula 1)
其中,Di为第i个虚拟机的第一迁移代价值,n为所述源主机的过载资源类型的数目,前述例子中,At为所述源主机的第t种类型过载资源的第一迁移权重,At>1,Sit为第i个虚拟机的第t种类型过载资源的使用率,Pt为所述 源主机的第t种类型过载资源的目标使用率,m为所述源主机的未过载资源类型的数目,Bl为所述源主机的第l种类型未过载资源的第二迁移权重,0<Bl<1,Til为第i个虚拟机的第l种类型未过载资源的使用率,Ql为所述源主机的第l种类型未过载资源的目标使用率,n+m为所述源主机的资源类型的数目。Wherein, D i is the first migration value of the i-th virtual machine, and n is the number of overload resource types of the source host. In the foregoing example, A t is the t-type overload resource of the source host. a migration weight, A t >1, S it is the usage rate of the t-type overload resource of the i-th virtual machine, and P t is the target usage rate of the t-type overload resource of the source host, where m is The number of un-overloaded resource types of the source host, B l is the second migration weight of the first type of un-overloaded resources of the source host, 0<B l <1, and T il is the lth of the i-th virtual machine. The usage rate of the type of non-overloaded resources, Q l is the target usage rate of the first type of un-overloaded resources of the source host, and n+m is the number of resource types of the source host.
如前述例子中,公式1中i=5,n=1,且A1=5,P1=0.9,m=2,B1=0.2,Q1=0.2,B2=0.3,Q2=0.2,且在计算虚拟机VM1的第一迁移代价值D1时,S11=0.1,T11=0.2,T12=0.9,因此
Figure PCTCN2015073422-appb-000004
Figure PCTCN2015073422-appb-000005
同理,可以获取到VM2、VM3、VM4和VM5的第一迁移代价值分别为:3.50、3.00、0.506、0.085。
As in the foregoing example, i=5, n=1, and A 1 =5, P 1 =0.9, m=2, B 1 =0.2, Q 1 =0.2, B 2 =0.3, Q 2 =0.2 in Equation 1. And when calculating the first migration value D 1 of the virtual machine VM 1 , S 11 =0.1, T 11 =0.2, T 12 =0.9, thus
Figure PCTCN2015073422-appb-000004
Figure PCTCN2015073422-appb-000005
Similarly, the first migration values of VM 2 , VM 3 , VM 4 , and VM 5 can be obtained: 3.50, 3.00, 0.506, and 0.085, respectively.
将VM1、VM2、VM3、VM4和VM5的第一迁移代价值进行比对,因为0.085<0.506<3.00<3.50<4.01,而0.085为虚拟机VM5的第一迁移代价值,所以可以将虚拟机VM5确定为待迁移虚拟机。此处VM5的CPU的使用率为0.9,因此,将虚拟机VM5迁移至目标主机之后,可以快速地解决源主机CPU过载的问题,而且可以减少迁移次数。Comparing the first migration value of VM 1 , VM 2 , VM 3 , VM 4 and VM 5 , because 0.085<0.506<3.00<3.50<4.01, and 0.085 is the first migration value of virtual machine VM 5 , Therefore, the virtual machine VM 5 can be determined as the virtual machine to be migrated. Here, the CPU usage of the VM 5 is 0.9. Therefore, after the virtual machine VM 5 is migrated to the target host, the problem of overloading the source host CPU can be quickly solved, and the number of migrations can be reduced.
S240,向所述源主机的监视器发送迁移指令,以使所述监视器根据所述迁移指令,将所述待迁移虚拟机迁移至目标主机。S240. Send a migration instruction to the monitor of the source host, so that the monitor migrates the to-be-migrated virtual machine to the target host according to the migration instruction.
此处,源主机的监视器即为VMM,上述迁移指令中可以包括待迁移虚拟机的源位置信息以及目标位置信息,其中,目标位置信息是由资源管理器根据放置策略确定的,其确定方法属于现有技术,在此不作赘述。Here, the monitor of the source host is a VMM, and the foregoing migration instruction may include source location information of the virtual machine to be migrated and target location information, where the target location information is determined by the resource manager according to the placement policy, and the determining method thereof is determined. It belongs to the prior art and will not be described here.
本发明提供的方法实施例一中,首先根据预先设定的门限值,将源主机上的多种类型资源分为过载资源和未过载资源,分别对过载资源和未过载资源根据不同的算法确定其迁移权重,这些资源的迁移权重将作为后续选取待迁移虚拟机的考虑因素。对于过载资源,其对应的第一迁移权重始终大于1,并且资源的使用率越高,对应的第一迁移权重越大;对于未过载资源,其对应的第二迁移权重始终小于1,并且资源的使用率越高,对应的第二迁移权重越小。然后根据源主机上各个虚拟机的多种类型资源的使用率建立多维度决 策矩阵,并根据建立的多维度决策矩阵,选取理想虚拟机,然后计算各个虚拟机与理想虚拟机的欧几里德距离,并将动态权重方法确定的过载资源的第一迁移权重和未过载资源的第二迁移权重考虑进去来确定待迁移虚拟机。In the first embodiment of the method provided by the present invention, first, according to a preset threshold, multiple types of resources on the source host are divided into an overload resource and an un-overload resource, and different algorithms are used for the overload resource and the non-overload resource respectively. Determine the migration weights, and the migration weight of these resources will be taken into consideration for the subsequent selection of the virtual machine to be migrated. For an overloaded resource, the corresponding first migration weight is always greater than 1, and the higher the usage rate of the resource, the larger the corresponding first migration weight; for the non-overloaded resource, the corresponding second migration weight is always less than 1, and the resource is always The higher the usage rate, the smaller the corresponding second migration weight. Then establish a multi-dimensional decision based on the usage rate of multiple types of resources of each virtual machine on the source host. Based on the established multi-dimensional decision matrix, the ideal virtual machine is selected, and then the Euclidean distance between each virtual machine and the ideal virtual machine is calculated, and the first migration weight and the overload of the overload resource determined by the dynamic weight method are not overloaded. The second migration weight of the resource is taken into account to determine the virtual machine to be migrated.
此外,在本发明提供的方法实施例一中,过载资源在虚拟机迁移的时候,由于具有更大的迁移权重,因此其总是具有更高的优先级进行资源的均衡,未过载资源由于其资源的使用率并未超过预先设定的门限值,因此为了充分利用资源,迁移的时候其迁移权重较低。所以,过载资源的使用率较大同时未过载资源的使用率较少的虚拟机在实施例一的方法中,将会有更大的机会被选中,因而可以快速的降低主机负载,减少了虚拟机迁移的次数。并且相比于现有技术中只选择虚拟机体积最大的虚拟机进行迁移,实施例一在选择虚拟机的时候,通过决策矩阵在CPU、内存、网络带宽等多个资源维度上进行精确地资源匹配,能够找到最适合迁移的虚拟机,因此充分的利用了各个维度的资源,提高了资源的使用率。In addition, in the first embodiment of the method provided by the present invention, when the virtual machine is migrated, the overload resource has a higher priority, so it always has a higher priority for resource balancing, and the un-allocated resource is due to its The resource usage rate does not exceed the preset threshold, so in order to make full use of resources, the migration weight is lower when migrating. Therefore, the virtual machine with a large usage rate of overload resources and a small usage rate of the non-overloaded resources will have a greater chance of being selected in the method of the first embodiment, thereby rapidly reducing the host load and reducing the virtual The number of machine migrations. Compared with the prior art, only the virtual machine with the largest virtual machine volume is selected for migration. In the first embodiment, when the virtual machine is selected, the decision matrix is used to accurately allocate resources in multiple resource dimensions such as CPU, memory, and network bandwidth. Matching, can find the most suitable virtual machine for migration, so it makes full use of the resources of each dimension and improves the utilization rate of resources.
在此说明,虽然本发明提供的方法实施例一是以触发条件为第一种情况为例进行了说明,当触发条件为第二种情况时,由于主机的资源没有过载,本领域技术人员容易想到不对主机的资源进行划分,而直接根据资源的使用率和预设的第三算法,确定每种资源的迁移权重。It is described here that although the first embodiment of the method provided by the present invention is an example in which the trigger condition is the first case, when the trigger condition is the second case, since the resource of the host is not overloaded, it is easy for a person skilled in the art. I think that the resources of the host are not divided, and the migration weight of each resource is determined directly according to the resource usage rate and the preset third algorithm.
本发明同样不对预设的第三算法进行限定,但要求根据预设的第三算法确定的每种资源的迁移权重同时具有如下5个特征:The present invention also does not limit the preset third algorithm, but requires that the migration weight of each resource determined according to the preset third algorithm has the following five characteristics:
1)各个虚拟机根据自身对各种类型资源的需求偏好确定各种类型资源的迁移权重,因此,不同的虚拟机,其各种类型资源的迁移权重一般不同。1) Each virtual machine determines the migration weight of each type of resource according to its own demand preference for various types of resources. Therefore, different virtual machines have different migration weights of various types of resources.
2)各种类型资源的迁移权重始终大于1。2) The migration weight of various types of resources is always greater than 1.
3)各种类型资源的迁移权重关于资源的使用率呈非线性关系。3) The migration weight of various types of resources has a nonlinear relationship with respect to the utilization rate of resources.
4)各种类型资源的使用率越高,其对应的迁移权重越大。4) The higher the usage rate of various types of resources, the greater the corresponding migration weight.
5)各种类型资源的使用率随着时间动态变化,按照动态权重确定方法,其对应的资源的迁移权重也动态改变。 5) The usage rate of various types of resources changes dynamically with time. According to the dynamic weight determination method, the migration weight of the corresponding resources also dynamically changes.
针对这种由于在线维护以及电源管理等原因触发虚拟机迁移的情况,通过根据虚拟机自身对各种类型资源的的性能偏好确定资源的迁移权重的方法,能够定量的确定该虚拟机对每种类型资源的需求情况,对于后期关于数据中心资源的再分配以及该虚拟机的重新部署,提供了有效的帮助。For the case where the virtual machine migration is triggered due to online maintenance and power management, etc., the virtual machine pair can be quantitatively determined by determining the migration weight of the resource according to the performance preference of the virtual machine itself for various types of resources. The demand situation of type resources provides effective help for later redistribution of data center resources and redeployment of the virtual machine.
此外,由于在触发条件为第二种情况时,主机上的所有虚拟机需要全部迁移出去,因此,在这种情况下不需要考虑待迁移虚拟机的选取。In addition, since all the virtual machines on the host need to be migrated when the trigger condition is the second case, in this case, it is not necessary to consider the selection of the virtual machine to be migrated.
本发明方法实施例一提供的虚拟机的迁移方法适用于迁移虚拟机所需的网络带宽足够大,且虚拟机的内存不是主要考虑因素的情况;当迁移虚拟机所需的网络带宽比较紧张的情况下,迁移一个虚拟机所需要的时间可能会比较长,迁移时间长意味着可能会影响虚拟机上运行的应用程序的性能,所以本发明还提供了一种虚拟机的迁移方法,该实施例的方法综合考虑了虚拟机上的应用程序的性能以及资源的利用率的情况。The migration method of the virtual machine provided in the first embodiment of the method of the present invention is applicable to the case where the network bandwidth required for migrating the virtual machine is sufficiently large, and the memory of the virtual machine is not a main consideration; when the network bandwidth required for migrating the virtual machine is relatively tight In this case, the time required to migrate one virtual machine may be longer. The long migration time means that the performance of the application running on the virtual machine may be affected. Therefore, the present invention also provides a virtual machine migration method. The method of the example takes into account the performance of the application on the virtual machine and the utilization of resources.
图4为本发明方法实施例二提供的虚拟机的迁移方法流程图,所述方法适用于解决图1中触发条件为第一种情况,且同时考虑迁移性能时,在迁移规划阶段所涉及的待迁移虚拟机选择的问题。在虚拟机迁移的过程中,迁移时间和停机时间会影响到迁移性能,而虚拟机的内存大小和网络带宽是影响迁移时间和停机时间的重要因素。因此,在同一个主机上,虚拟机迁移带宽分配不足并且所有虚拟机动态迁移使用网络带宽相同的条件下,选择占用内存较小的虚拟机进行迁移可以提高迁移性能。如图4所示,所述方法具体可以包括:FIG. 4 is a flowchart of a method for migrating a virtual machine according to Embodiment 2 of the present invention. The method is applicable to the solution in the migration planning phase when the trigger condition in FIG. 1 is the first case and the migration performance is considered at the same time. The problem of the virtual machine to be migrated. During virtual machine migration, migration time and downtime can affect migration performance, and virtual machine memory size and network bandwidth are important factors affecting migration time and downtime. Therefore, on the same host, if the virtual machine migration bandwidth allocation is insufficient and all virtual machine dynamic migration uses the same network bandwidth, selecting a virtual machine that occupies less memory for migration can improve migration performance. As shown in FIG. 4, the method may specifically include:
S410,资源管理器获取源主机中各个虚拟机的多种类型资源的使用率,其中,所述各个虚拟机具有相同类型的资源。S410. The resource manager obtains usage rates of multiple types of resources of each virtual machine in the source host, where each virtual machine has the same type of resources.
S420,依次根据所述各个虚拟机的相同类型资源的使用率以及预先为所述各个虚拟机分配的所述类型资源的大小,确定所述源主机的所述类型资源的使用率;直至确定所述源主机的每种类型资源的使用率。S420, determining, according to the usage rate of the same type of resources of the respective virtual machines and the size of the type resources allocated to the respective virtual machines in advance, determining the usage rate of the type resources of the source host; The usage rate of each type of resource of the source host.
S430,根据所述源主机的多种类型资源的使用率,将所述源主机的多种 类型资源划分为过载资源和未过载资源,并确定所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重。S430. According to the usage rate of multiple types of resources of the source host, multiple types of the source host are used. The type resource is divided into an overload resource and an un-overload resource, and determines a first migration weight of the overload resource and a second migration weight of the un-overload resource.
S440,根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,获取所述各个虚拟机的第一迁移代价值。S440. Acquire a first migration value of each virtual machine according to a usage rate of the multiple types of resources of the virtual machine, a first migration weight of the overloaded resource, and a second migration weight of the un-overloaded resource. .
S450,根据所述各个虚拟机的第一迁移代价值和预先为所述各个虚拟机分配的内存的大小,确定所述各个虚拟机的第二迁移代价值。S450. Determine a second mobility value of each virtual machine according to a first migration value of each virtual machine and a size of a memory allocated in advance for each virtual machine.
假设源主机的内存为10G,而预先为源主机中各个虚拟机VM1、VM2、VM3、VM4和VM5分配的内存的大小分别为1G、2G、3G、2G和2G;优选地,对各个虚拟机的内存的大小分别作归一化处理,归一化处理之后得到的相对值为0.1、0.2、0.3、0.2和0.2。举例来说,假设根据本发明实施例一的方法获取到的VM1、VM2、VM3、VM4和VM5的第一迁移代价值分别为:4.01、3.50、3.00、0.506、0.085;而对预先为源主机中各个虚拟机VM1、VM2、VM3、VM4和VM5分配的内存的大小作归一化处理之后得到的相对值分别为:0.1、0.2、0.3、0.2和0.2,则可以确定VM1、VM2、VM3、VM4和VM5的第二迁移代价值分别为:4.01×0.1,3.50×0.2,3.00×0.3,0.506×0.2,0.085×0.2,即VM1、VM2、VM3、VM4和VM5的第二迁移代价值分别为:0.401、0.7、0.9、0.1012、0.017。Suppose the source host memory to 10G, in advance of the source host each virtual machine VM 1, VM 2, VM 3 , VM 4 and memory size VM 5 assigned respectively 1G, 2G, 3G, 2G, and 2G; preferably The size of the memory of each virtual machine is normalized separately, and the relative values obtained after the normalization process are 0.1, 0.2, 0.3, 0.2, and 0.2. For example, assume that the first migration values of VM 1 , VM 2 , VM 3 , VM 4 , and VM 5 obtained by the method according to the first embodiment of the present invention are: 4.01, 3.50, 3.00, 0.506, and 0.085, respectively; The relative values obtained by normalizing the size of the memory allocated in advance for each of the virtual machines VM 1 , VM 2 , VM 3 , VM 4 , and VM 5 in the source host are: 0.1, 0.2, 0.3, 0.2, and 0.2, respectively. , it can be determined that the second migration value of VM 1 , VM 2 , VM 3 , VM 4 and VM 5 are: 4.01×0.1, 3.50×0.2, 3.00×0.3, 0.506×0.2, 0.085×0.2, ie VM 1 The second migration values of VM 2 , VM 3 , VM 4 , and VM 5 are: 0.401, 0.7, 0.9, 0.1012, and 0.017, respectively.
通过上述步骤,可以优先选取预先分配的内存较小的虚拟机进行迁移,预先分配的内存小,意味着迁移该虚拟机所需要的时间较少(因为迁移的过程中需要反复拷贝虚拟机的内存页面,内存小意味着需要拷贝的数据量小),从而可以减少迁移开销,降低迁移操作对虚拟机上所承载的相关应用程序性能的影响。Through the above steps, you can preferentially select a virtual machine with a small pre-allocated memory for migration. The pre-allocated memory is small, which means that it takes less time to migrate the virtual machine (because the memory of the virtual machine needs to be copied repeatedly during the migration process). Pages, small memory means a small amount of data to be copied, which reduces migration overhead and reduces the impact of migration operations on the performance of related applications hosted on virtual machines.
S460,将所述各个虚拟机的第二迁移代价值进行比对,将最小的第二迁移代价值对应的虚拟机确定为待迁移虚拟机。S460. Compare the second migration value of each virtual machine, and determine the virtual machine corresponding to the smallest second migration value as the virtual machine to be migrated.
将VM1、VM2、VM3、VM4和VM5的第二迁移代价值进行比对,因为0.017<0.1012<0.401<0.7<0.9,而0.017为虚拟机VM5的第二迁移代价值,所 以可以将虚拟机VM5确定为待迁移虚拟机,从表1中可以看出,虚拟机VM5具有最小的网络带宽且预先分配了较小的内存,而网络带宽和内存是影响迁移性能的因素,所以将虚拟机VM5作为待迁移虚拟机,可以提高虚拟机迁移的性能。The VM 1, VM 2, VM 3 , VM 4 and the value of second-generation VM migration 5 for comparison, since 0.017 <0.1012 <0.401 <0.7 <0.9, and 0.017 for the second virtual machine (VM) migration of value generation 5, Therefore, the virtual machine VM 5 can be determined as the virtual machine to be migrated. As can be seen from Table 1, the virtual machine VM 5 has the smallest network bandwidth and is pre-allocated with smaller memory, and the network bandwidth and memory are affecting the migration performance. Factor, so virtual machine VM 5 as a virtual machine to be migrated, can improve the performance of virtual machine migration.
S470,向所述源主机的监视器发送迁移指令,以使所述监视器根据所述迁移指令,将所述待迁移虚拟机迁移至目标主机。S470. Send a migration instruction to the monitor of the source host, so that the monitor migrates the to-be-migrated virtual machine to the target host according to the migration instruction.
本发明提供的方法实施例二中,在选取待迁移虚拟机时,考虑到了每个虚拟机的迁移代价,在减少虚拟机迁移次数,提高资源的使用率的基础上,可以进一步的提高迁移性能(即减小迁移开销),降低迁移导致发生用户服务等级协议(Service Level Agreement,SLA)违背的可能性。In the second embodiment of the method provided by the present invention, when the virtual machine to be migrated is selected, the migration cost of each virtual machine is taken into consideration, and the migration performance can be further improved on the basis of reducing the number of virtual machine migrations and increasing the resource utilization rate. (ie, reduce migration overhead), reducing the possibility of migration causing user service level agreement (SLA) violations.
装置实施例Device embodiment
图5为本发明装置实施例提供的虚拟机的迁移装置示意图,所述装置可以用于执行图2或图4所述的方法,图5中,该装置包括:获取单元501、划分单元502、选取单元503和发送单元504。FIG. 5 is a schematic diagram of a device for migrating a virtual machine according to an embodiment of the present invention. The device may be used to perform the method described in FIG. 2 or FIG. 4. In FIG. 5, the device includes: an obtaining unit 501, a dividing unit 502, The unit 503 and the transmitting unit 504 are selected.
获取单元501,用于获取源主机中各个虚拟机的多种类型资源的使用率,根据所述各个虚拟机的多种类型资源的使用率,确定所述源主机的多种类型资源的使用率。The obtaining unit 501 is configured to obtain usage rates of multiple types of resources of each virtual machine in the source host, and determine usage rates of multiple types of resources of the source host according to usage rates of multiple types of resources of the virtual machines. .
可选地,所述各个虚拟机具有相同类型的资源,获取单元501具体用于:Optionally, each of the virtual machines has the same type of resources, and the obtaining unit 501 is specifically configured to:
依次根据所述各个虚拟机的相同类型资源的使用率以及预先为所述各个虚拟机分配的所述类型资源的大小,确定所述源主机的所述类型资源的使用率;直至确定所述源主机的每种类型资源的使用率。Determining the usage rate of the type resource of the source host according to the usage rate of the same type of resources of the respective virtual machines and the size of the type resources allocated to the respective virtual machines in advance; until the source is determined The usage rate of each type of resource for the host.
划分单元502,用于根据获取单元501确定的所述源主机的多种类型资源的使用率,将所述源主机的多种类型资源划分为过载资源和未过载资源,并确定所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重。The dividing unit 502 is configured to divide the multiple types of resources of the source host into overload resources and non-overload resources according to the usage rate of the multiple types of resources of the source host determined by the obtaining unit 501, and determine the overload resources. The first migration weight and the second migration weight of the unoverloaded resource.
划分单元502具体用于:对所述源主机的多种类型资源中第一类型资源,当所述第一类型资源的使用率大于预先设定的门限值时,则将所述第一类型 资源确定为过载资源;The dividing unit 502 is specifically configured to: when the usage rate of the first type resource is greater than a preset threshold, the first type is used. The resource is determined to be an overload resource;
当所述第一类型资源的使用率不大于预先设定的门限值时,则将所述第一类型资源确定为未过载资源。When the usage rate of the first type of resource is not greater than a preset threshold, the first type of resource is determined as an unoverloaded resource.
划分单元502还具体用于:对所述过载资源,根据所述过载资源的使用率和预设的第一算法,确定所述过载资源的第一迁移权重;The dividing unit 502 is further configured to determine, according to the usage rate of the overload resource and a preset first algorithm, the first migration weight of the overload resource, where the overload resource is used;
对所述未过载资源,根据所述未过载资源的使用率和预设的第二算法,确定所述未过载资源的第二迁移权重。And determining, by the un-overloaded resource, a second migration weight of the un-overloaded resource according to the usage rate of the un-overloaded resource and a preset second algorithm.
选取单元503,用于根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,从所述虚拟机中选取待迁移虚拟机。The selecting unit 503 is configured to select, according to the usage rate of the multiple types of resources of the respective virtual machines, the first migration weight of the overloaded resource, and the second migration weight of the un-overloaded resource, from the virtual machine. Migrate virtual machines.
选取单元503具体用于:根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,获取所述各个虚拟机的第一迁移代价值;The selecting unit 503 is specifically configured to: acquire the virtual machines according to the usage rate of the multiple types of resources of the virtual machines, the first migration weight of the overloaded resources, and the second migration weight of the un-overloaded resources. First migration value;
将所述各个虚拟机的第一迁移代价值进行比对,将最小的第一迁移代价值对应的虚拟机确定为待迁移虚拟机。The first migration value of each virtual machine is compared, and the virtual machine corresponding to the smallest first migration value is determined as the virtual machine to be migrated.
发送单元504,用于向所述源主机的监视器发送迁移指令,以使所述监视器根据所述迁移指令,将选取单元503选取的所述待迁移虚拟机迁移至目标主机。The sending unit 504 is configured to send a migration instruction to the monitor of the source host, so that the monitor migrates the to-be-migrated virtual machine selected by the selecting unit 503 to the target host according to the migration instruction.
可选地,选取单元503还具体用于:Optionally, the selecting unit 503 is further specifically configured to:
根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,获取所述各个虚拟机的第一迁移代价值;Acquiring, according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overloaded resource, and the second migration weight of the un-overloaded resource, acquiring a first migration value of each virtual machine;
根据所述各个虚拟机的第一迁移代价值和预先为所述各个虚拟机分配的内存的大小,确定所述各个虚拟机的第二迁移代价值;Determining, according to a first migration value of each of the virtual machines and a size of memory allocated to the respective virtual machines in advance, a second migration value of each of the virtual machines;
将所述各个虚拟机的第二迁移代价值进行比对,将最小的第二迁移代价值对应的虚拟机确定为待迁移虚拟机。 The second migration value of each virtual machine is compared, and the virtual machine corresponding to the smallest second migration value is determined as the virtual machine to be migrated.
可选地,所述装置还包括:比对单元505,用于对所述源主机的过载资源中每种类型过载资源,将所述各个虚拟机的所述类型过载资源的使用率进行比对,将最大的过载资源的使用率作为所述类型过载资源的目标使用率;Optionally, the device further includes: a comparing unit 505, configured to compare, for each type of overload resource in the overload resource of the source host, a usage rate of the type of overload resource of each virtual machine The maximum utilization rate of the overload resource is used as the target usage rate of the overload resource of the type;
对所述源主机的未过载资源中每种未过载资源,将所述各个虚拟机的所述类型未过载资源的使用率进行比对,将最小的过载资源的使用率作为所述类型未过载资源的目标使用率。Comparing the usage rates of the types of non-overloaded resources of the virtual machines to each of the un-overloaded resources of the source host, and using the minimum overload resource usage rate as the type is not overloaded. The target usage rate of the resource.
可选地,选取单元503具体用于:根据如下公式计算所述各个虚拟机的第一迁移代价值:Optionally, the selecting unit 503 is specifically configured to: calculate a first migration value of each virtual machine according to the following formula:
Figure PCTCN2015073422-appb-000006
Figure PCTCN2015073422-appb-000006
其中,Di为第i个虚拟机的第一迁移代价值,n为所述源主机的过载资源类型的数目,At为所述源主机的第t种类型过载资源的第一迁移权重,At>1,Sit为第i个虚拟机的第t种类型资源的使用率,Pt为所述源主机的第t种类型过载资源的目标使用率,m为所述源主机的未过载资源类型的数目,Bl为所述源主机的第l种类型未过载资源的第二迁移权重,0<Bl<1,Til为第i个虚拟机的第l种类型资源的使用率,Ql为所述源主机的第l种类型未过载资源的目标使用率,n+m为所述源主机的资源类型的数目。Wherein, D i is the first migration value of the i-th virtual machine, n is the number of overload resource types of the source host, and A t is the first migration weight of the t-type overload resource of the source host, A t >1, S it is the usage rate of the t-th type resource of the i-th virtual machine, P t is the target usage rate of the t-type overload resource of the source host, and m is the source host The number of overload resource types, B l is the second migration weight of the first type of un-overloaded resources of the source host, 0<B l <1, and T il is the use of the first type of resources of the i-th virtual machine. Rate, Q l is the target usage rate of the first type of un-overloaded resources of the source host, and n+m is the number of resource types of the source host.
本发明装置实施例提供的装置植入了本发明方法实施例提供的方法,因此,本发明提供的装置的具体工作过程,在此不复赘述。The device provided in the embodiment of the present invention is embedded in the method provided by the method embodiment of the present invention. Therefore, the specific working process of the device provided by the present invention is not described herein.
本发明装置实施例提供的虚拟机的迁移装置,获取单元501获取源主机中各个虚拟机的多种类型资源的使用率,根据所述各个虚拟机的多种类型资源的使用率,确定所述源主机的多种类型资源的使用率;划分单元502根据所述源主机的多种类型资源的使用率,将所述源主机的多种类型资源划分为过载资源和未过载资源,并确定所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重;选取单元503根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权 重,从所述虚拟机中选取待迁移虚拟机;发送单元504向所述源主机的监视器发送迁移指令,以使所述监视器根据所述迁移指令,将所述待迁移虚拟机迁移至目标主机。由此,可以提高待迁移虚拟机选择的正确性,从而可以快速解决源主机过载的问题,达到了节约计算机资源的目的。The device for acquiring the virtual machine provided by the embodiment of the present invention, the obtaining unit 501 acquires the usage rate of the multiple types of resources of each virtual machine in the source host, and determines the usage rate according to the usage rate of the multiple types of resources of the virtual machines. The usage rate of the multiple types of resources of the source host; the dividing unit 502 divides the multiple types of resources of the source host into overload resources and non-overload resources according to the usage rate of the multiple types of resources of the source host, and determines a first migration weight of the overload resource and a second migration weight of the overloaded resource; the selecting unit 503, according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overload resource, and the Second migration right of unoverloaded resources Selecting a virtual machine to be migrated from the virtual machine; the sending unit 504 sends a migration instruction to the monitor of the source host, so that the monitor migrates the virtual machine to be migrated to the migration instruction according to the migration instruction Target host. Therefore, the correctness of the selection of the virtual machine to be migrated can be improved, so that the problem of overloading the source host can be quickly solved, and the purpose of saving computer resources is achieved.
设备实施例Equipment example
图6为本发明设备实施例提供的虚拟机的迁移设备示意图。如图6所示,所述迁移设备600包括:处理器602、存储器604、通信接口606和总线608。其中,处理器602、存储器604和通信接口606通过总线608实现彼此之间的通信连接。FIG. 6 is a schematic diagram of a migration device of a virtual machine according to an embodiment of a device according to the present invention. As shown in FIG. 6, the migration device 600 includes a processor 602, a memory 604, a communication interface 606, and a bus 608. Among them, the processor 602, the memory 604, and the communication interface 606 implement a communication connection with each other through the bus 608.
处理器602可以采用通用的中央处理器(Central Processing Unit,CPU),微处理器,应用专用集成电路(Application Specific Integrated Circuit,ASIC),或者一个或多个集成电路,用于执行相关程序,以实现前述本发明方法实施例所提供的技术方案。The processor 602 can be a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits for executing related programs. The technical solution provided by the foregoing method embodiments of the present invention is implemented.
存储器604可以是只读存储器(Read Only Memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(Random Access Memory,RAM)。存储器604可以存储操作系统和其他应用程序。在通过软件或者固件来实现本发明实施例提供的技术方案时,用于实现本发明前述方法实施例提供的任一可选技术方案的程序代码保存在存储器604中,并由处理器602来执行。The memory 604 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). Memory 604 can store operating systems and other applications. When the technical solution provided by the embodiment of the present invention is implemented by software or firmware, the program code for implementing any of the optional technical solutions provided by the foregoing method embodiments of the present invention is stored in the memory 604 and executed by the processor 602. .
通信接口606用以与SDN网络中其他交换机或控制服务器通信。 Communication interface 606 is used to communicate with other switches or control servers in the SDN network.
总线608可包括一通路,在迁移设备600各个部件(例如处理器602、存储器604和通信接口606)之间传送信息。Bus 608 can include a path for communicating information between various components of migration device 600, such as processor 602, memory 604, and communication interface 606.
本发明设备实施例提供的虚拟机的迁移设备,可以提高待迁移虚拟机选择的正确性,从而可以快速解决源主机过载的问题,达到了节约计算机资源的目的。The migration device of the virtual machine provided by the device embodiment of the present invention can improve the correctness of the selection of the virtual machine to be migrated, thereby quickly solving the problem of overloading the source host and achieving the purpose of saving computer resources.
专业人员应该还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来 实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。A person skilled in the art will further appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. Implementations, in order to clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
结合本文中所公开的实施例描述的方法或算法的步骤可以用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of a method or algorithm described in connection with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be placed in random access memory (RAM), memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or technical field. Any other form of storage medium known.
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 The specific embodiments of the present invention have been described in detail with reference to the preferred embodiments of the present invention. All modifications, equivalent substitutions, improvements, etc., made within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims (17)

  1. 一种虚拟机的迁移方法,其特征在于,所述方法包括:A method for migrating a virtual machine, the method comprising:
    资源管理器获取源主机中各个虚拟机的多种类型资源的使用率,根据所述各个虚拟机的多种类型资源的使用率,确定所述源主机的多种类型资源的使用率;The resource manager obtains usage rates of multiple types of resources of each virtual machine in the source host, and determines usage rates of multiple types of resources of the source host according to usage rates of multiple types of resources of the virtual machines;
    根据所述源主机的多种类型资源的使用率,将所述源主机的多种类型资源划分为过载资源和未过载资源,并确定所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重;Dividing, according to the usage rate of the multiple types of resources of the source host, the multiple types of resources of the source host into an overload resource and an un-overload resource, and determining a first migration weight of the overload resource and the un-overloaded resource. Second migration weight;
    根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,从所述虚拟机中选取待迁移虚拟机;Selecting a virtual machine to be migrated from the virtual machine according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overloaded resource, and the second migration weight of the unoverloaded resource;
    向所述源主机的监视器发送迁移指令,以使所述监视器根据所述迁移指令,将所述待迁移虚拟机迁移至目标主机。Sending a migration instruction to the monitor of the source host, so that the monitor migrates the virtual machine to be migrated to the target host according to the migration instruction.
  2. 根据权利要求1所述的方法,其特征在于,所述各个虚拟机具有相同类型的资源,所述根据所述各个虚拟机的多种类型资源的使用率,确定所述源主机的多种类型资源的使用率包括:The method according to claim 1, wherein each of the virtual machines has the same type of resources, and the plurality of types of the source hosts are determined according to usage rates of the plurality of types of resources of the respective virtual machines. Resource usage includes:
    依次根据所述各个虚拟机的相同类型资源的使用率以及预先为所述各个虚拟机分配的所述类型资源的大小,确定所述源主机的所述类型资源的使用率;直至确定所述源主机的每种类型资源的使用率。Determining the usage rate of the type resource of the source host according to the usage rate of the same type of resources of the respective virtual machines and the size of the type resources allocated to the respective virtual machines in advance; until the source is determined The usage rate of each type of resource for the host.
  3. 根据权利要求1或2所述的方法,其特征在于,所述根据所述源主机的多种类型资源的使用率,将所述源主机的多种类型资源划分为过载资源和未过载资源包括:The method according to claim 1 or 2, wherein the dividing the plurality of types of resources of the source host into overload resources and un-overloaded resources according to the usage rate of the plurality of types of resources of the source host includes :
    对所述源主机的多种类型资源中第一类型资源,当所述第一类型资源的使用率大于预先设定的门限值时,则将所述第一类型资源确定为过载资源;And determining, by the first type of resources, the first type of resources, when the usage rate of the first type of resources is greater than a preset threshold, determining the first type of resources as an overload resource;
    当所述第一类型资源的使用率不大于预先设定的门限值时,则将所述第一类型资源确定为未过载资源。 When the usage rate of the first type of resource is not greater than a preset threshold, the first type of resource is determined as an unoverloaded resource.
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述确定所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重包括:The method according to any one of claims 1-3, wherein the determining the first migration weight of the overload resource and the second migration weight of the un-overloaded resource comprises:
    对所述过载资源,根据所述过载资源的使用率和预设的第一算法,确定所述过载资源的第一迁移权重;Determining, by the overload resource, a first migration weight of the overload resource according to the usage rate of the overload resource and a preset first algorithm;
    对所述未过载资源,根据所述未过载资源的使用率和预设的第二算法,确定所述未过载资源的第二迁移权重。And determining, by the un-overloaded resource, a second migration weight of the un-overloaded resource according to the usage rate of the un-overloaded resource and a preset second algorithm.
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,从所述虚拟机中选取待迁移虚拟机包括:The method according to any one of claims 1-4, wherein the usage rate of the plurality of types of resources of the respective virtual machines, the first migration weight of the overloaded resources, and the un-overloaded resources The second migration weight, the virtual machine to be migrated from the virtual machine includes:
    根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,获取所述各个虚拟机的第一迁移代价值;Acquiring, according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overloaded resource, and the second migration weight of the un-overloaded resource, acquiring a first migration value of each virtual machine;
    将所述各个虚拟机的第一迁移代价值进行比对,将最小的第一迁移代价值对应的虚拟机确定为待迁移虚拟机。The first migration value of each virtual machine is compared, and the virtual machine corresponding to the smallest first migration value is determined as the virtual machine to be migrated.
  6. 根据权利要求1-4任一项所述的方法,其特征在于,所述根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,从所述虚拟机中选取待迁移虚拟机包括:The method according to any one of claims 1-4, wherein the usage rate of the plurality of types of resources of the respective virtual machines, the first migration weight of the overloaded resources, and the un-overloaded resources The second migration weight, the virtual machine to be migrated from the virtual machine includes:
    根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,获取所述各个虚拟机的第一迁移代价值;Acquiring, according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overloaded resource, and the second migration weight of the un-overloaded resource, acquiring a first migration value of each virtual machine;
    根据所述各个虚拟机的第一迁移代价值和预先为所述各个虚拟机分配的内存的大小,确定所述各个虚拟机的第二迁移代价值;Determining, according to a first migration value of each of the virtual machines and a size of memory allocated to the respective virtual machines in advance, a second migration value of each of the virtual machines;
    将所述各个虚拟机的第二迁移代价值进行比对,将最小的第二迁移代价值对应的虚拟机确定为待迁移虚拟机。The second migration value of each virtual machine is compared, and the virtual machine corresponding to the smallest second migration value is determined as the virtual machine to be migrated.
  7. 根据权利要求5或6所述的方法,其特征在于,在所述获取所述各个虚拟机的第一迁移代价值之前,所述方法还包括: The method according to claim 5 or 6, wherein before the obtaining the first migration value of the respective virtual machines, the method further comprises:
    对所述源主机的过载资源中每种类型过载资源,将所述各个虚拟机的所述类型过载资源的使用率进行比对,将最大的过载资源的使用率作为所述类型过载资源的目标使用率;Comparing the usage rate of the type of overload resources of each virtual machine to each type of overload resource in the overload resource of the source host, and using the maximum overload resource usage rate as the target of the type overload resource Usage rate
    对所述源主机的未过载资源中每种未过载资源,将所述各个虚拟机的所述类型未过载资源的使用率进行比对,将最小的过载资源的使用率作为所述类型未过载资源的目标使用率。Comparing the usage rates of the types of non-overloaded resources of the virtual machines to each of the un-overloaded resources of the source host, and using the minimum overload resource usage rate as the type is not overloaded. The target usage rate of the resource.
  8. 根据权利要求7所述的方法,其特征在于,所述根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,获取所述各个虚拟机的第一迁移代价值包括:The method according to claim 7, wherein the usage rate of the plurality of types of resources of the respective virtual machines, the first migration weight of the overloaded resources, and the second migration weight of the un-overloaded resources Obtaining the first migration value of each of the virtual machines includes:
    根据如下公式计算所述各个虚拟机的第一迁移代价值:Calculating the first migration value of each virtual machine according to the following formula:
    Figure PCTCN2015073422-appb-100001
    Figure PCTCN2015073422-appb-100001
    其中,Di为第i个虚拟机的第一迁移代价值,n为所述源主机的过载资源类型的数目,At为所述源主机的第t种类型过载资源的第一迁移权重,At>1,Sit为第i个虚拟机的第t种类型资源的使用率,Pt为所述源主机的第t种类型过载资源的目标使用率,m为所述源主机的未过载资源类型的数目,Bl为所述源主机的第l种类型未过载资源的第二迁移权重,0<Bl<1,Til为第i个虚拟机的第l种类型资源的使用率,Ql为所述源主机的第l种类型未过载资源的目标使用率,n+m为所述源主机的资源类型的数目。Wherein, D i is the first migration value of the i-th virtual machine, n is the number of overload resource types of the source host, and A t is the first migration weight of the t-type overload resource of the source host, A t >1, S it is the usage rate of the t-th type resource of the i-th virtual machine, P t is the target usage rate of the t-type overload resource of the source host, and m is the source host The number of overload resource types, B l is the second migration weight of the first type of un-overloaded resources of the source host, 0<B l <1, and T il is the use of the first type of resources of the i-th virtual machine. Rate, Q l is the target usage rate of the first type of un-overloaded resources of the source host, and n+m is the number of resource types of the source host.
  9. 一种虚拟机的迁移装置,其特征在于,所述装置包括:获取单元、划分单元、选取单元和发送单元;A device for migrating a virtual machine, the device comprising: an obtaining unit, a dividing unit, a selecting unit, and a sending unit;
    所述获取单元,用于获取源主机中各个虚拟机的多种类型资源的使用率,根据所述各个虚拟机的多种类型资源的使用率,确定所述源主机的多种类型资源的使用率;The obtaining unit is configured to obtain usage rates of multiple types of resources of each virtual machine in the source host, and determine usage of multiple types of resources of the source host according to usage rates of multiple types of resources of the virtual machines. rate;
    所述划分单元,用于根据所述获取单元确定的所述源主机的多种类型资源的使用率,将所述源主机的多种类型资源划分为过载资源和未过载资源, 并确定所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重;The dividing unit is configured to divide the multiple types of resources of the source host into overload resources and non-overload resources according to the usage rate of the multiple types of resources of the source host determined by the acquiring unit, And determining a first migration weight of the overload resource and a second migration weight of the unoverloaded resource;
    所述选取单元,用于根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,从所述虚拟机中选取待迁移虚拟机;The selecting unit is configured to select, according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overload resource, and the second migration weight of the un-overloaded resource, from the virtual machine The virtual machine to be migrated;
    所述发送单元,用于向所述源主机的监视器发送迁移指令,以使所述监视器根据所述迁移指令,将所述选取单元选取的所述待迁移虚拟机迁移至目标主机。The sending unit is configured to send a migration instruction to the monitor of the source host, so that the monitor migrates the to-be-migrated virtual machine selected by the selecting unit to the target host according to the migration instruction.
  10. 根据权利要求9所述的装置,其特征在于,所述各个虚拟机具有相同类型的资源,所述获取单元具体用于:The device according to claim 9, wherein each of the virtual machines has the same type of resources, and the obtaining unit is specifically configured to:
    依次根据所述各个虚拟机的相同类型资源的使用率以及预先为所述各个虚拟机分配的所述类型资源的大小,确定所述源主机的所述类型资源的使用率;直至确定所述源主机的每种类型资源的使用率。Determining the usage rate of the type resource of the source host according to the usage rate of the same type of resources of the respective virtual machines and the size of the type resources allocated to the respective virtual machines in advance; until the source is determined The usage rate of each type of resource for the host.
  11. 根据权利要求9或10所述的装置,其特征在于,所述划分单元具体用于:The device according to claim 9 or 10, wherein the dividing unit is specifically configured to:
    对所述源主机的多种类型资源中第一类型资源,当所述第一类型资源的使用率大于预先设定的门限值时,则将所述第一类型资源确定为过载资源;And determining, by the first type of resources, the first type of resources, when the usage rate of the first type of resources is greater than a preset threshold, determining the first type of resources as an overload resource;
    当所述第一类型资源的使用率不大于预先设定的门限值时,则将所述第一类型资源确定为未过载资源。When the usage rate of the first type of resource is not greater than a preset threshold, the first type of resource is determined as an unoverloaded resource.
  12. 根据权利要求9-11任一项所述的装置,其特征在于,所述划分单元具体用于:The device according to any one of claims 9 to 11, wherein the dividing unit is specifically configured to:
    对所述过载资源,根据所述过载资源的使用率和预设的第一算法,确定所述过载资源的第一迁移权重;Determining, by the overload resource, a first migration weight of the overload resource according to the usage rate of the overload resource and a preset first algorithm;
    对所述未过载资源,根据所述未过载资源的使用率和预设的第二算法,确定所述未过载资源的第二迁移权重。And determining, by the un-overloaded resource, a second migration weight of the un-overloaded resource according to the usage rate of the un-overloaded resource and a preset second algorithm.
  13. 根据权利要求9-12任一项所述的装置,其特征在于,所述选取单元具体用于: The device according to any one of claims 9 to 12, wherein the selecting unit is specifically configured to:
    根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,获取所述各个虚拟机的第一迁移代价值;Acquiring, according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overloaded resource, and the second migration weight of the un-overloaded resource, acquiring a first migration value of each virtual machine;
    将所述各个虚拟机的第一迁移代价值进行比对,将最小的第一迁移代价值对应的虚拟机确定为待迁移虚拟机。The first migration value of each virtual machine is compared, and the virtual machine corresponding to the smallest first migration value is determined as the virtual machine to be migrated.
  14. 根据权利要求9-12任一项所述的装置,其特征在于,所述选取单元具体用于:The device according to any one of claims 9 to 12, wherein the selecting unit is specifically configured to:
    根据所述各个虚拟机的多种类型资源的使用率、所述过载资源的第一迁移权重以及所述未过载资源的第二迁移权重,获取所述各个虚拟机的第一迁移代价值;Acquiring, according to the usage rate of the multiple types of resources of the virtual machine, the first migration weight of the overloaded resource, and the second migration weight of the un-overloaded resource, acquiring a first migration value of each virtual machine;
    根据所述各个虚拟机的第一迁移代价值和预先为所述各个虚拟机分配的内存的大小,确定所述各个虚拟机的第二迁移代价值;Determining, according to a first migration value of each of the virtual machines and a size of memory allocated to the respective virtual machines in advance, a second migration value of each of the virtual machines;
    将所述各个虚拟机的第二迁移代价值进行比对,将最小的第二迁移代价值对应的虚拟机确定为待迁移虚拟机。The second migration value of each virtual machine is compared, and the virtual machine corresponding to the smallest second migration value is determined as the virtual machine to be migrated.
  15. 根据权利要求13或14所述的装置,其特征在于,所述装置还包括:比对单元,用于对所述源主机的过载资源中每种类型过载资源,将所述各个虚拟机的所述类型过载资源的使用率进行比对,将最大的过载资源的使用率作为所述类型过载资源的目标使用率;The device according to claim 13 or 14, wherein the device further comprises: a comparison unit, configured to load each type of overload resource in the overload resource of the source host, where the virtual machine is located The usage rate of the type overload resource is compared, and the usage rate of the largest overload resource is used as the target usage rate of the overload resource of the type;
    对所述源主机的未过载资源中每种未过载资源,将所述各个虚拟机的所述类型未过载资源的使用率进行比对,将最小的过载资源的使用率作为所述类型未过载资源的目标使用率。Comparing the usage rates of the types of non-overloaded resources of the virtual machines to each of the un-overloaded resources of the source host, and using the minimum overload resource usage rate as the type is not overloaded. The target usage rate of the resource.
  16. 根据权利要求15所述的装置,其特征在于,所述选取单元具体用于:The device according to claim 15, wherein the selecting unit is specifically configured to:
    根据如下公式计算所述各个虚拟机的第一迁移代价值:Calculating the first migration value of each virtual machine according to the following formula:
    Figure PCTCN2015073422-appb-100002
    Figure PCTCN2015073422-appb-100002
    其中,Di为第i个虚拟机的第一迁移代价值,n为所述源主机的过载资 源类型的数目,At为所述源主机的第t种类型过载资源的第一迁移权重,At>1,Sit为第i个虚拟机的第t种类型资源的使用率,Pt为所述源主机的第t种类型过载资源的目标使用率,m为所述源主机的未过载资源类型的数目,Bl为所述源主机的第l种类型未过载资源的第二迁移权重,0<Bl<1,Til为第i个虚拟机的第l种类型资源的使用率,Ql为所述源主机的第l种类型未过载资源的目标使用率,n+m为所述源主机的资源类型的数目。Wherein, D i is the first migration value of the i-th virtual machine, n is the number of overload resource types of the source host, and A t is the first migration weight of the t-type overload resource of the source host, A t >1, S it is the usage rate of the t-th type resource of the i-th virtual machine, P t is the target usage rate of the t-type overload resource of the source host, and m is the source host The number of overload resource types, B l is the second migration weight of the first type of un-overloaded resources of the source host, 0<B l <1, and T il is the use of the first type of resources of the i-th virtual machine. Rate, Q l is the target usage rate of the first type of un-overloaded resources of the source host, and n+m is the number of resource types of the source host.
  17. 一种虚拟机的迁移设备,其特征在于,所述迁移设备包括:A migration device of a virtual machine, wherein the migration device includes:
    处理器,存储器,通信接口和总线,其中,所述处理器、所述存储器和所述通信接口通过所述总线通信;a processor, a memory, a communication interface, and a bus, wherein the processor, the memory, and the communication interface communicate via the bus;
    所述通信接口用于与交换机或控制服务器通信;The communication interface is configured to communicate with a switch or a control server;
    所述存储器用于存放程序;The memory is used to store a program;
    当所述迁移设备运行时,所述处理器用于执行所述存储器存储的所述程序,以执行权利要求1至8任一所述的方法。 The processor is configured to execute the program stored by the memory to perform the method of any one of claims 1 to 8 when the migration device is in operation.
PCT/CN2015/073422 2015-02-28 2015-02-28 Virtual machine migration method, apparatus and device WO2016134542A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2015/073422 WO2016134542A1 (en) 2015-02-28 2015-02-28 Virtual machine migration method, apparatus and device
CN201580001989.0A CN106133693B (en) 2015-02-28 2015-02-28 Moving method, device and the equipment of virtual machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/073422 WO2016134542A1 (en) 2015-02-28 2015-02-28 Virtual machine migration method, apparatus and device

Publications (1)

Publication Number Publication Date
WO2016134542A1 true WO2016134542A1 (en) 2016-09-01

Family

ID=56787814

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/073422 WO2016134542A1 (en) 2015-02-28 2015-02-28 Virtual machine migration method, apparatus and device

Country Status (2)

Country Link
CN (1) CN106133693B (en)
WO (1) WO2016134542A1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108182105A (en) * 2017-12-12 2018-06-19 苏州大学 Local dynamic station moving method and control system based on Docker container techniques
CN110162379A (en) * 2018-04-24 2019-08-23 腾讯云计算(北京)有限责任公司 Virtual machine migration method, device and computer equipment
US20190370080A1 (en) * 2018-05-31 2019-12-05 Salesforce.Com, Inc. Streaming traffic pattern for public cloud auto scaling
US10904303B2 (en) 2018-05-31 2021-01-26 Salesforce.Com, Inc. Control message from streaming source to facilitate scaling
CN112698714A (en) * 2020-12-28 2021-04-23 武汉卓尔信息科技有限公司 Intelligent management method and system for virtual resources when UPS is started
US11150931B2 (en) * 2018-10-30 2021-10-19 Hewlett Packard Enterprise Development Lp Virtual workload migrations
CN114968493A (en) * 2022-06-22 2022-08-30 中国电信股份有限公司 Virtual machine scheduling method and device, computer readable medium and electronic equipment

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107168786B (en) * 2017-06-15 2020-11-10 郑州云海信息技术有限公司 Dynamic migration method and device for virtual machine
CN107291528A (en) * 2017-07-14 2017-10-24 郑州云海信息技术有限公司 The treating method and apparatus of virtual machine (vm) migration
CN110119301A (en) * 2018-02-07 2019-08-13 卓望数码技术(深圳)有限公司 A kind of virtual machine migration method and system
CN111625333A (en) * 2020-05-21 2020-09-04 慧众行知科技(北京)有限公司 Module migration method and system
CN113923215B (en) * 2021-09-09 2023-12-29 深信服科技股份有限公司 Virtual machine scheduling method, electronic equipment and storage medium
CN116932229B (en) * 2023-09-13 2023-12-12 新华三信息技术有限公司 Memory allocation method and device, network manager and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559077A (en) * 2013-11-08 2014-02-05 北京华胜天成科技股份有限公司 Optimized automatic transfer method and system for virtual machines
CN104184813A (en) * 2014-08-20 2014-12-03 杭州华为数字技术有限公司 Load balancing method of virtual machines, related equipment and trunking system
US20140379930A1 (en) * 2008-05-28 2014-12-25 Red Hat, Inc. Load balancing in cloud-based networks

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9098335B2 (en) * 2009-12-23 2015-08-04 Citrix Systems, Inc. Systems and methods for managing spillover limits in a multi-core system
CN102759979B (en) * 2011-04-29 2016-03-30 国际商业机器公司 A kind of energy consumption of virtual machine method of estimation and device
US9152448B2 (en) * 2012-05-11 2015-10-06 Vmware, Inc. Performance of load balancing modules with migration awareness
CN103294546B (en) * 2013-04-03 2016-04-20 华中科技大学 The online moving method of virtual machine of multi-dimensional resource performance interference aware and system
CN104375897B (en) * 2014-10-27 2018-02-27 西安工程大学 Cloud computing resource scheduling method based on the unbalanced degree of minimum relative load
CN104375621A (en) * 2014-11-28 2015-02-25 广东石油化工学院 Dynamic weighting load assessment method based on self-adaptive threshold values in cloud computing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140379930A1 (en) * 2008-05-28 2014-12-25 Red Hat, Inc. Load balancing in cloud-based networks
CN103559077A (en) * 2013-11-08 2014-02-05 北京华胜天成科技股份有限公司 Optimized automatic transfer method and system for virtual machines
CN104184813A (en) * 2014-08-20 2014-12-03 杭州华为数字技术有限公司 Load balancing method of virtual machines, related equipment and trunking system

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108182105A (en) * 2017-12-12 2018-06-19 苏州大学 Local dynamic station moving method and control system based on Docker container techniques
CN108182105B (en) * 2017-12-12 2023-08-15 苏州大学 Local dynamic migration method and control system based on Docker container technology
CN110162379A (en) * 2018-04-24 2019-08-23 腾讯云计算(北京)有限责任公司 Virtual machine migration method, device and computer equipment
US20190370080A1 (en) * 2018-05-31 2019-12-05 Salesforce.Com, Inc. Streaming traffic pattern for public cloud auto scaling
US10904303B2 (en) 2018-05-31 2021-01-26 Salesforce.Com, Inc. Control message from streaming source to facilitate scaling
US11321139B2 (en) * 2018-05-31 2022-05-03 Salesforce.Com, Inc. Streaming traffic pattern for public cloud auto scaling
US11150931B2 (en) * 2018-10-30 2021-10-19 Hewlett Packard Enterprise Development Lp Virtual workload migrations
CN112698714A (en) * 2020-12-28 2021-04-23 武汉卓尔信息科技有限公司 Intelligent management method and system for virtual resources when UPS is started
CN112698714B (en) * 2020-12-28 2022-06-21 武汉卓尔信息科技有限公司 Intelligent management method and system for virtual resources when UPS is started
CN114968493A (en) * 2022-06-22 2022-08-30 中国电信股份有限公司 Virtual machine scheduling method and device, computer readable medium and electronic equipment
CN114968493B (en) * 2022-06-22 2023-12-12 中国电信股份有限公司 Virtual machine scheduling method and device, computer readable medium and electronic equipment

Also Published As

Publication number Publication date
CN106133693B (en) 2019-10-25
CN106133693A (en) 2016-11-16

Similar Documents

Publication Publication Date Title
WO2016134542A1 (en) Virtual machine migration method, apparatus and device
US8230069B2 (en) Server and storage-aware method for selecting virtual machine migration targets
TWI591542B (en) Cloud compute node,method and system,and computer readable medium
US8078824B2 (en) Method for dynamic load balancing on partitioned systems
Wood et al. Sandpiper: Black-box and gray-box resource management for virtual machines
US20190227845A1 (en) Methods and apparatus to improve resource allocation for virtualized server systems
EP2425339B1 (en) Methods and apparatus to get feedback information in virtual environment for server load balancing
US10977086B2 (en) Workload placement and balancing within a containerized infrastructure
US11714668B2 (en) Supporting quality-of-service for virtual machines based on operational events
Shen et al. A resource usage intensity aware load balancing method for virtual machine migration in cloud datacenters
Dargie Estimation of the cost of VM migration
US10489208B1 (en) Managing resource bursting
JP2016103113A5 (en)
US10169102B2 (en) Load calculation method, load calculation program, and load calculation apparatus
US10198295B2 (en) Mechanism for controlled server overallocation in a datacenter
US20160094424A1 (en) Virtual Machine Processor &amp; Memory Resource Coordinator
KR20150009662A (en) Method of allocating a virtual machine for virtual desktop service
Xue et al. Managing data center tickets: Prediction and active sizing
US20200272526A1 (en) Methods and systems for automated scaling of computing clusters
JP2014167713A (en) Information processing device, information processing system, information processing device management program and information processing device management method
KR20230063015A (en) Apparatus and method for managing virtual machine cpu resource in virtualization server
Zhu et al. Optimal primary and backup resource allocation with workload-dependent failure probability
Nam et al. Workload-aware resource management for software-defined compute
Monteiro et al. Qmapper: Dynamic power and performance management in virtualized web servers clusters
Kwak et al. Autonomous learning of load and traffic patterns to improve cluster utilization

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15882980

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15882980

Country of ref document: EP

Kind code of ref document: A1