发明名称 Method, apparatus, and system for generating and recovering memory snapshot of virtual machine
摘要 A method for generating and recovering a memory snapshot of a virtual machine is provided. The method includes: obtaining a current Sth memory page of the virtual machine; identifying a page type of the current Sth memory page, where the page type includes an invalid data page and a valid data page; and recording the page type of the current Sth memory page in a memory snapshot file when the page is an invalid data page; and recording the page type and page data of the current Sth memory page in the memory snapshot file when the page is a valid data page, so that only valid data is stored according to the embodiments of the present invention, thereby reducing backup of invalid data, greatly shortening the generation time of the memory snapshot, reducing the size of the memory snapshot file, and saving storage resources.
申请公布号 US9507672(B2) 申请公布日期 2016.11.29
申请号 US201414251785 申请日期 2014.04.14
申请人 Huawei Technologies Co., Ltd. 发明人 Ye Chuan
分类号 G06F11/14;G06F9/46;G06F9/455 主分类号 G06F11/14
代理机构 Conley Rose, P.C. 代理人 Conley Rose, P.C.
主权项 1. A method for generating a memory snapshot of a virtual machine, comprising: obtaining a current Sth memory page of the virtual machine; identifying a page type of the current Sth memory page, wherein the page type comprises an invalid data page and a valid data page; recording the page type of the current Sth memory page in a memory snapshot file when the current Sth memory page is the invalid data page; and recording the page type and page data of the current Sth memory page in the memory snapshot file when the current Sth memory page is the valid data page, wherein identifying the page type of the current Sth memory page specifically comprises determining the page type of the current Sth memory page according to page type information stored in virtual machine monitor (VMM) memory space, wherein the page type comprises a balloon page, a populate-on-demand page, a share page, a swap page, and a common page, wherein the balloon page and the populate-on-demand page are invalid data pages, wherein the share page, the swap page, and the common page are valid data pages, wherein recording the page type of the current Sth memory page in the memory snapshot file when the current Sth memory page is the invalid data page, and recording the page type and the page data of the current Sth memory page in the memory snapshot file when the current Sth memory page is the valid data page specifically comprises: recording the page type of the current Sth memory page as the balloon page in the memory snapshot file when the current Sth memory page is the balloon page;recording the page type of the current Sth memory page as the populate-on-demand page in the memory snapshot file when the current Sth memory page is the populate-on-demand page;recording the page type of the current Sth memory page as the swap page in the memory snapshot file;copying page data of the swap page from a memory swap file into the memory snapshot file when the current Sth memory page is the swap page;recording the page type of the current Sth memory page as the share page in the memory snapshot file;copying the page data of the share page into the memory snapshot, file;recording a page number of another memory page sharing memory data with the current Sth memory page when the current Sth memory page is the share page;recording the page type of the current Sth memory page as the common page in the memory snapshot file; andcopying page data of the common page into the memory snapshot file when the current Sth memory page is the common page.
地址 Shenzhen CN