WO2016078422A1 - Virtual machine configuration information storage method and apparatus - Google Patents

Virtual machine configuration information storage method and apparatus Download PDF

Info

Publication number
WO2016078422A1
WO2016078422A1 PCT/CN2015/083282 CN2015083282W WO2016078422A1 WO 2016078422 A1 WO2016078422 A1 WO 2016078422A1 CN 2015083282 W CN2015083282 W CN 2015083282W WO 2016078422 A1 WO2016078422 A1 WO 2016078422A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
configuration information
machine configuration
disk
request message
Prior art date
Application number
PCT/CN2015/083282
Other languages
French (fr)
Chinese (zh)
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 WO2016078422A1 publication Critical patent/WO2016078422A1/en

Links

Images

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

Definitions

  • the write request message sent by the control management interface provided by the storage system is received.
  • the sending the virtual machine configuration information and the LUN to the disk array includes:
  • Figure 11 is a schematic diagram of disaster recovery backup through a hypervisor or a third-party device
  • the virtual machine configuration information refers to the attribute information of the virtual machine, such as the name of the virtual machine, the virtual device information, and the disk storage characteristic information. Generally, considering the versatility and variability, the virtual machine configuration information can be divided into three parts for storage, see Table-1.
  • the configuration information of the virtual machine and the LUN are sent to the disk array, which may include:
  • the virtual machine configuration information is read. In this way, it is possible to prevent multiple devices from simultaneously reading the virtual machine configuration information of the logical disk and conflicting to ensure that the device can obtain the virtual machine configuration information; on the other hand, read again if the disk array where the logical disk is located allows The virtual machine configuration information ensures the security of the virtual machine configuration information.
  • the hypervisor can read the virtual machine configuration information stored in the control information area by using the command (see Figure 9). ), the virtual machine configuration information can still be obtained, and the virtual disk data is obtained according to the virtual machine configuration information, and the virtual machine is started normally.
  • the virtual disk data of VM1 is stored in the logical disk 4. Therefore, on the disaster recovery side 12, the logical disk of the virtual machine and the virtual disk of the virtual machine cannot be associated. At this time, it is necessary to re-establish the correspondence between the virtual disk of the virtual machine and the virtual disk of the virtual machine at the management node, and this operation is time consuming and laborious.
  • the writing unit 1402 is configured to write the virtual machine configuration information into the control information area corresponding to the logical disk 140 according to the LUN.
  • the receiving module 1401a is configured to receive a write request message, where the write request message carries virtual machine configuration information and a LUN.

Abstract

A virtual machine configuration information storage method and apparatus, which can reduce the dependence on a management node, and enable virtual machine configuration information to be still available when the management node has a failure. The storage method comprises: acquiring, by a disk array, virtual machine configuration information about a virtual machine (VM) and a logical unit number (LUN) of a logical disk where a virtual disk corresponding to the VM is located (S201); and writing, by the disk array, the virtual machine configuration information into a control information region corresponding to the logical disk according to the LUN (S202). The present invention is applicable to the technical field of computers.

Description

一种虚拟机配置信息的存储方法及装置Method and device for storing virtual machine configuration information
本申请要求于2014年11月20日提交中国专利局、申请号为201410668433.4、发明名称为“一种虚拟机配置信息的存储方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201410668433.4, entitled "Storage Method and Apparatus for Virtual Machine Configuration Information", filed on November 20, 2014, the entire contents of which are incorporated by reference. In this application.
技术领域Technical field
本发明涉及计算机技术领域,尤其涉及一种虚拟机配置信息的存储方法及装置。The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for storing virtual machine configuration information.
背景技术Background technique
近年来,随着云计算的发展,作为其基础支撑技术之一的虚拟化技术也得到了广泛应用。虚拟化技术是一种将底层硬件设备与上层操作系统、应用程序分离的去耦合技术。它可以实现在一台物理主机上同时运行多个虚拟机,从而大大提高资源的利用率和分配灵活性。同时,与传统的物理计算机相比,虚拟机具有更好的隔离性和封装性,其可以将整个虚拟机的信息保存到虚拟磁盘中,从而可以方便地对虚拟机进行快照、备份、克隆和分发等操作。In recent years, with the development of cloud computing, virtualization technology, which is one of its basic supporting technologies, has also been widely used. Virtualization technology is a decoupling technology that separates the underlying hardware devices from the upper operating system and applications. It can run multiple virtual machines simultaneously on a single physical host, greatly improving resource utilization and allocation flexibility. At the same time, compared with the traditional physical computer, the virtual machine has better isolation and encapsulation. It can save the information of the entire virtual machine to the virtual disk, so that the virtual machine can be conveniently snapshotted, backed up, cloned and Distribution and other operations.
目前,现有的存储虚拟化技术主要有两种实现方式:一是通过虚拟机文件系统上的虚拟磁盘镜像文件;二是通过裸设备映射(Raw Device Mapping,RDM)磁盘。在上述两种方案中,由于启动虚拟机所需的虚拟磁盘数据和虚拟机配置信息被分开保存,虚拟磁盘数据被保存在逻辑磁盘中,而虚拟机配置信息被保存在管理节点中。因此,当管理节点出现单点失效后,就会造成虚拟机配置信息无法访问,进而导致虚拟机无法启动。Currently, there are two main implementations of the existing storage virtualization technology: one is through the virtual disk image file on the virtual machine file system; the other is through the raw device mapping (RDM) disk. In the above two schemes, since the virtual disk data and the virtual machine configuration information required to start the virtual machine are separately saved, the virtual disk data is saved in the logical disk, and the virtual machine configuration information is saved in the management node. Therefore, when a single point of failure occurs on the management node, the virtual machine configuration information cannot be accessed, and the virtual machine cannot be started.
发明内容Summary of the invention
本发明的实施例提供一种虚拟机配置信息的存储方法及装置,以至少解决现有技术中管理节点失效所导致的虚拟机配置信息无法访问的问题,能够减少对管理节点的依赖,在管理节点失效时使虚拟机配置信息仍然可用。The embodiment of the present invention provides a method and a device for storing virtual machine configuration information, so as to at least solve the problem that the virtual machine configuration information cannot be accessed due to the failure of the management node in the prior art, and the dependency on the management node can be reduced. Virtual machine configuration information is still available when the node fails.
为达到上述目的,本发明的实施例采用如下技术方案:In order to achieve the above object, embodiments of the present invention adopt the following technical solutions:
第一方面,提供一种虚拟机配置信息的存储方法,所述方法包括: In a first aspect, a method for storing virtual machine configuration information is provided, where the method includes:
获取虚拟机VM的虚拟机配置信息及所述VM对应的虚拟磁盘所在的逻辑磁盘的逻辑单元号LUN;Obtaining the virtual machine configuration information of the virtual machine VM and the logical unit number LUN of the logical disk where the virtual disk corresponding to the VM is located;
根据所述LUN,所述逻辑磁盘将所述虚拟机配置信息写入所述逻辑磁盘对应的控制信息区域。According to the LUN, the logical disk writes the virtual machine configuration information into a control information area corresponding to the logical disk.
在第一方面第一种可能的实现方式中,结合第一方面,所述获取虚拟机VM的虚拟机配置信息及所述VM对应的虚拟磁盘所在的逻辑磁盘的逻辑单元号LUN,包括:In a first possible implementation manner of the first aspect, in combination with the first aspect, the acquiring the virtual machine configuration information of the virtual machine VM and the logical unit number LUN of the logical disk where the virtual disk corresponding to the VM is located includes:
接收写入请求消息,所述写入请求消息携带所述虚拟机配置信息及所述LUN;Receiving a write request message, the write request message carrying the virtual machine configuration information and the LUN;
根据所述写入请求消息,获取所述虚拟机配置信息及所述LUN。Obtaining the virtual machine configuration information and the LUN according to the write request message.
在第一方面第二种可能的实现方式中,结合第一方面第一种可能的实现方式,所述接收写入请求消息,包括:In a second possible implementation manner of the first aspect, in combination with the first possible implementation manner of the first aspect, the receiving a write request message includes:
接收通过小型计算机系统接口SCSI带内命令发送的所述写入请求消息;Receiving the write request message sent by a small computer system interface SCSI in-band command;
或者,or,
接收通过存储系统提供的控制管理接口发送的所述写入请求消息。The write request message sent by the control management interface provided by the storage system is received.
在第一方面第三种可能的实现方式中,结合第一方面至第一方面第二种可能的实现方式,在所述根据所述LUN,将所述虚拟机配置信息写入所述逻辑磁盘对应的控制信息区域之前,还包括:In a third possible implementation manner of the first aspect, in combination with the first aspect to the second possible implementation manner of the first aspect, the virtual machine configuration information is written to the logical disk according to the LUN Before the corresponding control information area, it also includes:
确定所述逻辑磁盘对应的控制信息区域中是否存储与所述虚拟机配置信息不同的虚拟机配置信息;Determining, in the control information area corresponding to the logical disk, whether virtual machine configuration information different from the virtual machine configuration information is stored;
若是,删除所述与所述虚拟机配置信息不同的虚拟机配置信息。If yes, the virtual machine configuration information different from the virtual machine configuration information is deleted.
在第一方面第四种可能的实现方式中,结合第一方面,在所述根据所述LUN,将所述虚拟机配置信息写入所述逻辑磁盘对应的控制信息区域之后,还包括:In a fourth possible implementation manner of the first aspect, in combination with the first aspect, after the virtual machine configuration information is written in the control information area corresponding to the logical disk according to the LUN, the method further includes:
接收删除请求消息,所述删除请求消息用于指示删除所述逻辑磁盘对应的控制信息区域中的所述虚拟机配置信息;Receiving a delete request message, where the delete request message is used to delete the virtual machine configuration information in a control information area corresponding to the logical disk;
根据所述删除请求消息,删除所述虚拟机配置信息。And deleting the virtual machine configuration information according to the deletion request message.
现有技术中,由于虚拟磁盘数据和虚拟机配置信息被分开保存,虚拟磁盘数据被保存在逻辑磁盘中,而虚拟机配置信息被保存在管理节点中。因此,当管理节点出现单点失效时,就会使得虚拟机配置信息无法 访问,进而无法获知虚拟机与虚拟机的虚拟磁盘所在的逻辑磁盘的对应关系,最终导致虚拟机无法启动。而基于本发明实施例提供的虚拟机配置信息的存储方法,将虚拟机配置信息存储在逻辑磁盘的控制信息区域,因此,即使管理节点出现单点失效,仍然可以通过访问虚拟机的虚拟磁盘所在的逻辑磁盘的控制信息区域,实现对虚拟机配置信息的访问。而根据虚拟机配置信息和虚拟机的虚拟磁盘数据,即可正常启动虚拟机。即,本发明实施例提供的虚拟机配置信息的存储方法,能够减少对管理节点的依赖,在管理节点失效时使虚拟机配置信息仍然可用。In the prior art, since the virtual disk data and the virtual machine configuration information are separately saved, the virtual disk data is saved in the logical disk, and the virtual machine configuration information is saved in the management node. Therefore, when the management node has a single point of failure, the virtual machine configuration information cannot be made. Access, and thus the relationship between the virtual machine and the logical disk where the virtual disk of the virtual machine is located cannot be known, and the virtual machine cannot be started. The storage method of the virtual machine configuration information provided by the embodiment of the present invention stores the virtual machine configuration information in the control information area of the logical disk. Therefore, even if the management node has a single point of failure, the virtual disk of the virtual machine can still be accessed. The control information area of the logical disk realizes access to the virtual machine configuration information. According to the virtual machine configuration information and the virtual disk data of the virtual machine, the virtual machine can be started normally. That is, the storage method of the virtual machine configuration information provided by the embodiment of the present invention can reduce the dependency on the management node, and the virtual machine configuration information is still available when the management node fails.
第二方面,提供一种虚拟机配置信息的存储方法,所述方法包括:A second aspect provides a method for storing virtual machine configuration information, where the method includes:
获取虚拟机VM的虚拟机配置信息和所述VM对应的虚拟磁盘所在的逻辑磁盘的逻辑单元号LUN;Obtaining the virtual machine configuration information of the virtual machine VM and the logical unit number LUN of the logical disk where the virtual disk corresponding to the VM is located;
将所述虚拟机配置信息和所述LUN发送给所述磁盘阵列,由所述磁盘阵列根据所述LUN,将所述虚拟机配置信息写入所述逻辑磁盘对应的控制信息区域。Sending the virtual machine configuration information and the LUN to the disk array, and the disk array writes the virtual machine configuration information into a control information area corresponding to the logical disk according to the LUN.
在第二方面第一种可能的实现方式中,结合第二方面,所述将所述虚拟机配置信息和所述LUN发送给磁盘阵列,包括:In a first possible implementation manner of the second aspect, in combination with the second aspect, the sending the virtual machine configuration information and the LUN to the disk array includes:
发送写入请求消息给所述磁盘阵列,所述写入请求消息携带所述虚拟机配置信息和所述LUN。Sending a write request message to the disk array, the write request message carrying the virtual machine configuration information and the LUN.
在第二方面第二种可能的实现方式中,结合第二方面第一种可能的实现方式,所述发送写入请求消息给所述磁盘阵列,包括:In a second possible implementation manner of the second aspect, in combination with the first possible implementation manner of the second aspect, the sending a write request message to the disk array includes:
通过小型计算机系统接口SCSI带内命令发送所述写入请求消息给所述磁盘阵列;Transmitting the write request message to the disk array by a small computer system interface SCSI in-band command;
或者,or,
通过存储系统提供的控制管理接口发送所述写入请求消息给所述磁盘阵列。The write request message is sent to the disk array through a control management interface provided by the storage system.
在第二方面第三种可能的实现方式中,结合第二方面,在所述将所述虚拟机配置信息和所述LUN发送给磁盘阵列之后,还包括:In a third possible implementation manner of the second aspect, in combination with the second aspect, after the sending the virtual machine configuration information and the LUN to the disk array, the method further includes:
发送删除请求消息给所述磁盘阵列,所述删除请求消息用于指示删除所述逻辑磁盘对应的控制信息区域中的所述虚拟机配置信息。And sending a delete request message to the disk array, where the delete request message is used to delete the virtual machine configuration information in the control information area corresponding to the logical disk.
现有技术中,由于虚拟磁盘数据和虚拟机配置信息被分开保存,虚拟磁盘数据被保存在逻辑磁盘中,而虚拟机配置信息被保存在管理节点 中。因此,当管理节点出现单点失效时,就会使得虚拟机配置信息无法访问,进而无法虚拟机与虚拟机的虚拟磁盘所在的逻辑磁盘的对应关系,最终导致虚拟机无法启动。基于本发明实施例提供的虚拟机配置信息的存储方法,将虚拟机配置信息存储在逻辑磁盘的控制信息区域,因此,即使管理节点出现单点失效,仍然可以通过访问虚拟机的虚拟磁盘所在的逻辑磁盘的控制信息区域,实现对虚拟机配置信息的访问。而根据虚拟机配置信息和虚拟机的虚拟磁盘数据,即可正常启动虚拟机。即,本发明实施例提供的虚拟机配置信息的存储方法,能够减少对管理节点的依赖,在管理节点失效时使虚拟机配置信息仍然可用。In the prior art, since the virtual disk data and the virtual machine configuration information are separately saved, the virtual disk data is saved in the logical disk, and the virtual machine configuration information is saved in the management node. in. Therefore, when a single point of failure occurs on the management node, the virtual machine configuration information cannot be accessed, and the corresponding relationship between the virtual machine and the logical disk where the virtual disk of the virtual machine resides cannot be obtained. Eventually, the virtual machine cannot be started. The virtual machine configuration information is stored in the control information area of the logical disk according to the storage method of the virtual machine configuration information provided by the embodiment of the present invention. Therefore, even if the management node has a single point of failure, the virtual disk of the virtual machine can still be accessed. The control information area of the logical disk enables access to the virtual machine configuration information. According to the virtual machine configuration information and the virtual disk data of the virtual machine, the virtual machine can be started normally. That is, the storage method of the virtual machine configuration information provided by the embodiment of the present invention can reduce the dependency on the management node, and the virtual machine configuration information is still available when the management node fails.
第三方面,提供一种磁盘阵列,所述磁盘阵列包括:获取单元、以及写入单元;In a third aspect, a disk array is provided, the disk array includes: an acquiring unit, and a writing unit;
所述获取单元,用于获取虚拟机VM的虚拟机配置信息及所述VM对应的虚拟磁盘所在的逻辑磁盘的逻辑单元号LUN;The acquiring unit is configured to acquire virtual machine configuration information of the virtual machine VM and a logical unit number LUN of the logical disk where the virtual disk corresponding to the VM is located;
所述写入单元,用于根据所述LUN,将所述虚拟机配置信息写入所述逻辑磁盘对应的控制信息区域。The writing unit is configured to write the virtual machine configuration information into a control information area corresponding to the logical disk according to the LUN.
在第三方面第一种可能的实现方式中,结合第三方面,所述获取单元包括:接收模块、以及获取模块;In a first possible implementation manner of the third aspect, in combination with the third aspect, the acquiring unit includes: a receiving module, and an acquiring module;
所述接收模块,用于接收写入请求消息,所述写入请求消息携带所述虚拟机配置信息及所述LUN;The receiving module is configured to receive a write request message, where the write request message carries the virtual machine configuration information and the LUN;
所述获取模块,用于根据所述写入请求消息,获取所述虚拟机配置信息及所述LUN。The obtaining module is configured to acquire the virtual machine configuration information and the LUN according to the write request message.
在第三方面第二种可能的实现方式中,结合第三方面第一种可能的实现方式,所述接收模块具体用于:In a second possible implementation manner of the third aspect, in combination with the first possible implementation manner of the third aspect, the receiving module is specifically configured to:
接收通过小型计算机系统接口SCSI带内命令发送的所述写入请求消息;Receiving the write request message sent by a small computer system interface SCSI in-band command;
或者,or,
接收通过存储系统提供的控制管理接口发送的所述写入请求消息。The write request message sent by the control management interface provided by the storage system is received.
在第三方面第三种可能的实现方式中,结合第三方面至第三方面第二种可能的实现方式,所述磁盘阵列还包括:确定单元、以及第一删除单元;In a third possible implementation manner of the third aspect, in combination with the second possible implementation manner of the third aspect to the third aspect, the disk array further includes: a determining unit, and a first deleting unit;
所述确定单元,用于: The determining unit is configured to:
在所述写入单元根据所述LUN,将所述虚拟机配置信息写入所述磁盘阵列对应的控制信息区域之前,确定所述逻辑磁盘对应的控制信息区域中是否存储与所述虚拟机配置信息不同的虚拟机配置信息;Before the writing unit writes the virtual machine configuration information to the control information area corresponding to the disk array according to the LUN, determining whether the virtual machine configuration is stored in the control information area corresponding to the logical disk Different virtual machine configuration information;
所述第一删除单元,用于若所述确定单元确定所述逻辑磁盘对应的控制信息区域中存储与所述虚拟机配置信息不同的虚拟机配置信息,删除所述与所述虚拟机配置信息不同的虚拟机配置信息。The first deleting unit is configured to: if the determining unit determines that the virtual machine configuration information different from the virtual machine configuration information is stored in the control information area corresponding to the logical disk, deleting the virtual machine configuration information Different virtual machine configuration information.
在第三方面第四种可能的实现方式中,结合第三方面,所述磁盘阵列还包括:接收单元、以及第二删除单元;In a fourth possible implementation manner of the third aspect, in combination with the third aspect, the disk array further includes: a receiving unit, and a second deleting unit;
所述接收单元,用于在所述写入单元根据所述LUN,将所述虚拟机配置信息写入所述逻辑磁盘对应的控制信息区域之后,接收删除请求消息,所述删除请求消息用于指示删除所述逻辑磁盘对应的控制信息区域中的所述虚拟机配置信息;The receiving unit is configured to: after the writing unit writes the virtual machine configuration information into a control information area corresponding to the logical disk according to the LUN, receive a delete request message, where the delete request message is used Instructing to delete the virtual machine configuration information in the control information area corresponding to the logical disk;
所述第二删除单元,用于根据所述删除请求消息,删除所述虚拟机配置信息。The second deleting unit is configured to delete the virtual machine configuration information according to the deletion request message.
现有技术中,由于虚拟磁盘数据和虚拟机配置信息被分开保存,虚拟磁盘数据被保存在逻辑磁盘中,而虚拟机配置信息被保存在管理节点中。因此,当管理节点出现单点失效时,就会使得虚拟机配置信息无法访问,进而无法获知虚拟机与虚拟机的虚拟磁盘所在的逻辑磁盘的对应关系,最终导致虚拟机无法启动。而基于本发明实施例提供的逻辑磁盘,将虚拟机配置信息存储在逻辑磁盘的控制信息区域,因此,即使管理节点出现单点失效,仍然可以通过访问虚拟机的虚拟磁盘所在的逻辑磁盘的控制信息区域,实现对虚拟机配置信息的访问。而根据虚拟机配置信息和虚拟机的虚拟磁盘数据,即可正常启动虚拟机。即,本发明实施例提供的逻辑磁盘,能够减少对管理节点的依赖,在管理节点失效时使虚拟机配置信息仍然可用。In the prior art, since the virtual disk data and the virtual machine configuration information are separately saved, the virtual disk data is saved in the logical disk, and the virtual machine configuration information is saved in the management node. Therefore, when a single point of failure occurs on the management node, the virtual machine configuration information cannot be accessed, and the corresponding relationship between the virtual machine and the logical disk where the virtual disk of the virtual machine resides cannot be obtained. As a result, the virtual machine cannot be started. The logical disk provided by the embodiment of the present invention stores the virtual machine configuration information in the control information area of the logical disk. Therefore, even if the management node has a single point of failure, the logical disk of the virtual disk can be accessed by the virtual disk. The information area enables access to virtual machine configuration information. According to the virtual machine configuration information and the virtual disk data of the virtual machine, the virtual machine can be started normally. That is, the logical disk provided by the embodiment of the present invention can reduce the dependency on the management node, and the virtual machine configuration information is still available when the management node fails.
第四方面,提供一种虚拟机配置信息的存储装置,所述装置包括:获取单元、以及第一发送单元;A fourth aspect provides a storage device for virtual machine configuration information, where the device includes: an acquiring unit, and a first sending unit;
所述获取单元,用于获取虚拟机VM的虚拟机配置信息和所述VM对应的虚拟磁盘所在的逻辑磁盘的逻辑单元号LUN;The acquiring unit is configured to acquire virtual machine configuration information of the virtual machine VM and a logical unit number LUN of the logical disk where the virtual disk corresponding to the VM is located;
所述第一发送单元,用于根据所述LUN,将所述虚拟机配置信息发送和所述LUN发送给磁盘阵列,由所述磁盘阵列将所述虚拟机配置信息 写入所述逻辑磁盘对应的控制信息区域。The first sending unit is configured to send the virtual machine configuration information and the LUN to a disk array according to the LUN, where the virtual machine configuration information is used by the disk array Write the control information area corresponding to the logical disk.
在第四方面第一种可能的实现方式中,结合第四方面,所述第一发送单元包括:发送模块;In a first possible implementation manner of the fourth aspect, in combination with the fourth aspect, the first sending unit includes: a sending module;
所述发送模块,用于发送写入请求消息给所述磁盘阵列,所述写入请求消息携带所述虚拟机配置信息和所述LUN。The sending module is configured to send a write request message to the disk array, where the write request message carries the virtual machine configuration information and the LUN.
在第四方面第二种可能的实现方式中,结合第四方面第一种可能的实现方式,所述发送模块具体用于:In a second possible implementation manner of the fourth aspect, in combination with the first possible implementation manner of the fourth aspect, the sending module is specifically configured to:
通过小型计算机系统接口SCSI带内命令发送所述写入请求消息给所述磁盘阵列;Transmitting the write request message to the disk array by a small computer system interface SCSI in-band command;
或者,or,
通过存储系统提供的控制管理接口发送所述写入请求消息给所述磁盘阵列。The write request message is sent to the disk array through a control management interface provided by the storage system.
在第四方面第三种可能的实现方式中,结合第四方面,所述装置还包括:第二发送单元;In a third possible implementation manner of the fourth aspect, in combination with the fourth aspect, the device further includes: a second sending unit;
所述第二发送单元,用于在所述第一发送单元将所述虚拟机配置信息和所述LUN发送给磁盘阵列之后,发送删除请求消息给所述磁盘阵列,所述删除请求消息用于指示删除所述逻辑磁盘对应的控制信息区域中的所述虚拟机配置信息。The second sending unit is configured to send a delete request message to the disk array after the first sending unit sends the virtual machine configuration information and the LUN to the disk array, where the delete request message is used Instructing to delete the virtual machine configuration information in the control information area corresponding to the logical disk.
现有技术中,由于虚拟磁盘数据和虚拟机配置信息被分开保存,虚拟磁盘数据被保存在逻辑磁盘中,而虚拟机配置信息被保存在管理节点中。因此,当管理节点出现单点失效时,就会使得虚拟机配置信息无法访问,进而无法虚拟机与虚拟机的虚拟磁盘所在的逻辑磁盘的对应关系,最终导致虚拟机无法启动。而本发明实施例提供的虚拟机配置信息的存储装置,将虚拟机配置信息存储在逻辑磁盘的控制信息区域,因此,即使管理节点出现单点失效,仍然可以通过访问虚拟机的虚拟磁盘所在的逻辑磁盘的控制信息区域,实现对虚拟机配置信息的访问。而根据虚拟机配置信息和虚拟机的虚拟磁盘数据,即可正常启动虚拟机。即,本发明实施例提供的虚拟机配置信息的存储装置,能够减少对管理节点的依赖,在管理节点失效时使虚拟机配置信息仍然可用。In the prior art, since the virtual disk data and the virtual machine configuration information are separately saved, the virtual disk data is saved in the logical disk, and the virtual machine configuration information is saved in the management node. Therefore, when a single point of failure occurs on the management node, the virtual machine configuration information cannot be accessed, and the corresponding relationship between the virtual machine and the logical disk where the virtual disk of the virtual machine resides cannot be obtained. Eventually, the virtual machine cannot be started. The storage device of the virtual machine configuration information provided by the embodiment of the present invention stores the virtual machine configuration information in the control information area of the logical disk. Therefore, even if the management node has a single point of failure, the virtual disk of the virtual machine can still be accessed. The control information area of the logical disk enables access to the virtual machine configuration information. According to the virtual machine configuration information and the virtual disk data of the virtual machine, the virtual machine can be started normally. That is, the storage device of the virtual machine configuration information provided by the embodiment of the present invention can reduce the dependency on the management node, and the virtual machine configuration information is still available when the management node fails.
附图说明DRAWINGS
图1为虚拟机系统架构示意图; 1 is a schematic diagram of a virtual machine system architecture;
图2为本发明实施例提供的一种虚拟机配置信息的存储方法的流程示意图一;2 is a schematic flowchart 1 of a method for storing virtual machine configuration information according to an embodiment of the present invention;
图3为本发明实施例提供的一种虚拟机配置信息的存储方法的流程示意图二;FIG. 3 is a second schematic flowchart of a method for storing virtual machine configuration information according to an embodiment of the present disclosure;
图4为本发明实施例提供的一种虚拟机配置信息的存储方法的流程示意图三;4 is a schematic flowchart 3 of a method for storing virtual machine configuration information according to an embodiment of the present invention;
图5为本发明实施例提供的一种虚拟机配置信息的存储方法的流程示意图四;FIG. 5 is a schematic flowchart 4 of a method for storing virtual machine configuration information according to an embodiment of the present disclosure;
图6为本发明实施例提供的一种虚拟机配置信息的存储方法的流程示意图五;FIG. 6 is a schematic flowchart 5 of a method for storing virtual machine configuration information according to an embodiment of the present disclosure;
图7为本发明实施例提供的一种虚拟机配置信息的读取方法的流程示意图一;FIG. 7 is a schematic flowchart 1 of a method for reading configuration information of a virtual machine according to an embodiment of the present disclosure;
图8为本发明实施例提供的一种虚拟机配置信息的读取方法的流程示意图二;FIG. 8 is a second schematic flowchart of a method for reading configuration information of a virtual machine according to an embodiment of the present disclosure;
图9为本发明实施例提供的使用本发明实施例提供的虚拟机配置信息的读取方法读取虚拟机配置信息的过程示意图;FIG. 9 is a schematic diagram of a process for reading virtual machine configuration information by using a virtual machine configuration information reading method according to an embodiment of the present disclosure;
图10为本发明实施例提供的一种远程存储容灾备份方法的示意图一;FIG. 10 is a schematic diagram 1 of a remote storage disaster recovery backup method according to an embodiment of the present invention;
图11为通过Hypervisor或第三方设备进行容灾备份的示意图;Figure 11 is a schematic diagram of disaster recovery backup through a hypervisor or a third-party device;
图12为通过磁盘阵列进行容灾备份的示意图;12 is a schematic diagram of performing disaster recovery backup through a disk array;
图13为现有技术中远程存储容灾备份方法的示意图;13 is a schematic diagram of a remote storage disaster recovery backup method in the prior art;
图14为本发明实施例提供的一种磁盘阵列的结构示意图一;FIG. 14 is a schematic structural diagram 1 of a disk array according to an embodiment of the present disclosure;
图15为本发明实施例提供的一种磁盘阵列的结构示意图二;FIG. 15 is a schematic structural diagram 2 of a disk array according to an embodiment of the present disclosure;
图16为本发明实施例提供的一种磁盘阵列的结构示意图三;FIG. 16 is a schematic structural diagram 3 of a disk array according to an embodiment of the present disclosure;
图17为本发明实施例提供的一种磁盘阵列的结构示意图四;FIG. 17 is a schematic structural diagram 4 of a disk array according to an embodiment of the present disclosure;
图18为本发明实施例提供的一种虚拟机配置信息的存储装置的结构示意图一;FIG. 18 is a schematic structural diagram 1 of a storage device for configuring virtual machine configuration information according to an embodiment of the present disclosure;
图19为本发明实施例提供的一种虚拟机配置信息的存储装置的结构示意图二;FIG. 19 is a schematic structural diagram 2 of a storage device for configuring virtual machine configuration information according to an embodiment of the present disclosure;
图20为本发明实施例提供的一种虚拟机配置信息的存储装置的结 构示意图三。FIG. 20 is a schematic diagram of a storage device for configuring virtual machine configuration information according to an embodiment of the present invention; Figure 3 is constructed.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
为了方便理解本发明实施例,首先在此介绍本发明实施例描述中会引入的几个术语:In order to facilitate the understanding of the embodiments of the present invention, several terms introduced in the description of the embodiments of the present invention are first introduced herein:
虚拟机(Virtual Machine,VM):通过虚拟机软件可以在一台物理主机上模拟出一台或者多台虚拟的计算机,而这些虚拟机就像真正的计算机那样进行工作,虚拟机上可以安装操作系统和应用程序,虚拟机还可访问网络资源。对于在虚拟机中运行的应用程序而言,虚拟机就像是真正的计算机进行工作。Virtual Machine (VM): Virtual machine software can simulate one or more virtual computers on a physical host. These virtual machines work like real computers, and can be installed on virtual machines. Systems and applications, virtual machines also have access to network resources. For an application running in a virtual machine, the virtual machine is like a real computer.
Hypervisor:一种运行在基础物理服务器和操作系统之间的中间软件层,可允许多个操作系统和应用程序共享硬件。可以访问服务器上包括磁盘和内存在内的所有物理设备。当基础物理服务器启动并执行Hypervisor时,它会加载所有虚拟机的操作系统,同时会分配给每一台虚拟机适量的内存、CPU、网络和磁盘。Hypervisor: An intermediate layer of software running between the underlying physical server and the operating system that allows multiple operating systems and applications to share hardware. All physical devices on the server, including disk and memory, can be accessed. When the underlying physical server starts and executes the hypervisor, it loads the operating systems of all virtual machines and allocates the appropriate amount of memory, CPU, network, and disk to each virtual machine.
逻辑磁盘:在物理存储设备上将存储空间按照前期规划和功能划分的逻辑存储单元。应理解,逻辑磁盘不等于某个具体的设备,只是逻辑存储单元。每个逻辑磁盘都有一个对应的逻辑单元号(Logical Unit Number,LUN),用以标识该逻辑磁盘。一个或多个逻辑磁盘可以组成虚拟机文件系统,用以存放虚拟机的虚拟磁盘数据。Logical disk: A logical storage unit that divides storage space according to prior planning and functions on a physical storage device. It should be understood that a logical disk is not equal to a specific device, but a logical storage unit. Each logical disk has a corresponding Logical Unit Number (LUN) to identify the logical disk. One or more logical disks can form a virtual machine file system to hold virtual disk data of the virtual machine.
其次,给出一种虚拟机系统架构示意图,如图1所示,包括:虚拟机10、Hypervisor11、管理节点12、以及磁盘阵列13上的逻辑磁盘131。其中,逻辑磁盘131中存储有虚拟磁盘数据,管理节点12中存储有虚拟机配置信息。当管理节点12出现单点失效后,保存在管理节点12的虚拟机配置信息就会丢失,虚拟机配置信息中有关虚拟磁盘存储位置的信息也会随之丢失,如此一来,就无法获知虚拟机与虚拟机的虚拟磁盘所在的逻辑磁盘的对应关系,从而也就无法启动虚拟机。 Next, a schematic diagram of a virtual machine system architecture is shown. As shown in FIG. 1, the virtual machine 10, the hypervisor 11, the management node 12, and the logical disk 131 on the disk array 13 are provided. The virtual disk data is stored in the logical disk 131, and the virtual machine configuration information is stored in the management node 12. When the management node 12 fails in a single point, the virtual machine configuration information stored in the management node 12 is lost, and the information about the virtual disk storage location in the virtual machine configuration information is also lost, so that the virtual information cannot be learned. The correspondence between the machine and the logical disk where the virtual disk of the virtual machine resides, and thus the virtual machine cannot be started.
应理解,本发明实施例可以应用于xen、KVM等虚拟化平台中,也可以应用于任意一个需要进行虚拟机配置信息的存储、读取的虚拟化平台中,本发明实施例对此不进行限制。It should be understood that the embodiment of the present invention may be applied to a virtualization platform such as xen or KVM, and may also be applied to any virtualization platform that needs to store and read virtual machine configuration information. limit.
实施例一、Embodiment 1
本发明实施例提供一种虚拟机配置信息的存储方法,具体如图2所示,包括:The embodiment of the invention provides a method for storing virtual machine configuration information, as shown in FIG. 2, which includes:
S201、磁盘阵列获取VM的虚拟机配置信息及VM对应的虚拟磁盘所在的逻辑磁盘的LUN。S201. The disk array acquires the virtual machine configuration information of the VM and the LUN of the logical disk where the virtual disk corresponding to the VM is located.
S202、磁盘阵列根据LUN,将虚拟机配置信息写入逻辑磁盘对应的控制信息区域。S202. The disk array writes the virtual machine configuration information to the control information area corresponding to the logical disk according to the LUN.
其中,虚拟机配置信息是指虚拟机的属性信息,如虚拟机的名称、虚拟设备信息、磁盘存储特性信息等。通常,考虑到通用性和差异性,可以将虚拟机配置信息分为三部分信息进行存储,参见表-1。The virtual machine configuration information refers to the attribute information of the virtual machine, such as the name of the virtual machine, the virtual device information, and the disk storage characteristic information. Generally, considering the versatility and variability, the virtual machine configuration information can be divided into three parts for storage, see Table-1.
表-1Table 1
通用信息General information 虚拟化厂商自定义信息Virtualization vendor customization information 存储厂商自定义信息Store vendor customization information
其中,通用信息是指与厂商无关的虚拟机通用信息,如虚拟机通用唯一识别码(Universally Unique Identifier,UUID)、虚拟机名称、客户端操作系统(Guest OS)名称、虚拟机的中央处理器(Central Processing Unit,CPU)规格、虚拟机的内存规格等;虚拟化厂商自定义信息是指虚拟化厂商定义的虚拟机信息,如虚拟机相关特性信息、虚拟机虚拟设备信息、虚拟机状态信息等;存储厂商自定义信息是指存储厂商定义的虚拟机信息,如虚拟机磁盘存储特性信息、虚拟机磁盘快照信息、虚拟机磁盘镜像信息等。The general information refers to the general information of the virtual machine that is not related to the manufacturer, such as the Universally Unique Identifier (UUID) of the virtual machine, the name of the virtual machine, the name of the guest operating system (Guest OS), and the central processing unit of the virtual machine. (Central Processing Unit, CPU) specifications, virtual machine memory specifications, etc.; virtualization vendor custom information refers to virtual machine information defined by the virtualization vendor, such as virtual machine related feature information, virtual machine virtual device information, virtual machine state information The storage vendor-defined information refers to the virtual machine information defined by the storage vendor, such as virtual machine disk storage feature information, virtual machine disk snapshot information, and virtual machine disk image information.
需要说明的是,在现有的存储电气协议下,每个逻辑磁盘上都包含有控制信息区域和用户数据区域两个区域。其中,控制信息区域中存储的是逻辑磁盘的属性信息数据,如逻辑磁盘的LUN、名称、所属的存储设备等;用户数据区域存储的是用户指定存储的数据。通常,用户可以访问和管理用户数据区域的数据,而无权管理控制信息区域的数据。因此,将虚拟机配置信息存储在控制信息区域可以防止用户修改虚拟机配置信息;另外,相比于用户数据区域的数据,控制信息区域的数据的相对较少,因此,将虚拟机配置信息存储在控制信息区域可实现虚拟机配 置信息的快速查找。It should be noted that, under the existing storage electrical protocol, each logical disk includes two areas of a control information area and a user data area. The information of the logical disk is stored in the control information area, such as the LUN of the logical disk, the name, the storage device to which it belongs, and the user data area stores the data specified by the user. Typically, users can access and manage data in the user data area without having the authority to manage data in the control information area. Therefore, storing the virtual machine configuration information in the control information area can prevent the user from modifying the virtual machine configuration information; in addition, the data of the control information area is relatively less than the data of the user data area, and therefore, the virtual machine configuration information is stored. Virtual machine configuration can be implemented in the control information area Quick search for information.
优选的,如图3所示,在本发明实施例提供的虚拟机配置信息的存储方法中,磁盘阵列获取VM的虚拟机配置信息及VM对应的虚拟磁盘所在的逻辑磁盘的LUN(步骤S201),具体可以包括:Preferably, as shown in FIG. 3, in the method for storing the virtual machine configuration information provided by the embodiment of the present invention, the disk array acquires the virtual machine configuration information of the VM and the LUN of the logical disk where the virtual disk corresponding to the VM is located (step S201). Specifically, the method may include:
S201a、磁盘阵列接收写入请求消息,写入请求消息携带虚拟机配置信息及LUN。S201a. The disk array receives a write request message, where the write request message carries virtual machine configuration information and a LUN.
S201b、磁盘阵列根据写入请求消息,获取虚拟机配置信息及LUN。S201b and the disk array acquire the virtual machine configuration information and the LUN according to the write request message.
其中,写入请求消息具体可以是Hypervisor发送的,也可以是第三方设备发送的,还可以是另外一个磁盘阵列发送的,本发明实施例对此不作具体限定。The write request message may be sent by the Hypervisor, or may be sent by a third-party device, or may be sent by another disk array, which is not specifically limited in this embodiment of the present invention.
需要说明的是,写入请求消息具体可以用于新增虚拟机配置信息,即在逻辑磁盘的控制信息区域中未存储虚拟机配置信息时,磁盘阵列接收写入请求消息,从写入请求消息中获取虚拟机配置信息及LUN,并根据LUN,将虚拟机配置信息写入逻辑磁盘的控制信息区域,以在逻辑磁盘控制信息区域中添加虚拟机配置信息;写入请求消息还可以用于更新虚拟机配置信息,即在逻辑磁盘的控制信息区域中已存储有虚拟机配置信息时,磁盘阵列接收写入请求消息,从写入请求消息中获取虚拟机配置信息及LUN,并根据LUN,将虚拟机配置信息写入逻辑磁盘对应的控制信息区域,以覆盖逻辑磁盘控制信息区域中原有的虚拟机配置信息,更新逻辑磁盘控制信息区域中的虚拟机配置信息。本发明实施例对此不作具体限定。It should be noted that the write request message may be specifically used to add virtual machine configuration information, that is, when the virtual machine configuration information is not stored in the control information area of the logical disk, the disk array receives the write request message, and the write request message Obtain virtual machine configuration information and LUNs, and write virtual machine configuration information to the control information area of the logical disk according to the LUN, to add virtual machine configuration information in the logical disk control information area; the write request message may also be used for updating The virtual machine configuration information, that is, when the virtual machine configuration information is stored in the control information area of the logical disk, the disk array receives the write request message, obtains the virtual machine configuration information and the LUN from the write request message, and according to the LUN, The virtual machine configuration information is written in the control information area corresponding to the logical disk to cover the original virtual machine configuration information in the logical disk control information area, and the virtual machine configuration information in the logical disk control information area is updated. This embodiment of the present invention does not specifically limit this.
优选的,在本发明实施例提供的虚拟机配置信息的存储方法中,磁盘阵列接收写入请求消息(步骤S201a),具体可以包括:Preferably, in the method for storing the virtual machine configuration information provided by the embodiment of the present invention, the disk array receives the write request message (step S201a), which may specifically include:
磁盘阵列接收通过小型计算机系统接口(Small Computer System Interface,SCSI)带内命令发送的写入请求消息。The disk array receives a write request message sent via a Small Computer System Interface (SCSI) in-band command.
或者,or,
磁盘阵列接收通过存储系统提供的控制管理接口发送的写入请求消息。The disk array receives a write request message sent through a control management interface provided by the storage system.
进一步的,如图4所示,在本发明实施例提供的虚拟机配置信息的存储方法中,在磁盘阵列根据LUN,将虚拟机配置信息写入逻辑磁盘对应的控制信息区域(步骤S202)之前,还可以包括: Further, as shown in FIG. 4, in the method for storing virtual machine configuration information provided by the embodiment of the present invention, before the disk array writes the virtual machine configuration information to the control information area corresponding to the logical disk according to the LUN (step S202) Can also include:
S203、磁盘阵列确定逻辑磁盘对应的控制信息区域中是否存储与所述虚拟机配置信息不同的虚拟机配置信息。S203. The disk array determines whether virtual machine configuration information different from the virtual machine configuration information is stored in a control information area corresponding to the logical disk.
S204、若是,磁盘阵列删除与所述虚拟机配置信息不同的虚拟机配置信息。S204. If yes, the disk array deletes virtual machine configuration information different from the virtual machine configuration information.
即,若逻辑磁盘无法实现数据覆盖,则在磁盘阵列接收到写入请求消息后,若确定逻辑磁盘对应的控制信息区域中存储与所述虚拟机配置信息不同的虚拟机配置信息,需首先删除该逻辑磁盘控制信息区域中与所述虚拟机配置信息不同的虚拟机配置信息,然后将写入请求消息中携带的虚拟机配置信息写入该控制信息区域,本发明实施例对此不作具体限定。That is, if the logical disk cannot achieve the data coverage, after the disk array receives the write request message, if it is determined that the virtual machine configuration information different from the virtual machine configuration information is stored in the control information area corresponding to the logical disk, it needs to be deleted first. The virtual disk configuration information in the information area is different from the virtual machine configuration information, and then the virtual machine configuration information carried in the write request message is written into the control information area, which is not specifically limited in this embodiment of the present invention. .
优选的,如图5所示,在本发明实施例提供的虚拟机配置信息的存储方法中,在磁盘阵列将虚拟机配置信息写入逻辑磁盘对应的控制信息区域(步骤S202)之后,还可以包括:Preferably, as shown in FIG. 5, in the method for storing virtual machine configuration information provided by the embodiment of the present invention, after the disk array writes the virtual machine configuration information to the control information area corresponding to the logical disk (step S202), include:
S205、磁盘阵列接收删除请求消息,删除请求消息用于指示删除逻辑磁盘对应的控制信息区域中的虚拟机配置信息;S205. The disk array receives the delete request message, where the delete request message is used to delete the virtual machine configuration information in the control information area corresponding to the logical disk.
S206、磁盘阵列根据删除请求消息,删除虚拟机配置信息。S206. The disk array deletes the virtual machine configuration information according to the delete request message.
如此一来,在不需要逻辑磁盘中的虚拟机配置信息时,即可将虚拟机配置信息删除,以减少对逻辑磁盘的控制信息区域的占用,及时释放逻辑磁盘的控制信息区域的存储空间。In this way, when the virtual machine configuration information in the logical disk is not required, the virtual machine configuration information can be deleted to reduce the occupation of the control information area of the logical disk and release the storage space of the control information area of the logical disk in time.
本发明实施例提供的虚拟机配置信息的存储方法,磁盘阵列先获取VM的虚拟机配置信息及VM对应的虚拟磁盘所在的逻辑磁盘的LUN,然后根据LUN,将虚拟机配置信息写入逻辑磁盘对应的控制信息区域。现有技术中,由于虚拟磁盘数据和虚拟机配置信息被分开保存,虚拟磁盘数据被保存在逻辑磁盘中,而虚拟机配置信息被保存在管理节点中。因此,当管理节点出现单点失效时,就会使得虚拟机配置信息无法访问,进而无法获知虚拟机与虚拟机的虚拟磁盘所在的逻辑磁盘的对应关系,最终导致虚拟机无法启动。而基于本发明实施例提供的虚拟机配置信息的存储方法,将虚拟机配置信息存储在逻辑磁盘的控制信息区域,因此,即使管理节点出现单点失效,仍然可以通过访问虚拟机的虚拟磁盘所在的逻辑磁盘的控制信息区域,实现对虚拟机配置信息的访问。而根据虚拟机配置信息和虚拟机的虚拟磁盘数据,即可正常启动虚拟机。即,本发明实施例提供的虚拟机配置信息的存储方法,能够减少对管理节点的依 赖,在管理节点失效时使虚拟机配置信息仍然可用。The method for storing the configuration information of the virtual machine provided by the embodiment of the present invention, the disk array first acquires the virtual machine configuration information of the VM and the LUN of the logical disk where the virtual disk corresponding to the VM is located, and then writes the virtual machine configuration information to the logical disk according to the LUN. Corresponding control information area. In the prior art, since the virtual disk data and the virtual machine configuration information are separately saved, the virtual disk data is saved in the logical disk, and the virtual machine configuration information is saved in the management node. Therefore, when a single point of failure occurs on the management node, the virtual machine configuration information cannot be accessed, and the corresponding relationship between the virtual machine and the logical disk where the virtual disk of the virtual machine resides cannot be obtained. As a result, the virtual machine cannot be started. The storage method of the virtual machine configuration information provided by the embodiment of the present invention stores the virtual machine configuration information in the control information area of the logical disk. Therefore, even if the management node has a single point of failure, the virtual disk of the virtual machine can still be accessed. The control information area of the logical disk realizes access to the virtual machine configuration information. According to the virtual machine configuration information and the virtual disk data of the virtual machine, the virtual machine can be started normally. That is, the method for storing virtual machine configuration information provided by the embodiment of the present invention can reduce the dependency on the management node. Lay, the virtual machine configuration information is still available when the management node fails.
实施例二、Embodiment 2
本发明实施例提供一种虚拟机配置信息的存储方法,具体如图6所示,包括:An embodiment of the present invention provides a method for storing virtual machine configuration information, as shown in FIG. 6, which includes:
S601、获取VM的虚拟机配置信息和VM对应的虚拟磁盘所在的逻辑磁盘的LUN。S601. Obtain VM configuration information of the VM and a LUN of the logical disk where the virtual disk corresponding to the VM is located.
S602、将虚拟机配置信息和LUN发送给磁盘阵列,由磁盘阵列根据LUN,将虚拟机配置信息写入逻辑磁盘对应的控制信息区域。S602: Send the virtual machine configuration information and the LUN to the disk array, and the disk array writes the virtual machine configuration information to the control information area corresponding to the logical disk according to the LUN.
需要说明的是,在本发明实施例中,可以由Hypervisor执行上述存储方法,也可以由第三方设备执行,还可以由存储所述虚拟机配置信息的逻辑磁盘所在的磁盘阵列执行,本发明实施例对此不作具体限定。It should be noted that, in the embodiment of the present invention, the foregoing storage method may be performed by a hypervisor, may be performed by a third-party device, or may be performed by a disk array in which a logical disk storing the virtual machine configuration information is located, and is implemented by the present invention. This example does not specifically limit this.
优选的,在本发明实施例提供的虚拟机配置信息的存储方法中,将虚拟机配置信息和LUN发送给磁盘阵列,具体可以包括:Preferably, in the method for storing the configuration information of the virtual machine provided by the embodiment of the present invention, the configuration information of the virtual machine and the LUN are sent to the disk array, which may include:
发送写入请求消息给磁盘阵列,写入请求消息携带虚拟机配置信息和LUN。A write request message is sent to the disk array, and the write request message carries the virtual machine configuration information and the LUN.
需要说明的是,写入请求消息具体可以用于新增虚拟机配置信息,即在逻辑磁盘的控制信息区域中未存储虚拟机配置信息时,发送写入请求消息给磁盘阵列,由磁盘阵列从写入请求消息中获取虚拟机配置信息及LUN,并根据LUN,将虚拟机配置信息写入逻辑磁盘的控制信息区域,以在逻辑磁盘控制信息区域中添加虚拟机配置信息;写入请求消息还可以用于更新虚拟机配置信息,即在逻辑磁盘的控制信息区域中已存储有虚拟机配置信息时,发送写入请求消息给磁盘阵列,由磁盘阵列从写入请求消息中获取虚拟机配置信息及LUN,并根据LUN,将虚拟机配置信息写入逻辑磁盘对应的控制信息区域,以覆盖逻辑磁盘控制信息区域中原有的虚拟机配置信息,更新逻辑磁盘控制信息区域中的虚拟机配置信息。It should be noted that the write request message may be used to newly add virtual machine configuration information, that is, when the virtual machine configuration information is not stored in the control information area of the logical disk, the write request message is sent to the disk array, and the disk array is The virtual machine configuration information and the LUN are obtained in the write request message, and the virtual machine configuration information is written into the control information area of the logical disk according to the LUN, so that the virtual machine configuration information is added in the logical disk control information area; the write request message is further It can be used to update the virtual machine configuration information, that is, when the virtual machine configuration information is stored in the control information area of the logical disk, the write request message is sent to the disk array, and the disk array obtains the virtual machine configuration information from the write request message. And the LUN, and the virtual machine configuration information is written to the control information area corresponding to the logical disk according to the LUN, so as to overwrite the original virtual machine configuration information in the logical disk control information area, and update the virtual machine configuration information in the logical disk control information area.
优选的,在本发明实施例提供的虚拟机配置信息的存储方法中,发送写入请求消息给磁盘阵列,具体可以包括:Preferably, in the method for storing the configuration information of the virtual machine provided by the embodiment of the present invention, the sending the write request message to the disk array may include:
通过小型计算机系统接口SCSI带内命令发送写入请求消息给磁盘阵列。A write request message is sent to the disk array via the small computer system interface SCSI in-band command.
或者,or,
通过存储系统提供的控制管理接口发送写入请求消息给磁盘阵列。 A write request message is sent to the disk array through a control management interface provided by the storage system.
优选的,在本发明实施例提供的虚拟机配置信息的存储方法中,在将虚拟机配置信息和LUN发送给磁盘阵列之后,还可以包括:Preferably, after the virtual machine configuration information and the LUN are sent to the disk array, the method for storing the virtual machine configuration information provided by the embodiment of the present invention may further include:
发送删除请求消息给磁盘阵列,删除请求消息用于指示删除逻辑磁盘对应的控制信息区域中的虚拟机配置信息。The delete request message is sent to the disk array, and the delete request message is used to delete the virtual machine configuration information in the control information area corresponding to the logical disk.
如此一来,在不需要逻辑磁盘中的虚拟机配置信息时,即可将虚拟机配置信息删除,以减少对逻辑磁盘的控制信息区域的占用,及时释放逻辑磁盘的控制信息区域的存储空间。In this way, when the virtual machine configuration information in the logical disk is not required, the virtual machine configuration information can be deleted to reduce the occupation of the control information area of the logical disk and release the storage space of the control information area of the logical disk in time.
本发明实施例提供的虚拟机配置信息的存储方法,通过获取VM的虚拟机配置信息和VM对应的虚拟磁盘所在的逻辑磁盘的LUN,将虚拟机配置信息和LUN发送给磁盘阵列,然后由磁盘阵列根据LUN,将虚拟机配置信息写入逻辑磁盘对应的控制信息区域。现有技术中,由于虚拟磁盘数据和虚拟机配置信息被分开保存,虚拟磁盘数据被保存在逻辑磁盘中,而虚拟机配置信息被保存在管理节点中。因此,当管理节点出现单点失效时,就会使得虚拟机配置信息无法访问,进而无法虚拟机与虚拟机的虚拟磁盘所在的逻辑磁盘的对应关系,最终导致虚拟机无法启动。而基于本发明实施例提供的虚拟机配置信息的存储方法,将虚拟机配置信息存储在逻辑磁盘的控制信息区域,因此,即使管理节点出现单点失效,仍然可以通过访问虚拟机的虚拟磁盘所在的逻辑磁盘的控制信息区域,实现对虚拟机配置信息的访问。而根据虚拟机配置信息和虚拟机的虚拟磁盘数据,即可正常启动虚拟机。即,本发明实施例提供的虚拟机配置信息的存储方法,能够减少对管理节点的依赖,在管理节点失效时使虚拟机配置信息仍然可用。The method for storing the configuration information of the virtual machine provided by the embodiment of the present invention, by acquiring the virtual machine configuration information of the VM and the LUN of the logical disk where the virtual disk corresponding to the VM is located, sends the virtual machine configuration information and the LUN to the disk array, and then the disk. The array writes the VM configuration information to the control information area corresponding to the logical disk according to the LUN. In the prior art, since the virtual disk data and the virtual machine configuration information are separately saved, the virtual disk data is saved in the logical disk, and the virtual machine configuration information is saved in the management node. Therefore, when a single point of failure occurs on the management node, the virtual machine configuration information cannot be accessed, and the corresponding relationship between the virtual machine and the logical disk where the virtual disk of the virtual machine resides cannot be obtained. Eventually, the virtual machine cannot be started. The storage method of the virtual machine configuration information provided by the embodiment of the present invention stores the virtual machine configuration information in the control information area of the logical disk. Therefore, even if the management node has a single point of failure, the virtual disk of the virtual machine can still be accessed. The control information area of the logical disk realizes access to the virtual machine configuration information. According to the virtual machine configuration information and the virtual disk data of the virtual machine, the virtual machine can be started normally. That is, the storage method of the virtual machine configuration information provided by the embodiment of the present invention can reduce the dependency on the management node, and the virtual machine configuration information is still available when the management node fails.
实施例三、Embodiment 3
本发明实施例提供一种虚拟机配置信息的读取方法,具体如图7所示,包括:An embodiment of the present invention provides a method for reading configuration information of a virtual machine, as shown in FIG. 7, which includes:
S701、获取VM对应的虚拟磁盘所在的逻辑磁盘的LUN。S701. Obtain a LUN of a logical disk where the virtual disk corresponding to the VM is located.
S702、根据LUN,读取逻辑磁盘对应的控制信息区域中预先存储的虚拟机配置信息。S702. The virtual machine configuration information pre-stored in the control information area corresponding to the logical disk is read according to the LUN.
需要说明的是,在本发明实施例中,可以由Hypervisor执行上述读取方法,也可以由第三方设备执行,还可以由存储所述虚拟机配置信息的逻辑磁盘所在的磁盘阵列之外的磁盘阵列执行,本发明实施例对此不 作具体限定。It should be noted that, in the embodiment of the present invention, the foregoing reading method may be performed by the hypervisor, or may be performed by a third-party device, or may be a disk other than the disk array where the logical disk storing the virtual machine configuration information is located. The array is executed, and the embodiment of the present invention does not Be specifically limited.
优选的,在本发明实施例提供的虚拟机配置信息的读取方法中,获取VM对应的虚拟磁盘所在的逻辑磁盘的LUN(步骤S701),具体可以包括:Preferably, in the method for reading the configuration information of the virtual machine provided by the embodiment of the present invention, the LUN of the logical disk in which the virtual disk corresponding to the VM is located is obtained (step S701), which may specifically include:
获取SCSI上的VM对应的虚拟磁盘所在的逻辑磁盘的LUN。Obtain the LUN of the logical disk where the virtual disk corresponding to the VM on the SCSI is located.
具体的,可通过扫描主机总线适配卡(Host Bus Adaptor,HBA)获得SCSI上所有逻辑磁盘的LUN的一览表,根据该一览表以及VM的标识,即可获得VM对应的虚拟磁盘所在的逻辑磁盘的LUN。当然,也可由用户指定逻辑磁盘,即由用户给出逻辑磁盘的LUN,本发明实施例对此不作具体限定。Specifically, a host bus adapter (HBA) can be used to obtain a list of LUNs of all logical disks on the SCSI. According to the list and the identifier of the VM, the logical disk where the virtual disk corresponding to the VM is located can be obtained. LUN. Of course, the LUN can be specified by the user, that is, the LUN of the logical disk is given by the user, which is not specifically limited in this embodiment of the present invention.
进一步的,如图8所示,在本发明实施例提供的虚拟机配置信息的读取方法中,在根据LUN,读取逻辑磁盘对应的控制信息区域中预先存储的虚拟机配置信息(步骤S702)之前,还可以包括:Further, as shown in FIG. 8 , in the method for reading the configuration information of the virtual machine provided by the embodiment of the present invention, the virtual machine configuration information pre-stored in the control information area corresponding to the logical disk is read according to the LUN (step S702). Before, you can also include:
S703、根据LUN,向逻辑磁盘所在的磁盘阵列发送第一请求消息,第一请求消息请求读取虚拟机配置信息。S703. Send a first request message to the disk array where the logical disk is located according to the LUN, where the first request message requests to read the virtual machine configuration information.
S704、接收逻辑磁盘所在的磁盘阵列发送的请求确认消息,请求确认消息指示允许读取虚拟机配置信息。S704: Receive a request confirmation message sent by the disk array where the logical disk is located, and request a confirmation message to indicate that the virtual machine configuration information is allowed to be read.
即,在逻辑磁盘所在的磁盘阵列允许读取虚拟机配置信息后,再读取虚拟机配置信息。如此,能够防止多个设备同时读取该逻辑磁盘的虚拟机配置信息而出现冲突,确保设备能够获取到虚拟机配置信息;另一方面,在逻辑磁盘所在的磁盘阵列允许的情况下再读取虚拟机配置信息,可保证虚拟机配置信息的安全性。That is, after the disk array where the logical disk is located allows the virtual machine configuration information to be read, the virtual machine configuration information is read. In this way, it is possible to prevent multiple devices from simultaneously reading the virtual machine configuration information of the logical disk and conflicting to ensure that the device can obtain the virtual machine configuration information; on the other hand, read again if the disk array where the logical disk is located allows The virtual machine configuration information ensures the security of the virtual machine configuration information.
进一步的,在本发明实施例提供的虚拟机配置信息的读取方法中,虚拟机配置信息包含VM的VM标识。Further, in the method for reading virtual machine configuration information provided by the embodiment of the present invention, the virtual machine configuration information includes a VM identifier of the VM.
则,在根据LUN,读取逻辑磁盘对应的控制信息区域中预先存储的虚拟机配置信息(步骤S702)之后,还可以包括:Then, after the virtual machine configuration information pre-stored in the control information area corresponding to the logical disk is read according to the LUN (step S702), the method may further include:
根据VM标识,将虚拟磁盘挂载至VM。Mount the virtual disk to the VM based on the VM ID.
更进一步的,在本发明实施例提供的虚拟机配置信息的读取方法中,在根据VM标识,将虚拟磁盘挂载至VM之后,还可以包括:Further, in the method for reading the configuration information of the virtual machine provided by the embodiment of the present invention, after the virtual disk is mounted to the VM according to the VM identifier, the method further includes:
根据虚拟机配置信息,启动VM。Start the VM based on the virtual machine configuration information.
即,在将虚拟磁盘挂载至对应的VM后,即可根据逻辑磁盘的控制信 息区域中预先存储的虚拟机配置信息启动VM。That is, after the virtual disk is mounted to the corresponding VM, it can be based on the control letter of the logical disk. The virtual machine configuration information pre-stored in the interest area starts the VM.
优选的,在本发明实施例提供的虚拟机配置信息的读取方法中,在根据虚拟机配置信息,启动VM之前,还可以包括:Preferably, in the method for reading the configuration information of the virtual machine provided by the embodiment of the present invention, before the VM is started according to the configuration information of the virtual machine, the method further includes:
接收第二请求消息,第二请求消息请求启动VM。A second request message is received, the second request message requesting to start the VM.
则,根据虚拟机配置信息启动VM,具体可以包括:Then, the VM is started according to the virtual machine configuration information, and specifically includes:
根据第二请求消息,以及虚拟机配置信息,启动VM。The VM is started according to the second request message and the virtual machine configuration information.
即,在将虚拟磁盘挂载至对应的VM后,可以暂不启动VM,而是确认接收到启动VM的请求后,再根据逻辑磁盘的控制信息区域中预先存储的虚拟机配置信息启动VM。That is, after the virtual disk is mounted to the corresponding VM, the VM may not be started yet, but after confirming that the request to start the VM is received, the VM is started according to the virtual machine configuration information stored in advance in the control information area of the logical disk.
需要说明的是,在现有技术中,当管理节点出现单点失效后,保存在管理节点的虚拟机配置信息就会丢失,虚拟机配置信息中有关虚拟磁盘存储位置的信息也会随之丢失,如此一来,就无法获知虚拟机与虚拟机的虚拟磁盘所在的逻辑磁盘的对应关系,从而无法启动虚拟机。此时,要正常启动虚拟机,必须先恢复管理节点以及虚拟机与虚拟机的虚拟磁盘所在的逻辑磁盘的对应关系,而这一过程往往需要大量的手动操作。而若将虚拟机配置信息预先存储在逻辑磁盘对应的控制信息区域,当管理节点出现单点失效后,可由Hypervisor通过带上命令读取存储在控制信息区域中的虚拟机配置信息(参见图9),仍然能够获取到虚拟机配置信息,进而根据虚拟机配置信息获取虚拟磁盘数据,正常启动虚拟机。It should be noted that, in the prior art, when a single point of failure occurs on the management node, the configuration information of the virtual machine saved in the management node is lost, and the information about the storage location of the virtual disk in the virtual machine configuration information is also lost. As a result, the correspondence between the virtual machine and the logical disk where the virtual disk of the virtual machine is located cannot be known, and the virtual machine cannot be started. In this case, to start the virtual machine normally, you must restore the mapping between the management node and the logical disk where the virtual machine and the virtual disk of the virtual machine reside. This process often requires a lot of manual operations. If the virtual machine configuration information is pre-stored in the control information area corresponding to the logical disk, after the single-point failure of the management node, the hypervisor can read the virtual machine configuration information stored in the control information area by using the command (see Figure 9). ), the virtual machine configuration information can still be obtained, and the virtual disk data is obtained according to the virtual machine configuration information, and the virtual machine is started normally.
本发明实施例提供的虚拟机配置信息的读取方法,通过先获取VM对应的虚拟磁盘所在的逻辑磁盘的LUN,然后根据LUN,读取逻辑磁盘对应的控制信息区域中预先存储的虚拟机配置信息。现有技术中,由于虚拟磁盘数据和虚拟机配置信息被分开保存,虚拟磁盘数据被保存在逻辑磁盘中,而虚拟机配置信息被保存在管理节点中。因此,当管理节点出现单点失效时,就会使得虚拟机配置信息无法访问,进而无法获知虚拟机与虚拟机的虚拟磁盘所在的逻辑磁盘的对应关系,导致虚拟机无法启动。而基于本发明实施例提供的虚拟机配置信息的读取方法,由于将虚拟机配置信息预先存储在逻辑磁盘的控制信息区域,因此,即使管理节点出现单点失效,仍然可以通过访问虚拟机的虚拟磁盘所在的逻辑磁盘的控制信息区域,实现对虚拟机配置信息的访问,进而根据虚拟机配置信息和虚拟机的虚拟磁盘数据正常启动虚拟机。即,本发明实施例提供的虚拟机配置信息的读取方法,能够减少对管理节点的依赖,在管理节点失 效时使虚拟机配置信息仍然可用。The method for reading the configuration information of the virtual machine provided by the embodiment of the present invention obtains the LUN of the logical disk where the virtual disk corresponding to the VM is located, and then reads the virtual machine configuration pre-stored in the control information area corresponding to the logical disk according to the LUN. information. In the prior art, since the virtual disk data and the virtual machine configuration information are separately saved, the virtual disk data is saved in the logical disk, and the virtual machine configuration information is saved in the management node. Therefore, when a single point of failure occurs on the management node, the virtual machine configuration information cannot be accessed, and the corresponding relationship between the virtual machine and the logical disk where the virtual disk of the virtual machine resides cannot be obtained. As a result, the virtual machine cannot be started. The method for reading the configuration information of the virtual machine provided by the embodiment of the present invention, because the virtual machine configuration information is pre-stored in the control information area of the logical disk, even if the management node has a single point of failure, the virtual machine can still be accessed. The control information area of the logical disk where the virtual disk resides enables access to the virtual machine configuration information, and then the virtual machine is started normally according to the virtual machine configuration information and the virtual disk data of the virtual machine. That is, the method for reading the configuration information of the virtual machine provided by the embodiment of the present invention can reduce the dependency on the management node and is lost in the management node. The virtual machine configuration information is still available when it is valid.
实施例四、Embodiment 4
本发明实施例提供一种应用本发明上述实施例提供的虚拟机配置信息的存储、读取方法,进行灾备恢复的方法如下:The embodiment of the present invention provides a method for storing and reading virtual machine configuration information according to the foregoing embodiment of the present invention, and the method for performing disaster recovery is as follows:
1、灾备恢复前:1. Before disaster recovery:
参见图10,在灾难侧11尚未发生故障时,需要将灾难侧11中逻辑磁盘中存储的虚拟机的相关信息备份至灾备侧12中相应的逻辑磁盘中。具体而言,以将灾难侧11的逻辑磁盘1中存储的虚拟机的相关信息备份至灾备侧12的逻辑磁盘4中为例:如图11所示,首先,由Hypervisor或第三方设备通过本发明实施例三提供的虚拟机配置信息的读取方法,将逻辑磁盘1的控制信息区域中的虚拟机配置信息读取出来;接着,通过本发明实施例一和实施例二提供的虚拟机配置信息的存储方法,将该虚拟机配置信息存储至逻辑磁盘4的控制信息区域。当然,也可由逻辑磁盘4所在的磁盘阵列B通过本发明实施例三提供的方法直接从逻辑磁盘1中读取虚拟机配置信息,再通过本发明实施例一提供的方法将虚拟机配置信息写入控制信息区域,如图12所示。本发明实施例对此不作具体限定。Referring to FIG. 10, when the disaster side 11 has not failed, the information about the virtual machine stored in the logical disk in the disaster side 11 needs to be backed up to the corresponding logical disk in the disaster recovery side 12. Specifically, the information about the virtual machine stored in the logical disk 1 of the disaster side 11 is backed up to the logical disk 4 of the disaster recovery side 12 as an example: as shown in FIG. 11, first, by a hypervisor or a third-party device. The method for reading the configuration information of the virtual machine provided by the third embodiment of the present invention reads the virtual machine configuration information in the control information area of the logical disk 1; and then, the virtual machine provided by the first embodiment and the second embodiment of the present invention The storage method of the configuration information stores the virtual machine configuration information in the control information area of the logical disk 4. Of course, the virtual machine configuration information can be directly read from the logical disk 1 by using the method provided by the third embodiment of the present invention, and the virtual machine configuration information can be written by the method provided in the first embodiment of the present invention. Enter the control information area as shown in Figure 12. This embodiment of the present invention does not specifically limit this.
另外,需要说明的是,在灾备恢复前,还需要将灾难侧11中逻辑磁盘的用户数据区域中存储的虚拟磁盘数据也备份至灾备侧12中相应的逻辑磁盘的用户数据区域,本发明实施例对此不作具体限定。In addition, it is necessary to back up the virtual disk data stored in the user data area of the logical disk in the disaster side 11 to the user data area of the corresponding logical disk in the disaster recovery side 12 before the recovery of the disaster recovery. The embodiment of the invention is not specifically limited thereto.
2、灾备恢复:2. Disaster recovery:
灾备侧Hypervisor通过本发明实施例三提供的方法获取灾备侧逻辑磁盘中的虚拟机配置信息;根据虚拟机配置信息中的VM标识,确定该虚拟机配置信息所属的虚拟机,并将虚拟磁盘挂载至相应的虚拟机;进而可以根据该虚拟机配置信息,启动虚拟机。The hypervisor on the disaster recovery side obtains the configuration information of the virtual machine in the logical disk on the disaster recovery side by using the method provided in the third embodiment of the present invention; determining the virtual machine to which the virtual machine configuration information belongs according to the VM identifier in the virtual machine configuration information, and virtualizing The disk is mounted to the corresponding virtual machine; in turn, the virtual machine can be started according to the virtual machine configuration information.
现有技术中,进行远程存储容灾备份时,逻辑磁盘的LUN会发生变化。参见图13,例如,在灾难侧11,VM1的虚拟磁盘数据存储在逻辑磁盘1中,备份后,在灾备侧12,VM1的虚拟磁盘数据被备份至逻辑磁盘4,而逻辑磁盘1的LUN与逻辑磁盘4的LUN是不同的。灾备侧12的管理节点B中存储的VM1的虚拟机配置信息是由灾难侧11的管理节点A复制而来的,因此,根据管理节点B中VM1的虚拟机配置信息,VM1的虚拟 磁盘数据存储在逻辑磁盘1中。而事实上,在灾备侧12,VM1的虚拟磁盘数据存储在逻辑磁盘4中。所以,在灾备侧12,虚拟机与虚拟机的虚拟磁盘所在的逻辑磁盘无法对应起来。此时,需要在管理节点重新建立虚拟机和虚拟机的虚拟磁盘所在的逻辑磁盘的对应关系,而这一操作费时费力。In the prior art, when a remote storage disaster recovery backup is performed, the LUN of the logical disk changes. Referring to FIG. 13, for example, on the disaster side 11, the virtual disk data of the VM1 is stored in the logical disk 1. After the backup, on the disaster recovery side 12, the virtual disk data of the VM1 is backed up to the logical disk 4, and the LUN of the logical disk 1 It is different from the LUN of logical disk 4. The VM configuration information of the VM1 stored in the management node B of the disaster recovery side 12 is copied from the management node A of the disaster side 11, and therefore, the virtual machine configuration information of VM1 in the management node B is virtualized by VM1. The disk data is stored in logical disk 1. In fact, on the disaster recovery side 12, the virtual disk data of VM1 is stored in the logical disk 4. Therefore, on the disaster recovery side 12, the logical disk of the virtual machine and the virtual disk of the virtual machine cannot be associated. At this time, it is necessary to re-establish the correspondence between the virtual disk of the virtual machine and the virtual disk of the virtual machine at the management node, and this operation is time consuming and laborious.
使用本发明实施例提供的虚拟机配置信息的存储、读取方法进行远程灾备恢复时,可通过灾备侧的Hypervisor通过带上命名直接获取虚拟机配置信息,根据虚拟机配置信息中的虚拟机标识,即可获知该逻辑磁盘存储的虚拟磁盘数据属于哪个虚拟机。即,通过本发明实施例的提供的虚拟机配置信息的存储、读取方法,进行灾备恢复时,无需在灾备侧管理节点进行数据恢复即可获得虚拟机与虚拟机的虚拟磁盘所在的逻辑磁盘的正确的对应关系。与现有技术相比,本发明实施例提供的灾备恢复方法,省去了大量的恢复操作,在灾难侧出现故障后,可以快速地启动虚拟机,确保虚拟机能够正常使用。When the remote disaster recovery is performed by using the storage and reading method of the virtual machine configuration information provided by the embodiment of the present invention, the hypervisor on the disaster recovery side can directly obtain the virtual machine configuration information by using the naming on the tape, according to the virtual information in the virtual machine configuration information. Machine ID, you can know which virtual machine the virtual disk data stored in the logical disk belongs to. That is, when the recovery and recovery of the virtual machine configuration information provided by the embodiment of the present invention is performed, the virtual disk of the virtual machine and the virtual machine can be obtained without performing data recovery on the disaster recovery side management node. The correct correspondence of logical disks. Compared with the prior art, the disaster recovery method provided by the embodiment of the present invention saves a large number of recovery operations. After a fault occurs on the disaster side, the virtual machine can be quickly started to ensure that the virtual machine can be used normally.
实施例五、Embodiment 5
本发明实施例提供一种磁盘阵列140,用于执行本发明实施例一提供的虚拟机配置信息的存储方法,具体如图14所示,包括:获取单元1401、以及写入单元1402。The embodiment of the present invention provides a disk array 140 for performing a method for storing virtual machine configuration information provided by the first embodiment of the present invention. Specifically, as shown in FIG. 14, the method includes: an obtaining unit 1401 and a writing unit 1402.
其中,获取单元1401,用于获取VM的虚拟机配置信息及VM对应的虚拟磁盘所在的逻辑磁盘的LUN。The obtaining unit 1401 is configured to acquire virtual machine configuration information of the VM and a LUN of the logical disk where the virtual disk corresponding to the VM is located.
写入单元1402,用于根据LUN,将虚拟机配置信息写入逻辑磁盘140对应的控制信息区域。The writing unit 1402 is configured to write the virtual machine configuration information into the control information area corresponding to the logical disk 140 according to the LUN.
优选的,如图15所示,在本发明实施例提供的磁盘阵列140中,获取单元1401具体包括:接收模块1401a、以及获取模块1401b。Preferably, as shown in FIG. 15, in the disk array 140 provided by the embodiment of the present invention, the obtaining unit 1401 specifically includes: a receiving module 1401a, and an obtaining module 1401b.
其中,接收模块1401a,用于接收写入请求消息,写入请求消息携带虚拟机配置信息及LUN。The receiving module 1401a is configured to receive a write request message, where the write request message carries virtual machine configuration information and a LUN.
获取模块1401b,用于根据写入请求消息,获取虚拟机配置信息及LUN。The obtaining module 1401b is configured to obtain virtual machine configuration information and a LUN according to the write request message.
需要说明的是,写入请求消息具体可以是Hypervisor发送的,也可以是第三方设备发送的,还可以是另外一个磁盘阵列发送的,本发明实施例对此不作具体限定。 It should be noted that the write request message may be sent by the Hypervisor, or may be sent by a third-party device, or may be sent by another disk array, which is not specifically limited in this embodiment of the present invention.
优选的,在本发明实施例提供的磁盘阵列140中,接收模块1401a具体用于:Preferably, in the disk array 140 provided by the embodiment of the present invention, the receiving module 1401a is specifically configured to:
接收通过SCSI带内命令发送的写入请求消息。A write request message sent by a SCSI in-band command is received.
或者,or,
接收通过存储系统提供的控制管理接口发送的写入请求消息。A write request message sent through a control management interface provided by the storage system is received.
进一步的,如图16所示,本发明实施例提供的磁盘阵列140还可以包括:确定单元1403、以及第一删除单元1404。Further, as shown in FIG. 16, the disk array 140 provided by the embodiment of the present invention may further include: a determining unit 1403, and a first deleting unit 1404.
其中,确定单元1403,用于在写入单元1402根据LUN,将虚拟机配置信息写入逻辑磁盘140对应的控制信息区域之前,确定逻辑磁盘140对应的控制信息区域中是否存储与所述虚拟机配置信息不同的虚拟机配置信息。The determining unit 1403 is configured to determine, before the writing unit 1402 writes the virtual machine configuration information to the control information area corresponding to the logical disk 140 according to the LUN, whether the virtual machine is stored in the control information area corresponding to the logical disk 140. Configure virtual machine configuration information with different information.
第一删除单元1404,用于若确定单元1403确定逻辑磁盘对应的控制信息区域中存储与所述虚拟机配置信息不同的虚拟机配置信息,删除与所述虚拟机配置信息不同的虚拟机配置信息。The first deleting unit 1404 is configured to: if the determining unit 1403 determines that the virtual machine configuration information different from the virtual machine configuration information is stored in the control information area corresponding to the logical disk, delete the virtual machine configuration information different from the virtual machine configuration information. .
即,若磁盘阵列无法实现数据覆盖,则在磁盘阵列接收到写入请求消息后,若确定逻辑磁盘对应的控制信息区域中存储与所述虚拟机配置信息不同的虚拟机配置信息,需首先删除该逻辑磁盘控制信息区域中与所述虚拟机配置信息不同的虚拟机配置信息,然后将写入请求消息中携带的虚拟机配置信息写入该控制信息区域,本发明实施例对此不作具体限定。That is, if the disk array cannot implement data coverage, after the disk array receives the write request message, if it is determined that the virtual machine configuration information different from the virtual machine configuration information is stored in the control information area corresponding to the logical disk, it needs to be deleted first. The virtual disk configuration information in the information area is different from the virtual machine configuration information, and then the virtual machine configuration information carried in the write request message is written into the control information area, which is not specifically limited in this embodiment of the present invention. .
优选的,如图17所示,本发明实施例提供的磁盘阵列140还可以包括:接收单元1405、以及第二删除单元1406。Preferably, as shown in FIG. 17, the disk array 140 provided by the embodiment of the present invention may further include: a receiving unit 1405, and a second deleting unit 1406.
其中,接收单元1405,用于在写入单元1402根据LUN,将虚拟机配置信息写入逻辑磁盘对应的控制信息区域之后,接收删除请求消息,删除请求消息用于指示删除逻辑磁盘140对应的控制信息区域中的虚拟机配置信息。The receiving unit 1405 is configured to: after the writing unit 1402 writes the virtual machine configuration information to the control information area corresponding to the logical disk according to the LUN, and receives a deletion request message, where the deletion request message is used to indicate that the corresponding control of the logical disk 140 is deleted. Virtual machine configuration information in the information area.
第二删除单元1406,用于根据删除请求消息,删除虚拟机配置信息。The second deleting unit 1406 is configured to delete the virtual machine configuration information according to the deletion request message.
如此一来,在不需要逻辑磁盘中的虚拟机配置信息时,即可将虚拟机配置信息删除,以减少对逻辑磁盘的控制信息区域的占用,及时释放逻辑磁盘的控制信息区域的存储空间。In this way, when the virtual machine configuration information in the logical disk is not required, the virtual machine configuration information can be deleted to reduce the occupation of the control information area of the logical disk and release the storage space of the control information area of the logical disk in time.
本发明实施例提供的逻辑磁盘中,先由获取单元获取VM的虚拟机配 置信息及VM对应的虚拟磁盘所在的逻辑磁盘的LUN,然后由写入单元根据LUN,将虚拟机配置信息写入逻辑磁盘对应的控制信息区域。现有技术中,由于虚拟磁盘数据和虚拟机配置信息被分开保存,虚拟磁盘数据被保存在逻辑磁盘中,而虚拟机配置信息被保存在管理节点中。因此,当管理节点出现单点失效时,就会使得虚拟机配置信息无法访问,进而无法获知虚拟机与虚拟机的虚拟磁盘所在的逻辑磁盘的对应关系,最终导致虚拟机无法启动。而基于本发明实施例提供的逻辑磁盘,将虚拟机配置信息存储在逻辑磁盘的控制信息区域,因此,即使管理节点出现单点失效,仍然可以通过访问虚拟机的虚拟磁盘所在的逻辑磁盘的控制信息区域,实现对虚拟机配置信息的访问。而根据虚拟机配置信息和虚拟机的虚拟磁盘数据,即可正常启动虚拟机。即,本发明实施例提供的逻辑磁盘,能够减少对管理节点的依赖,在管理节点失效时使虚拟机配置信息仍然可用。In the logical disk provided by the embodiment of the present invention, the virtual machine of the VM is first acquired by the obtaining unit. Set the information and the LUN of the logical disk where the virtual disk corresponding to the VM is located. Then, the write unit writes the virtual machine configuration information to the control information area corresponding to the logical disk according to the LUN. In the prior art, since the virtual disk data and the virtual machine configuration information are separately saved, the virtual disk data is saved in the logical disk, and the virtual machine configuration information is saved in the management node. Therefore, when a single point of failure occurs on the management node, the virtual machine configuration information cannot be accessed, and the corresponding relationship between the virtual machine and the logical disk where the virtual disk of the virtual machine resides cannot be obtained. As a result, the virtual machine cannot be started. The logical disk provided by the embodiment of the present invention stores the virtual machine configuration information in the control information area of the logical disk. Therefore, even if the management node has a single point of failure, the logical disk of the virtual disk can be accessed by the virtual disk. The information area enables access to virtual machine configuration information. According to the virtual machine configuration information and the virtual disk data of the virtual machine, the virtual machine can be started normally. That is, the logical disk provided by the embodiment of the present invention can reduce the dependency on the management node, and the virtual machine configuration information is still available when the management node fails.
实施例六、Embodiment 6
本发明实施例提供一种虚拟机配置信息的存储装置180,用于执行本发明实施例二提供的虚拟机配置信息的读取方法,具体如图18所示,包括:获取单元1801、以及第一发送单元1802。The embodiment of the present invention provides a storage device 180 for storing virtual machine configuration information, which is used to perform the method for reading the configuration information of the virtual machine provided by the second embodiment of the present invention. Specifically, as shown in FIG. 18, the method includes: acquiring unit 1801 and A transmitting unit 1802.
其中,获取单元1801,用于获取VM的虚拟机配置信息和VM对应的虚拟磁盘所在的逻辑磁盘的LUN。The obtaining unit 1801 is configured to acquire virtual machine configuration information of the VM and a LUN of the logical disk where the virtual disk corresponding to the VM is located.
第一发送单元1802,用于将虚拟机配置信息和LUN发送给磁盘阵列,由磁盘阵列将虚拟机配置信息写入逻辑磁盘对应的控制信息区域。The first sending unit 1802 is configured to send the virtual machine configuration information and the LUN to the disk array, and the virtual machine configuration information is written by the disk array to the control information area corresponding to the logical disk.
需要说明的是,所述虚拟机配置信息的存储装置180具体可以是Hypervisor,也可以是第三方设备,还可以是存储所述虚拟机配置信息的逻辑磁盘所在的磁盘阵列,本发明实施例对此不作具体限定。It should be noted that the storage device 180 of the virtual machine configuration information may be a hypervisor or a third-party device, or may be a disk array in which the logical disk storing the virtual machine configuration information is located, which is in the embodiment of the present invention. This is not specifically limited.
优选的,如图19所示,在本发明实施例提供的虚拟机配置信息的存储装置180中,第一发送单元1802可以包括:发送模块1802a。Preferably, as shown in FIG. 19, in the storage device 180 of the virtual machine configuration information provided by the embodiment of the present invention, the first sending unit 1802 may include: a sending module 1802a.
发送模块1802a,用于发送写入请求消息给磁盘阵列,写入请求消息携带虚拟机配置信息和LUN。The sending module 1802a is configured to send a write request message to the disk array, where the write request message carries the virtual machine configuration information and the LUN.
优选的,发送模块1802a具体可以用于:Preferably, the sending module 1802a is specifically configured to:
通过SCSI带内命令发送写入请求消息给磁盘阵列。A write request message is sent to the disk array via a SCSI in-band command.
或者, Or,
通过存储系统提供的控制管理接口发送写入请求消息给磁盘阵列。A write request message is sent to the disk array through a control management interface provided by the storage system.
优选的,如图20所示,本发明实施例提供的虚拟机配置信息的存储装置180,还可以包括:第二发送单元1803。Preferably, as shown in FIG. 20, the storage device 180 of the virtual machine configuration information provided by the embodiment of the present invention may further include: a second sending unit 1803.
第二发送单元1803,用于在第一发送单元1802将虚拟机配置信息和LUN发送给磁盘阵列之后,发送删除请求消息给磁盘阵列,删除请求消息用于指示删除逻辑磁盘对应的控制信息区域中的虚拟机配置信息。The second sending unit 1803 is configured to send a delete request message to the disk array after the first sending unit 1802 sends the virtual machine configuration information and the LUN to the disk array, where the delete request message is used to indicate that the control information area corresponding to the logical disk is deleted. Virtual machine configuration information.
如此一来,在不需要逻辑磁盘中的虚拟机配置信息时,即可将虚拟机配置信息删除,以减少对逻辑磁盘的控制信息区域的占用,及时释放逻辑磁盘的控制信息区域的存储空间。In this way, when the virtual machine configuration information in the logical disk is not required, the virtual machine configuration information can be deleted to reduce the occupation of the control information area of the logical disk and release the storage space of the control information area of the logical disk in time.
本发明实施例提供的虚拟机配置信息的存储装置中,由获取单元获取VM的虚拟机配置信息和VM对应的虚拟磁盘所在的逻辑磁盘的LUN,并由第一发送单元将虚拟机配置信息和LUN发送给磁盘阵列,然后由磁盘阵列将虚拟机配置信息写入逻辑磁盘对应的控制信息区域。现有技术中,由于虚拟磁盘数据和虚拟机配置信息被分开保存,虚拟磁盘数据被保存在逻辑磁盘中,而虚拟机配置信息被保存在管理节点中。因此,当管理节点出现单点失效时,就会使得虚拟机配置信息无法访问,进而无法虚拟机与虚拟机的虚拟磁盘所在的逻辑磁盘的对应关系,最终导致虚拟机无法启动。而本发明实施例提供的虚拟机配置信息的存储装置,将虚拟机配置信息存储在逻辑磁盘的控制信息区域,因此,即使管理节点出现单点失效,仍然可以通过访问虚拟机的虚拟磁盘所在的逻辑磁盘的控制信息区域,实现对虚拟机配置信息的访问。而根据虚拟机配置信息和虚拟机的虚拟磁盘数据,即可正常启动虚拟机。即,本发明实施例提供的虚拟机配置信息的存储装置,能够减少对管理节点的依赖,在管理节点失效时使虚拟机配置信息仍然可用。In the storage device of the virtual machine configuration information provided by the embodiment of the present invention, the acquiring unit acquires the virtual machine configuration information of the VM and the LUN of the logical disk where the virtual disk corresponding to the VM is located, and the virtual device configuration information is configured by the first sending unit. The LUN is sent to the disk array, and then the virtual machine configuration information is written by the disk array to the control information area corresponding to the logical disk. In the prior art, since the virtual disk data and the virtual machine configuration information are separately saved, the virtual disk data is saved in the logical disk, and the virtual machine configuration information is saved in the management node. Therefore, when a single point of failure occurs on the management node, the virtual machine configuration information cannot be accessed, and the corresponding relationship between the virtual machine and the logical disk where the virtual disk of the virtual machine resides cannot be obtained. Eventually, the virtual machine cannot be started. The storage device of the virtual machine configuration information provided by the embodiment of the present invention stores the virtual machine configuration information in the control information area of the logical disk. Therefore, even if the management node has a single point of failure, the virtual disk of the virtual machine can still be accessed. The control information area of the logical disk enables access to the virtual machine configuration information. According to the virtual machine configuration information and the virtual disk data of the virtual machine, the virtual machine can be started normally. That is, the storage device of the virtual machine configuration information provided by the embodiment of the present invention can reduce the dependency on the management node, and the virtual machine configuration information is still available when the management node fails.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the above described device is only illustrated by the division of the above functional modules. In practical applications, the above functions may be assigned differently according to needs. The function module is completed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the system, the device and the unit described above, refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例 仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiment described above For example, the division of the module or unit is only a logical function division, and the actual implementation may have another division manner, for example, multiple units or components may be combined or integrated into another system. Or some features can be ignored or not executed. In addition, the mutual 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 in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units 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 purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, 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 functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。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. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。 The above is only a specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the appended claims.

Claims (18)

  1. 一种虚拟机配置信息的存储方法,其特征在于,所述方法包括:A method for storing virtual machine configuration information, the method comprising:
    获取虚拟机VM的虚拟机配置信息及所述VM对应的虚拟磁盘所在的逻辑磁盘的逻辑单元号LUN;Obtaining the virtual machine configuration information of the virtual machine VM and the logical unit number LUN of the logical disk where the virtual disk corresponding to the VM is located;
    根据所述LUN,将所述虚拟机配置信息写入所述逻辑磁盘对应的控制信息区域。And writing, according to the LUN, the virtual machine configuration information to a control information area corresponding to the logical disk.
  2. 根据权利要求1所述的方法,其特征在于,所述获取虚拟机VM的虚拟机配置信息及所述VM对应的虚拟磁盘所在的逻辑磁盘的逻辑单元号LUN,包括:The method according to claim 1, wherein the acquiring the virtual machine configuration information of the virtual machine VM and the logical unit number LUN of the logical disk where the virtual disk corresponding to the VM is located includes:
    接收写入请求消息,所述写入请求消息携带所述虚拟机配置信息及所述LUN;Receiving a write request message, the write request message carrying the virtual machine configuration information and the LUN;
    根据所述写入请求消息,获取所述虚拟机配置信息及所述LUN。Obtaining the virtual machine configuration information and the LUN according to the write request message.
  3. 根据权利要求2所述的方法,其特征在于,所述接收写入请求消息,包括:The method of claim 2, wherein the receiving a write request message comprises:
    接收通过小型计算机系统接口SCSI带内命令发送的所述写入请求消息;Receiving the write request message sent by a small computer system interface SCSI in-band command;
    或者,or,
    接收通过存储系统提供的控制管理接口发送的所述写入请求消息。The write request message sent by the control management interface provided by the storage system is received.
  4. 根据权利要求1-3任一项所述的方法,其特征在于,在所述根据所述LUN,将所述虚拟机配置信息写入所述逻辑磁盘对应的控制信息区域之前,还包括:The method according to any one of claims 1-3, wherein before the writing the virtual machine configuration information to the control information area corresponding to the logical disk according to the LUN, the method further includes:
    确定所述逻辑磁盘对应的控制信息区域中是否存储与所述虚拟机配置信息不同的虚拟机配置信息;Determining, in the control information area corresponding to the logical disk, whether virtual machine configuration information different from the virtual machine configuration information is stored;
    若是,删除所述与所述虚拟机配置信息不同的虚拟机配置信息。If yes, the virtual machine configuration information different from the virtual machine configuration information is deleted.
  5. 根据权利要求1所述的方法,其特征在于,在所述根据所述LUN,将所述虚拟机配置信息写入所述逻辑磁盘对应的控制信息区域之后,还包括:The method according to claim 1, wherein after the virtual machine configuration information is written in the control information area corresponding to the logical disk according to the LUN, the method further includes:
    接收删除请求消息,所述删除请求消息用于指示删除所述逻辑磁盘对应的控制信息区域中的所述虚拟机配置信息;Receiving a delete request message, where the delete request message is used to delete the virtual machine configuration information in a control information area corresponding to the logical disk;
    根据所述删除请求消息,删除所述虚拟机配置信息。And deleting the virtual machine configuration information according to the deletion request message.
  6. 一种虚拟机配置信息的存储方法,其特征在于,所述方法包括: A method for storing virtual machine configuration information, the method comprising:
    获取虚拟机VM的虚拟机配置信息和所述VM对应的虚拟磁盘所在的逻辑磁盘的逻辑单元号LUN;Obtaining the virtual machine configuration information of the virtual machine VM and the logical unit number LUN of the logical disk where the virtual disk corresponding to the VM is located;
    将所述虚拟机配置信息和所述LUN发送给磁盘阵列,由所述磁盘阵列根据所述LUN,将所述虚拟机配置信息写入所述逻辑磁盘对应的控制信息区域。Sending the virtual machine configuration information and the LUN to the disk array, and the disk array writes the virtual machine configuration information into the control information area corresponding to the logical disk according to the LUN.
  7. 根据权利要求6所述的方法,其特征在于,所述将所述虚拟机配置信息和所述LUN发送给磁盘阵列,包括:The method according to claim 6, wherein the sending the virtual machine configuration information and the LUN to the disk array comprises:
    发送写入请求消息给所述磁盘阵列,所述写入请求消息携带所述虚拟机配置信息和所述LUN。Sending a write request message to the disk array, the write request message carrying the virtual machine configuration information and the LUN.
  8. 根据权利要求7所述的方法,其特征在于,所述发送写入请求消息给所述磁盘阵列,包括:The method according to claim 7, wherein the sending a write request message to the disk array comprises:
    通过小型计算机系统接口SCSI带内命令发送所述写入请求消息给所述磁盘阵列;Transmitting the write request message to the disk array by a small computer system interface SCSI in-band command;
    或者,or,
    通过存储系统提供的控制管理接口发送所述写入请求消息给所述磁盘阵列。The write request message is sent to the disk array through a control management interface provided by the storage system.
  9. 根据权利要求6所述的方法,其特征在于,在所述将所述虚拟机配置信息和所述LUN发送给磁盘阵列之后,还包括:The method of claim 6, further comprising: after the sending the virtual machine configuration information and the LUN to the disk array,
    发送删除请求消息给所述磁盘阵列,所述删除请求消息用于指示删除所述逻辑磁盘对应的控制信息区域中的所述虚拟机配置信息。And sending a delete request message to the disk array, where the delete request message is used to delete the virtual machine configuration information in the control information area corresponding to the logical disk.
  10. 一种磁盘阵列,其特征在于,所述磁盘阵列包括:获取单元、以及写入单元;A disk array, comprising: an acquiring unit, and a writing unit;
    所述获取单元,用于获取虚拟机VM的虚拟机配置信息及所述VM对应的虚拟磁盘所在的逻辑磁盘的逻辑单元号LUN;The acquiring unit is configured to acquire virtual machine configuration information of the virtual machine VM and a logical unit number LUN of the logical disk where the virtual disk corresponding to the VM is located;
    所述写入单元,用于根据所述LUN,将所述虚拟机配置信息写入所述逻辑磁盘对应的控制信息区域。The writing unit is configured to write the virtual machine configuration information into a control information area corresponding to the logical disk according to the LUN.
  11. 根据权利要求10所述的磁盘阵列,其特征在于,所述获取单元包括:接收模块、以及获取模块;The disk array according to claim 10, wherein the obtaining unit comprises: a receiving module, and an acquiring module;
    所述接收模块,用于接收写入请求消息,所述写入请求消息携带所述虚拟机配置信息及所述LUN;The receiving module is configured to receive a write request message, where the write request message carries the virtual machine configuration information and the LUN;
    所述获取模块,用于根据所述写入请求消息,获取所述虚拟机配置信息及所述LUN。 The obtaining module is configured to acquire the virtual machine configuration information and the LUN according to the write request message.
  12. 根据权利要求11所述的磁盘阵列,其特征在于,所述接收模块具体用于:The disk array according to claim 11, wherein the receiving module is specifically configured to:
    接收通过小型计算机系统接口SCSI带内命令发送的所述写入请求消息;Receiving the write request message sent by a small computer system interface SCSI in-band command;
    或者,or,
    接收通过存储系统提供的控制管理接口发送的所述写入请求消息。The write request message sent by the control management interface provided by the storage system is received.
  13. 根据权利要求10-12任一项所述的磁盘阵列,其特征在于,所述磁盘阵列还包括:确定单元、以及第一删除单元;The disk array according to any one of claims 10 to 12, wherein the disk array further comprises: a determining unit, and a first deleting unit;
    所述确定单元,用于:The determining unit is configured to:
    在所述写入单元根据所述LUN,将所述虚拟机配置信息写入所述逻辑磁盘对应的控制信息区域之前,确定所述逻辑磁盘对应的控制信息区域中是否存储与所述虚拟机配置信息不同的虚拟机配置信息;Before the writing unit writes the virtual machine configuration information to the control information area corresponding to the logical disk according to the LUN, determining whether the virtual machine configuration is stored in the control information area corresponding to the logical disk Different virtual machine configuration information;
    所述第一删除单元,用于若所述确定单元确定所述逻辑磁盘对应的控制信息区域中存储与所述虚拟机配置信息不同的虚拟机配置信息,删除所述与所述虚拟机配置信息不同的虚拟机配置信息。The first deleting unit is configured to: if the determining unit determines that the virtual machine configuration information different from the virtual machine configuration information is stored in the control information area corresponding to the logical disk, deleting the virtual machine configuration information Different virtual machine configuration information.
  14. 根据权利要求10所述的磁盘阵列,其特征在于,所述磁盘阵列还包括:接收单元、以及第二删除单元;The disk array according to claim 10, wherein the disk array further comprises: a receiving unit, and a second deleting unit;
    所述接收单元,用于在所述写入单元根据所述LUN,将所述虚拟机配置信息写入所述逻辑磁盘对应的控制信息区域之后,接收删除请求消息,所述删除请求消息用于指示删除所述逻辑磁盘对应的控制信息区域中的所述虚拟机配置信息;The receiving unit is configured to: after the writing unit writes the virtual machine configuration information into a control information area corresponding to the logical disk according to the LUN, receive a delete request message, where the delete request message is used Instructing to delete the virtual machine configuration information in the control information area corresponding to the logical disk;
    所述第二删除单元,用于根据所述删除请求消息,删除所述虚拟机配置信息。The second deleting unit is configured to delete the virtual machine configuration information according to the deletion request message.
  15. 一种虚拟机配置信息的存储装置,其特征在于,所述装置包括:获取单元、以及第一发送单元;A storage device for configuring virtual machine information, the device comprising: an acquiring unit, and a first sending unit;
    所述获取单元,用于获取虚拟机VM的虚拟机配置信息和所述VM对应的虚拟磁盘所在的逻辑磁盘的逻辑单元号LUN;The acquiring unit is configured to acquire virtual machine configuration information of the virtual machine VM and a logical unit number LUN of the logical disk where the virtual disk corresponding to the VM is located;
    所述第一发送单元,用于将所述虚拟机配置信息和所述LUN发送给磁盘阵列,由所述磁盘阵列将所述虚拟机配置信息写入所述逻辑磁盘对应的控制信息区域。The first sending unit is configured to send the virtual machine configuration information and the LUN to a disk array, and the virtual machine configuration information is written by the disk array into a control information area corresponding to the logical disk.
  16. 根据权利要求15所述的装置,其特征在于,所述第一发送单元包括:发送模块; The apparatus according to claim 15, wherein the first sending unit comprises: a sending module;
    所述发送模块,用于发送写入请求消息给所述磁盘阵列,所述写入请求消息携带所述虚拟机配置信息和所述LUN。The sending module is configured to send a write request message to the disk array, where the write request message carries the virtual machine configuration information and the LUN.
  17. 根据权利要求16所述的装置,其特征在于,所述发送模块具体用于:The device according to claim 16, wherein the sending module is specifically configured to:
    通过小型计算机系统接口SCSI带内命令发送所述写入请求消息给所述磁盘阵列;Transmitting the write request message to the disk array by a small computer system interface SCSI in-band command;
    或者,or,
    通过存储系统提供的控制管理接口发送所述写入请求消息给所述磁盘阵列。The write request message is sent to the disk array through a control management interface provided by the storage system.
  18. 根据权利要求15所述的装置,其特征在于,所述装置还包括:第二发送单元;The device according to claim 15, wherein the device further comprises: a second sending unit;
    所述第二发送单元,用于在所述第一发送单元将所述虚拟机配置信息和所述LUN发送给磁盘阵列之后,发送删除请求消息给所述磁盘阵列,所述删除请求消息用于指示删除所述逻辑磁盘对应的控制信息区域中的所述虚拟机配置信息。 The second sending unit is configured to send a delete request message to the disk array after the first sending unit sends the virtual machine configuration information and the LUN to the disk array, where the delete request message is used Instructing to delete the virtual machine configuration information in the control information area corresponding to the logical disk.
PCT/CN2015/083282 2014-11-20 2015-07-03 Virtual machine configuration information storage method and apparatus WO2016078422A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410668433.4 2014-11-20
CN201410668433.4A CN104461687B (en) 2014-11-20 2014-11-20 The storage method and device of a kind of virtual machine configuration information

Publications (1)

Publication Number Publication Date
WO2016078422A1 true WO2016078422A1 (en) 2016-05-26

Family

ID=52907791

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/083282 WO2016078422A1 (en) 2014-11-20 2015-07-03 Virtual machine configuration information storage method and apparatus

Country Status (2)

Country Link
CN (1) CN104461687B (en)
WO (1) WO2016078422A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651235A (en) * 2020-04-17 2020-09-11 北京奇艺世纪科技有限公司 Virtual machine set task management method and device

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461687B (en) * 2014-11-20 2018-03-09 华为技术有限公司 The storage method and device of a kind of virtual machine configuration information
CN105786489B (en) * 2016-02-18 2019-05-17 山东乾云启创信息科技股份有限公司 A kind of construction method of the stateless virtualization calculate node of safety
CN108153578B (en) * 2016-12-05 2022-02-25 北京国双科技有限公司 Method and device for adding disk to virtual machine
CN107391224A (en) * 2017-06-09 2017-11-24 华为技术有限公司 A kind of creation method of virtual volume, hanging method and device
CN109728924A (en) * 2017-10-30 2019-05-07 华为技术有限公司 The method and apparatus for obtaining the configuration information of host
CN109240804B (en) * 2018-09-27 2020-09-22 苏州浪潮智能科技有限公司 Method and device for managing disk resources of virtual machine
CN109756397B (en) * 2019-01-08 2021-05-18 深圳市网心科技有限公司 Hardware sharing method, system and related equipment
CN110908609B (en) * 2019-11-22 2021-09-17 苏州浪潮智能科技有限公司 Method, system and equipment for processing disk and readable storage medium
CN111708612B (en) * 2020-08-18 2020-12-01 南京赛宁信息技术有限公司 Network shooting range cloud platform data disk management system and method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100228903A1 (en) * 2009-03-03 2010-09-09 Vmware, Inc. Block Map Based I/O Optimization for Storage Virtual Appliances
CN102750110A (en) * 2011-10-25 2012-10-24 北京同有飞骥科技股份有限公司 High-reliable disk array system for configuration information
CN103838639A (en) * 2012-11-23 2014-06-04 华为技术有限公司 Method, device and system for recovering metadata of virtual disk
CN104461687A (en) * 2014-11-20 2015-03-25 华为技术有限公司 Virtual machine configuration information storage method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002132518A (en) * 2000-10-25 2002-05-10 Fujitsu Ltd Virtual computer system and exchanging method of input- output apparatus among virtual computers
CN103235746B (en) * 2013-04-23 2016-04-20 深圳市京华科讯科技有限公司 Server all-in-one automatic recovery method
CN103618627B (en) * 2013-11-27 2017-01-04 华为技术有限公司 A kind of manage the method for virtual machine, Apparatus and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100228903A1 (en) * 2009-03-03 2010-09-09 Vmware, Inc. Block Map Based I/O Optimization for Storage Virtual Appliances
CN102750110A (en) * 2011-10-25 2012-10-24 北京同有飞骥科技股份有限公司 High-reliable disk array system for configuration information
CN103838639A (en) * 2012-11-23 2014-06-04 华为技术有限公司 Method, device and system for recovering metadata of virtual disk
CN104461687A (en) * 2014-11-20 2015-03-25 华为技术有限公司 Virtual machine configuration information storage method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651235A (en) * 2020-04-17 2020-09-11 北京奇艺世纪科技有限公司 Virtual machine set task management method and device

Also Published As

Publication number Publication date
CN104461687B (en) 2018-03-09
CN104461687A (en) 2015-03-25

Similar Documents

Publication Publication Date Title
WO2016078422A1 (en) Virtual machine configuration information storage method and apparatus
US10310949B1 (en) Disaster restore of big data application with near zero RTO
US10331525B2 (en) Cluster file server proxy server for backup and recovery
US10152387B1 (en) Instant start of virtual machine from archive copy on backup media
US8738883B2 (en) Snapshot creation from block lists
US8959323B2 (en) Remote restarting client logical partition on a target virtual input/output server using hibernation data in a cluster aware data processing system
US8473462B1 (en) Change tracking for shared disks
US10154112B1 (en) Cloud-to-cloud data migration via cache
CN108701048B (en) Data loading method and device
US8495351B2 (en) Preparing and preserving a system configuration during a hot upgrade
US9501231B2 (en) Storage system and storage control method
WO2018090290A1 (en) Mirror image file conversion method and apparatus
US10514947B2 (en) Container management apparatus, container management method, and nonvolatile recording medium
US8954706B2 (en) Storage apparatus, computer system, and control method for storage apparatus
US20140122860A1 (en) Cloud system and boot deployment method for the cloud system
US9436494B2 (en) Preserving an independent virtual disk
US9749193B1 (en) Rule-based systems for outcome-based data protection
WO2017145272A1 (en) Data migration method and computer system
US9032402B2 (en) Managing an independent virtual disk
US20160191620A1 (en) System backup device and backup method
EP2639698B1 (en) Backup control program, backup control method, and information processing device
CN107402839B (en) Method and system for backing up data
US8543779B2 (en) Management system and management method for managing computer system
US10496493B1 (en) Method and system for restoring applications of particular point in time
US20170139779A1 (en) Controller, storage system, and non-transitory computer-readable storage medium having control program stored therein

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: 15860052

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: 15860052

Country of ref document: EP

Kind code of ref document: A1