IP Library › Granted Patent US 8,935,502
Granted Patent B2
US 8,935,502 · App. 13/724,692 · Granted Jan 13, 2015

Synchronous management of disk flush requests

Inventor: Paolo Bonzini (Turate, IT)
Assignee: Red Hat, Inc.
G06F12/16G06F17/30575
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,935,502
App. No.
13/724,692
Granted
Jan 13, 2015
Kind
B2
Abstract

In a process for migrating a virtual machine's storage from a source disk to a destination disk, a virtual machine monitor (VMM) records a source-generation count representing contents on the source disk, a writes-mirrored value representing a number of writes replicated from the source disk to the destination disk at a time contents of the disks were equal, a flush-request value representing the source-generation count at a time a flush is requested by a guest operating system of the virtual machine, and a writes-flushed value representing the writes-mirrored value at a time of a last flush of the destination disk. Upon identification of a steady state, the VMM sets the writes-mirrored value to the recorded source-generation count. The VMM determines if a request to flush the source disk has been issued by the guest, sets the flush-request value to the source-generation count at a time of the flush request, and flushes the destination disk upon determining that the flush-request value is greater than the writes-flushed value and the flush-request value is less than or equal to the writes-mirrored value.

Claims (89)

1. A method comprising:

recording, by a virtual machine monitor executed by a processing device, a source-generation count representing content on a source disk associated with a virtual machine;

recording a writes-mirrored value representing content on a destination disk migrated from a source disk, at a time contents of the source disk and the destination disk were equal;

recording a flush-request value representing the source-generation count at a time a flush is requested by a guest operating system of the virtual machine;

recording a writes-flushed value representing the writes-mirrored value at a time of a last flush of the destination disk;

identifying, by the virtual machine monitor, a steady state wherein contents associated with a virtual machine stored on the source disk and a destination disk are equal;

upon identifying the steady state, setting a writes-mirrored value to the recorded source-generation count;

determining if a flush request to flush the source disk has been issued by the guest operating system of the virtual machine;

setting the flush-request value to the source-generation count at a time of the flush request; and

flushing the destination disk upon determining that the flush-request value is greater than the writes-flushed value and the flush-request value is less than or equal to the writes-mirrored value.

2. The method of claim 1 , further comprising recording the writes-flushed value as the writes-mirrored value upon completion of the flush of the destination disk.

3. The method of claim 1 , further comprising:

entering an idle state waiting for a disk write; and

exiting the idle state upon determining the writes-mirrored value is less than the source-generation count.

4. A method comprising:

recording, by a virtual machine monitor executed by a processing device, a source-generation count representing contents on a source disk associated with a virtual machine;

recording a writes-mirrored value representing content on a destination disk migrated from a source disk, at a time contents of the source disk and the destination disk were equal;

recording a flush-request value representing the source-generation count at a time a flush is requested by a guest operating system of a virtual machine;

recording a writes-flushed value representing the writes-mirrored value at a time of a last flush of the destination disk;

determining that the flush-request value is less than or equal to the writes-flushed value or the flush-request value is greater than or equal to the source-generation count;

setting the flush-request value to the source-generation count; and

reporting confirmation of completion of the flush request upon determining that the writes-flushed value is greater than or equal to the source-generation count.

5. The method of claim 4 , wherein the determining, setting, and reporting further comprising:

observing a change to the writes-flushed value;

repeating determining that the flush-request value is less than or equal to the writes-flushed value or the flush-request value is greater than or equal to the source-generation count;

repeating setting the flush-request value to the source-generation count; and

repeating reporting confirmation of completion of the flush request upon determining that the writes-flushed value is greater than or equal to the source-generation count.

6. The method of claim 4 , further comprising reporting, to the virtual machine, an error associated with execution of the flush request.

7. The method of claim 4 , further comprising:

detecting an error associated with execution of the flush request;

stopping the virtual machine; and

reporting the error to the virtual machine manager.

8. A non-transitory computer readable storage medium including instructions that, when executed by a processing device, cause the processing device to perform operations comprising:

recording, by a virtual machine monitor executed by the processing device, a source-generation count representing contents on a source disk associated with a virtual machine;

recording a writes-mirrored value representing content on a destination disk migrated from a source disk, at a time contents of the source disk and the destination disk were equal;

recording a flush-request value representing the source-generation count at a time a flush is requested by a guest operating system of the virtual machine;

recording a writes-flushed value representing the writes-mirrored value at a time of a last flush of the destination disk;

identifying, by the virtual machine monitor, a steady state wherein contents associated with a virtual machine stored on the source disk and a destination disk are equal;

upon identifying the steady state, setting a writes-mirrored value to the recorded source-generation count;

determining if a flush request to flush the source disk has been issued by the guest operating system of the virtual machine;

setting the flush-request value to the source-generation count at a time of the flush request; and

flushing the destination disk upon determining that the flush-request value is greater than the writes-flushed value and the flush-request value is less than or equal to the writes-mirrored value.

9. The non-transitory computer readable storage medium of claim 8 , further comprising recording the writes-flushed value as the writes-mirrored value upon completion of the flush of the destination disk.

10. The non-transitory computer readable storage medium of claim 8 , further comprising:

entering an idle state waiting for a disk write; and

exiting the idle state upon determining the writes-mirrored value is less than the source-generation count.

11. The non-transitory computer readable storage medium of claim 8 , further comprising:

determining that the flush-request value is less than or equal to the writes-flushed value or the flush-request value is greater than or equal to the source-generation count;

setting the flush-request value to the source-generation count; and

reporting confirmation of completion of the flush request upon determining that the writes-flushed value is greater than or equal to the source-generation count.

12. The non-transitory computer readable storage medium of claim 11 , further comprising:

observing a change to the writes-flushed value;

repeating determining that the flush-request value is less than or equal to the writes-flushed value or the flush-request value is greater than or equal to the source-generation count;

repeating setting the flush-request value to the source-generation count; and

repeating reporting confirmation of completion of the flush request upon determining that the writes-flushed value is greater than or equal to the source-generation count.

13. The non-transitory computer readable storage medium of claim 11 , further comprising reporting, to the virtual machine, an error associated with execution of the flush request.

14. The non-transitory computer readable storage medium of claim 11 , further comprising:

detecting an error associated with execution of the flush request;

stopping the virtual machine; and

reporting the error to the virtual machine manager.

15. A system comprising:

a memory;

a processing device, operatively coupled to the memory, the processing device to perform operations comprising:

recording, by a virtual machine monitor executed by the processing device, a source-generation count representing contents on a source disk associated with a virtual machine;

recording a writes-mirrored value representing content on a destination disk migrated from a source disk, at a time contents of the source disk and the destination disk were equal;

recording a flush-request value representing the source-generation count at a time a flush is requested by a guest operating system of the virtual machine;

recording a writes-flushed value representing the writes-mirrored value at a time of a last flush of the destination disk;

identifying, by the virtual machine monitor, a steady state wherein contents associated with a virtual machine stored on the source disk and a destination disk are equal;

upon identifying the steady state, setting a writes-mirrored value to the recorded source-generation count;

determining if a flush request to flush the source disk has been issued by the guest operating system of the virtual machine;

setting the flush-request value to the source-generation count at a time of the flush request; and

flushing the destination disk upon determining that the flush-request value is greater than the writes-flushed value and the flush-request value is less than or equal to the writes-mirrored value.

16. The system of claim 15 , further comprising recording the writes-flushed value as the writes-mirrored value upon completion of the flush of the destination disk.

17. The system of claim 15 , further comprising:

entering an idle state waiting for a disk write; and

exiting the idle state upon determining the writes-mirrored value is less than the source-generation count.

18. The system of claim 15 , further comprising:

determining that the flush-request value is less than or equal to the writes-flushed value or the flush-request value is greater than or equal to the source-generation count;

setting the flush-request value to the source-generation count; and

reporting confirmation of completion of the flush request upon determining that the writes-flushed value is greater than or equal to the source-generation count.

19. The system of claim 18 , further comprising:

observing a change to the writes-flushed value;

repeating determining that the flush-request value is less than or equal to the writes-flushed value or the flush-request value is greater than or equal to the source-generation count;

repeating setting the flush-request value to the source-generation count; and

repeating reporting confirmation of completion of the flush request upon determining that the writes-flushed value is greater than or equal to the source-generation count.

20. The system of claim 18 , further comprising:

detecting an error associated with execution of the flush request;

stopping the virtual machine; and

reporting the error to the virtual machine manager.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 1, 2014
From: BONZINI, PAOLO
To: RED HAT, INC.
Reel/Frame 033870/0459 →
Continuity (1)
Related Publication 20140181397A1 · Jun 26, 2014