Method and apparatus for generating virtual machine snapshot
AssigneeHuawei Technologies Co., Ltd.
InventorHailiang Zhang
Life of this patent
Estimating the term…
Abstract
A method and an apparatus for generating a virtual machine snapshot, where the method includes suspending a virtual machine at a first moment according to a received snapshot command, starting to perform a storage operation on a memory page in memory of the virtual machine and a contamination interception operation on the memory page in the memory, storing a device status, which is at the first moment, of the virtual machine to a snapshot file, and restoring the virtual machine from a suspended state to a running state after the device status is stored.
Claims19
A method for generating a virtual machine snapshot, comprising:
- suspending a virtual machine at a first moment according to a received snapshot command;
- starting to perform a contamination interception operation on a memory page in a memory of the virtual machine by:
- intercepting, from the first moment to a moment at which content of the memory page is stored to a snapshot file of the virtual machine, a contamination action affecting the content of the memory page;
- and
- releasing the interception on the contamination action after storing the content of the memory page to a buffer;
- starting to perform a storage operation on the memory page in the memory of the virtual machine by storing the content, stored in the buffer, of the memory page to the snapshot file of the virtual machine;
- storing a device status, which is at the first moment, of the virtual machine in a suspended state to the snapshot file of the virtual machine;
- and
- restoring the virtual machine from the suspended state to a running state after the device status is stored.
A non-transitory computer-readable storage medium storing instructions that when executed by a computer device, cause the computer device to be configured to:
- suspend a virtual machine at a first moment according to a received snapshot command;
- start performing a contamination interception operation on a memory page in a memory of the virtual machine from the first moment by:
- intercepting, from the first moment to a moment at which content of the memory page is stored to a snapshot file of the virtual machine, a contamination action affecting the content of the memory page;
- and
- releasing the interception on the contamination action after the content of the memory page is stored to a buffer;
- start performing a storage operation on the memory page in the memory of the virtual machine from the first moment by storing the content, stored in the buffer, of the memory page to the snapshot file of the virtual machine;
- store a device status, which is at the first moment, of the virtual machine in a suspended state to the snapshot file of the virtual machine;
- and
- restore the virtual machine from the suspended state to a running state after the device status is stored.
A computing node, comprising:
- a hardware platform;
- and
- a virtual machine monitor and a virtual machine run on the hardware platform, the virtual machine monitor being configured to:
- suspend the virtual machine at a first moment according to a received snapshot command;
- start performing a contamination interception operation on a memory page in a memory of the virtual machine by
- intercepting, from the first moment to a moment at which content of the memory page is stored to a snapshot file of the virtual machine, a contamination action affecting the content of the memory page;
- and
- releasing the interception on the contamination action after storing the content of the memory page to a buffer;
- start performing a storage operation on the memory page in the memory of the virtual machine by storing the content, stored in the buffer, of the memory page to the snapshot file of the virtual machine;
- store a device status, which is at the first moment, of the virtual machine in a suspended state to the snapshot file of the virtual machine;
- and
- restore the virtual machine from the suspended state to a running state after the device status is stored.
Dependencies are inferred from the claim text.