WO2014089967A1 - 建立虚拟机共享存储缓存的方法及装置 - Google Patents

建立虚拟机共享存储缓存的方法及装置 Download PDF

Info

Publication number
WO2014089967A1
WO2014089967A1 PCT/CN2013/079647 CN2013079647W WO2014089967A1 WO 2014089967 A1 WO2014089967 A1 WO 2014089967A1 CN 2013079647 W CN2013079647 W CN 2013079647W WO 2014089967 A1 WO2014089967 A1 WO 2014089967A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
read
data
virtual
shared cache
Prior art date
Application number
PCT/CN2013/079647
Other languages
English (en)
French (fr)
Inventor
金添福
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2014089967A1 publication Critical patent/WO2014089967A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Definitions

  • the present invention relates to the field of virtual machine technologies, and in particular, to a method and apparatus for establishing a virtual machine shared storage cache. Background technique
  • the flow control method is adopted, and the startup time of the virtual machine is set to be several hours before the work, and all the virtual machines are gradually started in a flow control manner, thereby avoiding the impact of centralized concurrent startup on the storage service capability.
  • the technical problem to be solved by the present invention is to provide a method and a device for establishing a shared storage cache of a virtual machine, which can cache only valid data in the startup of the virtual machine with a small amount of memory space, and solve the problem of concurrently starting and reading data by the virtual machine concurrently. Input and output problems.
  • a first aspect of the present invention provides a method for establishing a virtual machine shared storage cache, including: acquiring data read and written from a virtual boot disk during a virtual machine startup process; storing the data to a virtual machine shared cache device for other virtual The data is read from the virtual machine shared cache device upon booting.
  • the step of acquiring data read and written from the virtual boot disk during startup of the virtual machine includes: sending, by the virtual machine, the read to the virtual machine shared cache device Writing a request; the virtual machine receives a read/write request response sent by the virtual machine shared cache device, and the read/write request response carries read/write request failure information.
  • the method further includes: performing a data deletion operation on the data stored by the virtual machine shared cache device.
  • the virtual machine startup process includes booting the virtual machine to the virtual machine operating system. The startup is completed or the startup of the virtual machine to the virtual machine's preset application is completed.
  • a second aspect of the present invention provides an apparatus for sharing a cache of a virtual machine, where the apparatus includes: an obtaining module and a storage module; and the obtaining module is configured to acquire data read and written from a virtual boot disk during startup of the virtual machine; The storage module is configured to store the data to the virtual machine shared cache device for reading the data from the virtual machine shared cache device when other virtual machines are booted.
  • the device further includes: a read/write module; the read/write module is configured to: when the virtual machine sends a read/write request to the virtual machine shared cache device, Receiving the request, and sending a read/write request response sent by the virtual machine shared cache device to the virtual machine, where the read/write request response carries read/write request failure information.
  • the device further includes a deduplication module, where the deduplication module is configured to The virtual machine shares the data stored by the cache device for deduplication operations.
  • the virtual machine startup process includes booting the virtual machine to the virtual machine operating system The startup is completed or the startup of the virtual machine to the virtual machine's preset application is completed.
  • the invention has the following advantages: the present invention acquires data read and written from the virtual boot disk during the startup process of the virtual machine; and only caches valid data for the virtual machine to the virtual machine shared cache device, When other virtual machines are started, data is read from the virtual machine shared cache device. In this way, only valid data in the virtual machine startup can be cached with a small amount of memory space, and the input and output problems of the virtual machine concurrent startup can be solved.
  • FIG. 1 is a flowchart of an embodiment of a method for establishing a virtual machine shared storage cache according to the present invention
  • 2 is a flowchart of another embodiment of a method for establishing a virtual machine shared storage cache according to the present invention
  • FIG. 3 is an implementation manner of a method for establishing a virtual machine shared storage cache according to the present invention
  • Figure 5 shows the virtual machine creation, startup, and shutdown processes
  • 6 is an implementation manner of the method for establishing a virtual machine shared storage cache in the actual application to repeat operations in the actual application;
  • FIG. 7 is a schematic structural diagram of an apparatus for sharing a cache of a virtual machine according to the present invention.
  • FIG. 8 is a schematic structural diagram of another embodiment of a device for sharing a cache of a virtual machine according to the present invention. detailed description
  • FIG. 1 is a flow chart of an embodiment of a method for establishing a virtual machine shared storage cache according to the present invention, including:
  • Step S101 Obtain data read and written from the virtual boot disk during startup of the virtual machine.
  • a virtual machine is a complete computer system that runs through a software and has full hardware system functionality running in a fully isolated environment.
  • the virtual machine When the virtual machine is powered on, the virtual machine reads and writes data from the virtual boot disk.
  • This data is the real valid data required for the virtual machine to boot, and obtains these valid data, so that the virtual machine can be read and written from the virtual boot disk when the virtual machine starts. The data.
  • Step S102 Store the data to the virtual machine shared cache device for reading the data from the virtual machine shared cache device when other virtual machines are started.
  • the data After obtaining the data read and written from the virtual boot disk during the startup process of the virtual machine, the data is stored in the virtual machine shared cache device, so that the other virtual machine reads the data from the virtual machine shared cache device when the virtual machine starts, so that the data is shared.
  • the input and output pressure of most virtual boot disks are stored in the virtual machine shared cache device, so that the other virtual machine reads the data from the virtual machine shared cache device when the virtual machine starts, so that the data is shared.
  • the virtual machine startup process includes the startup of the virtual machine to the startup of the virtual machine operating system or the startup of the preset application of the virtual machine to the virtual machine.
  • it can be the startup process of the Windows operating system, or the application of Office, Photosho, etc. Boot process.
  • the virtual machine is started as a temporary virtual machine startup process before the virtual machine cluster is started in a large-scale manner, and the read and write data necessary for the virtual machine large-scale startup process is obtained according to the startup of the temporary virtual machine, and these are read.
  • the write data is stored to the virtual machine shared cache device for reading data from the virtual machine shared cache device when other virtual machines are booted.
  • the invention obtains data read and written from the virtual boot disk during the startup process of the virtual machine; only valid data validated for the virtual machine is cached to the virtual machine shared cache device, so that the data is read from the virtual machine shared cache device when other virtual machines are started. In this way, it is possible to cache only valid data in the virtual machine startup with a small amount of memory space, and solve the problem of input and output when the virtual machine concurrently starts reading and writing data.
  • FIG. 2 is a flowchart of another embodiment of a method for establishing a virtual machine shared storage cache according to the present invention, including:
  • Step S201 The virtual machine sends a read/write request to the virtual machine shared cache device.
  • the virtual machine When the virtual machine is powered on, the virtual machine sends a read and write request to the virtual machine shared cache device.
  • Step S202 The virtual machine receives the read/write request response sent by the virtual machine shared cache device, and the read/write request response carries the read/write request failure information.
  • the virtual machine When there is no virtual machine read/write request data in the virtual machine shared cache device, the virtual machine sends a read/write request response to the virtual machine, and then the virtual machine receives the read/write request response sent by the virtual machine shared cache device, and the read/write request response carries the read/write request. Request failure information.
  • Step S203 Acquire data read and written from the virtual boot disk during the startup of the virtual machine.
  • Step S204 Store the data to the virtual machine shared cache device for reading the data from the virtual machine shared cache device when other virtual machines are started.
  • FIG. 3 is an implementation manner of the method for establishing a virtual machine shared storage cache in the practical application of the present invention.
  • This implementation method is a process of starting a virtual machine and a data read request during an operating system startup process, including:
  • Cache miss that is, there is no data currently requested by the B module in the C module, C module Returns null data and cache miss status to the B module.
  • the B module reads the currently requested data from the storage device (that is, the operating system virtual boot disk).
  • Module B caches the data read from the storage device to the C module. This caching operation only occurs during virtual machine startup.
  • ( b3.1 ) Cache hit That is, the C module stores the data currently requested by the B module, and the C module returns the read data and the cache hit status to the B module.
  • FIG. 4 is another implementation manner of the method for establishing a virtual machine shared storage cache in the practical application of the present invention.
  • This implementation method is a process of starting a virtual machine and a data write request during an operating system startup process, including:
  • ( cl ) Write request The virtual machine VM0 write request to the operating system virtual boot disk reaches the read/write module of the virtual machine shared cache device (ie, module B).
  • Module B sends a write request to the storage device (that is, the operating system virtual boot disk).
  • Module B returns the result returned by the write storage device to the virtual machine. See Figure 5, Figure 5 shows the virtual machine VM0 creation, startup, and shutdown process. The process includes: ( al ) Creating a virtual machine from an operating system boot disk in an unlinked clone in the Hypervisor
  • ( a3 ) VM0 enters the boot and operating system boot process.
  • ( a4 ) VM0 completes the boot and operating system startup process, and records the time when the OS startup is completed. T2.
  • T1 Log in to VMO, VMO starts to log in, and record the time when the login OS is completed is T3.
  • the identification of the time T1 may be the time when the management software issues the virtual machine to boot.
  • the T2 time can be identified by the following method: An agent program is implemented and deployed in advance in the virtual machine operating system, and the agent program monitors the process of opening and closing the system process.
  • the Agent detects that a process has started, it writes a token to Xenstore.
  • the Cache Optimization module (that is, the storage module of the VM shared cache device) in the Hypervisor or in the operating system where the Hypervisor is located determines the T2 and T3 times by detecting the corresponding tags in the Xenstore.
  • T2 can be determined by detecting "winlogon.exe”
  • T3 can be determined by detecting "explorer.exe”.
  • Step S205 Perform a data deletion operation on the data stored by the virtual machine shared cache device.
  • Deduplication technology is a current mainstream and very popular storage technology that optimizes storage capacity. It eliminates redundant data by deleting duplicate data in the data set, leaving only one of them. This technology can greatly reduce the need for physical storage space to meet the growing demand for data storage. This technology can bring many practical benefits, such as: can effectively control the rapid growth of data; increase effective storage space, improve storage efficiency; save total storage cost and management cost; save network bandwidth for data transmission; save space, power supply, Cooling and other operating costs and so on.
  • FIG. 6 is an implementation manner of the method for establishing a virtual machine shared storage cache in the actual application.
  • This implementation is a process of deduplicating the cache data between different virtual machines.
  • the process of saving the data of the VM1 to the VM1-cacheMap is taken as an example.
  • the process includes:
  • mapping table item with ⁇ start sector, length ⁇ in VM1_ CacheMap. If not, create a new entry and fill it with ⁇ start sector, length, -1 ⁇ and set it to VM1_cacheMap table to be operated. If the map entry is queried, set the map entry to the VM1_cacheMap entry to be operated.
  • (d2) Calculate the hash value of the data to be cached. (d3) performing a hash value search in the shared cache data table. If the data item of the hash value is found, the data to be cached is compared with the data in the data item bit by bit. If they are identical, the current VM1 to be operated is updated. The Data Pointer of the entry points to the data item, and the ref count in the data item is 1.
  • the startup process of the virtual machine in this embodiment includes the startup of the virtual machine to the startup of the virtual machine operating system or the startup of the preset application of the virtual machine to the virtual machine.
  • it can be the startup of the Windows operating system, or the launch of an application such as Office, Photoshop.
  • the virtual machine is started as a temporary virtual machine startup process before the virtual machine cluster is started in a large-scale manner, and the read and write data necessary for the virtual machine large-scale startup process is obtained according to the startup of the temporary virtual machine, and these are read.
  • the write data is stored to the virtual machine shared cache device for reading data from the virtual machine shared cache device when other virtual machines are booted.
  • the invention obtains data read and written from the virtual boot disk during the startup process of the virtual machine; only valid data validated for the virtual machine is cached to the virtual machine shared cache device, so that the data is read from the virtual machine shared cache device when other virtual machines are started. In this way, it is possible to cache only valid data in the virtual machine startup with a small amount of memory space, and solve the problem of input and output of the virtual machine concurrent startup. In addition, deduplication with deduplication can save memory.
  • FIG. 7 is a schematic structural diagram of an implementation manner of a virtual machine shared cache device according to the present invention.
  • the device includes: an obtaining module 101 and a storage module 102.
  • the apparatus of Figure 7 can perform the steps of Figures 1 through 2.
  • the obtaining module 101 is configured to obtain data read and written from the virtual boot disk during the startup of the virtual machine. When the virtual machine is powered on, the virtual machine reads and writes data from the virtual boot disk. This data is the real valid data required for the virtual machine to boot, and obtains these valid data, so that the virtual machine can be read and written from the virtual boot disk when the virtual machine starts. The data.
  • the storage module 102 is configured to store the data to the virtual machine shared cache device for reading the data from the virtual machine shared cache device when other virtual machines are started.
  • the virtual machine startup process includes the startup of the virtual machine to the startup of the virtual machine operating system or the startup of the preset application of the virtual machine to the virtual machine.
  • it can be the startup of a Windows operating system, or the launch of an application such as Office or Photosho.
  • the startup process acquires the read and write data necessary for the virtual machine large-scale startup process according to the startup of the temporary virtual machine, and stores the read and write data to the virtual machine shared cache device for sharing from the virtual machine when other virtual machines are started.
  • the cache device reads the data.
  • the invention obtains data read and written from the virtual boot disk during the startup process of the virtual machine; only valid data validated for the virtual machine is cached to the virtual machine shared cache device, so that the data is read from the virtual machine shared cache device when other virtual machines are started. In this way, it is possible to cache only valid data in the virtual machine startup with a small amount of memory space, and solve the problem of input and output when the virtual machine concurrently starts reading and writing data, and is not limited to the deployment mode of the virtual machine.
  • FIG. 8 is a schematic structural diagram of another embodiment of a virtual machine shared cache device according to the present invention.
  • the device includes an obtaining module 201, a storage module 202, a read/write module 203, and a deduplication module 204.
  • the apparatus of Figure 8 can perform the steps of Figure 2.
  • the obtaining module 201 is configured to obtain data read and written from the virtual boot disk during the startup of the virtual machine.
  • the storage module 202 is configured to store the data to the virtual machine shared cache device for reading the data from the virtual machine shared cache device when other virtual machines are started.
  • the read/write module 203 is configured to receive the request when the virtual machine sends a read/write request to the virtual machine shared cache device, and send a read/write request response sent by the virtual machine shared cache device to the virtual machine, where the read/write request response carries the read/write request. Request failure information.
  • the deduplication module 204 is configured to perform a deduplication operation on data stored by the virtual machine shared cache device.
  • the virtual machine startup process includes starting the virtual machine to boot into the virtual machine operating system or starting the virtual machine to boot into the virtual machine.
  • the virtual machine is started as a temporary virtual machine startup process before the virtual machine cluster is started in a large-scale manner, and the read and write data necessary for the virtual machine large-scale startup process is obtained according to the startup of the temporary virtual machine, and these are read.
  • Write data to The virtual machine shares the cache device for reading data from the virtual machine shared cache device when other virtual machines are booted.
  • the invention obtains data read and written from the virtual boot disk during the startup process of the virtual machine; only valid data validated for the virtual machine is cached to the virtual machine shared cache device, so that the data is read from the virtual machine shared cache device when other virtual machines are started. In this way, it is possible to cache only valid data in the virtual machine startup with a small amount of memory space, and solve the problem of input and output when the virtual machine concurrently starts reading and writing data.
  • deduplication can be used to save memory by deduplication.
  • the disclosed systems, devices and methods may be implemented in other ways.
  • the device implementations described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be another division manner for example, multiple units or components may be used. Combined or can be integrated into another system, or some features can be ignored, or not executed.
  • the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
  • the components displayed by the unit may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the embodiments of the present embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software function unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the instructions include a plurality of instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the methods of the various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, and a read only memory (ROM, Read-Only Memory).
  • ROM Read-Only Memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种建立虚拟机共享存储缓存的方法及装置,该方法包括:获取虚拟机启动过程中从虚拟启动磁盘读写的数据;存储所述数据至虚拟机共享缓存装置,以供其他虚拟机启动时从所述虚拟机共享缓存装置读取所述数据。通过上述方式,本发明能够以很少的内存空间只缓存在虚拟机启动中有效的数据,解决虚拟机并发启动读写数据时的输入输出问题。

Description

建立虚拟机共享存储緩存的方法及装置 技术领域
本发明涉及虚拟机技术领域,特别是涉及一种建立虚拟机共享存储緩存的 方法及装置。 背景技术
不管是对于全克隆模式部署的虚拟机还是对于链接克隆模式部署的虚拟 机, 大量的虚拟机在同时启动的情况下, 出现频繁的输入输出 (10 , Input Output )操作, 这对共享存储形成了很高的每秒输入输出 (IOPS , Input Output per second )压力峰值, 导致虚拟机启动速度慢。 在配置桌面云存储时按照最 高峰值的要求进行配置, 导致高 IOPS存储配置在平常时段形成浪费。
现有技术釆用流控方法, 将虚拟机的启动时间设置在上班前几个小时,提 前对所有虚拟机以流控的方式逐步启动,从而避免集中并发启动对存储服务能 力的冲击。
现有技术未真正解决虚拟机并发启动读写数据时的输入输出问题。 发明内容
本发明主要解决的技术问题是提供一种建立虚拟机共享存储緩存的方法 及装置, 能够以很少的内存空间只緩存在虚拟机启动中有效的数据,解决虚拟 机并发启动数据读写时的输入输出问题。
本发明的第一方面提供一种建立虚拟机共享存储緩存的方法, 包括: 获取 虚拟机启动过程中从虚拟启动磁盘读写的数据;存储所述数据至虚拟机共享緩 存装置, 以供其他虚拟机启动时从所述虚拟机共享緩存装置读取所述数据。
在第一方面的第一种可能的实现方式中,所述获取虚拟机启动过程中从虚 拟启动磁盘读写的数据的步骤之前, 包括: 所述虚拟机向所述虚拟机共享緩存 装置发送读写请求;所述虚拟机接收所述虚拟机共享緩存装置发送的读写请求 响应, 所述读写请求响应携带读写请求失败信息。
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种 可能的实现方式中, 所述方法还包括: 对所述虚拟机共享緩存装置存储的数据 进行重复数据删除操作。
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第三种 可能的实现方式中,所述虚拟机启动过程包括所述虚拟机开机到所述虚拟机操 作***启动完成或所述虚拟机开机到所述虚拟机的预设的应用程序的启动完 成。
本发明的第二方面提供一种虚拟机共享緩存的装置, 所述装置包括: 获取 模块和存储模块;所述获取模块用于获取虚拟机启动过程中从虚拟启动磁盘读 写的数据; 所述存储模块用于存储所述数据至虚拟机共享緩存装置, 以供其他 虚拟机启动时从所述虚拟机共享緩存装置读取所述数据。
在第二方面的第一种可能的实现方式中, 所述装置还包括: 读写模块; 所 述读写模块用于在所述虚拟机向所述虚拟机共享緩存装置发送读写请求时,接 收所述请求,并向所述虚拟机发送所述虚拟机共享緩存装置发送的读写请求响 应, 所述读写请求响应携带读写请求失败信息。
结合第二方面或第二方面的第一种可能的实现方式,在第二方面的第二种 可能的实现方式中, 所述装置还包括去重复模块, 所述去重复模块用于对所述 虚拟机共享緩存装置存储的数据进行重复数据删除操作。
结合第二方面或第二方面的第一种可能的实现方式,在第二方面的第三种 可能的实现方式中,所述虚拟机启动过程包括所述虚拟机开机到所述虚拟机操 作***启动完成或所述虚拟机开机到所述虚拟机的预设的应用程序的启动完 成。
本发明的有益效果是: 区别于现有技术的情况, 本发明获取虚拟机启动过 程中从虚拟启动磁盘读写的数据;只将对虚拟机启动有效的数据緩存至虚拟机 共享緩存装置, 以供其他虚拟机启动时从虚拟机共享緩存装置读取数据,通过 这种方式, 能够以很少的内存空间只緩存在虚拟机启动中有效的数据, 解决虚 拟机并发启动的输入输出问题。 附图说明
图 1是本发明建立虚拟机共享存储緩存的方法一实施方式的流程图; 图 2是本发明建立虚拟机共享存储緩存的方法另一实施方式的流程图; 图 3是本发明建立虚拟机共享存储緩存的方法在实际应用中的一实现方 式;
图 4是本发明建立虚拟机共享存储緩存的方法在实际应用中的另一实现方 式;
图 5是虚拟机创建、 启动以及关机过程;
图 6是本发明建立虚拟机共享存储緩存的方法在实际应用中去重复操作的 一实现方式;
图 7是本发明虚拟机共享緩存的装置一实施方式的结构示意图;
图 8是本发明虚拟机共享緩存的装置另一实施方式的结构示意图。 具体实施方式
下面结合附图和实施方式对本发明进行详细说明。
参阅图 1 , 图 1是本发明建立虚拟机共享存储緩存的方法一实施方式的流 程图, 包括:
步骤 S101 : 获取虚拟机启动过程中从虚拟启动磁盘读写的数据。
虚拟机指通过软件模拟的具有完整硬件***功能的、运行在一个完全隔离 环境中的完整计算机***。
在启动虚拟机时,虚拟机从虚拟启动磁盘读写数据, 这些数据是虚拟机启 动所需要的真正有效的数据, 获取这些有效的数据, 以便于存储这些虚拟机启 动时从虚拟启动磁盘读写的数据。
步骤 S102: 存储该数据至虚拟机共享緩存装置, 以供其他虚拟机启动时 从虚拟机共享緩存装置读取该数据。
在获取了虚拟机启动过程中从虚拟启动磁盘读写的数据后 ,将这些数据存 储在虚拟机共享緩存装置中,以供其他虚拟机启动时从虚拟机共享緩存装置读 取该数据, 这样分担了大部分的虚拟启动磁盘的输入输出压力。
需要说明的是,本实施方式中虚拟机启动过程包括虚拟机开机到虚拟机操 作***启动完成或虚拟机开机到虚拟机的预设的应用程序的启动完成。 例如 , 可以是 Windows操作***的启动过程, 或者 Office、 Photosho 等应用程序的 启动过程。本发明实施例中虚拟机启动为虚拟机机群大规模启动之前的一台临 时虚拟机启动过程,根据临时虚拟机的启动获取虚拟机大规模启动过程所必须 的读写的数据, 并将这些读写数据存储到虚拟机共享緩存装置, 以供其他虚拟 机启动时从该虚拟机共享緩存装置读取数据。
本发明获取虚拟机启动过程中从虚拟启动磁盘读写的数据;只将对虚拟机 启动有效的数据緩存至虚拟机共享緩存装置,以供其他虚拟机启动时从虚拟机 共享緩存装置读取数据, 通过这种方式, 能够以很少的内存空间只緩存在虚拟 机启动中有效的数据, 解决虚拟机并发启动读写数据时输入输出问题。
参阅图 2, 图 2是本发明建立虚拟机共享存储緩存的方法另一实施方式的 流程图, 包括:
步骤 S201 : 虚拟机向虚拟机共享緩存装置发送读写请求。
在启动虚拟机时, 虚拟机向虚拟机共享緩存装置发送读写请求。
步骤 S202: 虚拟机接收虚拟机共享緩存装置发送的读写请求响应, 读写 请求响应携带读写请求失败信息。
在虚拟机共享緩存装置中没有虚拟机读写请求的数据时,向虚拟机发送读 写请求响应,虚拟机然后接收虚拟机共享緩存装置发送的读写请求响应, 该读 写请求响应携带读写请求失败信息。
步骤 S203: 获取虚拟机启动过程中从虚拟启动磁盘读写的数据。
步骤 S204: 存储所述数据至虚拟机共享緩存装置, 以供其他虚拟机启动 时从所述虚拟机共享緩存装置读取所述数据。
在实际应用中, 步骤 S201、 步骤 S202、 步骤 S203以及步骤 S204的实现 过程请参见图 3和图 4, 图 3是本发明建立虚拟机共享存储緩存的方法在实际 应用中的一实现方式。本实现方式是虚拟机开机以及操作***启动过程中对数 据读请求的过程, 包括:
( bl )读请求: 虚拟机 VM0对操作***启动虚拟磁盘的读请求到达虚拟 机共享緩存装置的读写模块 (即模块 B )。
( b2 ) Cache (即虚拟机共享緩存装置的存储模块, C模块) 查询: B模 块向 C模块获取当前请求的数据。
( b3.2 ) Cache 未命中: 即 C模块中没有 B模块当前请求的数据, C模块 向 B模块返回空数据和緩存未命中状态。
( b4 )读存储设备: B模块从存储设备 (即操作***虚拟启动磁盘 )读取 当前请求的数据。
( b5 )读存储设备返回: 存储设备返回当前请求的数据给 B模块。
( b6.2 )虚拟机读请求返回: B模块将从存储设备读取到的数据返回给虚 拟机。
( b7 )模块 B将从存储设备中读取到的数据緩存到 C模块。 此緩存操作 只发生在虚拟机启动过程中。
( b3.1 ) Cache命中: 即 C模块中保存有 B模块当前请求的数据, C模块 向 B模块返回读取到的数据和緩存命中状态。
( b6.1 )虚拟机读请求返回: B模块将 C模块返回的数据返回给虚拟机。 图 4 是本发明建立虚拟机共享存储緩存的方法在实际应用中的另一实现 方式。 本实现方式是虚拟机开机以及操作***启动过程中的数据写请求的过 程, 包括:
( cl )写请求: 虚拟机 VM0对操作***虚拟启动磁盘的写请求到达虚拟 机共享緩存装置的读写模块 (即模块 B )。
( c2 )写存储设备: 模块 B向存储设备 (即操作***虚拟启动磁盘)发送 写请求。
( c3 )写存储设备返回: 存储设备返回写请求完成情况给模块^
( c4 ) 更新緩存: 如果 c3返回写入存储设备成功, 将本次写请求的数据 緩存到 C模块 (即虚拟机共享緩存装置的存储模块), 此緩存操作只发生在虚 拟机启动过程中。
( c5 )虚拟机写请求返回:模块 B将写存储设备返回的结果返回给虚拟机。 请参阅图 5 , 图 5是虚拟机 VM0创建、 启动以及关机过程。 该过程包括: ( al )在 Hypervisor中从操作***启动磁盘以非链接克隆方式创建虚拟机
VM0。
( a2 )开始启动虚拟机 VM0 , 记录开始启动的时间为 T1。
( a3 ) VM0进入开机和操作***启动过程。
( a4 ) VM0完成开机和操作***启动过程, 记录完成 OS 启动的时刻为 T2。
( a5 )登陆 VMO, VMO开始登陆, 记录登陆 OS 完成的时刻为 T3。 在图 5中, T1 时刻的识别可以是管理软件下达虚拟机开机的时刻。
以基于 Xen***实现的虚拟机为例, T2时刻可以由以下方法识别: 在虚 拟机操作***中预先实现和部署一个 Agent程序,该 Agent程序监测***进程 的开启和关闭过程。 当该 Agent检测到某个进程开始启动时, 向 Xenstore写 入一个标记。 在 Hypervisor中或者 Hypervisor所在操作***中的 Cache优化 模块(即虚拟机共享緩存装置的存储模块)通过在 Xenstore 中检测相应的标 记来确定 T2和 T3时刻。 以 Windows操作***为例, 检测到 "winlogon.exe" 就可以定出 T2; 检测到 "explorer.exe" 就可以定出 T3。
通过緩存 T1到 Τ2 (或者 Τ3 )之间的数据, 来有效减少需要緩存的数据 量。
步骤 S205: 对虚拟机共享緩存装置存储的数据进行重复数据删除操作。 重复数据删除技术是一种目前主流且非常热门的存储技术,可对存储容量 进行有效优化。 它通过删除数据集中重复的数据, 只保留其中一份, 从而消除 冗余数据。 这种技术可以很大程度上减少对物理存储空间的需求,从而满足日 益增长的数据存储需求。 该技术可以带来许多实际的利益, 比如: 可以有效控 制数据的急剧增长; 增加有效存储空间, 提高存储效率; 节省存储总成本和管 理成本; 节省数据传输的网络带宽; 节省空间、 电力供应、 冷却等运维成本 等等。
在实际应用中, 步骤 S205的实现过程请参见图 6, 图 6是本发明建立虚 拟机共享存储緩存的方法在实际应用中去重复操作的一实现方式。本实现方式 是不同虚拟机之间的緩存数据去重复操作的过程, 具体以虚拟机 VM1的数据 保存到 VM1— cacheMap的过程为例说明, 该过程包括:
( dl )在 VM1— CacheMap中查询有没有 {start sector, length}的影射表项, 如果没有则新建表项并填充 {start sector, length, -1 } , 并设为要操作的 VM1— cacheMap 表项; 如果查询到影射表项, 将该影射表项设为要操作的 VM1— cacheMap表项。
( d2 )计算待緩存数据的 hash值。 ( d3 )在共享緩存数据表中进行 hash值查找, 如果找到 hash值的数据项 则将待緩存数据与数据项中的数据进行逐位对比, 如果完全一样, 则更新当前 要操作的 VM1— cacheMap表项的 Data Pointer 为指向该数据项,并将数据项中 的 ref count力口 1。
( d4 )如果在共享緩存数据表中没有找到重复内容的项,则新建数据表项, 填充相应内容并更新当前要操作的 VM1— cacheMap表项的 Data Pointer 为指 向该新建数据项。
需要说明的是,本实施方式中虚拟机的启动过程包括虚拟机开机到虚拟机 操作***启动完成或虚拟机开机到虚拟机的预设的应用程序的启动完成。 例 如, 可以是 Windows操作***的启动, 或者 Office, Photoshop等应用程序的 启动。本发明实施例中虚拟机启动为虚拟机机群大规模启动之前的一台临时虚 拟机启动过程,根据临时虚拟机的启动获取虚拟机大规模启动过程所必须的读 写的数据, 并将这些读写数据存储到虚拟机共享緩存装置, 以供其他虚拟机启 动时从该虚拟机共享緩存装置读取数据。
本发明获取虚拟机启动过程中从虚拟启动磁盘读写的数据;只将对虚拟机 启动有效的数据緩存至虚拟机共享緩存装置,以供其他虚拟机启动时从虚拟机 共享緩存装置读取数据, 通过这种方式, 能够以很少的内存空间只緩存在虚拟 机启动中有效的数据, 解决虚拟机并发启动的输入输出问题。 另外, 利用重复 数据删除技术进行去重复操作可以节省内存。
参阅图 7 , 图 7是本发明虚拟机共享緩存装置一实施方式的结构示意图, 该装置包括: 获取模块 101和存储模块 102。
可选地, 图 7的装置可以执行图 1至图 2中的步骤。
获取模块 101用于获取虚拟机启动过程中从虚拟启动磁盘读写的数据。 在启动虚拟机时,虚拟机从虚拟启动磁盘读写数据, 这些数据是虚拟机启 动所需要的真正有效的数据, 获取这些有效的数据, 以便于存储这些虚拟机启 动时从虚拟启动磁盘读写的数据。
存储模块 102用于存储该数据至虚拟机共享緩存装置,以供其他虚拟机启 动时从该虚拟机共享緩存装置读取该数据。
在获取了虚拟机启动过程中从虚拟启动磁盘读写的数据后 ,将这些数据存 储在虚拟机共享緩存装置中,以供其他虚拟机启动时从虚拟机共享緩存装置读 取该数据, 这样分担了大部分的虚拟启动磁盘的输入输出压力。
需要说明的是,本实施方式中虚拟机启动过程包括虚拟机开机到虚拟机操 作***启动完成或虚拟机开机到虚拟机的预设的应用程序的启动完成。 例如 , 可以是 Windows操作***的启动,或者 Office、 Photosho 等应用程序的启动。 启动过程,根据临时虚拟机的启动获取虚拟机大规模启动过程所必须的读写的 数据, 并将这些读写数据存储到虚拟机共享緩存装置, 以供其他虚拟机启动时 从该虚拟机共享緩存装置读取数据。
本发明获取虚拟机启动过程中从虚拟启动磁盘读写的数据;只将对虚拟机 启动有效的数据緩存至虚拟机共享緩存装置,以供其他虚拟机启动时从虚拟机 共享緩存装置读取数据, 通过这种方式, 能够以很少的内存空间只緩存在虚拟 机启动中有效的数据,解决虚拟机并发启动读写数据时的输入输出问题,且不 限于虚拟机的部署模式。
参阅图 8,图 8是本发明虚拟机共享緩存装置另一实施方式的结构示意图, 该装置包括:获取模块 201、存储模块 202、读写模块 203以及去重复模块 204。
可选地, 图 8的装置可以执行图 2中的步骤。
获取模块 201用于获取虚拟机启动过程中从虚拟启动磁盘读写的数据。 存储模块 202用于存储该数据至虚拟机共享緩存装置,以供其他虚拟机启 动时从该虚拟机共享緩存装置读取该数据。
读写模块 203用于在虚拟机向虚拟机共享緩存装置发送读写请求时,接收 该请求, 并向虚拟机发送虚拟机共享緩存装置发送的读写请求响应, 该读写请 求响应携带读写请求失败信息。
去重复模块 204 用于对虚拟机共享緩存装置存储的数据进行重复数据删 除操作。
其中 ,虚拟机启动过程包括虚拟机开机到虚拟机操作***启动完成或虚拟 机开机到虚拟机的预设的应用程序的启动完成。本发明实施例中虚拟机启动为 虚拟机机群大规模启动之前的一台临时虚拟机启动过程,根据临时虚拟机的启 动获取虚拟机大规模启动过程所必须的读写的数据,并将这些读写数据存储到 虚拟机共享緩存装置,以供其他虚拟机启动时从该虚拟机共享緩存装置读取数 据。
本发明获取虚拟机启动过程中从虚拟启动磁盘读写的数据;只将对虚拟机 启动有效的数据緩存至虚拟机共享緩存装置,以供其他虚拟机启动时从虚拟机 共享緩存装置读取数据, 通过这种方式, 能够以很少的内存空间只緩存在虚拟 机启动中有效的数据,解决虚拟机并发启动读写数据时的输入输出问题。另夕卜, 利用重复数据删除技术进行去重复操作可以节省内存。
在本发明所提供的几个实施方式中, 应该理解到, 所揭露的***, 装置和 方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施方式仅仅是示 意性的, 例如, 所述模块或单元的划分, 仅仅为一种逻辑功能划分, 实际实现 时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一 个***, 或一些特征可以忽略, 或不执行。 另一点, 所显示或讨论的相互之间 的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或 通信连接, 可以是电性, 机械或其它的形式。 单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者 也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部 单元来实现本实施方式方案的目的。
另外, 在本发明各个实施方式中的各功能单元可以集成在一个处理单元 中,也可以是各个单元单独物理存在, 也可以两个或两个以上单元集成在一个 单元中。上述集成的单元既可以釆用硬件的形式实现,也可以釆用软件功能单 元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售 或使用时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发 明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全 部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储 介质中, 包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器, 或者网络设备等)或处理器(processor )执行本发明各个实施方式所述方法的 全部或部分步骤。而前述的存储介质包括: U盘、移动硬盘、只读存储器( ROM, Read-Only Memory ). 随机存取存 4诸器 ( RAM, Random Access Memory )、 磁 碟或者光盘等各种可以存储程序代码的介质。
以上所述仅为本发明的实施方式, 并非因此限制本发明的专利范围, 凡是 利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接 运用在其他相关的技术领域, 均同理包括在本发明的专利保护范围内。

Claims

权 利 要 求 书
1.一种建立虚拟机共享存储緩存的方法, 其特征在于, 包括:
获取虚拟机启动过程中从虚拟启动磁盘读写的数据;
存储所述数据至虚拟机共享緩存装置,以供其他虚拟机启动时从所述虚拟 机共享緩存装置读取所述数据。
2.根据权利要求 1所述的方法, 其特征在于, 所述获取虚拟机启动过程中 从虚拟启动磁盘读写的数据的步骤之前, 包括:
所述虚拟机向所述虚拟机共享緩存装置发送读写请求;
所述虚拟机接收所述虚拟机共享緩存装置发送的读写请求响应,所述读写 请求响应携带读写请求失败信息。
3.根据权利要求 1或 2所述的方法, 其特征在于, 所述方法还包括: 对所 述虚拟机共享緩存装置存储的数据进行重复数据删除操作。
4.根据权利要求 1或 2所述的方法, 其特征在于, 所述虚拟机启动过程包 括所述虚拟机开机到所述虚拟机操作***启动完成或所述虚拟机开机到所述 虚拟机的预设的应用程序的启动完成。
5—种虚拟机共享緩存装置, 其特征在于, 所述装置包括: 获取模块和存 储模块;
所述获取模块用于获取虚拟机启动过程中从虚拟启动磁盘读写的数据; 所述存储模块用于存储所述数据至虚拟机共享緩存装置,以供其他虚拟机 启动时从所述虚拟机共享緩存装置读取所述数据。
6.根据权利要求 5所述的装置, 其特征在于, 所述装置还包括: 读写模块; 所述读写模块用于在所述虚拟机向所述虚拟机共享緩存装置发送读写请 求时,接收所述请求, 并向所述虚拟机发送所述虚拟机共享緩存装置发送的读 写请求响应, 所述读写请求响应携带读写请求失败信息。
7.根据权利要求 5或 6所述的装置, 其特征在于, 所述装置还包括去重复 模块,所述去重复模块用于对所述虚拟机共享緩存装置存储的数据进行重复数 据删除操作。
8.根据权利要求 5或 6所述的装置, 其特征在于, 所述虚拟机启动过程包 括所述虚拟机开机到所述虚拟机操作***启动完成或所述虚拟机开机到所述 虚拟机的预设的应用程序的启动完成。
PCT/CN2013/079647 2012-12-12 2013-07-19 建立虚拟机共享存储缓存的方法及装置 WO2014089967A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210535072.7A CN103870312B (zh) 2012-12-12 2012-12-12 建立虚拟机共享存储缓存的方法及装置
CN201210535072.7 2012-12-12

Publications (1)

Publication Number Publication Date
WO2014089967A1 true WO2014089967A1 (zh) 2014-06-19

Family

ID=50908879

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/079647 WO2014089967A1 (zh) 2012-12-12 2013-07-19 建立虚拟机共享存储缓存的方法及装置

Country Status (2)

Country Link
CN (1) CN103870312B (zh)
WO (1) WO2014089967A1 (zh)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9454497B2 (en) * 2014-08-15 2016-09-27 Intel Corporation Technologies for secure inter-virtual-machine shared memory communication
CN105786591B (zh) * 2016-02-26 2019-05-07 新华三技术有限公司 一种虚拟机启动方法及装置
CN107463426B (zh) * 2016-06-06 2020-11-27 阿里巴巴集团控股有限公司 一种kvm虚拟化下虚拟机克隆的方法及装置
CN106201650B (zh) * 2016-06-29 2020-08-25 联想(北京)有限公司 一种虚拟机控制方法和***
CN106406981A (zh) * 2016-09-18 2017-02-15 深圳市深信服电子科技有限公司 一种读、写磁盘数据的方法及虚拟机监视器
CN108475201B (zh) * 2016-11-24 2021-02-26 华为技术有限公司 一种虚拟机启动过程中的数据获取方法和云计算***
CN106775942B (zh) * 2016-12-09 2020-06-16 中国科学院软件研究所 一种云应用导向的固态盘缓存管理***及方法
CN108255577A (zh) * 2017-12-20 2018-07-06 深圳市杉岩数据技术有限公司 一种虚拟机启动的加速方法和装置
CN108345477B (zh) 2018-02-28 2021-10-26 郑州云海信息技术有限公司 一种双镜像共享conf分区文件的设计方法及装置
CN108958886B (zh) * 2018-07-02 2022-03-04 哈尔滨工业大学 一种基于网络流的虚拟机快速部署***及方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276284A (zh) * 2007-03-27 2008-10-01 英特尔公司 用于提高平台网络引导效率的***和方法
US20100299667A1 (en) * 2009-05-19 2010-11-25 Vmware, Inc. Shortcut input/output in virtual machine systems
US20110265083A1 (en) * 2010-04-26 2011-10-27 Vmware, Inc. File system independent content aware cache

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7721080B2 (en) * 2006-06-30 2010-05-18 Intel Corporation Management of option ROM
US7882198B2 (en) * 2007-07-02 2011-02-01 Oracle America, Inc. Shared JAVA JAR files
US8949585B2 (en) * 2007-10-09 2015-02-03 Vmware, Inc. In-place conversion of virtual machine state
CN101697134A (zh) * 2009-10-27 2010-04-21 北京大学 一种支持相似虚拟机快速启动的方法
CN102591702B (zh) * 2011-12-31 2015-04-15 华为技术有限公司 虚拟化处理方法及相关装置和计算机***
CN102629941B (zh) * 2012-03-20 2014-12-31 武汉邮电科学研究院 云计算***中虚拟机镜像缓存的方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276284A (zh) * 2007-03-27 2008-10-01 英特尔公司 用于提高平台网络引导效率的***和方法
US20100299667A1 (en) * 2009-05-19 2010-11-25 Vmware, Inc. Shortcut input/output in virtual machine systems
US20110265083A1 (en) * 2010-04-26 2011-10-27 Vmware, Inc. File system independent content aware cache

Also Published As

Publication number Publication date
CN103870312B (zh) 2018-01-23
CN103870312A (zh) 2014-06-18

Similar Documents

Publication Publication Date Title
WO2014089967A1 (zh) 建立虚拟机共享存储缓存的方法及装置
US11687446B2 (en) Namespace change propagation in non-volatile memory devices
US9141529B2 (en) Methods and apparatus for providing acceleration of virtual machines in virtual environments
US9819739B2 (en) Systems and methods for supporting hot plugging of remote storage devices accessed over a network via NVME controller
US9501245B2 (en) Systems and methods for NVMe controller virtualization to support multiple virtual machines running on a host
US10496613B2 (en) Method for processing input/output request, host, server, and virtual machine
US9058123B2 (en) Systems, methods, and interfaces for adaptive persistence
US8782335B2 (en) Latency reduction associated with a response to a request in a storage system
US9778860B2 (en) Re-TRIM of free space within VHDX
US20070162692A1 (en) Power controlled disk array system using log storage area
US9836478B2 (en) File system sharing
US20140095555A1 (en) File management device and method for storage system
US11016817B2 (en) Multi root I/O virtualization system
JP6652647B2 (ja) ストレージシステム
WO2019053533A1 (en) FINE AND DYNAMIC ALLOCATION USING CLOUD RANKS
WO2017157145A1 (zh) 一种数据预取方法以及装置
US8799573B2 (en) Storage system and its logical unit management method
US20230236966A1 (en) Intelligent defragmentation in a storage system
US9053033B1 (en) System and method for cache content sharing
US20150356108A1 (en) Storage system and storage system control method
US12032849B2 (en) Distributed storage system and computer program product
WO2017092402A1 (zh) 虚拟网络硬盘挂载方法、局域网服务器、用户终端和***
EP4318249A1 (en) Storage device and operation method thereof
US20240045597A1 (en) Storage device and operation method thereof
WO2016190891A1 (en) Translate data operations based on data stripe size

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13861740

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13861740

Country of ref document: EP

Kind code of ref document: A1