[go: up one dir, main page]

CN113515343A - Virtual machine migration system and method - Google Patents

Virtual machine migration system and method Download PDF

Info

Publication number
CN113515343A
CN113515343A CN202110441522.5A CN202110441522A CN113515343A CN 113515343 A CN113515343 A CN 113515343A CN 202110441522 A CN202110441522 A CN 202110441522A CN 113515343 A CN113515343 A CN 113515343A
Authority
CN
China
Prior art keywords
virtual machine
disk
source
target
migration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110441522.5A
Other languages
Chinese (zh)
Inventor
倪国军
陈勇铨
周华
胡军擎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Yingfang Software Co ltd
Original Assignee
Shanghai Yingfang Software 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 Shanghai Yingfang Software Co ltd filed Critical Shanghai Yingfang Software Co ltd
Priority to CN202110441522.5A priority Critical patent/CN113515343A/en
Publication of CN113515343A publication Critical patent/CN113515343A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • G06F9/4856Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration
    • G06F9/4862Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration the task being a mobile agent, i.e. specifically designed to migrate
    • G06F9/4868Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration the task being a mobile agent, i.e. specifically designed to migrate with creation or replication
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a virtual machine migration system and a method, wherein the system comprises: the virtual machine migration server is used for creating snapshots of virtual machines on a source virtual platform, acquiring configuration and disk information of the source virtual machine, mounting a disk to a source proxy virtual machine, creating a target virtual machine and a disk thereof on a target virtual platform, mounting the disk to the target proxy virtual machine, issuing a migration task, sending source and target disk mounting points to the target proxy virtual machine, and informing the source proxy virtual machine to connect the target proxy virtual machine for disk data transmission; the source virtual platform is used for mounting a source virtual machine disk to a source proxy virtual machine and connecting the source proxy virtual machine to a target proxy virtual machine for data transmission; the target virtual platform deploys a target agent virtual machine thereon, receives the issued migration task and the disk mounting point list, establishes connection with the source agent virtual machine, sends mounting points of all disk files to the source agent virtual machine, and receives and stores data sent by the source agent virtual machine.

Description

Virtual machine migration system and method
Technical Field
The invention relates to the technical field of virtualization and cloud computing, in particular to a system and a method for virtual machine migration in a virtualization platform.
Background
With the rapid development of information technology, the demand of computing infrastructure is continuously increased in the information construction process, and the requirements on hardware equipment, software, maintenance cost and timeliness are higher and higher. Hardware virtualization ensues in order to increase infrastructure utilization, reducing time and money overhead. For users, a virtual machine provided by a virtual platform is a remote computer distributed according to needs, almost all functions of a physical computer can be realized, computing, storage and network resources can be flexibly expanded, and time and money costs can be greatly reduced.
Virtualization is a specific technology, and means to virtualize hardware resources, so that isolation, expandability, security, full utilization of resources and the like are realized. A virtual platform is a platform that provides computing resources on demand over a network based on virtualization technology. Cloud is not a specific technology, a service that delivers shared computing resources on demand over a network. Virtualization is the most critical technology of the cloud, and is a cornerstone. Enterprises can start with virtualizing their servers and then turn to the cloud for greater agility and self-service.
At present, although the virtual machine migration techniques of various manufacturers are different, the following defects are mainly found in summary:
1. some vendors need to install services or plug-ins on virtual machines inside the virtual platform to support migration of the virtual machines. But in fact installing anything on a virtual platform is very sensitive and may affect the stability of the entire virtual platform. It is generally not allowed to install additional services or plug-ins.
2. Some vendors' migration of virtual machines, which requires applications to be installed on the virtual machines, have the following disadvantages:
(1) the user name and the password of the virtual machine are required to log in the virtual machine system, which cannot be operated by the virtual machine of some sensitive departments, and the login information cannot be provided.
(2) Installing and running applications on a virtual machine is a threat to the stability of the virtual machine, destroys the state of the original virtual machine, and is not feasible for a database server in particular.
(3) If the number of virtual machines to be migrated is large, the manual workload of this approach is enormous and often unacceptable.
3. Some vendors use third party tools for transmission. The use of third party sophisticated tools to transmit data, while potentially functionally or functionally unique, is somewhat laborious to implement in addition to the basic functions of encryption, compression, etc., such as bandwidth control, congestion control, performance tuning, etc.
4. Automated migration cannot be achieved.
5. No independent controller, controller server, target agent virtual machine and the like cooperate, so that a high-expansion and high-performance migration system cannot be realized; virtual machine migration of other kinds of platforms cannot be conveniently realized; and cannot be conveniently merged with other data migration methods, such as data migration of a block device and data migration of a file system.
Disclosure of Invention
In order to overcome the defects in the prior art, the present invention provides a virtual machine migration system and method to implement a general method for migrating a virtual machine from a virtualization platform to a heterogeneous virtualization platform.
To achieve the above object, the present invention provides a virtual machine migration system, including:
the virtual machine migration server is used for creating a migration rule aiming at virtual machine migration, creating a snapshot for a virtual machine to be migrated on a source virtual platform, acquiring the configuration and disk information of the source virtual machine, mounting a disk of the source virtual machine to a source proxy virtual machine, creating a target virtual machine and a disk thereof on a target virtual platform according to the disk configuration information of the source virtual machine, mounting the disk to a target proxy virtual machine of the target virtual platform, issuing a migration task, sending the disk mounting point information of the source proxy virtual machine and the target proxy virtual machine to the target proxy virtual machine, and informing a source end proxy virtual machine on the source virtual platform to be connected to the target proxy virtual machine of the target virtual platform to perform disk data transmission;
the source virtual platform is provided with a source virtual machine to be migrated and a source proxy virtual machine, a disk of the source virtual machine is mounted to the source proxy virtual machine under the control of the virtual machine migration server, and the source proxy virtual machine is connected to a target proxy virtual machine corresponding to a target virtual platform to perform disk data transmission after receiving parameters issued by the virtual machine migration server;
the target virtual platform is provided with a target agent virtual machine, the target virtual machine and a disk thereof are established under the control of the virtual machine migration server, the disk is mounted on the target agent virtual machine, the target agent virtual machine receives a migration task and a disk mounting point list sent by the virtual machine migration server, when a connection request sent by a source agent virtual machine for the migration task is received, the target agent virtual machine establishes connection with the source agent virtual machine, after the connection is established, mounting points of all disk files are sent to the source agent virtual machine, and data of each disk file sent by the source agent virtual machine is received and stored.
Preferably, the virtual machine migration server further includes:
a snapshot creating unit, configured to create a snapshot for a source virtual machine to be migrated of the source virtual platform;
the configuration information acquisition unit is used for acquiring all configuration and disk information of the corresponding source virtual machine according to the snapshot;
the disk operation unit is used for creating a target virtual machine and a disk thereof on a target virtual platform according to the acquired configuration information of the source virtual machine, mounting the disk of the source virtual machine to the source proxy virtual machine, and mounting the disk of the target virtual machine to the target proxy virtual machine;
a disk mounting point query and acquisition unit, configured to acquire mounting point information of a mounted disk from each proxy virtual machine through a remote management interface of each proxy virtual machine, and establish a disk mounting point correspondence table;
the disk mounting point sending unit is used for sending a migration task to the target agent virtual machine and sending the disk mounting point correspondence table to the target agent virtual machine through a remote management interface of the target agent virtual machine;
and the source proxy virtual machine task starting unit is used for starting the task of the source proxy virtual machine by using the issued parameters so as to establish connection between the source proxy virtual machine and the target proxy virtual machine.
Preferably, the system further includes a disk unloading unit, configured to unload the source virtual machine disk mounted on the source proxy virtual machine and unload the target virtual machine disk mounted on the target proxy virtual machine after the disk data transmission is completed.
Preferably, the source proxy virtual machine and the target proxy virtual machine deploy a transceiver library component and a block device data read-write component.
Preferably, the source proxy virtual machine further includes:
the connection establishing unit is used for connecting the issuing parameters of the source proxy virtual machine task starting unit to the corresponding target proxy virtual machine through the transceiving library component according to the issuing parameters when receiving the issuing parameters of the source proxy virtual machine task starting unit;
the disk mounting point list acquiring unit is used for acquiring a disk mounting point list needing to be read;
the migration unit is used for reading disk data from the disk data of the mounted source virtual machine according to a fixed size and calculating a hash value during full migration, and sending the effective data blocks and the hash value of each data block to the target proxy virtual machine and storing the effective data blocks and the hash value of each data block in the target proxy virtual machine; during incremental migration, a disk hash value list generated during last migration is obtained from the target agent virtual machine, then disk data is read from the disk data of the mounted source virtual machine according to a fixed size to calculate a hash value, the hash value during last migration is compared, and according to a comparison result, an effective data block is determined to be sent to the target agent virtual machine and stored on the target agent virtual machine.
Preferably, the issued parameters include an IP address, a port number, and a migration task ID to be connected of the target proxy virtual machine.
Preferably, when performing full migration, the migration unit reads disk data from the disk data mounted on the source virtual machine according to a fixed size, calculates a hash value for each data block, sequentially determines whether each data block is a non-empty data block, sends the non-empty data block and the hash value of each data block to the target proxy virtual machine, and reserves the hash value of each data block in the target proxy virtual machine for use in the next migration.
Preferably, when the migration unit performs incremental migration, the migration unit obtains a disk hash value list generated during last migration from the target proxy virtual machine, reads disk data according to a fixed size for the disk data mounted by the source proxy virtual machine, calculates hash values of the data blocks, determines whether the data blocks are changed data blocks by comparing whether the hash values of the corresponding data blocks in the disk hash value list are the same, sends the changed data blocks and the hash values of the data blocks to the target proxy virtual machine, and reserves the hash values of the data blocks in the target proxy virtual machine for use during next migration.
Preferably, the target proxy virtual machine further comprises:
and the issued task receiving unit is used for receiving the migration task issued by the virtual machine migration server and receiving the disk mounting point corresponding table sent by the virtual machine migration server.
And the connection request receiving unit is used for establishing connection with the source proxy virtual machine when receiving a connection request sent by the source proxy virtual machine aiming at the migration task, and sending the disk mounting point corresponding table to be read to the source proxy virtual machine.
A migration data obtaining and storing unit, configured to receive valid data block information of each disk sent by the migration unit of the source proxy virtual machine, write the valid data block information into a disk of the target virtual machine on a corresponding mount point, and meanwhile, receive hash values of each valid data block sent by the migration unit of the source proxy virtual machine, and retain the hash values of each data block in the target proxy virtual machine for use in the next migration
In order to achieve the above object, the present invention further provides a virtual machine migration method, including the following steps:
step S1, the virtual machine migration server obtains the configuration and disk information of the source virtual machine and mounts the disk of the source virtual machine to the source proxy virtual machine of the source virtual platform to obtain a mounting point, and creates a target virtual machine and its disk on the target virtual platform according to the configuration information of the source virtual machine and mounts the disk to the target proxy virtual machine to obtain a mounting point;
step S2, the virtual machine migration server sends a migration task to the target agent virtual machine, provides the disk mount point corresponding table to the target agent virtual machine, sends a parameter to the source end agent virtual machine to start the source agent virtual machine, and starts the source agent virtual machine to connect the target agent virtual machine by using the sent parameter;
step S3, after the source proxy virtual machine and the target proxy virtual machine are connected, the target proxy virtual machine sends a disk mount point list to be read to the source proxy virtual machine;
step S4, the source proxy virtual machine reads disk data of the mounted source virtual machine disk according to a fixed size, calculates a hash value of each data block, and sends the valid data block and the hash value of each data block to the target proxy virtual machine after the validity of each data block is judged;
and step S5, the target proxy virtual machine receives the effective data block information of each disk sent by the source proxy virtual machine, writes the effective data block information into the disk of the target virtual machine on the corresponding mount point, and stores the hash value of each data block for use in the next migration.
Compared with the prior art, the invention has the following beneficial effects:
1. the invention aims at a universal virtual platform and is suitable for most virtual platforms in the market.
2. The invention only carries out the migration aiming at the effective data block, thereby saving the transmission and the storage
3. The virtual machine migration of the present invention may be performed across heterogeneous virtual platforms.
4. The proxy virtual machine is a common virtual platform virtual machine without special limitation.
5. In the invention, the source virtual machine to be migrated has no influence, no login information is needed, no operating system and application information are needed, and the real agent-free migration in the virtual machine is realized.
6. The proxy virtual machine can simultaneously support the running of dozens or even hundreds of virtual machine migration tasks. If the simultaneous migration is not needed, one platform can deploy one agent virtual machine, so that the resources are fully saved, and the efficient migration is realized.
7. The invention can realize more flexible migration strategy by setting full amount, difference or increment migration based on the periodic strategy.
8. The control machine server, the virtual machine migration server and the proxy virtual machine can be flexibly configured, and a high-performance system which is scalable and easy to expand is realized.
Drawings
FIG. 1 is a system architecture diagram of a virtual machine migration system according to the present invention;
FIG. 2 is a detailed structure diagram of a virtual machine migration server according to an embodiment of the present invention;
FIG. 3 is a detailed structure diagram of a source proxy virtual machine according to an embodiment of the present invention
FIG. 4 is a detailed structure diagram of a target agent virtual machine according to an embodiment of the present invention
FIG. 5 is a flowchart illustrating steps of a virtual machine migration method according to the present invention;
fig. 6 is a flowchart of virtual machine migration according to an embodiment of the present invention.
Detailed Description
Other advantages and capabilities of the present invention will be readily apparent to those skilled in the art from the present disclosure by describing the embodiments of the present invention with specific embodiments thereof in conjunction with the accompanying drawings. The invention is capable of other and different embodiments and its several details are capable of modification in various other respects, all without departing from the spirit and scope of the present invention.
Fig. 1 is a system architecture diagram of a virtual machine migration system according to the present invention. As shown in fig. 1, the present invention provides a virtual machine migration system, including:
the virtual machine migration server 10 is configured to create a migration rule for virtual machine migration, process most management tasks of virtual machine migration, including managing a virtual platform and its virtual machines, managing rules of virtual machine migration, and scheduling operations of the rules, the method comprises the steps of creating a snapshot for a virtual machine to be migrated on a source virtual platform by calling a remote management interface, obtaining configuration and disk information of the source virtual machine, mounting a disk of the source virtual machine to a source-end proxy virtual machine, creating a target virtual machine and a disk thereof on a target virtual platform according to the disk configuration information, mounting the disk to the target proxy virtual machine of the target virtual platform, sending disk mounting point information of the source-end proxy virtual machine and the target proxy virtual machine to the target proxy virtual machine, and informing the source-end proxy virtual machine on the source virtual platform to be connected to the target proxy virtual machine of the target virtual platform to perform disk data transmission.
Generally, virtual platforms have development interfaces. The third-party application can be developed aiming at the interface, realizes more functions, and is complementary with the platform to form a set of situation that ecology achieves win-win. Referring to fig. 3, the virtual machine migration server manages virtual platforms (including a source virtual platform and a target virtual platform) through a development interface. In addition, the virtual machine migration server also manages and schedules the rules, and most of the management work of the system is realized. Meanwhile, in order to realize the migration of the virtual machine of the virtual platform in a proxy-free manner, at least one proxy virtual machine needs to be deployed on the virtual platform to operate the disk of the virtual machine to be migrated of the virtual platform.
Specifically, as shown in fig. 2, the virtual machine migration server 10 further includes:
a snapshot creating unit 101, configured to create a snapshot for a source virtual machine to be migrated by a source virtual platform. In a specific embodiment of the present invention, the snapshot creating unit 101 creates a snapshot for a source virtual machine to be migrated by a virtual platform by calling a virtual platform development interface;
the configuration information obtaining unit 102 is configured to obtain all configurations and disk information of the corresponding source virtual machine through snapshot by calling a virtual platform development interface. Specifically, the configuration information obtaining unit 102 calls a source virtual platform development interface, and obtains all configurations and disk information of the corresponding source virtual machine through the created snapshot
The disk operating unit 103 is configured to create a target virtual machine and a disk thereof on a target virtual platform according to the obtained configuration information of the source virtual machine by calling a virtual platform development interface, mount the disk of the source virtual machine to the source proxy virtual machine, and mount the disk of the target virtual machine to the target proxy virtual machine. Specifically, the disk operating unit 103 calls a target virtual platform development interface, creates a target virtual machine and a disk thereof on a target virtual platform according to the obtained configuration information of the source virtual machine, and mounts the disk of the target virtual machine to the target proxy virtual machine, and meanwhile, the disk operating unit 103 also mounts the disk of the source virtual machine to the source proxy virtual machine through the source virtual platform development interface.
The disk mount point query obtaining unit 104 is configured to obtain, through the remote management interface of each proxy virtual machine, mount point information of the mounted disk from each proxy virtual machine, and establish a disk mount point correspondence table, that is, a correspondence table between a source virtual machine disk mount point and a target virtual machine disk mount point. Specifically, the disk mounting point query unit 104 acquires mounting point information of the mounted disk from the corresponding proxy virtual machine through the remote management interfaces of the source proxy virtual machine and the target proxy virtual machine, respectively, to establish a disk mounting point correspondence table.
A disk mount point sending unit 105, configured to send a migration task to the target proxy virtual machine, and send a disk mount point correspondence table including disk mount point information of the source proxy virtual machine and the target proxy virtual machine to the target proxy virtual machine through a remote management interface of the target proxy virtual machine. That is, the virtual machine migration server 10 issues a migration task to the target proxy virtual machine and runs on the target proxy virtual machine.
The source proxy virtual machine task starting unit 106 is configured to start a task of the source proxy virtual machine by using a issued parameter by calling a remote management interface, and indicate an IP address and a port number of a target proxy virtual machine running a migration task and a task ID to be connected by using the parameter, so that the source proxy virtual machine and the target proxy virtual machine establish a connection. That is, the source proxy virtual machine task starting unit 106 issues a parameter and starts a task of the source proxy virtual machine, where the parameter in the issue zone includes a task ID (i.e. a migration task ID for the target proxy virtual machine to run), and information used to connect to the target proxy virtual machine, such as an ip and a port number of the target proxy virtual machine, so that the source proxy virtual machine and the target proxy virtual machine establish a connection.
And the disk unloading unit 107 is configured to delete the snapshot of the source virtual machine after the disk data transmission is completed, unload the disk of the source virtual machine mounted on the source proxy virtual machine, and unload the disk of the target virtual machine mounted on the target proxy virtual machine.
Specifically, the disk uninstalling unit 107 deletes the snapshot of the source virtual machine by calling the development interface of the source virtual platform, uninstalls the disk of the source virtual machine mounted on the source proxy virtual machine, and uninstalls the disk of the target virtual machine mounted on the target proxy virtual machine by calling the development interface of the target virtual platform.
The source virtual platform 11 is provided with a source virtual machine to be migrated and a source proxy virtual machine, mounts a disk of the source virtual machine to the source proxy virtual machine under the control of the virtual machine migration server 10, and connects the source proxy virtual machine to a target proxy virtual machine corresponding to a target virtual platform to perform disk data transmission after receiving parameters issued by the virtual machine migration server 10.
In the invention, the source proxy virtual machine belongs to a transceiver library component and a block device data read-write component, and after receiving parameters sent by the virtual machine migration server 10, the source proxy virtual machine is connected to the target proxy virtual machine through the transceiver library component to establish connection, so as to realize the transmission and storage of virtual machine data. Specifically, the source proxy virtual machine further includes:
the connection establishing unit 110 is configured to, when receiving the issued parameter of the source proxy virtual machine task starting unit 106, connect to the corresponding target proxy virtual machine through the transceiver library component according to the issued parameter. In the embodiment of the present invention, the parameter issued by the source proxy virtual machine task starting unit 106 indicates an IP address and a port number of a target proxy virtual machine to be connected, and a migration task ID to be connected, and the connection unit 110 connects the source proxy virtual machine to the corresponding target proxy virtual machine through a transceiver library component deployed by the source proxy virtual machine according to the issued parameter.
A disk mounting point list obtaining unit 111, configured to obtain a disk mounting point list that needs to be read. In the specific embodiment of the present invention, after the disk mounting point sending unit 105 of the virtual machine migration server 10 sends the disk mounting point correspondence table to the target proxy virtual machine, and after the source proxy virtual machine and the target proxy virtual machine establish a connection, the target proxy virtual machine sends the disk mounting point correspondence table acquired from the virtual machine migration server 10 to the source proxy virtual machine, and the disk mounting point list acquiring unit 311 acquires the disk mounting point list.
A migration unit 112, configured to, during full migration, read disk data from the disk data of the mounted source virtual machine according to a fixed size, calculate a hash value, send an effective data block and the hash value of each data block to the target proxy virtual machine, and store the effective data block and the hash value of each data block in the target proxy virtual machine; during incremental migration, a disk hash value list generated during last migration is obtained from a target agent virtual machine, then disk data is read from the mounted source virtual machine disk data according to a fixed size to calculate a hash value, the hash value during last migration is compared, and according to a comparison result, an effective data block is determined to be sent to the target agent virtual machine and stored on a target machine disk mounted by the target agent virtual machine.
Specifically, when performing full-scale migration, the migration unit 112 reads disk data from a disk mounted on a source proxy virtual machine according to a fixed size, calculates a hash value for each data block, sequentially checks whether each data block is empty (all zeros) and determines whether each data block is an effective data block, after removing the empty data blocks, all the obtained effective data blocks are sent to a target proxy virtual machine, and sends the hash value of each data block to the target proxy virtual machine, and the target proxy virtual machine reserves the hash value of each data block for use in the next migration, and writes the effective data block into a target virtual machine disk on a corresponding mount point; in incremental migration, the target proxy virtual machine sends a disk hash value list generated in the last migration to the source proxy virtual machine, the migration unit 112 also reads disk data from the disk mounted by the source proxy virtual machine according to a fixed size, calculates hash values of data blocks, compares the hash values of corresponding data blocks in the disk hash value list, if the data hash values at the same position are the same, it indicates that the data block data does not change and does not need to be migrated, the data block is an invalid data block, if the data hash values at the same position are different, it indicates that the data block data changes, it is determined that the data block data is a valid data block, after the invalid data block is removed, the valid data block is sent to the target proxy virtual machine, and similarly, the hash values of the data blocks are sent to the target proxy virtual machine, the hash values of the data blocks are reserved by the target proxy virtual machine for use in the next migration, and writing the effective data block into the target virtual machine disk on the corresponding mounting point by the target agent virtual machine.
A target virtual platform 12, on which a target proxy virtual machine is set, creates a target virtual machine and its disk on the target virtual platform according to the configuration information of the source virtual machine disk under the control of the virtual machine migration server 10, and mounts the disk to the target proxy virtual machine, where the target proxy virtual machine receives a migration task and a disk mounting point list issued by the virtual machine migration server 10, establishes a connection with the source proxy virtual machine when receiving a connection request sent by the source proxy virtual machine for the migration task, and sends mounting points of all disk files to the source proxy virtual machine after establishing the connection, and receives data of each disk file sent by the source proxy virtual machine and stores the data on the mounted target machine disk.
In the invention, the target proxy virtual machine also belongs to a transceiver library component and a block device data read-write component, and after receiving a connection request sent by the source proxy virtual machine, the target proxy virtual machine establishes connection with the source proxy virtual machine through the transceiver library component to realize the transmission and storage of virtual machine data.
Specifically, as shown in fig. 4, the target proxy virtual machine further includes:
the issued task receiving unit 120 is configured to receive a migration task issued by the virtual machine migration server 10, and receive a disk mount point correspondence table sent by the virtual machine migration server 10.
A connection request receiving unit 121, configured to establish a connection with the source proxy virtual machine when receiving a connection request sent by the source proxy virtual machine for the migration task, and send the disk mount point correspondence table to be read to the source proxy virtual machine.
The migration data obtaining and storing unit 122 is configured to receive valid data block information of each disk sent by the migration unit 112 of the source proxy virtual machine, and write the valid data block information into a disk of the target virtual machine at a corresponding mount point, and meanwhile, the migration data obtaining and storing unit 122 also receives hash values of each valid data block sent by the migration unit 112 of the source proxy virtual machine, and retains the hash values of each data block in the target proxy virtual machine for use in the next migration.
Preferably, after receiving the data of each disk file sent by the source proxy virtual machine, the migration data obtaining and storing unit 122 of the target proxy virtual machine stores the position and size of each block of data, and writes the real disk data into the disk mount point of the target virtual machine in a block device manner.
Preferably, the system of the present invention may further include a general control server module (not shown in the figure) including a user interface providing an interface for user operations in a web page and client mode and a control machine providing management functions including various management of users, permissions, authorities, logs, history records, rules, virtual machine migration servers and various agent virtual machines.
Fig. 5 is a flowchart illustrating steps of a virtual machine migration method according to the present invention. As shown in fig. 5, the virtual machine migration method of the present invention includes the following steps:
step S1, the virtual machine migration server obtains the configuration and disk information of the source virtual machine and mounts the disk of the source virtual machine to the source proxy virtual machine of the source virtual platform to obtain a mount point, and creates a target virtual machine and its disk on the target virtual platform according to the configuration information of the source virtual machine and mounts the disk to the target proxy virtual machine to obtain the mount point.
In the specific embodiment of the invention, the virtual machine migration server calls a development interface of a source virtual platform to create a snapshot for a source virtual machine to be migrated by the source virtual platform, calls the development interface of the source virtual platform to obtain all configuration and disk information of the corresponding source virtual machine, and mounts an obtained snapshot disk of the source virtual machine to a source proxy virtual machine of the source virtual platform, and simultaneously calls a development interface of a target virtual platform, creates a target virtual machine and a disk thereof according to the obtained configuration information of the source virtual machine, and mounts a disk of the target virtual machine to the target proxy virtual machine.
Step S2, the virtual machine migration server issues a migration task to the target proxy virtual machine, provides the disk mount point mapping table to the target proxy virtual machine, simultaneously issues a parameter to the source proxy virtual machine to start the source proxy virtual machine, and starts the source proxy virtual machine to connect to the target proxy virtual machine by using the issued parameter. The issued parameters are used for indicating the IP address and the port number of the target agent virtual machine and the migration task ID needing to be connected, so that the source agent virtual machine and the target agent virtual machine can establish connection.
Step S3, after the source proxy virtual machine establishes a connection with the target proxy virtual machine, the target proxy virtual machine sends the list of disk mount points to be read to the source proxy virtual machine.
Step S4, the source proxy virtual machine reads disk data of the mounted source virtual machine disk according to a fixed size, calculates a hash value for each data block, and sends the valid data block and the hash value of each data block to the target proxy virtual machine after performing validity judgment on each data block.
In the specific embodiment of the invention, during full migration, a source proxy virtual machine reads disk data of a mounted disk according to a fixed size, calculates a hash value for each block of data, judges whether each data block is an effective data block or not by checking whether each data block is empty (all zeros) or not, if a certain data block is all zeros, the data block is an invalid data block, after the validity of all data blocks is judged, the effective data block without the empty data block is sent to a target proxy virtual machine and the hash value of each data block is sent to the target proxy virtual machine, and the hash value of each data block is reserved by the target proxy virtual machine for use during next migration; during incremental migration, a disk hash value list generated during last migration is obtained from a target proxy virtual machine, hash values of mounted disk data are calculated according to a fixed size, hash values of corresponding data blocks in the disk hash value list are compared, if the data hash values at the same positions are the same, the data blocks are unchanged and do not need to be migrated, the data blocks are invalid data blocks, if the data hash values at the same positions are different, the data blocks are changed and determined to be valid data blocks, after the invalid data blocks are removed, the valid data blocks are sent to the target proxy virtual machine, and the hash values of the data blocks are reserved by the target proxy virtual machine for use during next migration.
And step S5, the target proxy virtual machine receives the effective data block information of each disk sent by the source proxy virtual machine, writes the effective data block information into the disk of the target virtual machine on the corresponding mount point, and stores the hash value of each data block for use in the next migration.
Specifically, after receiving the data of each disk file sent by the source proxy virtual machine, the target proxy virtual machine writes the disk data into the corresponding disk mount point of the target virtual machine in a block device manner.
Preferably, after step S5, the method further includes the following steps:
step S6, after the disk data transmission is completed, the virtual machine migration server calls the source virtual platform development interface to delete the source virtual machine snapshot, and unloads the source virtual machine disk mounted on the source proxy virtual machine and the target virtual machine disk mounted on the target proxy virtual machine.
Examples
Fig. 6 is a flowchart of virtual machine migration according to an embodiment of the present invention. In this embodiment, a virtual machine migration method includes the following processes:
step 1, a virtual machine migration server acquires a source virtual machine and snapshots the source virtual machine.
And 2, the virtual machine migration server obtains the configuration of the source virtual machine and the snapshot disk information.
And 3, mounting the snapshot disk to the source proxy virtual machine by the virtual machine migration server and obtaining a mounting point.
And 4, the virtual machine migration server creates a target virtual machine and a disk thereof on the target virtual platform according to the disk specification information of the source virtual machine.
And 5, mounting the target virtual machine disk applied by the target end to the target agent virtual machine by the virtual machine migration server and obtaining a mounting point.
And 6, the virtual machine migration server sends a migration task to the target agent virtual machine and sends the corresponding table of the disk mounting point to the target agent virtual machine.
And 7, the virtual machine migration server calls a remote calling interface of the source proxy virtual machine, and starts the task of the source proxy virtual machine by using the parameters.
And 8, connecting the source proxy virtual machine to the target proxy virtual machine according to the issued parameters.
And 9, the target agent virtual machine sends the disk mount point list needing to be read to the source agent virtual machine.
And step 10, if the incremental migration is performed, the target agent virtual machine sends the disk hash value list generated in the last migration to the source agent virtual machine.
Step 11, for each disk, performing the following operations of step 12 to step 15:
and step 12, reading the disk data according to the size of the fixed block by the source agent virtual machine, and generating a hash value for each piece of data.
And step 13, the source agent virtual machine checks the validity of the data block. If the migration is full, whether the data block is empty (all zeros) is checked, and if not, the data block is a valid data block. If the data block is the incremental migration, comparing whether the data hash values at the same position are the same or not in the last migration, and if not, determining the data block to be the valid data block.
And 14, the source proxy virtual machine ignores the invalid data blocks, sends the valid data blocks to the target proxy virtual machine and reserves the hash value of the data blocks for use in the next migration.
And step 15, writing the valid data into the target disk on the corresponding mounting point by the target agent virtual machine.
And step 16, after the disk data transmission is finished, the virtual machine migration server deletes the snapshot of the source virtual machine, unloads the disk of the source virtual machine mounted on the source proxy virtual machine, and unloads the target disk mounted on the target proxy virtual machine.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Modifications and variations can be made to the above-described embodiments by those skilled in the art without departing from the spirit and scope of the present invention. Therefore, the scope of the invention should be determined from the following claims.

Claims (10)

1. A virtual machine migration system, comprising:
the virtual machine migration server is used for creating a migration rule aiming at virtual machine migration, creating a snapshot for a virtual machine to be migrated on a source virtual platform, acquiring the configuration and disk information of the source virtual machine, mounting a disk of the source virtual machine to a source proxy virtual machine, creating a target virtual machine and a disk thereof on a target virtual platform according to the disk configuration information of the source virtual machine, mounting the disk to a target proxy virtual machine of the target virtual platform, issuing a migration task, sending the disk mounting point information of the source proxy virtual machine and the target proxy virtual machine to the target proxy virtual machine, and informing the source proxy virtual machine on the source virtual platform to be connected to the target proxy virtual machine of the target virtual platform to perform disk data transmission;
the source virtual platform is provided with a source virtual machine to be migrated and a source proxy virtual machine, a disk of the source virtual machine is mounted to the source proxy virtual machine under the control of the virtual machine migration server, and the source proxy virtual machine is connected to a target proxy virtual machine corresponding to a target virtual platform to perform disk data transmission after receiving parameters issued by the virtual machine migration server;
the target virtual platform is provided with a target agent virtual machine, the target virtual machine and a disk thereof are established under the control of the virtual machine migration server, the disk is mounted on the target agent virtual machine, the target agent virtual machine receives a migration task and a disk mounting point list sent by the virtual machine migration server, when a connection request sent by a source agent virtual machine for the migration task is received, the target agent virtual machine establishes connection with the source agent virtual machine, after the connection is established, mounting points of all disk files are sent to the source agent virtual machine, and data of each disk file sent by the source agent virtual machine is received and stored in a mounted target disk.
2. The virtual machine migration system according to claim 1, wherein said virtual machine migration server further comprises:
a snapshot creating unit, configured to create a snapshot for a source virtual machine to be migrated of the source virtual platform;
the configuration information acquisition unit is used for acquiring all configuration and disk information of the corresponding source virtual machine according to the snapshot;
the disk operation unit is used for creating a target virtual machine and a disk thereof on a target virtual platform according to the acquired configuration information of the source virtual machine, mounting the disk of the source virtual machine to the source proxy virtual machine, and mounting the disk of the target virtual machine to the target proxy virtual machine;
a disk mounting point query and acquisition unit, configured to acquire mounting point information of a mounted disk from each proxy virtual machine through a remote management interface of each proxy virtual machine, and establish a disk mounting point correspondence table;
the disk mounting point sending unit is used for sending a migration task to the target agent virtual machine and sending the disk mounting point correspondence table to the target agent virtual machine through a remote management interface of the target agent virtual machine;
and the source proxy virtual machine task starting unit is used for starting the task of the source proxy virtual machine by using the issued parameters so as to establish connection between the source proxy virtual machine and the target proxy virtual machine.
3. The virtual machine migration system according to claim 2, wherein: the system also comprises a disk unloading unit used for unloading the disk of the source virtual machine mounted on the source proxy virtual machine and unloading the disk of the target virtual machine mounted on the target proxy virtual machine after the disk data transmission is finished.
4. The virtual machine migration system according to claim 3, wherein: and the source agent virtual machine and the target agent virtual machine are provided with a transceiver library component and a block device data read-write component.
5. The virtual machine migration system of claim 4, wherein the source proxy virtual machine further comprises:
the connection establishing unit is used for connecting the issuing parameters of the source proxy virtual machine task starting unit to the corresponding target proxy virtual machine through the transceiving library component according to the issuing parameters when receiving the issuing parameters of the source proxy virtual machine task starting unit;
the disk mounting point list acquiring unit is used for acquiring a disk mounting point list needing to be read;
the migration unit is used for reading disk data from the disk data of the mounted source virtual machine according to a fixed size and calculating a hash value during full migration, and sending the effective data blocks and the hash value of each data block to the target proxy virtual machine and storing the effective data blocks and the hash value of each data block in the target proxy virtual machine; during incremental migration, a disk hash value list generated during last migration is obtained from the target agent virtual machine, then disk data is read from the disk data of the mounted source virtual machine according to a fixed size to calculate a hash value, the hash value during last migration is compared, and according to a comparison result, an effective data block is determined to be sent to the target agent virtual machine and stored on the target agent virtual machine.
6. The virtual machine migration system according to claim 5, wherein: the issued parameters comprise the IP address and the port number of the target agent virtual machine and the migration task ID needing to be connected.
7. The virtual machine migration system according to claim 6, wherein: when the migration unit performs full migration, the disk data mounted on the source virtual machine is read according to a fixed size, a hash value is calculated for each data block, whether each data block is a non-empty data block or not is sequentially judged, the non-empty data blocks and the hash values of the data blocks are sent to the target proxy virtual machine, and the hash values of the data blocks are reserved in the target proxy virtual machine for use in the next migration.
8. The virtual machine migration system according to claim 7, wherein: and when the migration unit performs incremental migration, acquiring a disk hash value list generated during last migration from the target agent virtual machine, reading disk data according to a fixed size from the disk data mounted by the source agent virtual machine, calculating hash values of all data blocks, judging whether the data blocks are changed or not by comparing whether the hash values of the corresponding data blocks in the disk hash value list are the same, sending the changed data blocks and the hash values of all the data blocks to the target agent virtual machine, and reserving the hash values of all the data blocks in the target agent virtual machine for use during next migration.
9. The virtual machine migration system of claim 8, wherein said target agent virtual machine further comprises:
and the issued task receiving unit is used for receiving the migration task issued by the virtual machine migration server and receiving the disk mounting point corresponding table sent by the virtual machine migration server.
And the connection request receiving unit is used for establishing connection with the source proxy virtual machine when receiving a connection request sent by the source proxy virtual machine aiming at the migration task, and sending the disk mounting point corresponding table to be read to the source proxy virtual machine.
And the migration data acquisition and storage unit is used for receiving the effective data block information of each disk sent by the migration unit of the source proxy virtual machine, writing the effective data block information into the disk of the target virtual machine on the corresponding mount point, and meanwhile, receiving the hash value of each effective data block sent by the migration unit of the source proxy virtual machine, and storing the hash value of each data block in the target proxy virtual machine for use in the next migration.
10. A virtual machine migration method comprises the following steps:
step S1, the virtual machine migration server obtains the configuration and disk information of the source virtual machine and mounts the disk of the source virtual machine to the source proxy virtual machine of the source virtual platform to obtain a mounting point, and creates a target virtual machine and its disk on the target virtual platform according to the configuration information of the source virtual machine and mounts the disk to the target proxy virtual machine to obtain a mounting point;
step S2, the virtual machine migration server sends a migration task to the target agent virtual machine, provides the disk mount point corresponding table to the target agent virtual machine, sends a parameter to the source agent virtual machine to start the source agent virtual machine, and starts the source agent virtual machine to connect the target agent virtual machine by using the sent parameter;
step S3, after the source proxy virtual machine and the target proxy virtual machine are connected, the target proxy virtual machine sends a disk mounting point list to be read to the source proxy virtual machine;
step S4, the source proxy virtual machine reads disk data of the mounted source virtual machine disk according to a fixed size, calculates a hash value of each data block, and sends the valid data block and the hash value of each data block to the target proxy virtual machine after the validity of each data block is judged;
and step S5, the target proxy virtual machine receives the effective data block information of each disk sent by the source proxy virtual machine, writes the effective data block information into the disk of the target virtual machine on the corresponding mount point, and stores the hash value of each data block for use in the next migration.
CN202110441522.5A 2021-04-23 2021-04-23 Virtual machine migration system and method Pending CN113515343A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110441522.5A CN113515343A (en) 2021-04-23 2021-04-23 Virtual machine migration system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110441522.5A CN113515343A (en) 2021-04-23 2021-04-23 Virtual machine migration system and method

Publications (1)

Publication Number Publication Date
CN113515343A true CN113515343A (en) 2021-10-19

Family

ID=78062286

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110441522.5A Pending CN113515343A (en) 2021-04-23 2021-04-23 Virtual machine migration system and method

Country Status (1)

Country Link
CN (1) CN113515343A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119759500A (en) * 2024-12-19 2025-04-04 上海英方软件股份有限公司 A virtual machine protection system and method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180239679A1 (en) * 2014-12-16 2018-08-23 At&T Intellectual Property I, L.P. Methods, systems, and computer readable storage devices for managing faults in a virtual machine network
CN112130959A (en) * 2020-09-29 2020-12-25 上海英方软件股份有限公司 Virtual machine protection system and method
CN112256397A (en) * 2020-10-28 2021-01-22 上海英方软件股份有限公司 Virtual machine cross-platform migration method and system
CN112328366A (en) * 2020-11-06 2021-02-05 上海英方软件股份有限公司 Efficient cloud platform host protection method and system
CN112506616A (en) * 2020-12-16 2021-03-16 航天壹进制(南京)数据科技有限公司 System and method for achieving cross-cloud quick recovery of virtual machine based on cloud platform volume

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180239679A1 (en) * 2014-12-16 2018-08-23 At&T Intellectual Property I, L.P. Methods, systems, and computer readable storage devices for managing faults in a virtual machine network
CN112130959A (en) * 2020-09-29 2020-12-25 上海英方软件股份有限公司 Virtual machine protection system and method
CN112256397A (en) * 2020-10-28 2021-01-22 上海英方软件股份有限公司 Virtual machine cross-platform migration method and system
CN112328366A (en) * 2020-11-06 2021-02-05 上海英方软件股份有限公司 Efficient cloud platform host protection method and system
CN112506616A (en) * 2020-12-16 2021-03-16 航天壹进制(南京)数据科技有限公司 System and method for achieving cross-cloud quick recovery of virtual machine based on cloud platform volume

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119759500A (en) * 2024-12-19 2025-04-04 上海英方软件股份有限公司 A virtual machine protection system and method
CN119759500B (en) * 2024-12-19 2025-10-31 上海英方软件股份有限公司 A virtual machine protection system and method

Similar Documents

Publication Publication Date Title
US7587471B2 (en) System and method for virtualizing network storages into a single file system view
CN112328366B (en) Efficient cloud platform host protection method and system
CN106991035B (en) Host monitoring system based on micro-service architecture
US6988102B2 (en) Techniques for managing configuration for a system of devices arranged in a network
US10754741B1 (en) Event-driven replication for migrating computing resources
US9351153B2 (en) Apparatus for end-user transparent utilization of computational, storage, and network capacity of mobile devices, and associated methods
US7783737B2 (en) System and method for managing supply of digital content
US8312231B1 (en) Method and system for mounting logical unit numbers (LUNS) of snapshots
US20090119304A1 (en) Metadata structures and related locking techniques to improve performance and scalability in a cluster file system
JP2003316522A (en) Computer system and computer system control method
CN109284170B (en) USB sharing system and sharing method in local area network
JP2016512906A (en) Multi-layer storage management for flexible data placement
JP2010186471A (en) Method and apparatus for migrating thin provisioning volume between storage systems
CN111459403B (en) Storage hardware management method and device
CN118193479A (en) A storage space allocation method and server
CN110990335A (en) Log archiving method, apparatus, device, and computer-readable storage medium
US11281550B2 (en) Disaster recovery specific configurations, management, and application
CN113515343A (en) Virtual machine migration system and method
CN106209445B (en) A kind of Visualized data centre disposed by network
CN109165078B (en) Virtual distributed server and access method thereof
CN109324931B (en) The method of realizing vmware mount recovery in the data deduplication system
US12346327B1 (en) Compact hosting of database query processors using virtualization snapshots
JP2003008575A (en) Network management system
JPH08235127A (en) Automatic load balancing method and apparatus
CN114401280A (en) Operation data synchronization method and system

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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20211019

WD01 Invention patent application deemed withdrawn after publication