The embodiments discussed herein are related to a computer product, a computing device, and a data migration method.
In live migration, a virtual machine running on hardware is moved to other hardware almost without a halt. Thus, an operating system (OS) or an application being executed by the virtual machine on the hardware can be moved to other hardware with a very short suspension. Therefore, live migration is used so that maintenance work of hardware is done while services continue.
As an example of related arts, there is a technique for memory sharing between virtual machines running on one physical computing device (see for example, Japanese Laid-open Patent Publication No. 2010-33206). Further, there is a technique for dynamically changing a physical resource configuration and a virtual device configuration under a virtualized environment (see for example Japanese Laid-open Patent Publication No. 2008-225546).
However, according to the related arts above, the content of memory allocated to the virtual machine subject to migration is copied to the destination-side hardware, resulting in an increase in the amount of data transferred between hardware.
According to an aspect of an embodiment, a computer-readable recording medium stores a data migration program that causes a computer to execute a process that includes comparing a hash value calculated from source-side data stored in each memory block forming memory of a first computing device from which data is migrated, and a hash value calculated from destination-side data stored in each memory block forming memory of a second computing device to which the data is migrated; and updating the data of the second computing device such that a hash value corresponding to a memory block of the second computing device coincides with a hash value of corresponding to a memory block of the first computing device.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention.
With reference to the accompanying drawings, preferred embodiments of a data migrating program, a computing device, and a data migrating method are described.
In
The memory 110 is sectioned according to given data units and divided into memory blocks 110-1 to 110-4. The data unit can be set arbitrarily. For example, the memory 100 is sectioned into units of megabytes, pages, or blocks. One page equals, for example, 4 to 64 KB (kilobyte). One block is, for example, a group of pages.
In
The memory 120 is sectioned according to given data units and divided into memory blocks 120-1 to 120-9. The data unit in the memory 120 is identical to one in the memory 110.
In
The data migration scheme according to the first embodiment is described blow. In this example, the data d1 to d4 stored in the memory blocks 110-1 to 110-4 of the source-side memory 110 are migrated to the destination memory 120.
(1) The source-side computing device 101 selects a memory block 110-i from among the memory blocks 110-1 to 110-4 forming the source-side memory 110. The selection process of the memory block 110-i is repeated until all memory blocks 110-1 to 110-4 have been selected.
(2) The source-side computing device 101 transmits to the destination computing device 102 a hash value (hereinafter “hash value hi”) of data di stored in the memory block 110-i that has been selected.
The hash value is, for example, a fixed-length random number calculated by giving data as an argument to a hash function. The hash function is a function that generates a fixed-length pseudo-random number from data given as an argument. The length of the hash value is set arbitrarily as far as the hash value is shorter than the bit length of the data given.
(3) The destination computing device 102 receives the hash value hi of the data di from the source-side computing device 101.
(4) The destination computing device 102 compares the hash value hi of data di with a hash value (hereinafter “hash value Hj”) of data Dj stored in the memory block 120-j. This process is performed for each memory block 120-j forming the destination memory 120. In the figure, part of the destination memory 120 is depicted.
The hash value indicates that when source-side data are different, the probability of obtaining the same hash value is very low. Therefore, it is determined whether data di and Dj are identical by the comparison of hash values hi and Hj of data di and Dj.
In
(5) The destination computing device 102 transmits to the source-side computing device 101, a result of comparison of the hash value hi of data di with the hash value Hj of data Dj. The result of comparison is information that indicates whether the hash value hi of data di has not matched hash values H1 to H9 of data D1 to D9 or has matched at least one hash values Hj among the hash values H1 to H9.
(6) The source-side computing device 101 receives from the destination computing device 102, the result of comparison of the hash value hi of data di with the hash values Hj of data Dj stored in each memory block 120-j that form the destination memory 120.
(7) The source-side computing device 101 checks the necessity of copying of data di to the destination memory 120, based on the result of comparison. When source-side data di is identical to destination data Dj, the copying of di to the destination memory 120 is not needed.
The source-side computing device 101 determines that the copying of data di to the destination memory 120 is not necessary when the hash value hi of data di matches at least one hash value Hj among the hash values H1 to H9 of data D1 to D9. On the other hand, when the hash value hi of data di does not match any of the hash values H1 to H9 of all data D1 to D9, the source-side computing device 101 determines that the copying of data di to the destination memory 120 is necessary.
In
(8) The source-side computing device 101 transmits data di stored in the memory block 110-i to the destination-side computing device 102 when the copying of data di is necessary.
In
The source-side computing device 101 transmits data d2 and d3 of source-side data d1 to d4 to the destination-side computing device 102. As a result, source-side data d2 and d3 are written into vacant areas in the destination-side memory 120 of the destination-side computing device 102. With respect to source-side data d1 and d4 that have not been transmitted from the source-side computing device 101, the destination-side computing device 102 copies data D2 and D7 whose hash values match the hash values of data d1 and 4 to vacant areas in the destination-side memory 120.
According to the data migrating scheme of the first embodiment described above, the necessity of copying of data di stored in the memory block 110-i is checked beforehand for each memory block 110-i forming the source-side memory 110. In this way, the migration of data d1 and d4 that need not be copied among migration data d1 to d4 is avoided and thus, the amount of data to be transferred between the computing devices 101 and 102 can be reduced.
The second embodiment applies the computing devices 101 and 102 of the first embodiment to servers SV (for example, servers SV1 and SV2 that will be described later). Descriptions identical to those of the first embodiment will be omitted.
The CPU 201 governs overall control of the server. The memory 202 is, for example, a read-only memory (ROM) or a random access memory (RAM).
The network I/F 203 is connected via a communication line to a network 205 such as a local area network (LAN), a wide area network (WAN), and the Internet and is connected to other devices via the network 205. The I/F 203 governs the network 205 and the internal interface and controls the input/output of data to/from other computers. The network I/F 203 may be a modem or a LAN adaptor.
The input/output device 204 inputs and outputs data. The input/output device 204 may be a display device that displays data such as a text, an image, and functional information, or may be a keyboard for inputting letters, numerals, and various instructions. The server SV may be equipped with a storage device such as a magnetic disk or an optical disk.
A network system 300 containing the server SV according to the second embodiment will be described.
The servers SV1 and SV2 include VM hosts HT1 and HT 2 and are computers that divide a hardware resource to establish multiple execution environments. The VM hosts HT1 and HT2 are software for virtualization of hardware resources (for example, the CPU 201, the memory 202, and the network I/F 203 in
The virtual machine VM is a virtual computer that operates under the execution environment that is built by the division of the hardware resources of the servers SV1 and SV2. The virtual machine VM includes software such as a program and an OS, variables that are given to the software, and information that designates hardware resources for execution of the software.
In
Logical memory separated from physical memory of each of the servers SV1 and SV2 (hereinafter “physical memory PM1 and PM2”) is allocated to the virtual machine VM. Each physical memory PM1 and PM2 of the servers SV1 and SV2 are, for example, the memory 202 depicted in
Each memory block in the memory of the virtual machine VM corresponds to one of the memory blocks obtained by dividing the physical memory PM1 and PM2. Data stored in each memory block is content such as programs (OS, application), images, and sounds.
Over the network system 300, a virtual machine VM running on the server SV is migrated to another server SV for the purpose of the load distribution among servers SV or the maintenance of the server SV; this migration is called live migration. In the live migration, the content of the memory allocated to the virtual machine VM subject to migration, is copied to a destination-side server SV.
If all the contents of the memory allocated to the virtual machine VM are copied to the destination-side server SV, an increase in the amount of data transferred between servers SV occurs. Further, when data is copied to the memory 202 of the destination-side server SV, the data goes through the bus 200 of the destination-side server SV. As a result, the cost for transferring data becomes higher than the copying of data to a storage device that is connected to a source-side server via the network 205.
According to the second embodiment, the amount of data transferred is reduced by checking beforehand, for each memory block in the memory of the virtual machine VM, the necessity of the copying to the destination sever SV of data stored in memory blocks.
In the description below, a virtual machine VM running on a server SV is written as “virtual machine VMk”. Memory allocated to a virtual machine VMk is written as “memory Mk”. Memory blocks in the memory Mk are written as “memory blocks b1 to bn”. A memory block of the memory blocks b1 to bn is written as “memory block bi” (i=1, 2, . . . , n). Data stored in the memory block bi is written as “source-side data di”.
Memory blocks in the physical memory PM of the destination-side server SV are written as “memory blocks B1 to Bm”. Any memory block of the memory blocks B1 to Bm is written as “memory block Bj” (j=1, 2, . . . , m). Data stored in the memory block Bj is written as “destination-side data Dj”.
A memory management table used by each server SV will be described. The memory management table is information for a server SV to manage the memory Mk allocated to the virtual machine VMk running on the server. A memory management table 400 is taken as an example. The memory management table 400 is used to manage memory M3 allocated to a virtual machine VM3 running on the server SV1. The memory management table 400 is implemented by, for example, the memory 202 depicted in
The machine ID is an identifier for a virtual machine VMk. The memory ID is an identifier for memory Mk allocated to the virtual machine VMk. The block ID is an identifier for a memory block bi in the memory Mk of the virtual machine VMk. The hash value is a hash value hi of source-side data di stored in the memory block bi.
With the memory management table 400, memory blocks b1 to b9 in the memory M3 allocated to the virtual machine VM3 can be identified. Further, with the memory management table 400, hash values h1 to h9 of source-side data d1 to d9 stored in the memory block b1 to b9 can be identified.
A functional configuration of a server SV (servers SV1 and SV2) according to the second embodiment will be described.
In the live migration, the server SV acts as a source-side server SV that runs the virtual machine VMk subject to migration or as a destination-side server SV that accommodates the virtual machine VMk subject to migration. Processes performed by the components when the server SV acts as a source-side server SV are described first.
A functional configuration of source-side server SV will be described. The receiving unit 501 receives an instruction to migrate a virtual machine VMk. The instruction to migrate a virtual machine VMk is to instruct the migration of a virtual machine VMk running on the server to another server. The instruction to migrate a virtual machine VMk includes, for example, a machine ID of the virtual machine VMk and a sever ID of the destination-side server SV.
For example, the VM host HT1 of the server SV1 receives, from an external computer via the network 205, an instruction that instructs migration of the virtual machine VM3 to the server SV2. The VM host HT1 may receive an instruction of the migration of the virtual machine VM3 by the operation of a user using the input/output device 204 of
When the instruction to migrate the virtual machine VMk is received, the selecting unit 502 selects an arbitrary memory block bi from among memory blocks b1 to bn that form the memory Mk allocated to the virtual machine VMk. As an example, suppose that an instruction to migrate the virtual machine VM3 to the server SV2 has been received.
In this case, the VM host HT1 refers to, for example, the memory management table 400 of
The transmitting unit 503 transmits the hash value hi of the source-side data di stored in the selected memory block bi to the destination-side server SV. The hash value hi of the source-side data di is calculated, for example, by the VM host HT1 of the source-side server SV1 giving the source-side data di, as an argument, to a hash function.
The hash value hi of the source-side data di may be calculated after the selecting unit 502 has selected a memory block bi or when the source-side data di is stored or updated in the memory block bi. The calculated hash value hi of the source-side data di may be associated with the block ID of the memory block bi and is stored in the memory management table 400.
For example, the VM host HT1 refers to the memory management table 400 and specifies the hash value hi of the source-side data di stored in the selected memory block bi. The VM host HT1 transmits, via the network 205, the hash value hi of the specified source-side data di to the VM host HT2 of the destination-side server SV2 together with the block ID of the memory block bi.
The receiving unit 501 receives, from the destination-side server SV, a result of the comparison of the hash value hi of the source-side data di with the hash value Hj of the destination-side data Dj stored in each memory block 120-j that forms the destination-side physical memory PM.
The result of the comparison is information that indicates that the hash value hi of the source-side di does not match any of the hash values H1 to Hm of all the destination-side data D1 to Dm or matches at least one of the hash values Hj among the hash values H1 to Hm. The result of the comparison may represent results of each comparison of the hash value hi of the source-side data di with the hash value Hj of each destination-side data Dj.
For example, as a result of the transmission of the hash value hi of the source-side data di, the VM host HT1 receives, via the network 205, the results of the comparison of the hash value di of the source-side data di with the hash value Hj of each destination-side data Dj from the VM host HT2 of the destination-side server SV2.
The determining unit 504 determines, based on the result of the comparison, whether the copying of the source-side data di to the physical memory PM of the destination-side server SV is necessary. For example, when the hash value hi of the source-side data di matches at least one of the hash value Hj among the hash values H1 to Hm of the destination-side data D1 to Dm, the VM host HT1 determines that the copying of the source-side data di is not necessary. On the other hand, when the hash value hi of the source-side data di does not match any of the hash values H1 to Hm of the destination-side data D1 to Dm, the VM host HT1 determines that the copying of the source-side data di is necessary.
The transmitting unit 503 transmits, based on the result of the determination, the source-side data di to the destination-side server SV. For example, when it is determined that the copying of the source-side data di is necessary, the VM host HT1 transmits an instruction of the copying of the source-side data di to the VM host HT2 via the network 205. The instruction of the copying includes, for example, the block ID of the memory block bi and the source-side data di. On the other hand, when it is determined that the copying of the source-side data di is not necessary, the VM host HT1 does not transmit the source-side data di to the destination-side server SV2.
Processes performed by each functional component when the sever SV acts as a destination-side server are described next.
A functional configuration of destination-side server SV will be described. The receiving unit 501 receives, from the source-side server SV, the hash value hi of the source-side data di stored in the memory block bi for each memory block bi forming the source-side memory Mk. For example, the VM host HT2 of the server SV2 receives the hash value hi of the source-side data di from the VM host HT1 of the server SV1 via the network 205.
The comparing unit 505 compares the hash value hi of the source-side data di with the hash value Hj of the destination-side data Dj stored in the memory block Bj for each memory block Bj forming the destination-side physical memory PM. The hash value Hj of the destination-side data Dj is calculated, for example, by the VM host HT2 of the destination-side server SV2 giving the destination-side data Dj as an argument to a hash function.
The hash value hi of the source-side data di and the hash value Hj of the destination-side data Dj are calculated according to the identical algorithm (for example, the identical hash function). The hash value Hj of the destination-side data Dj may be calculated when the comparison process is executed by the comparing unit 505 or when the destination-side data Dj is stored or updated in the memory block Bj.
The hash value Hj of the destination-side data Dj is stored, for example, in a hash table 600 as depicted in
For example, the VM host HT2 refers to the hash table 600 and compares the hash value hi of the source-side data di with the hash value Hj of the destination-side data Dj stored in the memory block Bj.
Return to
The receiving unit 501 receives the source-side data di from the source-side server SV as a result of the transmission of the comparison result. For example, the VM host HT2 receives, from the VM host HT1, an instruction of the copying of the source-side data di from which the hash value hi has been calculated while the hash value hi has not matched any of the hash values H1 to Hm of the destination-side data D1 to Dm.
The writing unit 506 writes the source-side data di into the destination-side physical memory PM. For example, when the instruction of the copying of the source-side data di is received, the VM host HT2 writes the source-side data di of the memory block bi included in the instruction into an available area of the destination-side physical memory PM.
As a result, the source-side data di is copied into an available area of the destination-side physical memory PM in the destination-side server SV2 and thus the memory block bi of the virtual machine VMk is created.
The writing unit 506 writes into the destination-side physical memory PM the destination-side data Dj from which the hash value Hj has been calculated while the hash value Hj has matched the hash value hi of the source-side data di. For example, the VM host HT2 reads out from the memory block Bj the destination-side data Dj from which the hash value Hj has been calculated while the hash value Hj has matched the hash value hi of the source-side data di, and writes the destination-side data Dj into an available area of the destination-side physical memory PM.
As a result, the destination-side data Dj from which the hash value Hj has been calculated while the hash value Hj has matched the hash value hi of the source-side data di is copied into an available area of the destination-side physical memory PM in the destination-side server SV2, and the memory block bi of the virtual machine VMk is created.
In the description above, the destination-side server SV has compared the hash value hi of the source-side data di with the hash value Hj of the destination-side data Dj but the embodiments are not restricted to this example. For example, the source-side VM host HT1 requests the destination-side VM host HT2 to send the hash value Hj of the destination-side data Dj and receives the hash value Hj of the destination-side data Dj (for example, the content of the hash table 600) from the VM host HT2.
The source-side VM host HT1 may compare the hash value hi of the source-side data di with the hash value Hj of the destination-side data Dj in this way. In this case, the source-side VM host HT1 determines, based on the result of comparison of the hash value hi of the source-side data di with the hash value Hj of the destination-side data Dj, whether to copy the source-side data di to the destination-side physical memory PM2.
When the copying of the source-side data di is not necessary, the destination-side VM host HT2 does not know the block ID of the memory block Bj of the destination-side data Dj that matches the hash value of the source-side data di. Thus, the VM host HT1 transmits to the destination-side VM host HT2, together with the block ID of the memory block bi of the source-side data di, the block ID of the memory block Bj of the destination-side data Dj from which the hash value Hj has been calculated while the hash value Hj has matched the hash value hi of the source-side data di.
As a result, the destination-side data Dj from which the hash value Hj has been calculated while the hash value Hj has matched the hash value hi of the source-side data di is copied into an available area of the destination-side physical memory PM in the destination-side server SV2, and the memory block bi of the virtual machine VMk is created.
A context switch of a program being executed by the virtual machine VMk may be performed right after the migration instruction of the virtual machine VMk or after the memory blocks bl to bn of the virtual machine VMk are created in the destination-side physical memory PM.
The context is information concerning a state (for example, a value of a register of the CPU 201) of a program being executed by the virtual machine VMk. The context switch is performed by, for example, the source-side VM host HT1 copying a value of a register of the CPU 201 allocated to the virtual machine VMk to the CPU 201 of the destination-side server SV2.
One example of live migration will be described where the virtual machine VM3 running on the server SV1 is migrated to the server SV2.
In this case, the VM host HT1 transmits an instruction of the copying of the source-side data d1, d6, and d8 the copying of which are necessary to the destination-side VM host HT2. The VM host HT2 writes the source-side data d1, d6, and d8 into an available area of the physical memory PM2. In this way, the source-side data d1, d6, and d8 are copied into an available area of the physical memory PM2, and the memory blocks b1, b6, and b8 of the virtual machine VM3 are created.
The destination-side data D2, D4, D8, D10, D14, and D16 are the destination-side data Dj whose hash values match the hash values of the source-side data d2 to d5, d7, and d9 the copying of which is not necessary. In this case, the VM host HT2 reads out the destination-side data D2, D4, D8, D10, D14, and D16 from the memory blocks B2, B4, B8, B10, B14, and B16 and writes the destination-side data to an available area of the physical memory PM2. In this way, the destination-side data D2, D4, D8, D10, D14, and D16 are copied into the physical memory PM2, and the memory blocks b2 to b5, b7, and b9 of the virtual machine VM3 are created.
As a result, the memory blocks b1 to b9 of the virtual machine VM3 are created in the physical memory PM2 of the destination server SV2, and the migration of the virtual machine VM 3 ends. As described, the necessity of the copying of the source-side data di is checked beforehand and the data di that need not be copied is not transferred and thus the amount of data transferred between servers can be reduced.
There is a possibility that the hash value hi and the hash value Hj are identical (collide) even if the content of the source-side data di does not match the content of the destination-side data Dj. Thus, the coherency check of the source-side data di and the destination-side data Dj based only on the comparison of hash values may cause a situation where the source-side data di that need be copied is not transferred to the destination-side server SV.
In this case, a failure will occur that the destination-side data Dj the content of which is not identical to that of the source-side data di is copied and the memory block bi of the virtual machine VMk is created in the destination-side server SV. Thus, with checking methods 1 to 4 below, the coherency check of the source-side data di and the destination-side data Dj may further be performed.
In the description below, it is assumed that the destination-side server SV performs the comparison process with the comparing unit 505 unless specified otherwise.
Checking method 1 is described where the source-side data di and the destination-side data Dj are compared based on hash values yielded by different algorithms. With the first hash function and the second hash function, hash values of the source-side data di and the destination-side data Dj are calculated.
In the description below, a hash value yielded by the first hash function that has received the source-side data di is called “the first hash value h1i”, and a hash value yielded by the first hash function that has received the destination side data Dj is called “the first hash value H1j”. A hash value yielded by the second hash function that has received the source-side data di is called “the second hash value h2i”, and a hash value yielded by the second hash function that has received the destination-side data Dj is called “the second hash value H2j”.
The comparing unit 505 compares the hash values of the destination-side data Dj (for example, the first and the second hash values H1j and H2j) with the hash values of the source-side data di (for example, the first and the second hash values h1i and h2i).
For example, the comparing unit 505 compares, for each memory block Bj, the first hash value H1j of the destination-side data Dj of the memory block Bj with the first hash value h1i of the source-side data di of the memory block bi. When the first hash value H1j matches the first hash value h1i, the comparing unit 505 compares the second hash value H2j of the destination-side data Dj with the second hash value h2i of the source-side data di.
The determining unit 504 determines whether to copy the source-side data di of the memory block bi to the physical memory PM of the destination-side server SV based on the result of the comparison. The details of the checking method 1 will be described below.
A memory management table 800 is described that stores the first hash value h1i and the second hash value h2i of the source-side data di. The memory management table 800 is implemented by the memory 202 of the source-side server SV.
The first hash value is the first hash value h1i yielded by the first hash function that has received the source-side data di stored in the memory block bi. The second hash value is the second hash value h2i yielded by the second hash function that has received the source-side data di stored in the memory block bi.
With the memory management table 800, the first hash values h11 to h19 and the second hash values h21 to h29 of the source-side data d1 to d9 stored in the memory blocks b1 to b9 can be specified.
For example, the source-side VM host HT1 refers to the memory management table 800 and specifies the first and the second hash values h1i and h2i of the source-side data di. The VM host HT1 transmits to the destination-side VM host HT2 the first and the second hash values h1i and h2i of the specified source-side data di.
The destination-side VM host HT2 compares, for each memory block Bj, the first hash value H1j of the destination-side data Dj of the memory block Bj with the first hash value h1i of the source-side data di. A hash table 900 is described that stores the first hash value H1j and the second hash value H2j of the destination-side data Dj. The hash table 900 is implemented by, for example, the memory 202 of the destination-side server SV.
For example, the destination-side VM host HT2 refers to the hash table 900 and compares, for each memory block Bj, the first hash value H2j of the destination-side data Dj of the memory block Bj with the first hash value h1i of the source-side data di. When the first hash value H2j matches the first hash value h1i, the VM host HT2 refers to the hash table 900 and compares the second hash value H2j of the destination-side data Dj with the second hash value h2i of the source-side data di. The VM host HT2 transmits a result of the comparison to the VM host HT1.
The VM host HT1 determines whether to copy the source-side data di of the memory block bi to the destination-side physical memory PM2 based on the result of the comparison. For example, when the second hash value H2j matches the second hash value h2i, the VM host HT1 determines that the copying of the source-side data di is not necessary. When the first hash value H2j does not match the first hash value h1i or when the second hash value H2j does not match the second hash value h2i, the VM host HT1 determines that the copying of the source-side data di is necessary.
As a result, the destination-side VM host HT2 receives, from the source-side VM host HT1, the source-side data di from which hash values have been created that have not matched at least one of the first and the second hash values H2j and H2j.
As described above, the checking of coherency between the source-side data di and the destination-side Dj with multiple hash values enables the avoidance of collision between the hash values of the source-side data di and the destination-side data Dj.
When the source-side server SV performs the comparison process with the comparing unit 505, the destination-side server SV transmits the first and the second hash values H2j and H2j of the destination-side data Dj to the source-side server SV in response to a request from the source-side server SV.
Checking method 2 will be described. In the checking method 2, coherency between partial data of the source-side data di and that of the destination-side data Dj whose hash values (for example, the first hash values described above) are identical is checked.
When the first hash value H2j matches the first hash value h1i, the comparing unit 505 compares partial data extracted from the destination-side data Dj according to a given extraction rule with partial data extracted from the source-side data di according to the extraction rule. In the below, partial data extracted from the source-side data di is called “partial data pi”. Partial data extracted from the destination-side data Dj is called “partial data Pj”.
The partial data pi of the source-side data di is extracted by, for example, the VM host HT1 of the source-side server SV1, from the source-side data di according to the given extraction rule. An example of the extraction rule is that a given number of bits from the head or the tail of the source-side data di is extracted.
The partial data Pj of the destination-side data Dj is extracted by, for example, the VM host HT2 of the destination-side server SV2 from the destination-side data Dj according to the given extraction rule. The partial data pi and Pj are extracted according to the same extraction rule. The partial data pi and Pj may be extracted when the source-side data di and the destination-side data Dj are recorded or updated.
The determining unit 504 determines, based on the result of the comparison, whether to copy the source-side data di of the memory block bi to the physical memory PM of the destination-side server SV. The details of the checking method 2 will be described below.
For example, when the first hash value H1j matches the first hash value h1i, the destination-side VM host HT2 compares the partial data Pj of the destination-side data Dj with the partial data pi of the source-side data di. For example, the partial data pi of the source-side data di is transmitted from the source-side VM host HT1 to the VM host HT2 in response to a request from the destination-side VM host HT2. The VM host HT2 transmits a result of the comparison to the VM host HT1.
The VM host HT1 determines whether to copy the source-side data di of the memory block bi to the destination-side physical memory PM based on the received result of the comparison. For example, when the partial data Pj matches the partial data pi, the VM host HT1 determines that the copying of the source-side data di is not necessary. When the partial data Pj does not match the partial data pi, the VM host HT1 determines that the copying of the source-side data di is necessary.
As a result, the destination-side VM host HT2 receives from the source-side VM host HT1, the source-side data di from which the partial data pi has been extracted that have not matched the partial data Pj of the destination-side data Dj.
As described above, a coherency check is performed by checking coherency between the partial data pi of the source-side data di and the partial data Pj of the destination-side data Dj. As a result, a failure due to the hash value collision between the source-side data di and the destination-side data Dj can be avoided.
When the source-side server SV performs the comparison process with the comparing unit 505, the destination-side server SV transmits the partial data Pj of the destination-side data Dj to the source-side server SV in response to a request from the source-side server SV.
A server which performs the comparison process of comparing the partial data pi of the source-side data di with the partial data Pj of the destination-side data Dj may be determined based on the communication quality of communication paths between servers SV.
For example, when the first hash value H1j matches the first hash value h1i, the comparing unit 505 chooses a communication path having a higher or highest communication quality from among the bidirectional communication paths between servers SV. As an index for a communication quality, a transmission rate or an error rate of data can be used. The transfer rate represents the amount of data transferred per unit time (for example, bit per second).
The error rate represents the possibility that a bit different from transmission data is included in received data when data is transmitted and received. The transmission rate and the error rate may be measured beforehand and stored in the memory 202 or may be measured each time a communication path is selected.
For example, when the first hash value H1j matches the first hash value h1i, the VM host HT2 selects a communication path having a higher communication quality from among the bidirectional communication paths between servers SV1 and SV2.
When a communication path directed towards the server SV2 from the server SV1 is selected, the VM host HT2 transmits a request of the partial data pi of the source-side data di to the source-side VM host HT1. As a result, the VM host HT2 receives the partial data pi of the source-side data di from the VM host HT1 and compares the partial data pi of the source-side data di with the partial data Pj of the destination-side data Dj.
When a communication path directed from the server SV2 to the server SV1 is selected, the VM host HT2 transmits the partial data Pj of the destination-side data Dj to the source-side VM host HT1. As a result, the source-side VM host HT1 compares the partial data di of the source-side data di with the partial data Pj of the destination-side data Dj.
As can be seen, a communication path having a higher communication quality is selected from among bidirectional communication paths between the server SV1 and the server SV2 and an executing entity that compares the partial data pi with the partial data Pj is selected and thus the comparing process is performed swiftly and efficiently.
Checking method 3 will be described. In the checking method 3, coherency between the source-side data di and the destination-side data Dj is checked by checking coherency between the source-side data di and the destination-side data Dj whose hash values (for example, the first hash values described above) are identical.
When the first hash value H1j matches the first hash value h1i, the comparing unit 505 selects a communication path having a higher communication quality from among the bidirectional communication paths between servers SV. For example, when the first hash value H1j matches the first hash value h1i, the VM host HT2 selects a communication path having a better or best communication quality from among the bidirectional communication paths between the server SV1 and the server SV2.
When a communication path directed from the server SV2 to the server SV1 is selected, the VM host HT2 transmits the destination-side data Dj to the source-side VM host HT1. The source-side VM host HT1 compares the source-side data di with the destination-side data Dj. The VM host HT1 determines whether to copy the source-side data di of the memory block bi to the destination-side physical memory PM2 based on a result of the comparison.
For example, when the source-side data di matches the destination-side data Dj, the VM host HT1 determines that the copying of the source-side data di is not necessary. When the source-side data di does not match the destination-side data Dj, the VM host HT1 determines that the copying of the source-side data di is necessary.
As a result, the destination-side VM host HT2 receives from the source-side VM host HT1 the source-side data di that has not matched the destination-side data Dj.
In this way, coherency between the source-side data di and the destination-side data Dj is checked and thus a failure due to the collision between hash values of the source-side data di and the destination-side data Dj can be avoided.
From the viewpoint of reducing the amount of data transferred between servers, it would be meaningless to send the source-side data di from the source-side VM host HT1 to the destination-side VM host HT2 for the comparison of the data di with the destination-side data Dj. Therefore, when a communication path directed from the server SV1 to the server SV2 is selected, the VM host HT2 may transmit to the VM host HT1 a result of comparison that the first hash value H1j matches the first hash value h1i.
In this case, the VM host HT1 determines that the copying of the source-side data di of the memory block bi to the destination-side physical memory PM2 is necessary. In other words, when a communication path directed from the server SV1 to the server SV2 is selected, it is determined without the coherency check between the source-side data di and the destination-side data Dj that the copying of the source-side data di is necessary.
Checking method 4 will be described. In the checking method 4, coherency between the source-side data di and the destination-side data Dj is checked by checking coherency between data sources of the source-side data di and the destination-side data Dj whose hash values (for example, the first hash values described above) are identical.
The virtual machine VM 3 running on the sever SV1 is subject to the migration process. The first hash value of source-side data d5 of the memory block b5 that forms the virtual machine VM3 matches the first hash value of destination-side data D10 of the memory block B10 that forms the destination-side physical memory PM2 (h15=H110).
The source-side data d5 is stored in a logical volume LV1 of the storage device 1000. The destination-side data D10 is stored in a logical volume LV2 of the storage device 1000. The storage device 1000 has a function of eliminating duplicates and thus the logical blocks having the identical content are stored in the same physical block. In other words, when the source-side data d5 and the destination-side data D10 are data D that is stored in a volume PV1 having the same physical address, d5 and D10 are identical and thus the same data source.
When data sources of the source-side d5 and the destination-side data D10 are identical, the memory block B10 in which the destination-side data D10 is stored can be shared by virtual machines (for example, virtual machines VM3 and VM4) in the destination-side server SV2. Thus, the copying of the source-side data d5 to the destination-side physical memory PM2 becomes unnecessary.
The comparing unit 505 compares, when the first hash value H1j matches the first hash value h1i, an address of a storage area within the storage storing the destination-side data Dj with an address of a storage area within the storage storing the source-side data di. The storage may be the storage device 1000 that the destination-side server SV and the source-side server SV can access. The determining unit 504 determines whether to copy the source-side data di of the memory block bi to the physical memory PM of the destination-side server SV based on a result of the comparison.
For example, the VM host HT2 inquires at the VM host HT1 about a volume ID that identifies the logical volume LV1 that stores the source-side data d5. The VM host HT2 inquires at the storage device 1000 about a physical address corresponding to the logical volume LV1 that stores the source-side data d5.
The VM host HT2 inquires at the storage device 1000 about a physical address corresponding to the logical volume LV2 that stores the destination-side data D10. The VM host HT2 compares the physical address corresponding to the logical volume LV1 storing the source-side data d5 with the physical address corresponding to the logical volume LV2 storing the destination-side data D10. The VM host HT2 transmits a result of the comparison to the VM host HT1.
The VM host HT1 determines whether to copy the source-side data di of the memory block bi to the destination-side physical memory PM2 based on the received comparison result. For example, when the physical address of the logical volume LV1 matches the physical address of the logical volume VL2, the VM host HT1 determines that the copying of the source-side data d5 is not necessary. As a result, for example, the virtual machine VM3 and VM4 share the memory block B10 that stores the destination-side data D10 in the destination-side server SV2.
When the physical address of the logical volume LV1 does not match the physical address of the logical volume LV2, the VM host HT1 determines that the copying of the source-side data d5 is necessary. As a result, the destination-side VM host HT2 receives from the source-side VM host HT1 the source-side data di that is stored in the logical volume LV1 whose physical address does not match the physical address of the logical volume LV2 that stores the destination-side data Dj.
In this way, a coherency check between data sources of the source-side data di and the destination-side data Dj is checked and thus a failure due to the collision of hash values of the source-side di and the destination-side data Dj can be avoided.
When the first hash value H1j matches the first hash value h1i, some of the checking methods 1 to 4 may be combined to check coherency between the source-side data di and the destination-side data Dj.
A data migration process of a server SV according to the second embodiment will be described. A data migration process on the source-side server SV will be described first.
The receiving unit 501 waits for an instruction concerning the migration of a virtual machine VMk (step S1101: NO). When the receiving unit 501 receives the instruction (step S1101: YES), the selecting unit 502 initializes a variable i of a memory block bi by setting i as i=1 (step S1102). The memory Mk of the virtual machine VMk is divided into memory blocks bi.
The selecting unit 502 selects one memory block bi from among the memory blocks b1 to bn that forms the memory Mk of the virtual machine VMk (step S1103). The transmitting unit 503 transmits the first and the second hash values h1i and h2i stored in the selected memory block bi to the destination-side server SV (step S1104).
It is determined whether the receiving unit 501 has received from the destination-side server SV the result of the comparison between the hash value hi of the source-side data di and the hash value Hj of each destination-side data Dj stored in each memory block 120-j that forms the destination-side physical memory PM (step S1105).
The process waits until the result of the comparison is received (step S1105: NO). When the result of the comparison is received (step S1105: YES), the determining unit 504 determines whether to copy the source-side data di to the physical memory PV of the destination-side server SV based on the result of the comparison (step S1106).
When the copying of the source-side data di is necessary (step S1107: YES), the transmitting unit 503 transmits to the destination-side server SV an instruction of copying the source-side data di (step S1108). The selecting unit 502 increments i of the memory block bi (step S1109) and determines whether i is larger than n (step S1110).
When i is less than or equal to n (step S1110: NO), the process returns to step S1103. When i is larger than n (step S1110: YES), the process according to this flowchart ends. When the copying of the source-side data di is not necessary at step S1107 (step S1107: NO), the process goes to step S1109.
In this way, the necessity of copying the source-side data di of the memory block bi can be determined for each memory block bi that forms the memory Mk of the virtual machine VMk that is subject to migration.
A data migration process on the destination-side server SV will be described next.
The process waits until the first and the second hash values h1i and h2i are received (step S1201: NO). When the hash values are received (step S1201: YES), the comparing unit 505 initializes, by setting j as j=1, a variable j of a memory block Bj that forms the destination-side physical memory PM (step S1202).
The comparing unit 505 compares the first hash value H1j of the destination-side data Dj stored in the memory block Bj with the first hash value h1i of the source-side data di (step S1203). The comparing unit 505 determines whether the first hash value H1j of the destination-side data Dj has matched the first hash value h1i of the source-side data di (step S1204).
When the first hash value H1j does not match the first hash value h1i (step S1204: NO), the comparing unit 505 increments j of the memory block Bj (step S1205) and determines whether j is larger than m (step S1206). When j is less than or equal to m (step S1206: NO), the process returns to step S1203.
When j is larger than m (step S1206: YES), the transmitting unit 503 transmits to the source-side server SV a result of the comparison conducted by the comparing unit 505 (step S1207), and the process according to this flowchart ends.
When the first hash value H1j matches the first hash value h1i at step S1204 (step S1204: YES), the comparing unit 505 compares the second hash value H2j of the destination-side data Dj stored in the memory block Bj with the second hash value h2i of the source-side data di (step S1208).
The comparing unit 505 determines whether the second hash value H2j of the destination-side data Dj matches the second hash value h2i of the source-side data di (step S1209). When the second hash value H2j does not match the second hash value h2i (step S1209: NO), the process goes to step S1205.
When the second hash value H2j matches the second hash value h2i (step S1208: YES), the process goes to step S1301 of
In the flowchart of
The process waits until the partial data pi is received (step S1302: NO). When the partial data is received (step S1302: YES), the comparing unit 505 compares the partial data Pj of the destination-side data Dj with the partial data pi of the source-side data di (step S1303).
The comparing unit 505 determines whether the partial data Pj of the destination-side data Dj matches the partial data pi of the source-side data di (step S1304). When the partial data Pj does not match the partial data pi (step S1304: NO), the process goes to step S1205 of
When the partial data Pj matches the partial data pi (step S1304: YES), the process goes to step S1401 of
In the flowchart of
The comparing unit 505 inquires at the storage device 1000 about a physical address corresponding to a logical volume storing the destination-side data Dj (step S1403). The comparing unit 505 compares the physical address corresponding to the logical volume storing the source-side data di with the physical address corresponding to the logical volume storing the destination-side data Dj (step S1404).
The comparing unit 505 determines whether the physical address of the sources-side data di matches the physical address of the destination-side data Dj (step S1405). When the physical address of the source-side data di does not match the physical address of the destination-side data Dj (step S1405: NO), the process goes to step S1205 of
When the physical address of the source-side data di matches the physical address of the destination-side data Dj (step S1405: YES), the transmitting unit 503 transmits to the source-side server SV a result of the comparison conducted by the comparing unit 505 (step S1406), and the process according to this flowchart ends.
In this way, information (result of the comparison) for checking coherency between the source-side data di stored in the source-side memory block bi and the destination-side data Dj stored in the destination-side memory block Bj can be transmitted to the source-side server SV.
When the receiving unit 501 receives the instruction of copying the source-side data di after the result of the comparison is transmitted to the source-side server SV at step S1207, the writing unit 506 writes the source-side data di into the destination-side physical memory PM.
When the result of the comparison is transmitted to the source-side server SV at step S1406, the writing unit 506 writes into the destination-side physical memory PM the destination-side data Dj whose hash value matches the hash value of the source-side data di. The context switch is performed, for example, after the memory blocks b1 to bn that forms the memory Mk of the virtual machine VMk is created on the physical memory PM of the destination-side server.
As described above, according to the server SV of the second embodiment, the necessity of the copying of the source-side data di of the memory block bi can be determined for each memory block bi that forms the memory Mk of the virtual machine VMk subject to the migration. As a result, unnecessary coping of data di can be prevented and the amount of data transferred between servers can be reduced at live migration.
According to the server SV, the hash value hi of the source-side data di is compared with the hash value Hj of the destination-side data Dj and coherency between the source-side data di and the destination-side data Dj is checked and the necessity of the copying of the data di of the memory block bi can be determined.
According to the server SV, coherency between the source-side data di and the destination-side data Dj are checked with multiple different hash values and thus a failure due to the collision between the hash values of the source-side data di and the destination-side data Dj can be avoided.
According to the server SV, coherency can be checked by checking coherency between the partial data pi and Pj of the source-side data di and the destination-side data Dj and thus a failure due to the collision between the hash values of the source-side data di and the destination-side data Dj can be avoided.
According to the server SV, the comparison between the partial data pi and the partial data Pj is performed by selecting a communication path having a better communication quality from among bidirectional communication paths between the server SV1 and the server SV2 and thus coherency between the partial data pi and the partial data Pj can be checked swiftly and efficiently.
According to the server SV, coherency between the source-side data di and the destination-side data Dj is checked and thus, a failure due to the collision between the hash values of the source-side data di and the destination-side data Dj can be avoided.
A server SV according to the third embodiment will be described. In the third embodiment, the necessity of the copying of the source-side data di is checked based on attribute information of the source-side data di stored in a memory block bi for each memory block bi of the virtual machine VMk that is subject to migration. Descriptions identical to those of the first and the second embodiments are omitted.
A memory block table will be described. An OS (hereinafter “guest OS”) being executed by the virtual machine VMk on a server SV uses the memory block table to manage the memory blocks b1 to bn that forms the memory block Mk. A memory block table 1500 is taken as an example that is used by a guest OS3 that is being executed by the virtual machine VM3 on the server SV1. The memory block table 1500 is implemented by, for example, the memory 202 of
The block ID is an identifier of a memory block bi that forms the memory Mk of the virtual machine VMk. The type is data type of data di stored in the memory block bi. In
The status indicates a state of data di stored in the memory block bi. In
The related block ID is a block ID of other memory blocks that stores data related to data di stored in the memory block bi. Other memory blocks are, for example, memory blocks on a file system or memory blocks within the swap region.
The checking unit 1601 checks, based on attribute information of the source-side data di stored in the memory block bi, whether the memory block bi is a vacant area. For example, the guest OS3 of the virtual machine VM3 refers to the memory block table 1500 and checks whether the memory block bi is a memory block that has been put into the free memory. More specifically, when “free” has been set in the type field of the memory block bi, the guest OS3 determines that the memory block bi is a memory block that has been put into the free memory.
The determining unit 1602 determines whether to copy the source-side data di to the physical memory PM of the destination-side server SV based on a result of the determination. For example, when it is determined that the memory block bi is a memory block that has been put into the free memory, the guest OS3 determines that the copying of the source-side data di is not necessary.
The guest OS3 changes the status of the memory block bi to a state where page stealing has been performed. The state that page stealing has been performed is, for example, a state where the memory block bi is stolen by other virtual machines VM. Information concerning the status change to the state that page stealing has been performed is transferred from the VM host HT1 to the VM host HT2.
As a result, for example, the status of the memory block bi is reflected on the memory block table 1500 that is used by the guest OS3 of the virtual machine VM3 running on the destination-side server SV2. When the memory block bi in the page-stolen state is accessed, the guest OS3 obtains an available area in the physical memory PM2 and creates a memory block bi.
The checking unit 1601 checks, based on the attribute information concerning the source-side data id stored in the memory block bi, whether the source-side data di is stored in a storage device which the destination-side server SV can access. For example, the guest OS3 of the virtual machine VM 3 refers to the memory block table 1500 and checks whether the sources-side data di is stored in a file system which the destination-side server SV can access.
More specifically, the guest OS3 checks whether “text” or “data” has been set in the type field of the memory block bi. When “text” or “data” has been set, the guest OS3 further checks whether “sync” has been set in the status field of the memory block bi. When “sync” has been set, the guest OS3 determines that the source-side data di is stored in the file system.
The guest OS3 determines that the copying of the source-side data di is not necessary. The guest OS3 changes the status of the memory block bi to a state where page stealing has been performed. When the memory block bi in the page-stolen state is accessed, the guest OS3 obtains an available area in the physical memory PM2, acquires data di from the file system, and creates a memory block bi.
The checking unit 1601 checks, based on the attribute information concerning the source-side data di stored in the memory block bi, whether the source-side data di has been backed up in a storage area different from the memory Mk. The storage area may reside in a storage device such as a magnetic disk or an optical disk of the source-side server or a storage device which the source-side server SV or the destination-side server SV can access.
For example, the guest OS3 of the virtual machine VM3 refers to the memory block table 1500 and checks whether there is a backing store of the source-side data di. More specifically, the guest OS3 checks whether “anno” has been set in the type field of the memory block bi. When “anno” has been set, the guest OS3 further checks whether the “sync” has been set in the status field of the memory block bi.
When “sync” has been set, the guest OS3 determines that there is a backing store of the source-side di. The guest OS3 determines that the copying of the source-side data di is not necessary. The guest OS3 changes the status of the memory block bi to a state where page stealing has been performed.
When the memory block bi in the page-stolen state is accessed, the guest OS3 obtains an available area in the physical memory PM2, acquires data di from the swap region, and creates a memory block bi.
The checking unit 1601 checks, based on the attribute information of the source-side data di stored in the memory block bi, whether the memory block bi has been initialized. For example, the guest OS3 of the virtual machine VM3 refers to the memory block table 1500 and checks whether the memory block bi has been initialized.
For example, the guest OS3 checks whether “null” has been set in the status field of the memory block bi. When “null” has been set, the guest OS3 determines that the memory block bi has been initialized. The guest OS3 determines that the copying of the source-side data di is not necessary.
The guest OS3 changes the status of the memory block bi to a state where page stealing has been performed. When the memory block bi in the page-stolen state is accessed, the guest OS3 obtains an available area in the physical memory PM2 and creates a memory block bi.
A data migration process of a server SV according to the third embodiment will be described.
The process waits until the receiving unit 501 receives the instruction of the migration of the virtual machine VMk (step S1701: NO). When the instruction of migration is received (step S1701: YES), the selecting unit 502 initializes a variable i of a memory block bi by setting i as i=1 (step S1702). The memory block bi forms the memory Mk of the virtual machine VMk.
The selecting unit 502 selects a memory block bi from among the memory blocks b1 to bn that forms the memory Mk of the virtual machine VMk (step S1703). The checking unit 1601 checks whether the memory block bi is a memory block that has been put into free memory (step S1704).
When the memory block bi is a memory block put into free memory (step S1704: YES), the determining unit 1602 determines that the copying of the source-side data di is not necessary (step S1705). The determining unit 1602 changes the status of the memory block bi to a state where page stealing has been performed (step S1706), and the process goes to step S1712.
When the memory bloc bi is not a memory block that has been put into free memory at step S1704 (step S1704: NO), the checking unit 1601 checks whether the source-side data di is stored in the file system (step S1707). When the source-side data di has been stored in the file system (step S1707: YES), the process goes to the step S1705.
When the source-side data di has not been stored in the file system (step S1707: NO), the checking unit 1601 checks whether there is a backing store of the source-side data di (step S1708). When there is a backing store of the source-side data di (step S1708: YES), the process goes to step S1705.
When there is no backing store of the source-side data di (step S1708: NO), the checking unit 1601 checks whether the memory block bi has been initialized (step S1709). When the memory block bi has been initialized (step S1709: YES), the process goes to step S1705.
When the memory block bi has not been initialized (step S1709: NO), the determining unit 1602 determines that the copying of the source-side data di is necessary (step S1710). The transmitting unit 503 transmits to the destination-side server SV the instruction concerning the copying of the source-side data di of the memory block bi (step S1711).
The selecting unit 502 increments i of the memory block bi (step S1712), and determines whether i is larger than n (step S1713). When i is less than or equal to n (step S1713: NO), the process returns to step S1703. When is larger than n (step S1713: YES), the process according to the flowchart ends.
As a result, for each memory block bi to which the memory Mk of the virtual machine VMk subject to migration, is divided, the necessity of the copying of the source-side data di of the memory block bi can be determined. The processes of step S1706 and step S1711 may be executed together after the necessity of the copying of all memory blocks b1 to bn is checked.
As described above, according to the server SV of the third embodiment, for each memory block bi of the virtual machine VMk, the necessity of the copying of the source-side data di is checked based on the attribute information of the source-side data di stored in the memory block bi. As a result, unnecessary copying of data di is prevented and the amount of data transferred between servers can be reduced in a live migration process.
According to the server SV, it is checked whether a memory block bi is a memory block that has been put into free memory and thus the necessity of the source-side data di stored in the memory block bi can be determined.
According to the server SV, it is checked whether the source-side data di stored in the memory block bi is stored in the file system that the destination-side server SV can access. As a result, the necessity of the copying of the source-side data di can be determined.
According to the server SV, it is checked whether there is a backing store of the source-side data di stored in the memory block bi. As a result, the necessity of the copying of the source-side data di can be determined.
According to the server SV, it is checked whether a memory block bi has been initialized. As a result, the necessity of the copying of the source-side data di stored in the memory block bi can be determined.
The data migration method in the present embodiments can be implemented by a computer, such as a personal computer and a workstation, executing a program that is prepared in advance. The data migration program is recorded on a computer-readable recording medium such as a hard disk, a flexible disk, a CD-ROM, an MO, and a DVD, and is executed by being read out from the recording medium by a computer. The program can be distributed through a network such as the Internet.
The data migration program, computing device, and data migration method prevent unnecessary data copying between computing devices and reduce the amount of data transferred between the devices.
All examples and conditional language provided herein are intended for pedagogical purposes of aiding the reader in understanding the invention and the concepts contributed by the inventor to further the art, and are not to be construed as limitations to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although one or more embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
This application is a continuation application of International Application PCT/JP2010/072583, filed on Dec. 15, 2010 and designating the U.S., the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/JP2010/072583 | Dec 2010 | US |
Child | 13917082 | US |