CN107577518B - Virtual machine deployment method and device - Google Patents

Virtual machine deployment method and device Download PDF

Info

Publication number
CN107577518B
CN107577518B CN201710826022.7A CN201710826022A CN107577518B CN 107577518 B CN107577518 B CN 107577518B CN 201710826022 A CN201710826022 A CN 201710826022A CN 107577518 B CN107577518 B CN 107577518B
Authority
CN
China
Prior art keywords
virtual machine
created
host
operating system
running
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710826022.7A
Other languages
Chinese (zh)
Other versions
CN107577518A (en
Inventor
王亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710826022.7A priority Critical patent/CN107577518B/en
Publication of CN107577518A publication Critical patent/CN107577518A/en
Application granted granted Critical
Publication of CN107577518B publication Critical patent/CN107577518B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a virtual machine deployment method and a virtual machine deployment device, wherein the method comprises the following steps: determining a host of a virtual machine which is running in the same type as the operating system of the virtual machine to be created in a cluster according to the type of the operating system of the virtual machine to be created; and creating a virtual machine to be created on the determined host. According to the embodiment of the invention, as more identical memory pages are arranged among the virtual machines with the same operating system type, the virtual machines with the same operating system type are established on the same host, so that more identical memory pages are arranged on the same host, and more memory pages are merged.

Description

Virtual machine deployment method and device
Technical Field
The present invention relates to virtualization technologies, and in particular, to a method and an apparatus for deploying a virtual machine.
Background
With the development of virtualization technology, the deployment of virtual machines has been increasing. How to run more virtual machines on the same configured host machine in a virtualization environment to save user cost has become a very important issue. In the related art, a memory same page Merging (KSM) technology is used to save memory, specifically, a Kernel of a host scans and checks a running process and compares memory pages of the process, and if it is found that the memory pages are completely the same, the same memory pages are merged into one memory page, so that two or more processes share one memory page, thereby saving the use of memory on the host and realizing that more virtual machines are run on the host with the same configuration.
In the virtualization system, because the virtual machine is also a process, and all memories of the virtual machine are memories applied by the process, the memories can be merged and applied to the virtualization system in the same page, so that the use amount of the memories by the virtual machine is reduced. However, in practical applications, because the same memory pages are few between different virtual machines in a host, that is, there are few memory pages to be merged, the effect of saving the memory on the host by using the memory page merging technology is not obvious.
Disclosure of Invention
In order to solve the above technical problems, the present invention provides a virtual machine deployment method and apparatus, which can implement merging of more identical memory pages on the same host.
In order to achieve the object of the present invention, the present invention provides a virtual machine deployment method including:
determining a host of a virtual machine which is running in the same type as the operating system of the virtual machine to be created in a cluster according to the type of the operating system of the virtual machine to be created;
and creating a virtual machine to be created on the determined host.
Further, if the number of the determined hosts is multiple, before creating the virtual machine to be created, the method further includes:
and selecting a host used for creating the virtual machine to be created from the determined hosts according to a preset first rule.
Further, if there is no host running a virtual machine of the operating system type corresponding to the virtual machine to be created in the cluster, the method further includes:
and selecting a host machine used for creating the virtual machine to be created from the host machines in the cluster according to a preset second rule.
Further, still include:
after the created virtual machine is restarted, if the created virtual machine and the virtual machine in the cluster running the operating system type of the created virtual machine run on different hosts, migrating the created virtual machine and the virtual machine in the cluster running the operating system type of the created virtual machine to the same host in the cluster.
Further, the migrating the created virtual machine and the virtual machine within the cluster that is running the operating system type as the created virtual machine onto the same host within the cluster includes:
determining to migrate the created virtual machine and the virtual machines running the operating system type of the created virtual machine in the cluster to two or more migration paths on the same host according to the host running the created virtual machine and the host running the virtual machine of the operating system type of the created virtual machine;
selecting a migration path from the determined two or more migration paths;
and migrating the created virtual machine and the virtual machine which is running the operating system type of the created virtual machine in the cluster to the same host machine in the cluster according to the selected migration path.
Further, the selecting a migration path from the determined two or more migration paths includes:
for each determined migration path, calculating the migration times of the virtual machine during migration according to the migration path;
and selecting a migration path with the least virtual machine migration times.
Further, the selecting a migration path from the determined two or more migration paths includes:
for each determined migration path, determining the total virtual machine load capacity of the virtual machine which is loaded with the created virtual machine after migration according to the migration path and the host which is running the virtual machine of the operating system type of the created virtual machine;
and selecting the migration path with the least total virtual machine load of the host.
Further, the determining a host machine within the cluster that is running a virtual machine of the same operating system type as the virtual machine to be created includes:
reading the operating system type of each virtual machine running on the host machines in the cluster from the virtual machine configuration information stored in the database;
and if the type of the operating system of the running virtual machine is read to be the same as that of the operating system of the virtual machine to be created, determining the host of the running virtual machine.
The invention provides a virtual machine deployment device, comprising:
the determining module is used for determining a host machine of a virtual machine which is running the same as the operating system type of the virtual machine to be created in the cluster according to the operating system type of the virtual machine to be created;
and the creating module is used for creating the virtual machine to be created on the determined host.
Further, if the determined number of the hosts is multiple, the method further includes:
and the first selection module is used for selecting a host used for creating the virtual machine to be created from the determined hosts according to a preset first rule.
Further, if there is no host running a virtual machine of the operating system type corresponding to the virtual machine to be created in the cluster, the method further includes:
and the second selection module is used for selecting a host used for creating the virtual machine to be created from the hosts in the cluster according to a preset second rule.
Further, still include:
and after the created virtual machine is restarted, if the created virtual machine and the virtual machine in the cluster, which is running on the operating system type of the created virtual machine, run on different hosts, migrating the created virtual machine and the virtual machine in the cluster, which is running on the operating system type of the created virtual machine, to the same host in the cluster.
Further, the migration module includes:
a first determining unit, configured to determine, according to a host running the created virtual machine and a host running a virtual machine of an operating system type corresponding to the created virtual machine, two or more migration paths for migrating the created virtual machine and the virtual machine in the cluster running the operating system type corresponding to the created virtual machine to the same host;
a second determination unit configured to select a migration path among the determined two or more migration paths;
and the migration unit is used for migrating the created virtual machine and the virtual machine which runs the operating system type of the created virtual machine in the cluster to the same host in the cluster according to the selected migration path.
Further, the second determination unit is specifically configured to,
for each determined migration path, calculating the migration times of the virtual machine during migration according to the migration path;
and selecting a migration path with the least virtual machine migration times.
Further, the second determination unit is specifically configured to,
for each determined migration path, determining the total virtual machine load capacity of the virtual machine which is loaded with the created virtual machine after migration according to the migration path and the host which is running the virtual machine of the operating system type of the created virtual machine;
and selecting the migration path with the least total virtual machine load of the host.
Further, the determining module includes:
the reading unit is used for reading the operating system type of each virtual machine running on the host in the cluster from the virtual machine configuration information stored in the database;
and a third determining unit, configured to determine a host of the running virtual machine if the operating system type of the running virtual machine is read to be the same as the operating system type of the virtual machine to be created.
The method at least comprises the steps of determining a host machine of a virtual machine which is running the same as the operating system type of the virtual machine to be created in a cluster according to the operating system type of the virtual machine to be created; and creating a virtual machine to be created on the determined host. It can be seen from the embodiments of the present invention that, because there are more same memory pages between virtual machines of the same operating system type, virtual machines of the same operating system type are created on the same host, so that more same memory pages are merged on the same host, and the memory on the host is obviously saved, thereby implementing more virtual machines running on the host with the same configuration.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the example serve to explain the principles of the invention and not to limit the invention.
Fig. 1 is a flowchart illustrating a virtual machine deployment method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a virtual machine deployment apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of another virtual machine deployment apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
An embodiment of the present invention provides a virtual machine deployment method, as shown in fig. 1, the virtual machine deployment method including:
step 101, determining a host of a virtual machine which is running the same as the operating system type of the virtual machine to be created in the cluster according to the operating system type of the virtual machine to be created.
Wherein the operating system types include: windows operating system, Linux operating system, Unix operating system, and MAC operating system, the operating system type of the virtual machine to be created is from user input. Because the running virtual machine only occupies the memory of the host machine, the host machine in the cluster running the virtual machine with the same type of operating system as the virtual machine to be created is determined. For example, there are A, B and C three hosts in the cluster, a virtual machine of the Windows operating system is running on the a host, a virtual machine of the Linux operating system is running on the B host, and a virtual machine of the Unix operating system is running on the C host, and when the operating system type of the virtual machine to be created is the Windows operating system, the a host of the virtual machine of the Windows operating system is determined to be running in the cluster.
And 102, creating a virtual machine to be created on the determined host.
By establishing the virtual machines to be established on the determined host, the virtual machines of the same operating system type are operated on the same host, so that the host has more same memory pages, and the more same memory pages can be combined, thereby saving the memory of the host and establishing more virtual machines on the host. The implementation of creating the virtual machine may be implemented in a manner in the related art, and the specific implementation is not used to limit the protection scope of the present invention, and is not described herein again.
Further, on the basis of the corresponding embodiment in fig. 1, if the determined number of hosts is multiple, after step 101 and before step 102, the method further includes:
and 103, selecting a host used for creating the virtual machine to be created from the determined hosts according to a preset first rule.
Specifically, the preset first rule includes: and randomly selecting one host from the determined hosts or selecting the host with the least total virtual machine load from the determined hosts.
Further, on the basis of the corresponding embodiment in fig. 1, if there is no host running a virtual machine of an operating system type corresponding to the virtual machine to be created in the cluster, the method further includes:
and 104, selecting a host machine for creating the virtual machine to be created from the host machines in the cluster according to a preset second rule.
Specifically, the preset second rule includes: and randomly selecting one host from the determined hosts or selecting the host with the least total virtual machine load from the determined hosts. The first rule and the second rule may be the same or different.
In addition, if the determined total virtual machine load capacity of the host used for creating the virtual machine to be created reaches the maximum load value of the host, the virtual machine to be created can be created on a host which is not running the virtual machine. For example, there are A, B and C hosts in the cluster, a virtual machine running a Windows operating system is on the a host, a virtual machine running a Linux operating system is on the B host, and a virtual machine is not running on the C host, and the total load of the virtual machines running on the a host has reached the maximum load value of the a host, that is, a virtual machine cannot be added to the a host.
Further, on the basis of the corresponding embodiment in fig. 1, after step 102, the method further includes:
and 105, after the created virtual machine is restarted, if the created virtual machine and the virtual machine which is running on the operating system type of the created virtual machine in the cluster are running on different hosts, migrating the created virtual machine and the virtual machine which is running on the operating system type of the created virtual machine in the cluster to the same host in the cluster.
After a virtual machine is created on one host, the virtual machine may run on the host, and if the virtual machine is restarted, a host to be run on the virtual machine may be newly allocated to the virtual machine according to a preset policy, so that the host running the virtual machine may change after the virtual machine is restarted, and is not necessarily the host used for creating the virtual machine before, that is, after the virtual machine is restarted, a situation that the virtual machines of the same operating system type run on different hosts may occur. For example, there are A, B and C hosts in the cluster, and a virtual machine is created on the a host, where the virtual machine is running on the a host, and if the virtual machine is restarted, the virtual machine will run on the B host or the C host. It can be seen from the above that the virtual machines of the same operating system type run on different hosts, and if the two virtual machines run on different hosts, the two virtual machines can be migrated to the same host in the cluster to run, so as to keep the virtual machines of the same operating system type running on the same host.
Further, step 105 comprises:
step 1051, determining to migrate the created virtual machine and the virtual machine of the operating system type running and created virtual machine in the cluster to two or more migration paths on the same host according to the host running the created virtual machine and the host running the virtual machine of the operating system type running and created virtual machine.
Determining a host running the created virtual machine and a host running the virtual machine of the operating system type of the created virtual machine, and determining a migration path after determining the hosts, wherein the migration path comprises: migrating the created virtual machine to a host of a virtual machine that is running the operating system type of the created virtual machine and migrating a virtual machine that is running the operating system type of the created virtual machine to the created virtual machine. In other words, there are several hosts that are running the created virtual machine and several hosts that are running the virtual machine of the operating system type with the created virtual machine, and there are several migration paths.
For example, there are A, B and C hosts in the cluster, the virtual machine to be created is an L virtual machine, the virtual machines of the operating system type that are running and created are an M virtual machine and an N virtual machine, both running on a B host, and when creating the L virtual machine, the virtual machine is selected to be created on the B host. After the L virtual machine is created on the B host, if the L virtual machine is restarted, the L virtual machine runs on the a host. The running condition at this moment is that the L virtual machine runs on the host A, the M virtual machine and the N virtual machine run on the host B, and the first migration path is to migrate the L virtual machine to the host B, so that the L virtual machine, the M virtual machine and the N virtual machine run on the host B; the second migration path is to migrate the M virtual machine and the N virtual machine to the a host, so that the L virtual machine, the M virtual machine, and the N virtual machine run on the a host.
Step 1052, selecting a migration path among the determined two or more migration paths.
And 1053, migrating the created virtual machine and the virtual machine which runs the operating system type of the created virtual machine in the cluster to the same host machine in the cluster according to the selected migration path.
Further, there are two implementations to implement step 1052.
In a first mode, step 1052 includes:
for each determined migration path, calculating the migration times of the virtual machine during migration according to the migration path; and selecting a migration path with the least virtual machine migration times.
After the migration paths are determined, for each migration path, whether the created virtual machine and the running virtual machine which is the same as the operating system type of the created virtual machine are migrated or not is known, and the number of the virtual machines participating in migration is calculated, wherein the number of the virtual machines participating in migration is the virtual machine migration number of the migration path.
For example, there are two migration paths, the first migration path is to migrate an L virtual machine to a B host, so that the B host runs the L virtual machine, an M virtual machine, and an N virtual machine; the second migration path is to migrate the M virtual machine and the N virtual machine to the a host, so that the L virtual machine, the M virtual machine, and the N virtual machine run on the a host. In the two migration paths, when migration is performed according to the first migration path, a virtual machine (L virtual machine) needs to be migrated to the B host, that is, the number of times of virtual machine migration when migration is performed according to the migration path is 1; when migration is performed according to the second migration path, two virtual machines (M virtual machine and N virtual machine) need to be migrated to the host a, that is, the number of times of virtual machine migration when migration is performed according to the migration path is 2. From the above analysis, migration is performed according to a migration path (i.e., the first migration path) in which the number of times of virtual machine migration is 1, so that the migration workload is reduced, and the migration efficiency is improved.
In the second mode, step 1052 includes:
for each determined migration path, determining the load of the virtual machine created by load after migration according to the migration path and the total virtual machine load of the host of the virtual machine which runs and is the operating system type of the virtual machine created; and selecting the migration path with the least total virtual machine load of the host.
For example, there are two migration paths, the first migration path is to migrate an L virtual machine to a B host, so that the B host runs the L virtual machine, an M virtual machine, and an N virtual machine; the second migration path is to migrate the M virtual machine and the N virtual machine to the a host, so that the L virtual machine, the M virtual machine, and the N virtual machine run on the a host. In the first migration path, if the migration path is followed, the total virtual machine load capacity of the hosts that load the L virtual machine, the M virtual machine, and the N virtual machine is 6, and in the second migration path, if the migration path is followed, the total virtual machine load capacity of the hosts that load the L virtual machine, the M virtual machine, and the N virtual machine is 4. From the above analysis, it can be derived that migration paths (i.e., the second migration paths) with a total virtual machine load of 4 are selected for migration, so that the load of each host is more balanced.
The two ways can also be combined to select the path to be migrated.
For example, in the first mode, after the number of virtual machine migrations during migration according to each migration path is calculated, if the number of migration paths with the smallest number of virtual machine migrations is two or more, one migration path is selected from the migration paths with the smallest number of virtual machine migrations, wherein after migration according to the selected migration path, the total virtual machine load capacity of the virtual machine that is created and the host that is running the virtual machine of the operating system type of the virtual machine that is created is smallest.
For another example, in the second method, when the migration path is selected, if the number of the migration paths with the smallest total virtual machine load of the host is two or more, for each migration path, the migration times of the created virtual machine and the virtual machine that is running and running the operating system type of the created virtual machine to the same host are calculated, and the migration path with the smallest virtual machine migration times is selected.
Further, on the basis of the corresponding embodiment in fig. 1, step 101 includes:
reading the operating system type of each virtual machine running on a host machine in the cluster from the virtual machine configuration information stored in the database; and if the operating system type of the running virtual machine is read to be the same as that of the virtual machine to be created, determining the host of the running virtual machine.
Although the virtual machine is created on the host, the virtual machine configuration information including the operating system type of the created virtual machine is stored in a database that is stored on the virtualization management platform. Specifically, the virtual machine configuration information stored in the database is scanned to read the operating system type of each running virtual machine from the virtual machine configuration information, and if the operating system type of a running virtual machine is read to be the same as that of the virtual machine to be created, the host of the running virtual machine is the determined host for creating the virtual machine to be created.
The main body that executes any of the above virtual machine deployment methods is a virtualization management platform.
The virtual machine deployment method provided by the embodiment of the invention determines a host machine of a virtual machine which is running in a cluster and has the same type as the operating system of the virtual machine to be created according to the type of the operating system of the virtual machine to be created; and creating a virtual machine to be created on the determined host. It can be seen from the embodiments of the present invention that, because there are more same memory pages between virtual machines of the same operating system type, virtual machines of the same operating system type are created on the same host, so that more same memory pages are merged on the same host, and the memory on the host is obviously saved, thereby implementing more virtual machines running on the host with the same configuration.
An embodiment of the present invention provides a virtual machine deployment device, as shown in fig. 2, where the virtual machine deployment device 2 includes:
the determining module 21 is configured to determine, according to the operating system type of the virtual machine to be created, a host in the cluster, where the virtual machine is running, the host being the same as the operating system type of the virtual machine to be created.
And a creating module 22, configured to create a virtual machine to be created on the determined host.
Further, on the basis of the embodiment corresponding to fig. 2, if the number of the determined hosts is multiple, the present invention provides another virtual machine deployment apparatus, as shown in fig. 3, where the virtual machine deployment apparatus 2 further includes:
the first selecting module 23 is configured to select, according to a preset first rule, a host used for creating a virtual machine to be created from the determined hosts.
Further, if there is no host running a virtual machine of the operating system type corresponding to the virtual machine to be created in the cluster, as shown in fig. 3, the virtual machine deployment apparatus 2 further includes:
and a second selecting module 24, configured to select, according to a preset second rule, a host used for creating the virtual machine to be created from the hosts in the cluster.
Further, as shown in fig. 3, the virtual machine deployment apparatus 2 further includes:
and a migration module 25, configured to, after the created virtual machine is restarted, migrate the created virtual machine and the virtual machine in the cluster, which is running the operating system type of the created virtual machine, to the same host in the cluster if the created virtual machine and the virtual machine in the cluster, which is running the operating system type of the created virtual machine, are running on different hosts.
Further, as shown in fig. 3, the migration module 25 includes:
the first determining unit 251 is configured to determine, according to the host running the created virtual machine and the host running the virtual machine of the operating system type of the virtual machine, to migrate the created virtual machine and the virtual machine of the operating system type of the virtual machine running and created within the cluster to two or more migration paths on the same host.
A second determining unit 252, configured to select a migration path from the determined two or more migration paths.
And a migration unit 253, configured to migrate the created virtual machine and the virtual machine in the cluster, which is running the operating system type of the created virtual machine, to the same host in the cluster according to the selected migration path.
Further, the second determination unit 252 is specifically configured to,
for each determined migration path, calculating the migration times of the virtual machine during migration according to the migration path; and selecting a migration path with the least virtual machine migration times.
Further, the second determination unit 252 is specifically configured to,
for each determined migration path, determining the load of the virtual machine created by load after migration according to the migration path and the total virtual machine load of the host of the virtual machine which runs and is the operating system type of the virtual machine created; and selecting the migration path with the least total virtual machine load of the host.
Further, as shown in fig. 3, the determining module 21 includes:
a reading unit 211, configured to read, from the virtual machine configuration information stored in the database, an operating system type of each virtual machine running on a host in the cluster.
A third determining unit 212, configured to determine a host of the running virtual machine if the operating system type of the running virtual machine is read to be the same as the operating system type of the virtual machine to be created.
In practical applications, the determining module 21, the creating module 22, the first selecting module 23, the second selecting module 24, and the migrating module 25 may be implemented by a CPU, a Microprocessor (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like in the virtual machine deploying device 2.
The virtual machine deployment device provided by the embodiment of the invention determines a host machine of a virtual machine which is running in a cluster and has the same type as the operating system of the virtual machine to be created according to the type of the operating system of the virtual machine to be created; and creating a virtual machine to be created on the determined host. It can be seen from the embodiments of the present invention that, because there are more same memory pages between virtual machines of the same operating system type, virtual machines of the same operating system type are created on the same host, so that more same memory pages are merged on the same host, and the memory on the host is obviously saved, thereby implementing more virtual machines running on the host with the same configuration.
An embodiment of the present invention provides another virtual machine deployment apparatus, where the virtual machine deployment apparatus includes a memory, a processor, and a computer program that is stored in the memory and is executable on the processor, and the steps implemented when the processor executes the computer program include:
determining a host of a virtual machine which is running in the same type as the operating system of the virtual machine to be created in a cluster according to the type of the operating system of the virtual machine to be created;
and creating a virtual machine to be created on the determined host.
Further, if the determined number of the hosts is multiple, the step implemented when the processor executes the computer program further includes:
and selecting a host used for creating the virtual machine to be created from the determined hosts according to a preset first rule.
Further, if there is no host running a virtual machine of the operating system type corresponding to the virtual machine to be created in the cluster, the steps implemented when the processor executes the computer program further include:
and selecting a host machine for creating the virtual machine to be created from the host machines in the cluster according to a preset second rule.
Further, the steps implemented when the processor executes the computer program further include:
after the created virtual machine is restarted, if the created virtual machine and the virtual machine in the cluster running the operating system type of the created virtual machine are running on different hosts, the created virtual machine and the virtual machine in the cluster running the operating system type of the created virtual machine are migrated to the same host in the cluster.
Further, the steps implemented when the processor executes the computer program specifically include:
determining two or more migration paths for migrating the created virtual machine and the virtual machines of the operating system types of the running and created virtual machines in the cluster to the same host according to the host running the created virtual machine and the host running the virtual machines of the operating system types of the running and created virtual machines;
selecting a migration path from the determined two or more migration paths;
and migrating the created virtual machine and the virtual machine which is running the operating system type of the created virtual machine in the cluster to the same host machine in the cluster according to the selected migration path.
Further, the steps implemented when the processor executes the computer program specifically include:
for each determined migration path, calculating the migration times of the virtual machine during migration according to the migration path;
and selecting a migration path with the least virtual machine migration times.
Further, the steps implemented when the processor executes the computer program specifically include:
for each determined migration path, determining the load of the virtual machine created by load after migration according to the migration path and the total virtual machine load of the host of the virtual machine which runs and is the operating system type of the virtual machine created;
and selecting the migration path with the least total virtual machine load of the host.
Further, the steps implemented when the processor executes the computer program specifically include:
reading the operating system type of each virtual machine running on a host machine in the cluster from the virtual machine configuration information stored in the database;
and if the operating system type of the running virtual machine is read to be the same as that of the virtual machine to be created, determining the host of the running virtual machine.
Although the embodiments of the present invention have been described above, the above description is only for the convenience of understanding the present invention, and is not intended to limit the present invention. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (14)

1. A method of deploying a virtual machine, comprising:
determining a host of a virtual machine which is running in the same type as the operating system of the virtual machine to be created in a cluster according to the type of the operating system of the virtual machine to be created;
creating a virtual machine to be created on the determined host;
after the virtual machine is established on the host machine, the virtual machine runs on the host machine, if the established virtual machine is restarted, the host machine of the virtual machine to be run is distributed to the virtual machine again according to a preset strategy, and then whether the host machine of the virtual machine to be run changes is judged;
if the created virtual machine and the virtual machine which is in the cluster and runs the same type as the operating system of the created virtual machine run on different hosts, migrating the created virtual machine and the virtual machine which is in the cluster and runs the same type as the operating system of the created virtual machine to the same host in the cluster.
2. The method for deploying a virtual machine according to claim 1, wherein if the number of the determined hosts is plural, before the creating the virtual machine to be created, the method further comprises:
and selecting a host used for creating the virtual machine to be created from the determined hosts according to a preset first rule.
3. The virtual machine deployment method of claim 1, wherein if there is no host within the cluster running a virtual machine of the operating system type of the virtual machine to be created, further comprising:
and selecting a host machine used for creating the virtual machine to be created from the host machines in the cluster according to a preset second rule.
4. The virtual machine deployment method of claim 1 wherein said migrating said created virtual machine and a virtual machine within said cluster that is running an operating system type as said created virtual machine onto the same host within said cluster comprises:
determining to migrate the created virtual machine and virtual machines running the operating system type of the created virtual machine to more than two migration paths on the same host machine according to the host machine running the created virtual machine and the host machine running the operating system type of the virtual machine;
selecting a migration path from the determined two or more migration paths;
and migrating the created virtual machine and the virtual machine which is running the operating system type of the created virtual machine in the cluster to the same host machine in the cluster according to the selected migration path.
5. The method according to claim 4, wherein said selecting a migration path among the two or more determined migration paths comprises:
for each determined migration path, calculating the migration times of the virtual machine during migration according to the migration path;
and selecting a migration path with the least virtual machine migration times.
6. The method according to claim 4, wherein said selecting a migration path among the two or more determined migration paths comprises:
for each determined migration path, determining the total virtual machine load capacity of the virtual machine which is loaded with the created virtual machine after migration according to the migration path and the host which is running the virtual machine of the operating system type of the created virtual machine;
and selecting the migration path with the least total virtual machine load of the host.
7. The virtual machine deployment method of any of claims 1 to 6, wherein said determining a host within a cluster that is running a virtual machine of the same operating system type as the virtual machine to be created, comprises:
reading the operating system type of each virtual machine running on the host machines in the cluster from the virtual machine configuration information stored in the database;
and if the type of the operating system of the running virtual machine is read to be the same as that of the operating system of the virtual machine to be created, determining the host of the running virtual machine.
8. A virtual machine deployment device, comprising:
the determining module is used for determining a host machine of a virtual machine which is running the same as the operating system type of the virtual machine to be created in the cluster according to the operating system type of the virtual machine to be created;
the creating module is used for creating a virtual machine to be created on the determined host;
and after the created virtual machine is restarted, if the created virtual machine and the virtual machine in the cluster, which runs the same type as the operating system of the created virtual machine, run on different hosts, migrating the created virtual machine and the virtual machine in the cluster, which runs the same type as the operating system of the created virtual machine, to the same host in the cluster.
9. The virtual machine deployment apparatus according to claim 8, further comprising, if the determined number of hosts is multiple:
and the first selection module is used for selecting a host used for creating the virtual machine to be created from the determined hosts according to a preset first rule.
10. The virtual machine deployment apparatus according to claim 8, further comprising, if there is no host running a virtual machine of an operating system type corresponding to the virtual machine to be created within the cluster:
and the second selection module is used for selecting a host used for creating the virtual machine to be created from the hosts in the cluster according to a preset second rule.
11. The virtual machine deployment device of claim 8, wherein the migration module comprises:
a first determining unit, configured to determine, according to a host that is running the created virtual machine and a host that is running a virtual machine of an operating system type corresponding to the created virtual machine, to migrate the created virtual machine and the virtual machine in the cluster that is running the operating system type corresponding to the created virtual machine to two or more migration paths on the same host;
a second determination unit configured to select a migration path from the determined two or more migration paths;
and the migration unit is used for migrating the created virtual machine and the virtual machine which runs the operating system type of the created virtual machine in the cluster to the same host in the cluster according to the selected migration path.
12. The virtual machine deployment device according to claim 11, wherein the second determining unit is specifically configured to,
for each determined migration path, calculating the migration times of the virtual machine during migration according to the migration path;
and selecting a migration path with the least virtual machine migration times.
13. The virtual machine deployment device according to claim 11, wherein the second determining unit is specifically configured to,
for each determined migration path, determining the total virtual machine load capacity of the virtual machine which is loaded with the created virtual machine after migration according to the migration path and the host which is running the virtual machine of the operating system type of the created virtual machine;
and selecting the migration path with the least total virtual machine load of the host.
14. The virtual machine deployment device according to any one of claims 8 to 13, wherein the determining module comprises:
the reading unit is used for reading the operating system type of each virtual machine running on the host in the cluster from the virtual machine configuration information stored in the database;
and a third determining unit, configured to determine a host of the running virtual machine if the operating system type of the running virtual machine is read to be the same as the operating system type of the virtual machine to be created.
CN201710826022.7A 2017-09-14 2017-09-14 Virtual machine deployment method and device Active CN107577518B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710826022.7A CN107577518B (en) 2017-09-14 2017-09-14 Virtual machine deployment method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710826022.7A CN107577518B (en) 2017-09-14 2017-09-14 Virtual machine deployment method and device

Publications (2)

Publication Number Publication Date
CN107577518A CN107577518A (en) 2018-01-12
CN107577518B true CN107577518B (en) 2021-05-04

Family

ID=61035884

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710826022.7A Active CN107577518B (en) 2017-09-14 2017-09-14 Virtual machine deployment method and device

Country Status (1)

Country Link
CN (1) CN107577518B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062666A (en) * 2018-07-27 2018-12-21 浪潮电子信息产业股份有限公司 A kind of cluster virtual machine management method and relevant apparatus
CN109271257A (en) * 2018-10-11 2019-01-25 郑州云海信息技术有限公司 A kind of method and apparatus of virtual machine (vm) migration deployment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9274823B1 (en) * 2014-12-24 2016-03-01 Parallels IP Holdings GmbH Thin hypervisor for native execution of unsafe code
CN106462442A (en) * 2014-07-24 2017-02-22 谷歌公司 System and method of loading virtual machines

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729254A (en) * 2013-12-31 2014-04-16 国网山东省电力公司 Virtual server Virtual CPU resource monitoring and dynamic allocation method
WO2015100681A1 (en) * 2013-12-31 2015-07-09 华为技术有限公司 Gpu virtualization implementation method, and related apparatus and system
CN104035822A (en) * 2014-05-28 2014-09-10 中国科学院计算技术研究所 Low-cost efficient internal storage redundancy removing method and system
CN104156255B (en) * 2014-07-31 2017-10-17 华为技术有限公司 A kind of virtual machine migration method, virtual machine (vm) migration device and source physical host
CN106155933B (en) * 2016-07-06 2019-02-05 乾云众创(北京)信息科技研究院有限公司 A kind of virutal machine memory sharing method combined based on KSM and Pass-through

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106462442A (en) * 2014-07-24 2017-02-22 谷歌公司 System and method of loading virtual machines
US9274823B1 (en) * 2014-12-24 2016-03-01 Parallels IP Holdings GmbH Thin hypervisor for native execution of unsafe code

Also Published As

Publication number Publication date
CN107577518A (en) 2018-01-12

Similar Documents

Publication Publication Date Title
WO2018010654A1 (en) Method, device, and system for virtual machine live migration
US8082400B1 (en) Partitioning a memory pool among plural computing nodes
US10025503B2 (en) Autonomous dynamic optimization of platform resources
US9798471B2 (en) Performance of de-clustered disk array by disk grouping based on I/O statistics
US9477427B2 (en) Storage tiering based on virtual machine operations and virtual volume type
US20140089921A1 (en) Method and system for managing virtual machine disks
US20150236978A1 (en) Managing resources in a distributed system using dynamic clusters
US11924117B2 (en) Automated local scaling of compute instances
US20210373971A1 (en) Cross-cluster load balancer
KR20060046260A (en) Systems and methods for implementing an operating system in a virtual machine environment
CN109995814B (en) Cloud host resource migration method and device, communication equipment and storage medium
JP5923627B2 (en) Method and apparatus for coordinating I / O channels on a virtual platform
CN110704161B (en) Virtual machine creation method and device and computer equipment
CN107577518B (en) Virtual machine deployment method and device
US20220035662A1 (en) Scheduling workloads on a common set of resources by multiple schedulers operating independently
US20150358404A1 (en) Dynamic virtual machine storage usage monitoring, provisioning, and migration
CN114048006A (en) Virtual machine dynamic migration method and device and storage medium
US10795821B2 (en) Memory efficient key-value store
CN109002348B (en) Load balancing method and device in virtualization system
CN112631994A (en) Data migration method and system
KR20210127427A (en) Method and apparatus for cpu virtualization in multicore embedded system
CN106325972B (en) Virtual machine management method and network equipment
US10379912B2 (en) Data storage allocation utilizing virtual machine resource allocation
US11093138B2 (en) Optimizing virtual machine storage performance in a stretched cluster
US8799616B2 (en) Method and system for preferred CPU binding on virtual partitions

Legal Events

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