# US 9,354,918 B2 · Migrating local cache state with a virtual machine

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 9,354,918 B2
- Document ID: US9354918B2
- Status: Granted
- Kind: B2
- Application number: 14/176,202
- Filed: 2014-02-10
- Published: 2015-08-13
- Granted: 2016-05-31
- Earliest claimed: 2014-02-10
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Aayush Gupta; James L. Hafner
- Web page: https://patentgrep.com/patent/US9354918B2

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- H04L 67/34: {involving the movement of software or configuration parameters (network booting or remote initial program loading [RIPL] G06F9/4416)}
- H04L 67/568: Storing data temporarily at an intermediate stage, e.g. caching
- G06F 2009/4557: {Distribution of virtual machine instances; Migration and load balancing}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Embodiments relate to migrating a local cache state with a virtual machine (VM) migration. An aspect includes detecting that a VM executing on a source host machine has been paused as part of a migration of the VM from the source host machine to a target host machine. A state of a first local cache associated with the VM is identified. The first local cache is accessible by the source host machine and includes data previously fetched from a shared storage. Pre-fetch hints that are based on the state of the first local cache are sent to the target host machine prior to the migration completing. The pre-fetch hints are utilized by the target host machine to fetch, from the shared storage, at least a subset of the data stored in the first local cache for storage in a second local cache accessible by the target host machine.

## Claims

### Claim 1

A method of migrating cache state with a virtual machine (VM), the method comprising:
detecting that a migration of a VM from a source host machine to a target host machine has started, the VM executing on the source host machine;
identifying an initial state of a first local cache associated with the VM, the first local cache accessible by the source host machine and storing data previously fetched from a shared storage;
sending initial pre-fetch hints to the target host machine, the initial pre-fetch hints based on the initial state of the first local cache, the initial pre-fetch hints utilized by the target host machine to fetch, from the shared storage, at least a subset of the data stored in the first local cache for storage in a second local cache accessible by the target host machine;
detecting that the VM executing on the source host machine has been paused as part of the migration of the VM from the source host machine to the target host machine;
based on detecting that the VM executing on the source host machine has been paused, identifying a state of the first local cache;
comparing the state of the first local cache to the initial state of the first local cache;
based on the comparing, identifying blocks in the first local cache that have been modified or newly added; and
prior to the migration completing and subsequent to sending the initial pre-fetch hints, sending pre-fetch hints only for those blocks in the first local cache that have been modified or newly added to the target host machine, the pre-fetch hints utilized by the target host machine to fetch, from the shared storage, at least a subset of the data stored in the first local cache for storage in the second local cache accessible by the target host machine.

### Claim 2 (depends on 1)

The method of claim 1, wherein the pre-fetch hints include a priority order to indicate a suggested fetching order to the target host machine.

### Claim 3 (depends on 1)

The method of claim 1, wherein the first local cache is not accessible by the target host machine.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
identifying an intermediate state of the first local cache associated with the VM; and
sending intermediate pre-fetch hints to the target host machine subsequent to sending the initial pre-fetch hints and prior to sending the pre-fetch hints, the intermediate pre-fetch hints based on the intermediate state of the first local cache.

### Claim 5 (depends on 1)

The method of claim 1, wherein the first local cache is a write-back mode cache and the method further comprises converting the first local cache to a write-through mode cache based on the detecting.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
receiving the pre-fetch hints at the target host machine;
fetching data from the shared storage based on the pre-fetch hints, the fetching performed independently of the migration of the VM from the source host machine to the target host machine; and
storing the fetched data in the second local cache associated with the VM and accessible by the target host machine.

### Claim 7

A computer program product for migrating cache state with a virtual machine (VM), the computer program product comprising:
a computer readable storage medium having program code embodied therewith, the program code executable by a computer for:
detecting that a migration of a VM from a source host machine to a target host machine has started, the VM executing on the source host machine;
identifying an initial state of a first local cache associated with the VM, the first local cache accessible by the source host machine and storing data previously fetched from a shared storage;
sending initial pre-fetch hints to the target host machine, the initial pre-fetch hints based on the initial state of the first local cache, the initial pre-fetch hints utilized by the target host machine to fetch, from the shared storage, at least a subset of the data stored in the first local cache for storage in a second local cache accessible by the target host machine;
detecting that the VM executing on the source host machine has been paused as part of the migration of the VM from the source host machine to the target host machine;
based on detecting that the VM executing on the source host machine has been paused, identifying a state of the first local
comparing the state of the first local cache to the initial state of the first local cache;
based on the comparing, identifying blocks in the first local cache that have been modified or newly added; and
prior to the migration completing and subsequent to sending the initial pre-fetch hints, sending pre-fetch hints only for those blocks in the first local cache that have been modified or newly added to the target host machine, the pre-fetch hints utilized by the target host machine to fetch, from the shared storage, at least a subset of the data stored in the first local cache for storage in the second local cache accessible by the target host machine.

### Claim 8 (depends on 7)

The computer program product of claim 7, wherein the pre-fetch hints include a priority order to indicate a suggested fetching order to the target host machine.

### Claim 9 (depends on 7)

The computer program product of claim 7, wherein the first local cache is not accessible by the target host machine.

### Claim 10 (depends on 7)

The computer program product of claim 7, wherein the program code is further executable by the computer for:
identifying an intermediate state of the first local cache associated with the VM; and
sending intermediate pre-fetch hints to the target host machine subsequent to sending the initial pre-fetch hints and prior to sending the pre-fetch hints, the intermediate pre-fetch hints based on the intermediate state of the first local cache.

### Claim 11 (depends on 7)

The computer program product of claim 7, wherein the first local cache is a write-back mode cache and the method further comprises converting the first local cache to a write-through mode cache based on the detecting.

### Claim 12 (depends on 7)

The computer program product of claim 7, wherein the program code is further executable by the computer for:
receiving the pre-fetch hints at the target host machine;
fetching data from the shared storage based on the pre-fetch hints, the fetching performed independently of the migration of the VM from the source host machine to the target host machine; and
storing the fetched data in the second local cache associated with the VM and accessible by the target host machine.

### Claim 13

A system for migrating cache state with a virtual machine (VM), the system comprising:
a memory having computer readable computer instructions; and
a processor for executing the computer readable instructions, the computer readable instructions including:
detecting that a migration of a VM from a source host machine to a target host machine has started, the VM executing on the source host machine;
identifying an initial state of a first local cache associated with the VM, the first local cache accessible by the source host machine and storing data previously fetched from a shared storage;
sending initial pre-fetch hints to the target host machine, the initial pre-fetch hints based on the initial state of the first local cache, the initial pre-fetch hints utilized by the target host machine to fetch, from the shared storage, at least a subset of the data stored in the first local cache for storage in a second local cache accessible by the target host machine;
detecting that the VM executing on the source host machine has been paused as part of the migration of the VM from the source host machine to the target host machine;
based on detecting that the VM executing on the source host machine has been paused, identifying a state of the first local cache;
comparing the state of the first local cache to the initial state of the first local cache;
based on the comparing, identifying blocks in the first local cache that have been modified or newly added; and
prior to the migration completing and subsequent to sending the initial pre-fetch hints, sending pre-fetch hints only for those blocks in the first local cache that have been modified or newly added to the target host machine, the pre-fetch hints utilized by the target host machine to fetch, from the shared storage, at least a subset of the data stored in the first local cache for storage in the second local cache accessible by the target host machine.

### Claim 14 (depends on 13)

The system of claim 13, wherein the pre-fetch hints include a priority order to indicate a suggested fetching order to the target host machine.

### Claim 15 (depends on 13)

The system of claim 13, wherein the first local cache is not accessible by the target host machine.

### Claim 16 (depends on 13)

The system of claim 13, wherein the computer readable instructions further include:
identifying an intermediate state of the first local cache associated with the VM; and
sending intermediate pre-fetch hints to the target host machine subsequent to sending the initial pre-fetch hints and prior to sending the pre-fetch hints, the intermediate pre-fetch hints based on the intermediate state of the first local cache.

### Claim 17 (depends on 13)

The system of claim 13, wherein the first local cache is a write-back mode cache and the method further comprises converting the first local cache to a write-through mode cache based on the detecting.

### Claim 18 (depends on 13)

The system of claim 13, wherein the computer readable instructions further include:
receiving the pre-fetch hints at the target host machine;
fetching data from the shared storage based on the pre-fetch hints, the fetching performed independently of the migration of the VM from the source host machine to the target host machine; and
storing the fetched data in the second local cache associated with the VM and accessible by the target host machine.
