发明名称 Method and system for managing virtual machine storage space and physical host
摘要 A method for managing Virtual Machine (VM) storage space is provided. In the method, a Storage Balloon Agent (SBA) module deployed in a VM is adopted to directly acquire virtual storage free block information and deliver the acquired virtual storage free block information to a Storage Balloon Daemon (SBD) module deployed in a Virtual Machine Monitor (VMM) layer; and the SBD module releases a part or all of physical storage space corresponding to the virtual storage free block information, and marks virtual storage blocks corresponding to the released physical storage space as unavailable. A corresponding system and a physical host are further provided in the present invention. Through the method of an embodiment of the present invention, use condition of virtual storage space can be acquired in real time, and a large number of read and write operations of a storage system can be avoided.
申请公布号 US8850156(B2) 申请公布日期 2014.09.30
申请号 US201113339209 申请日期 2011.12.28
申请人 Huawei Technologies Co., Ltd. 发明人 Yang Xiaowei;Wang Zhikun
分类号 G06F12/08;G06F9/455;G06F9/445 主分类号 G06F12/08
代理机构 代理人
主权项 1. A method for managing a Virtual Machine (VM) storage space, applicable to a physical host, wherein the physical host comprises a hardware layer, a Virtual Machine Monitor (VMM) layer running on the hardware layer, and a VM running on the VMM layer, wherein a Storage Balloon Agent (SBA) module is deployed in the VM, and a Storage Balloon Daemon (SBD) module is deployed in the VMM layer, the method comprising: acquiring, by the SBA module, virtual storage blocks occupied by an expanded part of a predefined file or virtual storage blocks occupied by a contracted part of the predefined file according to results obtained by comparing a size of virtual storage space occupied by the predefined file and a limit value range indicating virtual storage free space which is allowed to be occupied by the predefined file, wherein the predefined file is used to occupy certain virtual storage free space, and delivering virtual storage free block information indicating the virtual storage blocks to the SBD module; releasing, by the SBD module, a part or all of a physical storage space corresponding to the virtual storage free block information so that the released physical storage space can be re-allocated, and marking virtual storage blocks corresponding to the released physical storage space as unavailable in a VM storage format; wherein acquiring, by the SBA module, the virtual storage blocks and delivering the virtual storage free block information to the SBD module comprises: comparing, by the SBA module, the size of the virtual storage space occupied by the predefined file with the limit value range, wherein the limit value range includes a lower limit value and an upper limit value;if the size of the virtual storage space occupied by the predefined file is smaller than the lower limit value of the limit value range, expanding the predefined file and allocating virtual storage blocks from virtual storage free space to the predefined file that is expanded;obtaining first virtual storage blocks occupied by an expanded part of the predefined file; anddelivering first virtual storage free block information indicating the first virtual storage blocks to the SBD module; wherein releasing, by the SBD module, a part or all of the physical storage space corresponding to the virtual storage free block information, and marking the virtual storage blocks corresponding to the released physical storage space as unavailable in a VM storage format comprises: judging, by the SBD module, whether the first virtual storage blocks corresponding to the first virtual storage free block information are available, and if the first virtual storage blocks corresponding to the first virtual storage free block information are available, marking the first virtual storage blocks as free; andreleasing physical storage space corresponding to a part or all of the first virtual storage blocks marked as free and marking the first virtual storage blocks corresponding to the released physical storage space as unavailable in the VM format according to a policy; wherein releasing the physical storage space corresponding to a part or all of the first virtual storage blocks marked as free according to the policy comprises: judging whether a frequency of an operation of allocating or releasing the storage space in the VM is greater than a preset threshold, and if the frequency of the operation of allocating or releasing the storage space in the VM is not greater than the preset threshold, releasing, in a preset proportion, the physical storage space corresponding to the first virtual storage blocks marked as free; if the frequency of the operation of allocating or releasing the storage space in the VM is greater than the preset threshold, reducing the preset proportion at a preset rate, and releasing, in the reduced proportion, the physical storage space corresponding to the first virtual storage blocks marked as free.
地址 Shenzhen CN