(19)
(11)EP 3 188 008 B1

(12)EUROPEAN PATENT SPECIFICATION

(45)Mention of the grant of the patent:
02.09.2020 Bulletin 2020/36

(21)Application number: 15837577.4

(22)Date of filing:  02.07.2015
(51)International Patent Classification (IPC): 
G06F 9/445(2018.01)
G06F 9/455(2018.01)
(86)International application number:
PCT/CN2015/083215
(87)International publication number:
WO 2016/034015 (10.03.2016 Gazette  2016/10)

(54)

VIRTUAL MACHINE MIGRATION METHOD AND DEVICE

VERFAHREN UND VORRICHTUNG ZUR MIGRATION EINER VIRTUELLEN MASCHINE

PROCÉDÉ ET DISPOSITIF DE MIGRATION DE MACHINE VIRTUELLE


(84)Designated Contracting States:
AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR

(30)Priority: 04.09.2014 CN 201410448483

(43)Date of publication of application:
05.07.2017 Bulletin 2017/27

(73)Proprietor: Huawei Technologies Co., Ltd.
Longgang District Shenzhen, Guangdong 518129 (CN)

(72)Inventor:
  • PENG, Qingxiang
    Shenzhen Guangdong 518129 (CN)

(74)Representative: Thun, Clemens 
Mitscherlich PartmbB Patent- und Rechtsanwälte Sonnenstraße 33
80331 München
80331 München (DE)


(56)References cited: : 
CN-A- 101 876 921
CN-A- 102 821 158
CN-A- 104 281 484
US-A1- 2007 220 248
US-A1- 2010 257 269
US-A1- 2011 265 084
US-A1- 2014 007 085
CN-A- 102 571 698
CN-A- 104 239 122
US-A1- 2007 083 917
US-A1- 2008 040 714
US-A1- 2011 246 669
US-A1- 2013 085 989
  
  • Unknown ET AL: "Experimental study of virtual machine migration in support of reservation of cluster resources", Virtualization technology in distributed computing, 1 January 2007 (2007-01-01), pages 1-8, XP055550321, 2 Penn Plaza, Suite 701 New York NY 10121-0701 USA DOI: 10.1145/1408654.1408659 ISBN: 978-1-59593-897-8
  
Note: Within nine months from the publication of the mention of the grant of the European patent, any person may give notice to the European Patent Office of opposition to the European patent granted. Notice of opposition shall be filed in a written reasoned statement. It shall not be deemed to have been filed until the opposition fee has been paid. (Art. 99(1) European Patent Convention).


Description

TECHNICAL FIELD



[0001] The present invention relates to the field of computer technologies, and in particular, to a virtual machine migration method and apparatus.

BACKGROUND



[0002] A VM (Virtual Machine, virtual machine) refers to a complete software-simulated computer system that has full hardware system functions and that runs in an absolutely isolated environment. In the prior art, users obtain, by logging in to a VM on a cloud computing platform (cloud platform for short), resources and services shared on the cloud platform, to complete their work. Currently, there are mainly two usage scenarios of the VM on the cloud platform: One is a virtual desktop, and the other is a virtual server. A function of the virtual desktop is to allow a user to carry out daily office work by using the VM on the cloud platform instead of using a physical machine; a function of the virtual server is to build a service system such as a database or a network for a virtual desktop user by using the VM. In some scenarios, for example, when an existing cloud platform is no longer used and is replaced with a new cloud platform, or due to work requirements, a virtual desktop user on a cloud platform cannot log in to a VM on the original cloud platform to carry out work, and needs to log in to another cloud platform to carry out the original work, migration needs to be performed on the VM on the original cloud platform.

[0003] According to a current VM migration implementation solution, data in a source VM disk is copied by using an agent plug-in installed in a VM on a source cloud platform (source VM for short) and transmitted to a disk in a VM on a destination cloud platform (destination VM for short), and migration from the source VM to the destination VM is complete until all data in the source VM disk is copied to the destination VM disk. The data in the source VM includes an operating system, and a database, a network, or application software that implements various services required by a user.

[0004] During implementation of the present invention, the inventor finds that the prior art has at least the following problems:
According to the existing VM migration implementation solution, data migration can be performed only on a VM corresponding to the virtual server - one of the two usage scenarios of the VM on the cloud platform, to migrate all the data in the source VM to the destination VM. However, after data migration is performed on a VM corresponding to the other application scenario of the VM on the cloud platform, that is, performed on a VM corresponding to the virtual desktop, when a virtual desktop user wants to use the virtual desktop corresponding to the VM in which data has been migrated, because no user name is stored on a destination VM, the user cannot log in to the destination VM by using a user name that is set on the source VM, and needs to register a new user name. Operations are complex, and user experience of the virtual desktop user is degraded.

[0005] US 2014/007085 A1 discloses a technical solution of adjusting administrative access based on workload migration.

[0006] US 2011/265084 A1 provides a system of transferring a running virtual machine from a first to a second physical machine, where each of the physical machines has a different instruction set architecture.

[0007] US 2011/246669 A1 discloses that in cooperation between each data center and a WAN, virtual machine migration is carried out without interruption in processing so as to enable effective power-saving implementation, load distribution, or fault countermeasure processing.

[0008] US 2007/083917 A1 facilitates deploying a new authentication protocol in an established application environment.

[0009] US 2007/220248 A1 gathers configuration settings from a source system to apply to a target system. A source system is queried to determine configuration settings in the source system. A target system is queried to determine configuration settings in the target system.

[0010] US 2008/040714 A1 provides a method including: obtaining a plurality of source computers with corresponding users and preparing the source computers such that at least one software image is created, based on a software inventory, for the source computers to be used to migrate the source computers and the users to a plurality of target computers.

[0011] US 2013/085989 A1 relates to a cloud information migration method.

SUMMARY



[0012] To resolve a problem in the prior art, embodiments of the present invention provide a virtual machine migration method and apparatus. The technical solutions are as follows:
In a first aspect a virtual machine migration method performed by a virtual machine migration apparatus is provided, wherein the method comprises:
  • receiving an identifier of a source virtual machine corresponding to a virtual desktop, VM, input by an administrator into the virtual machine migration apparatus and receiving an identifier of a destination VM input by the administrator into the virtual machine migration apparatus, wherein the source VM is located on a source cloud platform and the destination VM is located on a destination cloud platform;
  • sending an instruction to both, the source VM and the destination VM, wherein the instruction is used to instruct the corresponding VM to switch to a maintenance mode in which a specified virtual desktop user cannot perform operations on any data of the corresponding VM;
  • migrating the data in the source VM, being in the maintenance mode, to the destination VM, being in the maintenance mode, according to the identifier of the source VM and the identifier of the destination VM;
  • obtaining a first mapping relationship, pre-stored on the source cloud platform, between the source VM, being in the maintenance mode, and the specified virtual desktop user when the data in the source VM are migrated to the destination VM, being in the maintenance mode;
  • configuring a second mapping relationship between the destination VM, being in the maintenance mode, and the specified virtual desktop user according to the obtained first mapping relationship between the source VM, being in the maintenance mode, and the specified virtual desktop user;
    wherein the configuring the second mapping relationship between the destination VM, being in the maintenance mode, and the specified virtual desktop user according to the obtained first mapping relationship between the source VM, being in the maintenance mode, and the specified virtual desktop user comprises: obtaining a correspondence between the identifier of the source VM, being in the maintenance mode, and a user identifier of the specified virtual desktop user in the first mapping relationship, and mapping the identifier of the destination VM, being in the maintenance mode, with the user identifier of the specified virtual desktop user according to the correspondence between the identifier of the source VM, being in the maintenance mode, and the user identifier of the specified virtual desktop user, to form the second mapping relationship;
  • storing the second mapping relationship on the destination cloud platform;
  • calling an interface on the destination cloud platform to restart the destination VM, wherein the restarting is used to finish the maintenance mode and turn into a mode in which the specified virtual desktop user can perform operations on any data of the destination VM;
  • receiving from the destination cloud platform information indicating a successful registration of the restarted destination VM, and
  • after the reception of the information indicating the successful registration of the restarted destination VM, calling an interface on the source cloud platform, wherein the calling is used to instruct the source VM, being in the maintenance mode, to shut down the source VM.


[0013] In a first implementation form of the first aspect the migrating the data in the source VM, being in the maintenance mode, to the destination VM, being in the maintenance mode, according to the obtained identifier of the source VM and the obtained identifier of the destination VM comprises:

copying, according to the obtained identifier of the source VM, the data in the source VM corresponding to the identifier of the source VM; and

transmitting the copied data in the source VM to the destination VM corresponding to the identifier of the destination VM.



[0014] In a second aspect a virtual machine migration apparatus is provided configured to perform any of the above methods.

[0015] The technical solutions provided in the embodiments of the present invention bring about the following beneficial effects:
According to the virtual machine migration method and apparatus provided in the embodiments of the present invention, when data in a source VM is migrated to a destination VM, the destination VM and a specified user are configured to form a second mapping relationship according to an obtained first mapping relationship between the source VM and the specified user, and the formed second mapping relationship is stored on the destination cloud platform. Therefore, after data migration is performed on a source VM corresponding to a virtual desktop, a virtual desktop user can log in, by using a user name that is set on the source VM, to a virtual desktop corresponding to a destination VM to which data is migrated, and does not need to register a new user name. Operations are simple, and user experience of the virtual desktop user is improved.

BRIEF DESCRIPTION OF DRAWINGS



[0016] To describe the technical solutions in the embodiments of the present invention more clearly, the following briefly describes the accompanying drawings required for describing the embodiments. Apparently, the accompanying drawings in the following descriptions show only some embodiments of the present invention, and a person of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative efforts.

FIG. 1 is a schematic structural diagram of an implementation environment involved in a virtual machine migration method according to an embodiment of the present invention;

FIG. 2 is a flowchart of a virtual machine migration method according to Embodiment 1 of the present invention;

FIG. 3 is a flowchart of a virtual machine migration method according to Embodiment 2 of the present invention;

FIG. 4 is a schematic structural diagram of a virtual machine migration apparatus according to Embodiment 3 of the present invention; and

FIG. 5 is a schematic structural diagram of a virtual machine migration apparatus according to Embodiment 4 of the present invention.



[0017] Embodiments of the present invention have been clearly shown in the accompanying drawings, and are described below in more detail. These accompanying drawings and literal descriptions are not intended to limit the scope of a conception of the present invention by any means, but to illustrate the concept of the present invention with reference to particular embodiments for a person skill in the art.

DESCRIPTION OF EMBODIMENTS



[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following clearly and completely describes the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0019] Unless otherwise defined, the technical terms or scientific terms used herein have normal meaning understood by a person of ordinary skill in the art to which the present invention belongs. The words "first", "second", and the like used in the descriptions and the claims of this patent application of the present invention do not indicate the sequence, the number or the importance but are only used for distinguishing between different components. Similarly, the words "a", "an", and the like also do not indicate the number but only indicate at least one. The words "connection", "connected", and the like are not limited to physical or mechanical connection but may include electrical connection, either directly or indirectly. The words "upper", "lower", "left", "right", and the like only indicate the relative position relationship which is correspondingly changed when the absolute position of a described object is changed.

[0020] Referring to FIG. 1, FIG. 1 is a schematic structural diagram of an implementation environment involved in a virtual machine migration method according to an embodiment of the present invention. The environment includes a source cloud platform 100 and a destination cloud platform 110 that receives a migrated VM on the source cloud platform 100.

[0021] Both the source cloud platform 100 and the destination cloud platform 110 include multiple servers (not shown in the figure), and each server includes a given quantity of VMs. These servers may be local, or may be distributed at different locations in a network. A VM included in each server may be a virtual desktop, a virtual server, or a combination of a virtual desktop and a virtual server.

[0022] When VM data migration is performed, data in a source VM on the source cloud platform 100 is migrated to the destination cloud platform 110 by using a virtual machine migration apparatus.

[0023] The virtual machine migration apparatus is adapted to migrate the data in the source VM to a destination VM according to an obtained identifier of the source VM, an obtained identifier of the destination VM, and the obtained data in the source VM.

[0024] The virtual machine migration apparatus may be disposed on a server that is specially configured for VM migration and that is independent of all servers on the source cloud platform 100 and the destination cloud platform 110, or may be disposed, in a form of a function module, on the source cloud platform 100 or the destination cloud platform 100.

[0025] According to the virtual machine migration method provided in the embodiments of the present invention, a source cloud platform and a destination cloud platform are different cloud platforms, that is, data migration from a source VM to a destination VM is performed between the two cloud platforms.

Embodiment 1



[0026] Referring to FIG. 2, an embodiment of the present invention provides a virtual machine migration method. The method includes the following steps:

Step 200: Obtain a first mapping relationship, pre-stored on a source cloud platform, between a source VM and a specified user when data in the source VM is migrated to a destination VM.

Step 201: Configure a second mapping relationship between the destination VM and the specified user according to the obtained first mapping relationship between the source VM and the specified user.

Step 202: Store the second mapping relationship on a destination cloud platform.



[0027] According to the foregoing process, after data migration is performed on a source VM corresponding to a virtual desktop, a virtual desktop user can log in, by using a user name that is set on the source VM, to a virtual desktop of a destination VM to which data is migrated, and does not need to register a new user name. Operations are simple.

[0028] The generated second mapping relationship is stored in a mapping relationship table or a service database that is preset on the destination cloud platform, or may be stored in another apparatus that can store a mapping relationship between a VM and a specified user. Details are not described herein.

Embodiment 2



[0029] Referring to FIG. 3, an embodiment of the present invention provides a virtual machine migration method, so as to migrate data in a source VM to a destination VM by using a virtual machine migration apparatus. The method includes the following steps.

[0030] Step 300: The virtual machine migration apparatus obtains an identifier of the source VM and an identifier of the destination VM.

[0031] Specifically, the virtual machine migration apparatus obtains the identifier of the source VM from a source cloud platform and obtains the identifier of the destination VM from a destination cloud platform. The identifier of the source VM on the source cloud platform and the identifier of the destination VM on the destination cloud platform are both entered into the source cloud platform and the destination cloud platform in advance by an administrator before the data in the source VM is migrated to the destination VM.

[0032] Further, in addition to the identifier of the source VM and the identifier of the destination VM, the virtual machine migration apparatus may obtain a host name of the source VM from the source cloud platform and obtain a host name of the destination VM from the destination cloud platform, to further determine the source VM and the destination VM. The obtained identifier of the source VM, the obtained host name of the source VM, the obtained identifier of the destination VM, and the obtained host name of the destination VM are entered into the virtual machine migration apparatus.

[0033] For example, the identifier of the source VM is A, and the identifier of the destination VM is B. Before the data in the source VM on the source cloud platform is migrated to the destination VM on the destination cloud platform, preparation is made for VM migration, that is, the identifier A of the source VM is obtained from the source cloud platform, and the identifier B of the destination VM is obtained from the destination cloud platform.

[0034] Further, storage space of the destination VM and storage space of the source VM are consistent in size and configuration.

[0035] Step 301: The virtual machine migration apparatus sets the source VM and the destination VM to a suspended state.

[0036] Specifically, the suspended state of the source VM and the destination VM in this step refers to: The virtual machine migration apparatus sets the source VM and the destination VM to a state in which a user cannot perform operations. As a result, in a process of migrating the data in the source VM to the destination VM, the user cannot operate the data in the source VM, thereby ensuring data consistency between the destination VM and the source VM after VM migration is complete, ensuring that all data in the source VM can be migrated to the destination VM once, ensuring a success rate of virtual machine migration, and improving data migration efficiency of the source VM.

[0037] Certainly, alternatively, before performing data migration on the source VM, the virtual machine migration apparatus may set the source VM and the destination VM to a maintenance mode by using an instruction, so that the source VM and the destination VM are in a state in which a user cannot perform operations. Then the virtual machine migration apparatus migrates the data from the source VM to the destination VM. In addition to the foregoing described manners, the source VM and the destination VM may be set, in another manner, to a state in which a user cannot perform operations. Details are not described herein.

[0038] Step 302: The virtual machine migration apparatus migrates the data in the source VM to the destination VM according to the obtained identifier of the source VM and the obtained identifier of the destination VM.

[0039] Specifically, this step includes:

copying, by virtual machine migration apparatus according to the obtained identifier of the source VM, data in a VM corresponding to the identifier of the source VM; and

transmitting, by virtual machine migration apparatus, the copied data in the source VM to a VM corresponding to the identifier of the destination VM.



[0040] In a process of transmitting the data in the source VM to the destination VM, the virtual machine migration apparatus sends a virtualized underlying command to the source platform, copies data in a disk of the source VM, and then sends the copied data block to the destination VM.

[0041] Preferably, in a process of migrating the data in the source VM to the destination VM, the virtual machine migration apparatus may copy a data block of a specific size in a disk of the source VM, send the copied data block to the destination VM, and then continue to copy a data block of a specific size in a disk of the source VM and transmit the data block to the destination VM, until all the data in the source VM is copied to the destination VM.

[0042] Step 303: The virtual machine migration apparatus obtains a first mapping relationship, pre-stored on a source cloud platform, between the source VM and a specified user when the data in the source VM is migrated to the destination VM.

[0043] Specifically, the first mapping relationship includes a correspondence between the identifier of the source VM and an identifier of the specified user. In an example in which the identifier of the source VM is A, a name of the specified user is Zhang San, and a user identifier of Zhang San is 003, a first mapping relationship between the source VM and the specified user Zhang San may be denoted as A-003.

[0044] The virtual machine migration apparatus may obtain the first mapping relationship from a mapping relationship table or a service database, for the source VM and the specified user, pre-stored on the source VM.

[0045] Step 304: The virtual machine migration apparatus configures a second mapping relationship between the destination VM and the specified user according to the obtained first mapping relationship between the source VM and the specified user.

[0046] Specifically, step 304 includes:

obtaining, by the virtual machine migration apparatus, an identifier of the destination VM and a correspondence between the identifier of the source VM and the user identifier of the specified user; and

mapping, by the virtual machine migration apparatus, the identifier of the destination VM with the user identifier of the specified user according to the correspondence between the identifier of the source VM and the user identifier of the specified user, to form the second mapping relationship.



[0047] The user identifier of the specified user includes a password used by the specified user to log in to the source VM.

[0048] Further, step 304 is further described by using an example in which the identifier of the source VM is A, the identifier of the destination VM is B, a name of the specified user is Zhang San, and a user identifier of Zhang San is 003.

[0049] The first mapping relationship may be denoted as A-003. A correspondence A-003 between the identifier A of the source VM and the user identifier 003 of the specified user Zhang San is obtained from the first mapping relationship, and the obtained identifier of the destination VM is B. A correspondence B-003 between the identifier B of the destination VM and the specified user Zhang San is formed according to the correspondence A-003 between the identifier A of the source VM and the specified user Zhang San and, the formed correspondence B-003 is used as the second mapping relationship.

[0050] Step 305: The virtual machine migration apparatus stores the second mapping relationship on the destination cloud platform.

[0051] Specifically, the virtual machine migration apparatus stores the second mapping relationship in a service database that is pre-stored on the destination cloud platform. The second mapping relationship between the destination VM and the specified user, formed according to the first mapping relationship that is between the source VM and the specified user and that is stored in the service database on the source cloud platform is stored in the service database on the destination cloud platform, so as to ensure consistency between the service database on the source cloud platform and the service database on the destination cloud platform before and after the VM data migration.

[0052] Step 306: The virtual machine migration apparatus instructs the source cloud platform to shut down the source VM.

[0053] Specifically, step 306 includes:

calling, by the virtual machine migration apparatus, an interface on the destination cloud platform to associate the destination VM with the specified user;

calling, by the virtual machine migration apparatus, an interface on the destination cloud platform to restart the destination VM, where the destination VM performs automatic registration after being restarted, and after the destination VM successfully performs registration, the destination cloud platform sends, to the virtual machine migration apparatus, information indicating successful registration of the destination VM; and

calling, by the virtual machine migration apparatus, an interface on the source cloud platform to shut down the source VM after receiving the information that indicates successful registration of the destination VM and that is sent by the destination cloud platform.



[0054] According to the descriptions of step 306, resource usage on the source platform can be reduced by shutting down the source VM in which the data has been migrated and by recycling VM resources that are not used on the source platform. The recycled VM resources can be re-allocated when necessary, so that the VM resources on the source platform are configured more properly.

[0055] Based on the foregoing descriptions, according to the virtual machine migration method provided in this embodiment of the present invention, when data in a source VM is migrated to a destination VM, the destination VM and a specified user is configured to form a second mapping relationship according to an obtained first mapping relationship between the source VM and the specified user, and the formed second mapping relationship is stored on a destination cloud platform. Therefore, after data migration is performed on a source VM corresponding to a virtual desktop, a virtual desktop user can log in, by using a user name that is set on the source VM, to a virtual desktop corresponding to a destination VM to which data is migrated, and does not need to register a new user name. Operations are simple, and user experience of the virtual desktop user is improved.

Embodiment 3



[0056] Referring to FIG. 4, an embodiment of the present invention provides a virtual machine migration apparatus. The apparatus includes:

a first obtaining module 410, adapted to obtain a first mapping relationship, pre-stored on a source cloud platform, between a source VM and a specified user when data in the source VM is migrated to a destination VM;

a first processing module 420, adapted to configure a second mapping relationship between the destination VM and the specified user according to the obtained first mapping relationship between the source VM and the specified user; and

a storage module 430, adapted to store the second mapping relationship on a destination cloud platform.



[0057] Specifically, the first processing module 410 is adapted to:

obtain an identifier of the destination VM and a correspondence between an identifier of the source VM and a user identifier of the specified user in the first mapping relationship; and

map the identifier of the destination VM with the user identifier of the specified user according to the correspondence between the identifier of the source VM and the user identifier of the specified user, to form the second mapping relationship.



[0058] Further, the virtual machine migration apparatus further includes:

a second obtaining module 440, adapted to obtain an identifier of the source VM and an identifier of the destination VM;

a second processing module 450, adapted to set the source VM and the destination VM to a suspended state; and

a third processing module 460, adapted to migrate the data in the source VM to the destination VM according to the obtained identifier of the source VM and the obtained identifier of the destination VM.



[0059] Specifically, the third processing module 460 is adapted to:

copy, according to the obtained identifier of the source VM, data in a VM corresponding to the identifier of the source VM; and

transmit the copied data in the source VM to a VM corresponding to the identifier of the destination VM.



[0060] Further, the virtual machine migration apparatus further includes:
a recycling module 470, adapted to shut down the source VM.

[0061] It should be noted that, when the virtual machine migration apparatus provided in this embodiment of the present invention migrates data from a source VM to a destination VM, the division of the foregoing function modules is only used as an example. In an actual application, the foregoing function allocation can be implemented by different function modules according to a requirement, that is, the internal structure of the apparatus is divided into different function modules to perform all or some of the foregoing functions described above. In addition, the virtual machine migration apparatus and system provided in this embodiment and the virtual machine migration method embodiments belong to a same conception. For a specific implementation process thereof, refer to the virtual machine migration method embodiments. Details are not described herein again.

[0062] Based on the foregoing descriptions, according to the virtual machine migration apparatus provided in this embodiment of the present invention, when data in a source VM is migrated to a destination VM, the destination VM and a specified user is configured to form a second mapping relationship according to an obtained first mapping relationship between the source VM and the specified user, and the formed second mapping relationship is stored on a destination cloud platform. Therefore, after data migration is performed on a source VM corresponding to a virtual desktop, a virtual desktop user can log in, by using a user name that is set on the source VM, to a virtual desktop corresponding to a destination VM to which data is migrated, and does not need to register a new user name. Operations are simple, and user experience of the virtual desktop user is improved.

Embodiment 4



[0063] Referring to FIG. 5, an embodiment of the present invention provides a virtual machine migration apparatus. The virtual machine migration apparatus includes a memory 500, a processor 600, and one or more programs. The one or more programs are stored in the memory 500, and are configured so as to be executed by the processor 600, and the one or more programs include instructions used to perform the following operations:

obtaining a first mapping relationship, pre-stored on a source cloud platform, between a source VM and a specified user when data in the source VM is migrated to a destination VM;

configuring a second mapping relationship between the destination VM and the specified user according to the obtained first mapping relationship between the source VM and the specified user; and

storing the second mapping relationship on a destination cloud platform.



[0064] It should be noted that, when the virtual machine migration apparatus provided in this embodiment of the present invention migrates data from a source VM to a destination VM, the division of the foregoing function modules is only used as an example. In an actual application, the foregoing function allocation can be implemented by different function modules according to a requirement, that is, the internal structure of the apparatus is divided into different function modules to perform all or some of the foregoing functions described above. In addition, the virtual machine migration apparatus and system provided in this embodiment and the virtual machine migration method embodiments belong to a same conception. For a specific implementation process thereof, refer to the virtual machine migration method embodiments. Details are not described herein again.

[0065] Based on the foregoing descriptions, according to the virtual machine migration apparatus provided in this embodiment of the present invention, when data in a source VM is migrated to a destination VM, the destination VM and a specified user is configured to form a second mapping relationship according to an obtained first mapping relationship between the source VM and the specified user, and the formed second mapping relationship is stored on a destination cloud platform. Therefore, after data migration is performed on a source VM corresponding to a virtual desktop, a virtual desktop user can log in, by using a user name that is set on the source VM, to a virtual desktop corresponding to a destination VM to which data is migrated, and does not need to register a new user name. Operations are simple, and user experience of the virtual desktop user is improved.

[0066] The sequence numbers in the foregoing embodiments of the present invention are only for illustrative purposes, and are not intended to indicate priorities of the embodiments.

[0067] A person of ordinary skill in the art may understand that all or some of the steps of the embodiments may be implemented by hardware or a program instructing related hardware. The program may be stored in a computer-readable storage medium. The storage medium may include: a read-only memory, a magnetic disk, or an optical disc.

[0068] Finally, it should be noted that the foregoing embodiments are only intended for describing the technical solutions of the present invention, but not for limiting the present invention. Although the present invention is described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that they may still make modifications to the technical solutions described in the foregoing embodiments or make equivalent replacements to some or all technical features thereof, without departing from the scope of the technical solutions of the embodiments of the present invention.


Claims

1. A virtual machine migration method performed by a virtual machine migration apparatus, wherein the method comprises:

• receiving an identifier of a source virtual machine corresponding to a virtual desktop, VM, input by an administrator into the virtual machine migration apparatus and receiving an identifier of a destination VM input by the administrator into the virtual machine migration apparatus, wherein the source VM is located on a source cloud platform and the destination VM is located on a destination cloud platform (step 300);

• sending an instruction to both, the source VM and the destination VM, wherein the instruction is used to instruct the corresponding VM to switch to a maintenance mode in which a specified virtual desktop user cannot perform operations on any data of the corresponding VM (step 301);

• migrating the data in the source VM, being in the maintenance mode, to the destination VM, being in the maintenance mode, according to the identifier of the source VM and the identifier of the destination VM (step 302);

• obtaining a first mapping relationship, pre-stored on the source cloud platform, between the source VM, being in the maintenance mode, and the specified virtual desktop user when the data in the source VM are migrated to the destination VM, being in the maintenance mode (step 303);

• configuring a second mapping relationship between the destination VM, being in the maintenance mode, and the specified virtual desktop user according to the obtained first mapping relationship between the source VM, being in the maintenance mode, and the specified virtual desktop user (step 304); wherein the configuring the second mapping relationship between the destination VM, being in the maintenance mode, and the specified virtual desktop user according to the obtained first mapping relationship between the source VM, being in the maintenance mode, and the specified virtual desktop user comprises: obtaining a correspondence between the identifier of the source VM, being in the maintenance mode, and a user identifier of the specified virtual desktop user in the first mapping relationship, and mapping the identifier of the destination VM, being in the maintenance mode, with the user identifier of the specified virtual desktop user according to the correspondence between the identifier of the source VM, being in the maintenance mode, and the user identifier of the specified virtual desktop user, to form the second mapping relationship;

• storing the second mapping relationship on the destination cloud platform (step 305);

• calling an interface on the destination cloud platform to restart the destination VM, wherein the restarting is used to finish the maintenance mode and turn into a mode in which the specified virtual desktop user can perform operations on any data of the destination VM;

• receiving from the destination cloud platform information indicating a successful registration of the restarted destination VM, and

• after the reception of the information indicating the successful registration of the restarted destination VM, calling an interface on the source cloud platform, wherein the calling is used to instruct the source VM, being in the maintenance mode, to shut down the source VM (step 306).


 
2. The virtual machine migration method according to claim 1, wherein the migrating the data in the source VM, being in the maintenance mode, to the destination VM, being in the maintenance mode, according to the obtained identifier of the source VM and the obtained identifier of the destination VM comprises:

copying, according to the obtained identifier of the source VM, the data in the source VM corresponding to the identifier of the source VM; and

transmitting the copied data in the source VM to the destination VM corresponding to the identifier of the destination VM.


 
3. A virtual machine migration apparatus configured to perform any of the methods according to claims 1 - 2.
 


Ansprüche

1. Verfahren zur Migration einer virtuellen Maschine, das von einer Vorrichtung zur Migration virtueller Maschinen durchgeführt wird, wobei das Verfahren umfasst:

• Empfangen einer von einem Administrator in die Vorrichtung zur Migration virtueller Maschinen eingegebenen Kennung einer virtuellen Ursprungsmaschine, die einem virtuellen Desktop, VM, entspricht, und Empfangen einer vom Administrator in die Vorrichtung zur Migration virtueller Maschinen eingegebenen Kennung einer Ziel-VM, wobei die Ursprungs-VM sich auf einer Ursprungs-Cloud-Plattform befindet, und die Ziel-VM sich auf eine Ziel-Cloud-Plattform befindet (Schritt 300);

• Senden einer Anweisung sowohl an die Ursprungs-VM als auch an die Ziel-VM, wobei die Anweisung verwendet wird, um die entsprechende VM zum Wechseln in einen Wartungsmodus anzuweisen, in welchem ein spezifizierter Benutzer eines virtuellen Desktops keine Operationen an Daten der entsprechenden VM durchführen kann (Schritt 301);

• Migrieren der Daten in der Ursprungs-VM, die im Wartungsmodus ist, zur Ziel-VM, die im Wartungsmodus ist, gemäß der Kennung der Ursprungs-VM und der Kennung der Ziel-VM (Schritt 302);

• Abrufen einer ersten Zuordnungsbeziehung, die auf der Ursprungs-Cloud-Plattform vorgespeichert ist, zwischen der Ursprungs-VM, die im Wartungsmodus ist, und dem spezifizierten Benutzer des virtuellen Desktops, wenn die Daten in der Ursprungs-VM zur Ziel-VM migriert werden, die im Wartungsmodus ist (Schritt 303);

• Konfigurieren einer zweiten Zuordnungsbeziehung zwischen der Ziel-VM, die im Wartungsmodus ist, und dem spezifizierten Benutzer des virtuellen Desktops gemäß der abgerufenen ersten Zuordnungsbeziehung zwischen der Ursprungs-VM, die im Wartungsmodus ist, und dem spezifizierten Benutzer des virtuellen Desktops (Schritt 304);
wobei das Konfigurieren der zweiten Zuordnungsbeziehung zwischen der Ziel-VM, die im Wartungsmodus ist, und dem spezifizierten Benutzer des virtuellen Desktops gemäß der abgerufenen ersten Zuordnungsbeziehung zwischen der Ursprungs-VM, die im Wartungsmodus ist, und dem spezifizierten Benutzer des virtuellen Desktops umfasst:
Abrufen einer Entsprechung zwischen der Kennung der Ursprungs-VM, die im Wartungsmodus ist, und einer Benutzerkennung des spezifizierten Benutzers des virtuellen Desktops in der ersten Zuordnungsbeziehung und Zuordnen der Kennung der Ziel-VM, die im Wartungsmodus ist, zur Benutzerkennung des spezifizierten Benutzers des virtuellen Desktops gemäß der Entsprechung zwischen der Kennung der Ursprungs-VM, die im Wartungsmodus ist, und der Benutzerkennung des spezifizierten Benutzers des virtuellen Desktops, um die zweite Zuordnungsbeziehung zu bilden;

• Speichern der zweiten Zuordnungsbeziehung auf der Ziel-Cloud-Plattform (Schritt 305);

• Aufrufen einer Schnittstelle auf der Ziel-Cloud-Plattform, um die Ziel-VM neu zu starten, wobei das Neustarten verwendet wird, um den Wartungszustand zu beenden und in einen Modus zurückzukehren, in welchem der spezifizierte Benutzer des virtuellen Desktops Operationen an Daten der Ziel-VM durchführen kann;

• Empfangen von Informationen, die eine erfolgreiche Registrierung der neu gestarteten Ziel-VM angeben, von der Ziel-Cloud-Plattform, und

• Aufrufen nach Empfang der Informationen, welche die erfolgreiche Registrierung der neu gestarteten Ziel-VM angeben, einer Schnittstelle auf der Ursprungs-Cloud-Plattform, wobei das Aufrufen verwendet wird, um die Ursprungs-VM, die im Wartungsmodus ist, zum Abschalten der Ursprungs-VM anzuweisen (Schritt 306).


 
2. Verfahren zur Migration einer virtuellen Maschine nach Anspruch 1, wobei das Migrieren der Daten in der Ursprungs-VM, die im Wartungsmodus ist, zur Ziel-VM, die im Wartungsmodus ist, gemäß der abgerufenen Kennung der Ursprungs-VM und der abgerufenen Kennung der Ziel-VM umfasst:

Kopieren der Daten in der Ursprungs-VM, die der Kennung der Ursprungs-VM entspricht, gemäß der abgerufenen Kennung der Ursprungs-VM; und

Senden der kopierten Daten in der Ursprungs-VM an die Ziel-VM, die der Kennung der Ziel-VM entspricht.


 
3. Vorrichtung zur Migration virtueller Maschinen, die zum Durchführen eines der Verfahren gemäß einem Anspruch 1 bis 2 konfiguriert ist.
 


Revendications

1. Procédé de migration de machine virtuelle réalisé par un appareil de migration de machine virtuelle, le procédé comprenant :

• la réception d'un identifiant d'une entrée de machine virtuelle, VM, correspondant à un bureau virtuel, source, par un administrateur dans l'appareil de migration de machine virtuelle, et la réception d'un identifiant d'une entrée de VM destinataire par l'administrateur dans l'appareil de migration de machine virtuelle, la VM source étant située sur une plate-forme source du nuage et la VM destinataire étant située sur une plate-forme destinataire du nuage (étape 300) ;

• l'envoi d'une instruction aux deux VM source et VM destinataire, l'instruction servant à donner instruction à la VM correspondante de communiquer sur un mode de de maintenance dans lequel un utilisateur spécifié du bureau virtuel ne peut pas réaliser d'opérations sur des données de la VM correspondante (étape 301) ;

• la migration des données dans la VM source, se trouvant dans le mode de maintenance, vers la VM destinataire, se trouvant dans le mode de maintenance, conformément à l'identifiant de la VM source et de l'identifiant de la VM destinataire (étape 302) ;

• l'obtention d'une première relation de mappage, prémémorisée sur la plate-forme source du nuage, entre la VM source, se trouvant dans le mode de maintenance, et l'utilisateur spécifié du bureau virtuel quand les données dans la VM source sont migrées vers la VM destinataire, se trouvant dans le mode de maintenance (étape 303) ;

• la configuration d'une seconde relation de mappage entre la VM destinataire, se trouvant dans le mode de maintenance, et l'utilisateur spécifié du bureau virtuel conformément à la première relation de mappage obtenue entre la VM source, se trouvant dans le mode de maintenance, et l'utilisateur spécifié du bureau virtuel (étape 304);
dans lequel la configuration de la seconde relation de mappage entre la VM destinataire se trouvant dans le mode de maintenance, et l'utilisateur spécifié du bureau virtuel conformément à la première relation de mappage obtenue entre la VM source, se trouvant dans le mode de maintenance, et l'utilisateur spécifié du bureau virtuel comprend : l'obtention d'une correspondance entre l'identifiant de la VM source, se trouvant dans le mode de maintenance, et un identifiant d'utilisateur de l'utilisateur spécifié du bureau virtuel dans la première relation de mappage, et le mappage de l'identifiant de la VM destinataire, se trouvant dans le mode de maintenance, avec l'identifiant d'utilisateur de l'utilisateur spécifié du bureau virtuel conformément à la correspondance entre l'identifiant de la VM source, se trouvant dans le mode de maintenance, et l'identifiant d'utilisateur de l'utilisateur spécifié du bureau virtuel, pour former la seconde relation de mappage ;

• la mémorisation de la seconde relation de mappage sur la plate-forme destinataire du nuage (étape 305) ;

• l'appel d'une interface sur la plate-forme destinataire du nuage pour relancer la VM destinataire, la relance servant à stopper le mode de maintenance et à commencer un mode dans lequel l'utilisateur spécifié du bureau virtuel réalise des opérations sur n'importe quelles données de la VM destinataire ;

• la réception depuis la plate-forme destinataire du nuage d'informations indiquant un enregistrement réussi de la VM destinataire relancée, et

• après la réception des informations indiquant l'enregistrement réussi de la VM destinataire relancée, l'appel d'une interface sur la plate-forme source du nuage, l'appel servant à donner instruction à la VM source, se trouvant dans le mode de maintenance, d'arrêter la VM source (étape 306).


 
2. Procédé de migration de machine virtuelle selon la revendication 1, dans lequel la migration des données dans la VM source, se trouvant dans le mode de maintenance, vers la VM destinataire, se trouvant dans le mode de maintenance, conformément à l'identifiant obtenu de la VM source et de l'identifiant obtenu de la VM destinataire comprend :

la copie, conformément à l'identifiant obtenu de la VM source, des données dans la VM source correspondant à l'identifiant de la VM source ; et

la transmission des données copiées dans la VM source à la VM destinataire correspondant à l'identifiant de la VM destinataire.


 
3. Appareil de migration de machine virtuelle configuré pour réaliser n'importe lequel des procédés selon les revendications 1 à 2.
 




Drawing














Cited references

REFERENCES CITED IN THE DESCRIPTION



This list of references cited by the applicant is for the reader's convenience only. It does not form part of the European patent document. Even though great care has been taken in compiling the references, errors or omissions cannot be excluded and the EPO disclaims all liability in this regard.

Patent documents cited in the description