# US 9,733,980 B1 · Virtual machine management using I/O device logging

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

- Number: US 9,733,980 B1
- Document ID: US9733980B1
- Status: Granted
- Kind: B1
- Application number: 14/562,560
- Filed: 2014-12-05
- Granted: 2017-08-15
- Earliest claimed: 2014-12-05
- Assignees: Amazon Technologies, Inc.
- Applicants: Amazon Technologies, Inc.
- Inventors: Asif Khan; Anthony Nicholas Liguori; Mark Bradley Davis
- Web page: https://patentgrep.com/patent/US9733980B1

## CPC

- H04L 41/0897: by horizontal or vertical scaling of resources, or by migrating entities, e.g. virtual resources or entities
- G06F 5/085: {in which the data is recirculated}
- G06F 5/14: for overflow or underflow handling, e.g. full or empty flags
- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 9/4856: {resumption being on a different machine, e.g. task migration, virtual machine migration (G06F9/5088 takes precedence)}
- G06F 13/00: Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units (interface circuits for specific input/output devices G06F3/00 {; multiprogram control therefor G06F9/46}; multiprocessor systems G06F15/16 )
- H04L 41/0813: characterised by the conditions triggering a change of settings
- H04L 67/1004: Server selection for load balancing
- G06F 2009/4557: {Distribution of virtual machine instances; Migration and load balancing}
- G06F 2009/45579: {I/O management, e.g. providing access to device drivers or storage}
- H04J 3/14: Monitoring arrangements {(for SDH/SONET rings H04J3/085)}
- H04L 49/90: Buffering arrangements
- H04L 67/02: based on web technology, e.g. hypertext transfer protocol [HTTP]
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04J: MULTIPLEX COMMUNICATION (transmission in general H04B; peculiar to transmission of digital information H04L5/00; systems for the simultaneous or sequential transmission of more than one television signal H04N7/08; in exchanges H04Q11/00; stereophonic systems H04S)

## Abstract

Techniques are described for managing virtual machines using input/output (I/O) device logging. For example, a system bus or other interface to a device may be monitored for traffic data elements. The traffic data elements may include, for example, transaction layer packets (TLPs) for communication across a PCI Express interface, or TCP/IP packets for communication over a network. These traffic data elements may be logged in an I/O device logging buffer. The I/O device logging buffer can then be used to ensure that all memory relating to a virtual machine is copied when transferring the virtual machine to another computing device. In addition, the I/O device logging buffer can be used to stop a virtual machine without waiting for the virtual machine to complete I/O processing.

## Claims

### Claim 1

A computer-implemented method, comprising:
receiving, by a first server computer, a request to migrate a virtual machine running on the first server computer to a second server computer;
copying, by the first server computer, a plurality of memory pages of the virtual machine to the second server computer;
determining, by the first server computer, using an input/output (I/O) logging buffer from a plurality of I/O buffers on an I/O device, that the I/O device has performed a direct memory access (DMA) write operation since the copying of the plurality of memory pages, wherein the I/O logging buffer stores one or more DMA operations performed by the I/O device,
wherein the one or more DMA operations performed by the I/O device are stored in the I/O logging buffer by classifying traffic data elements at the I/O device from a communication channel resulting in the one or more DMA operations, wherein the classifying comprises determining that the traffic data elements are directed to the virtual machine and routing the determined traffic data elements to the I/O logging buffer;
determining, by the first server computer, a modified memory page corresponding to an address of the DMA write operation;
copying, by the first server computer, the modified memory page to the second server computer; and
halting, by the first server computer, the virtual machine, wherein the virtual machine is resumed on the second server computer.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein a hypervisor tracks a plurality of dirty memory pages, wherein a page is marked as dirty if it has been modified since the copying of the plurality of memory pages, and wherein the hypervisor copies the plurality of dirty memory pages to the second server computer.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, further comprising copying, by the first server computer, state corresponding to the I/O logging buffer, wherein the second server computer uses the I/O logging buffer state to replay a plurality of pending I/O requests.

### Claim 4 (depends on 3)

The computer-implemented method of claim 3, wherein the I/O device communicates with the virtual machine via a PCI Express bus, and wherein the I/O logging buffer stores transaction layer packets.

### Claim 5

A computer-implemented method, comprising:
receiving, by a first server computer, a request to migrate a virtual machine running on the first server computer to a second server computer;
copying, by the first server computer, a plurality of memory data of the virtual machine to the second server computer;
determining, by the first server computer, that a subset of the plurality of memory data has been modified by an I/O device during the copying of the plurality of memory data performed by the first server computer,
wherein the determination that the subset of memory has been modified is performed using an I/O logging buffer of a plurality of I/O logging buffers on the I/O device, wherein the I/O logging buffer logs traffic data elements from a communication of the I/O device over a communication channel, and
wherein a classifier module on the I/O device determines the traffic data elements from the communication that are directed to the virtual machine and routes the determined traffic data elements to the I/O logging buffer;
copying, by the first server computer, in response to determining that the subset of the plurality of memory data has been modified, the modified memory data to the second server computer; and
halting, by the first server computer, the virtual machine, wherein the virtual machine is resumed on the second server computer.

### Claim 6 (depends on 5)

The method of claim 5, wherein the communication channel is a PCI Express bus, and wherein the I/O logging buffer comprises a plurality of transaction layer packets sent or received by the I/O device.

### Claim 7 (depends on 5)

The method of claim 5, wherein the communication channel is a communication network, and wherein the I/O logging buffer comprises a plurality of Ethernet packets.

### Claim 8 (depends on 5)

The method of claim 5, wherein the I/O device is one of a plurality of virtual I/O devices running on an offload engine.

### Claim 9 (depends on 5)

The method of claim 5, further comprising copying, by the first server computer, state corresponding to the I/O logging buffer, wherein the second server computer uses the I/O logging buffer state to replay a plurality of pending I/O requests.

### Claim 10 (depends on 5)

The method of claim 5, wherein determining that the subset of the plurality of memory data has been modified by the I/O device comprises:
determining, by the first server computer, one or more host physical memory addresses written to by the I/O device; and
determining, by the first server computer, a virtual machine physical memory address for the virtual machine corresponding to each of the host physical memory addresses.

### Claim 11 (depends on 10)

The method of claim 10, wherein the virtual machine physical memory address corresponding to a host physical memory addresses is determined using a shadow page table.

### Claim 12

A computing device comprising:
a processor comprising one or more processing cores, wherein each processing core is configured to execute a respective plurality of virtual machines simultaneously and wherein each virtual machine comprises a respective plurality of computer executable instructions;
an input/output (I/O) device operable to write data to a main memory of the computing device and comprising:
a plurality of I/O logging buffers on the I/O device, wherein an I/O logging buffer from the plurality of I/O logging buffers on the I/O device is configured to log traffic data elements sent via the communication channel, wherein the traffic data elements include direct memory access (DMA) write requests; and
a classifier module on the I/O device operable to determine that the traffic data elements from the communication are directed to a virtual machine from the plurality of virtual machines, and further operable to route the determined traffic data elements to the I/O logging buffer.

### Claim 13 (depends on 12)

The computing device of claim 12, wherein the processor is configured to migrate the virtual machine in the plurality of virtual machines to a second computing device, wherein migrating the virtual machine comprises:
copying, by the processor, a plurality of memory data of the virtual machine to the second computing device;
determining, by the processor, that a subset of the plurality of memory data has been modified by the I/O device using the I/O logging buffer; and
copying, by the processor, the modified memory data to the second computing device.

### Claim 14 (depends on 13)

The computing device of claim 13, wherein the plurality of memory data of the virtual machine comprises a plurality of memory pages and wherein the subset of the plurality of memory data comprises a subset of the memory pages.

### Claim 15 (depends on 13)

The computing device of claim 13, wherein the computing device further comprises a shadow page table mapping host physical memory pages to virtual machine physical pages, wherein the shadow page table and the I/O logging buffer are operable to determine a plurality of virtual machine physical pages modified by the I/O device.

### Claim 16 (depends on 13)

The computing device of claim 13, wherein the communication channel is a PCI Express bus, and wherein the I/O logging buffer comprises a plurality of transaction layer packets sent or received by the I/O device.

### Claim 17 (depends on 13)

The computing device of claim 13, wherein the processor is further configured to copy state corresponding to the I/O logging buffer, wherein the I/O logging buffer state is operable to replay a plurality of pending I/O requests.

### Claim 18 (depends on 12)

The computing device of claim 12, wherein the computing device comprises an offload engine, wherein the I/O device is one of a plurality of virtual I/O devices running on the offload engine, and wherein the I/O logging buffer is one of a plurality of I/O logging buffers maintained by the offload engine.
