WO2022141922A1 - Method and apparatus for implementing batch iso creation of cephx authentication virtual machines - Google Patents

Method and apparatus for implementing batch iso creation of cephx authentication virtual machines Download PDF

Info

Publication number
WO2022141922A1
WO2022141922A1 PCT/CN2021/085465 CN2021085465W WO2022141922A1 WO 2022141922 A1 WO2022141922 A1 WO 2022141922A1 CN 2021085465 W CN2021085465 W CN 2021085465W WO 2022141922 A1 WO2022141922 A1 WO 2022141922A1
Authority
WO
WIPO (PCT)
Prior art keywords
image cache
image
mapping
distribution
record
Prior art date
Application number
PCT/CN2021/085465
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 WO2022141922A1 publication Critical patent/WO2022141922A1/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
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

Disclosed in embodiments of the present application are a method and apparatus for implementing batch ISO creation of CephX authentication virtual machines. The method comprises: pre-setting a uniquely constrained image cache record table and an image cache mapping record table, performing image caching and storing records by means of the image cache record table, initiating an image distribution request, and performing image distribution caching according to a pre-set image distribution rule; and performing image cache mapping and storing records by means of the image cache mapping record table, initiating an image cache mapping request, and performing image cache mapping according to a pre-set image cache mapping rule. The embodiments of the present application solve the problem of not supporting hot plugging of an optical disc when using CephX authentication, and also implement concurrent execution on the same ISO and node, so as to achieve the effect of batch execution.

Description

批量ISO创建CephX认证虚拟机的实现方法及装置Implementation method and device for batch ISO creation of CephX certified virtual machine 技术领域technical field
本申请实施例涉及虚拟机管理技术领域,尤其涉及一种批量ISO创建CephX认证虚拟机的实现方法及装置。The embodiments of the present application relate to the technical field of virtual machine management, and in particular, to a method and apparatus for implementing a batch ISO to create a CephX certified virtual machine.
背景技术Background technique
RBD块存储是Ceph提供的3种存储类型中使用最广泛,最稳定的存储类型。RBD块类似于磁盘,可以挂载到物理机或虚拟机中。Ceph提供了两种身份认证方式:None和CephX;None表示客户端不需要通过密钥访问即可访问Ceph存储集群,显然这种方式是不被推荐的;CephX的本质是一种对称加密协议,加密算法为AES,用于识别用户的身份、对用户在客户端上的操作进行认证,以此防止中间人攻击、数据篡改等网络安全问题。RBD block storage is the most widely used and stable storage type among the 3 storage types provided by Ceph. RBD blocks are similar to disks and can be mounted into physical or virtual machines. Ceph provides two authentication methods: None and CephX; None means that the client can access the Ceph storage cluster without key access, which is obviously not recommended; CephX is essentially a symmetric encryption protocol, The encryption algorithm is AES, which is used to identify the user's identity and authenticate the user's operations on the client to prevent network security issues such as man-in-the-middle attacks and data tampering.
为了支持批量创建,很多云平台会提供镜像分发功能以预先把镜像缓存分发到节点的操作;但带CephX认证的RBDiso目前不支持热插拔,也即带CephX认证时无法进行在线挂载卸载光盘;为了实现批量iso创建虚拟机,大多平台都是通过提供映像分发功能,在批量创建前,先进行映像分发,这无疑增加了云平台操作的不便性。In order to support batch creation, many cloud platforms provide image distribution functions to distribute image caches to nodes in advance; however, RBDiso with CephX certification currently does not support hot swapping, that is, online mounting and unloading of CD-ROMs with CephX certification is not possible. ; In order to create virtual machines in batches, most platforms provide image distribution functions. Before batch creation, image distribution is performed first, which undoubtedly increases the inconvenience of cloud platform operations.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种批量ISO创建CephX认证虚拟机的实现方法及装置,以解决现有技术中在使用CephX认证时不支持光盘热插拔和在没有映像缓存的情况下不能批量ISO创建虚拟机的问题。Embodiments of the present application provide a method and device for creating a CephX certified virtual machine in batches, so as to solve the problem that in the prior art, when using CephX certification, hot-plugging of optical discs is not supported and the virtual machine cannot be created in batches without image cache. machine problem.
在第一方面,本申请实施例提供了一种批量ISO创建CephX认证虚拟机的实现方法,包括:In a first aspect, an embodiment of the present application provides a method for implementing a batch ISO to create a CephX certified virtual machine, including:
预设唯一约束的映像缓存记录表和映像缓存映射记录表,所述映像缓存记录表用于记录目标节点中的映像缓存,所述映像缓存映射记录表用于记录目标节点中的映像缓存映射;an image cache record table and an image cache mapping record table with preset unique constraints, the image cache record table is used to record the image cache in the target node, and the image cache mapping record table is used to record the image cache mapping in the target node;
通过所述映像缓存记录表判断目标节点是否已经存在映像缓存;Determine whether the target node already has an image cache by using the image cache record table;
根据映像缓存的判断结果保存记录并向镜像节点组件发起映像分发请求;Save the record according to the judgment result of the image cache and initiate an image distribution request to the mirror node component;
所述镜像节点组件收到映像分发请求后,根据预设的映像分发规则,进行映像分发缓存;After receiving the image distribution request, the image node component performs image distribution and caching according to a preset image distribution rule;
通过所述映像缓存映射记录表判断目标节点是否已经存在映像缓存映射;Determine whether the target node already has an image cache mapping by using the image cache mapping record table;
根据映像缓存映射的判断结果保存记录并向计算节点组件发起映像缓存映射请求;According to the judgment result of the image cache mapping, save the record and initiate the image cache mapping request to the computing node component;
所述计算节点组件收到映像缓存映射请求后,根据预设的映像缓存映射规则,进行映像缓存映射。After receiving the image cache mapping request, the computing node component performs image cache mapping according to a preset image cache mapping rule.
进一步的,所述根据映像缓存的判断结果保存记录并向镜像节点组件发起映像分发请求,包括:Further, saving records according to the judgment result of the image cache and initiating an image distribution request to the mirror node component, including:
若存在映像缓存,且分发状态为活跃状态,则在映像缓存记录表中保存映像缓存记录;If there is an image cache and the distribution state is active, save the image cache record in the image cache record table;
若保存映像缓存记录成功,则设置分发操作的标记为第一标记,并向镜像节点组件发起映像分发请求;If saving the image cache record is successful, set the mark of the distribution operation as the first mark, and initiate an image distribution request to the mirror node component;
若保存映像缓存记录失败,则设置分发操作的标记为第二标记,并向镜像节点组件发起映像分发请求;If saving the image cache record fails, set the mark of the distribution operation as the second mark, and initiate an image distribution request to the mirror node component;
若不存在映像缓存,则重新通过所述映像缓存记录表判断目标节点是否已经存在映像缓存。If there is no image cache, the image cache record table is used to determine whether the target node already has an image cache.
进一步的,所述镜像节点组件收到映像分发请求后,根据预设的映像分发规则,进行映像分发缓存,包括:Further, after receiving the image distribution request, the image node component performs image distribution and cache according to preset image distribution rules, including:
所述镜像节点组件收到映像分发请求后,判断分发操作的标记,若分发操作的标记为第一标记,则进行映像分发缓存;After receiving the image distribution request, the mirror node component determines the mark of the distribution operation, and if the mark of the distribution operation is the first mark, performs image distribution and cache;
若分发操作的标记为第二标记,则进行循环检测,通过控制节点调用分发状态的同步消息,直到分发状态为活跃状态则反馈给控制节点映像缓存分发成功;If the mark of the distribution operation is the second mark, the loop detection is carried out, and the synchronization message of the distribution state is called by the control node, and until the distribution state is the active state, it is fed back to the control node that the image cache distribution is successful;
当循环检测时间超过预设门限值,则反馈映像缓存分发失败状态给控制节点,进入回滚状态。When the cycle detection time exceeds the preset threshold value, the image cache distribution failure state is fed back to the control node, and the rollback state is entered.
进一步的,所述根据映像缓存映射的判断结果保存记录并向计算节点组件发起映像缓存映射请求,包括:Further, saving a record according to the judgment result of the image cache mapping and initiating an image cache mapping request to the computing node component, including:
若存在映像缓存映射,且映射状态为活跃状态,则在映像缓存映射记录表中保存映像缓存映射记录;If there is an image cache mapping and the mapping state is active, save the image cache mapping record in the image cache mapping record table;
若保存映像缓存映射记录成功,则设置映射操作的标记为第三标记,并向 计算节点组件发起映像缓存映射请求;If saving the image cache mapping record is successful, set the tag of the mapping operation as the third tag, and initiate an image cache mapping request to the computing node component;
若保存映像缓存映射记录失败,则设置映射操作的标记为第四标记,并向计算节点组件发起映像缓存映射请求;If saving the image cache mapping record fails, set the tag of the mapping operation to the fourth tag, and initiate an image cache mapping request to the computing node component;
若不存在映像缓存映射,则重新通过所述映像缓存映射记录表判断目标节点是否已经存在映像缓存映射。If there is no image cache mapping, the image cache mapping record table is used to determine whether the target node already has an image cache mapping.
进一步的,所述计算节点组件收到映像缓存映射请求后,根据预设的映像缓存映射规则,进行映像缓存映射,包括:Further, after receiving the image cache mapping request, the computing node component performs image cache mapping according to preset image cache mapping rules, including:
所述计算节点组件收到映像缓存映射请求后,判断映射操作的标记,若映射操作的标记为第三标记,则进行映像缓存映射;After receiving the image cache mapping request, the computing node component determines the mark of the mapping operation, and if the mark of the mapping operation is the third mark, performs the image cache mapping;
若映射操作的标记为第四标记,则进行循环检测,通过控制节点调用映射状态,直到映射状态为活跃状态时则反馈给控制节点映像缓存映射成功;If the mark of the mapping operation is the fourth mark, perform loop detection, call the mapping state through the control node, and feed back to the control node image cache that the mapping is successful until the mapping state is active;
当循环检测时间超过预设门限值,则反馈映像缓存映射失败状态给控制节点,进入回滚状态。When the cycle detection time exceeds the preset threshold value, the image cache mapping failure state is fed back to the control node, and the rollback state is entered.
进一步的,所述映像缓存记录表包括第一ID、第一映像ID、存储目标、存储类型、分发状态和资源类型六个字段;所述第一ID为唯一约束字段,所述第一ID由所述第一映像ID、所述存储目标、所述存储类型和所述资源类型四个字段的值组合而成;Further, the image cache record table includes six fields: first ID, first image ID, storage target, storage type, distribution status and resource type; the first ID is a unique constraint field, and the first ID is defined by The first image ID, the storage target, the storage type, and the value of the four fields of the resource type are combined;
所述映像缓存映射记录表包括第二ID、第二映像ID、节点名、存储池名、映射路径和映射状态六个字段;所述第二ID为唯一约束字段,所述第二ID由映像ID、节点名、存储池名三个字段的值组合而成。The image cache mapping record table includes six fields: the second ID, the second image ID, the node name, the storage pool name, the mapping path and the mapping state; the second ID is a unique constraint field, and the second ID is determined by the image. It is composed of the values of the three fields of ID, node name, and storage pool name.
进一步的,所述进行映像缓存映射,包括:Further, the performing image cache mapping includes:
通过RBD块的map命令将RBD块设备映射到虚拟机操作系统。The RBD block device is mapped to the virtual machine operating system through the map command of the RBD block.
进一步的,所述计算节点组件收到映像缓存映射请求后,根据预设的映像缓存映射规则,进行映像缓存映射之后,还包括:Further, after receiving the image cache mapping request, the computing node component performs image cache mapping according to preset image cache mapping rules, and further includes:
通过映射ISO缓存的设备路径来修改虚拟机的配置文件。Modify the virtual machine's configuration file by mapping the ISO cached device path.
在第二方面,本申请实施例提供了一种批量ISO创建CephX认证虚拟机的实现装置,包括:In a second aspect, an embodiment of the present application provides an implementation device for batch ISO creation of CephX certified virtual machines, including:
记录表预设模块,用于预设唯一约束的映像缓存记录表和映像缓存映射记录表,所述映像缓存记录表用于记录目标节点中的映像缓存,所述映像缓存映射记录表用于记录目标节点中的映像缓存映射;A record table preset module is used to preset a uniquely constrained image cache record table and an image cache mapping record table, the image cache record table is used to record the image cache in the target node, and the image cache mapping record table is used to record Image cache mapping in the target node;
映像缓存判断模块,用于通过所述映像缓存记录表判断目标节点是否已经存在映像缓存;an image cache judging module, configured to judge whether the target node already has an image cache through the image cache record table;
分发请求发送模块,用于根据映像缓存的判断结果保存记录并向镜像节点组件发起映像分发请求;The distribution request sending module is used to save the record according to the judgment result of the image cache and initiate an image distribution request to the mirror node component;
分发缓存执行模块,用于所述镜像节点组件收到映像分发请求后,根据预设的映像分发规则,进行映像分发缓存;a distribution cache execution module, configured to perform image distribution and cache according to preset image distribution rules after the image node component receives the image distribution request;
映像缓存映射判断模块,用于通过所述映像缓存映射记录表判断目标节点是否已经存在映像缓存映射;an image cache mapping judging module, used for judging whether the target node already has an image cache mapping through the image cache mapping record table;
映射请求发送模块,用于根据映像缓存映射的判断结果保存记录并向计算节点组件发起映像缓存映射请求;The mapping request sending module is used to save the record according to the judgment result of the image cache mapping and initiate the image cache mapping request to the computing node component;
映像缓存映射执行模块,用于所述计算节点组件收到映像缓存映射请求后,根据预设的映像缓存映射规则,进行映像缓存映射。The image cache mapping execution module is configured to perform image cache mapping according to preset image cache mapping rules after the computing node component receives the image cache mapping request.
进一步的,所述分发请求发送模块包括:缓存记录保存单元、第一标记设置模块、第二标记设置模块和映像缓存节点判断单元;Further, the distribution request sending module includes: a cache record keeping unit, a first marker setting module, a second marker setting module, and an image cache node judgment unit;
所述缓存记录保存单元用于实现若存在映像缓存,且分发状态为活跃状态,则在映像缓存记录表中保存映像缓存记录;所述第一标记设置模块用于实现若保存映像缓存记录成功,则设置分发操作的标记为第一标记,并向镜像节点组件发起映像分发请求;所述第二标记设置模块用于实现若保存映像缓存记录失败,则设置分发操作的标记为第二标记,并向镜像节点组件发起映像分发请求;所述映像缓存节点判断单元用于实现若不存在映像缓存,则重新通过所述映像缓存记录表判断目标节点是否已经存在映像缓存。The cache record keeping unit is configured to save the image cache record in the image cache record table if there is an image cache and the distribution state is active; the first mark setting module is configured to realize that if the image cache record is saved successfully, Then, the mark of the distribution operation is set as the first mark, and an image distribution request is initiated to the mirror node component; the second mark setting module is used to realize that if saving the image cache record fails, the mark of the distribution operation is set as the second mark, and Initiating an image distribution request to the image node component; the image cache node judgment unit is configured to determine whether the target node already has an image cache through the image cache record table if there is no image cache.
进一步的,所述分发缓存执行模块包括:分发缓存执行单元、分发循环检测单元和分发回滚状态单元;Further, the distribution cache execution module includes: a distribution cache execution unit, a distribution loop detection unit, and a distribution rollback state unit;
所述分发缓存执行单元用于实现所述镜像节点组件收到映像分发请求后,判断分发操作的标记,若分发操作的标记为第一标记,则进行映像分发缓存;所述分发循环检测单元用于实现若分发操作的标记为第二标记,则进行循环检测,通过控制节点调用分发状态的同步消息,直到分发状态为活跃状态则反馈给控制节点映像缓存分发成功;所述分发回滚状态单元用于实现当循环检测时间超过预设门限值,则反馈映像缓存分发失败状态给控制节点,进入回滚状态。The distribution cache execution unit is used to realize that after the mirror node component receives the image distribution request, determine the mark of the distribution operation, and if the mark of the distribution operation is the first mark, perform image distribution and cache; the distribution loop detection unit uses In order to realize that if the mark of the distribution operation is the second mark, loop detection is performed, and the synchronization message of the distribution state is called by the control node, and until the distribution state is the active state, it is fed back to the control node that the image cache is successfully distributed; the distribution rollback state unit It is used to realize that when the loop detection time exceeds the preset threshold value, the image cache distribution failure status is fed back to the control node, and the rollback status is entered.
进一步的,所述映射请求发送模块包括:映射缓存记录保存单元、第三标记设置模块、第四标记设置模块和缓存映射节点判断单元;Further, the mapping request sending module includes: a mapping cache record keeping unit, a third marker setting module, a fourth marker setting module, and a cache mapping node judgment unit;
所述映射缓存记录保存单元用于实现若存在映像缓存映射,且映射状态为活跃状态,则在映像缓存映射记录表中保存映像缓存映射记录;所述第三标记设置模块用于实现若保存映像缓存映射记录成功,则设置映射操作的标记为第三标记,并向计算节点组件发起映像缓存映射请求;所述第四标记设置模块用于实现若保存映像缓存映射记录失败,则设置映射操作的标记为第四标记,并向计算节点组件发起映像缓存映射请求;所述缓存映射节点判断单元用于实现若不存在映像缓存映射,则重新通过所述映像缓存映射记录表判断目标节点是否已经存在映像缓存映射。The mapping cache record saving unit is used to realize that if there is an image cache mapping and the mapping state is an active state, the image cache mapping record is saved in the image cache mapping record table; the third mark setting module is used to realize that if the image is saved If the cache mapping record is successful, the tag of the mapping operation is set as the third tag, and an image cache mapping request is initiated to the computing node component; the fourth tag setting module is used to realize that if saving the image cache mapping record fails, set the mapping operation. The mark is the fourth mark, and an image cache mapping request is initiated to the computing node component; the cache mapping node judgment unit is used to realize that if there is no image cache mapping, re-judging whether the target node already exists through the image cache mapping record table Image cache mapping.
进一步的,所述映像缓存映射执行模块包括:缓存映射执行单元、映射循环检测单元和映射回滚状态单元;Further, the image cache mapping execution module includes: a cache mapping execution unit, a mapping loop detection unit, and a mapping rollback state unit;
所述缓存映射执行单元用于所述计算节点组件收到映像缓存映射请求后,判断映射操作的标记,若映射操作的标记为第三标记,则进行映像缓存映射;The cache mapping execution unit is used for the computing node component to determine the mark of the mapping operation after receiving the image cache mapping request, and to perform the image cache mapping if the mark of the mapping operation is the third mark;
所述映射循环检测单元用于若映射操作的标记为第四标记,则进行循环检测,通过控制节点调用映射状态,直到映射状态为活跃状态时则反馈给控制节点映像缓存映射成功;The mapping loop detection unit is configured to perform loop detection if the mark of the mapping operation is the fourth mark, call the mapping state through the control node, and feed back to the control node that the mapping of the image cache is successful when the mapping state is an active state;
所述映射回滚状态单元用于当循环检测时间超过预设门限值,则反馈映像缓存映射失败状态给控制节点,进入回滚状态。The mapping rollback state unit is configured to feed back the mapping failure status of the image cache to the control node and enter the rollback state when the loop detection time exceeds the preset threshold value.
进一步的,所述映像缓存映射执行模块还用于通过RBD块的map命令将RBD块设备映射到虚拟机操作系统。Further, the image cache mapping execution module is further configured to map the RBD block device to the virtual machine operating system through the RBD block map command.
进一步的,还包括:虚拟机光盘配置模块,所述虚拟机光盘配置模块用于通过映射ISO缓存的设备路径来修改虚拟机的配置文件。Further, it also includes: a virtual machine optical disk configuration module, the virtual machine optical disk configuration module is used to modify the configuration file of the virtual machine by mapping the device path of the ISO cache.
在第三方面,本申请实施例提供了一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行如第一方面所述的批量ISO创建CephX认证虚拟机的实现方法。In a third aspect, embodiments of the present application provide a storage medium containing computer-executable instructions, when executed by a computer processor, the computer-executable instructions are used to perform the batch ISO creation CephX certification as described in the first aspect Implementation of the virtual machine.
本申请实施例通过预设唯一约束的映像缓存记录表和映像缓存映射记录表,通过映像缓存记录表进行映像缓存并保存记录,发起映像分发请求,根据预设的映像分发规则,进行映像分发缓存;通过映像缓存映射记录表进行映像缓存映射并保存记录,发起映像缓存映射请求,根据预设的映像缓存映射规则,进行映像缓存映射,解决使用CephX认证时不支持光盘热插拔的问题,同时实现同一个ISO和节点上可以并发执行,达到批量执行的效果。In the embodiment of the present application, the image cache record table and the image cache mapping record table with the preset unique constraints are used to perform image cache and save the records through the image cache record table, to initiate an image distribution request, and to perform image distribution and cache according to the preset image distribution rules. ; Perform image cache mapping and save records through the image cache mapping record table, initiate an image cache mapping request, and perform image cache mapping according to the preset image cache mapping rules to solve the problem of not supporting CD hot swap when using CephX authentication, and at the same time It can be executed concurrently on the same ISO and node to achieve the effect of batch execution.
附图说明Description of drawings
图1是本申请实施例提供的一种批量ISO创建CephX认证虚拟机的实现方法的流程图;1 is a flowchart of a method for implementing a batch ISO to create a CephX authentication virtual machine provided by an embodiment of the present application;
图2是本申请实施例提供的另一种批量ISO创建CephX认证虚拟机的实现方法的流程图;2 is a flowchart of another method for implementing a batch ISO to create a CephX certified virtual machine provided by an embodiment of the present application;
图3是本申请实施例提供的另一种批量ISO创建CephX认证虚拟机的实现方法的流程图;3 is a flowchart of another method for implementing a batch ISO to create a CephX certified virtual machine provided by an embodiment of the present application;
图4是本申请实施例提供的另一种批量ISO创建CephX认证虚拟机的实现方法的流程图;4 is a flowchart of another method for implementing a batch ISO to create a CephX certified virtual machine provided by an embodiment of the present application;
图5是本申请实施例提供的另一种批量ISO创建CephX认证虚拟机的实现方法的流程图;5 is a flowchart of another method for implementing a batch ISO to create a CephX certified virtual machine provided by an embodiment of the present application;
图6是本申请实施例提供的一种批量ISO创建CephX认证虚拟机的实现装置的流程图。FIG. 6 is a flowchart of an implementation device for batch ISO creation of CephX certified virtual machines provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案和优点更加清楚,下面结合附图对本申请具体实施例作进一步的详细描述。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部内容。在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各项操作(或步骤)描述成顺序的处理,但是其中的许多操作可以被并行地、并发地或者同时实施。此外,各项操作的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。In order to make the objectives, technical solutions and advantages of the present application clearer, the specific embodiments of the present application will be further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, the drawings only show some but not all of the contents related to the present application. Before discussing the exemplary embodiments in greater detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts various operations (or steps) as a sequential process, many of the operations may be performed in parallel, concurrently, or concurrently. Additionally, the order of operations can be rearranged. The process may be terminated when its operation is complete, but may also have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, subroutines, and the like.
本申请提供的批量ISO创建CephX认证虚拟机的实现的方法通过预设唯一约束的映像缓存记录表和映像缓存映射记录表,通过映像缓存记录表进行映像缓存并保存记录,发起映像分发请求,根据预设的映像分发规则,进行映像分发缓存;通过映像缓存映射记录表进行映像缓存映射并保存记录,发起映像缓 存映射请求,根据预设的映像缓存映射规则,进行映像缓存映射,解决使用CephX认证时不支持光盘热插拔的问题,同时实现同一个ISO和节点上可以并发执行,达到批量执行的效果。The method for implementing batch ISO creation of CephX certified virtual machines provided by this application uses the image cache record table and the image cache mapping record table with preset unique constraints, performs image cache and saves records through the image cache record table, initiates an image distribution request, according to Preset image distribution rules, perform image distribution caching; perform image cache mapping and save records through the image cache mapping record table, initiate image cache mapping requests, and perform image cache mapping according to preset image cache mapping rules to solve the problem of using CephX certification At the same time, the same ISO and nodes can be executed concurrently to achieve the effect of batch execution.
RBD块存储是Ceph提供的3种存储类型中使用最广泛,最稳定的存储类型。RBD块类似于磁盘,可以挂载到物理机或虚拟机中。Ceph提供了两种身份认证方式:None和CephX;None表示客户端不需要通过密钥访问即可访问Ceph存储集群,显然这种方式是不被推荐的;CephX的本质是一种对称加密协议,加密算法为AES,用于识别用户的身份、对用户在客户端上的操作进行认证,以此防止中间人攻击、数据篡改等网络安全问题。为了支持批量创建,很多云平台会提供镜像分发功能以预先把镜像缓存分发到节点的操作。但带CephX认证的RBDiso目前不支持热插拔,也即带CephX认证时无法进行在线挂载卸载光盘;为了实现批量iso创建虚拟机,大多平台都是通过提供映像分发功能,在批量创建前,先进行映像分发,这无疑增加了云平台操作的不便性。RBD block storage is the most widely used and stable storage type among the 3 storage types provided by Ceph. RBD blocks are similar to disks and can be mounted into physical or virtual machines. Ceph provides two authentication methods: None and CephX; None means that the client can access the Ceph storage cluster without key access, which is obviously not recommended; CephX is essentially a symmetric encryption protocol, The encryption algorithm is AES, which is used to identify the user's identity and authenticate the user's operations on the client to prevent network security issues such as man-in-the-middle attacks and data tampering. To support batch creation, many cloud platforms provide image distribution functions to distribute image caches to nodes in advance. However, RBDiso with CephX certification currently does not support hot swapping, that is, online mounting and unloading of discs with CephX certification cannot be performed; in order to create virtual machines in batches of iso, most platforms provide image distribution functions. Before batch creation, Image distribution is performed first, which undoubtedly increases the inconvenience of cloud platform operations.
具体的,创建虚拟机任务流模板中会有很多步骤,如创建虚拟机初始化步骤、检测虚拟机创建节点环境步骤、创建系统盘步骤、挂载系统盘步骤、创建挂载数据盘任务流步骤、创建挂载网卡任务流步骤、虚拟机开机步骤、虚拟机修改密码步骤和虚拟机重命名步骤等。Specifically, there are many steps in creating a virtual machine task flow template, such as creating virtual machine initialization steps, detecting virtual machine creation node environment steps, creating system disk steps, mounting system disk steps, creating and mounting data disk task flow steps, Create the task flow steps for attaching the network card, the steps for starting the virtual machine, the steps for changing the password of the virtual machine, and the steps for renaming the virtual machine.
本申请实施例通过在创建挂载网卡任务流步骤后面添加挂载ISO任务流步骤,来避免现有在使用CephX认证时不支持光盘热插拔和在没有映像缓存的情况下不能批量ISO创建虚拟机的问题。In this embodiment of the present application, a task flow step of mounting ISO is added after the step of creating a task flow for mounting a network card, so as to avoid the existing inability to support hot-plugging of optical discs when using CephX authentication and the inability to create virtual ISOs in batches without an image cache. machine problem.
其中,挂载ISO任务流步骤是一个嵌套的子任务流,该任务流包括挂载ISO初始化步骤、检测与分发映像缓存步骤、检测与映射ISO缓存步骤、修改虚拟机光盘配置步骤以及挂载光盘完成步骤。The task flow step of mounting ISO is a nested subtask flow, and the task flow includes the initialization step of mounting ISO, the step of detecting and distributing the image cache, the step of detecting and mapping the ISO cache, the step of modifying the configuration of the virtual machine disc, and the step of mounting Disc completion steps.
示例性的,挂载ISO初始化步骤:一般是做一些挂载ISO前的操作,如把虚拟机的任务状态改为正在挂载光盘等,以防止其他人对虚拟机进行其他操作。Exemplarily, the ISO mounting initialization step: generally, some operations before mounting the ISO are performed, such as changing the task status of the virtual machine to a CD-ROM being mounted, etc., so as to prevent others from performing other operations on the virtual machine.
具体的,在挂载ISO任务流模板中添加检测与分发映像缓存步骤,该步骤对于同一个ISO和节点上可以并发执行,达到批量执行的效果;具体的,在挂载ISO任务流模板中添加检测与映射ISO缓存步骤,通过RBD块的map命令将RBD块设备映射到操作系统的方式解决使用CephX认证时不支持光盘热插拔的问题,同时对同一个ISO和节点上同样可以并发执行,达到批量执行的效果。Specifically, a step of detecting and distributing image cache is added to the mounting ISO task flow template. This step can be executed concurrently on the same ISO and node to achieve the effect of batch execution; In the step of detecting and mapping the ISO cache, the RBD block device is mapped to the operating system through the map command of the RBD block to solve the problem of not supporting hot-plugging of optical discs when using CephX authentication. At the same time, the same ISO and node can be executed concurrently. achieve the effect of batch execution.
图1为本申请实施例提供的一种批量ISO创建CephX认证虚拟机的实现方 法的流程图。参考图1,该批量ISO创建CephX认证虚拟机的实现方法具体包括:1 is a flow chart of a method for implementing a batch ISO to create a CephX certified virtual machine provided by an embodiment of the present application. Referring to Figure 1, the implementation method of the batch ISO to create a CephX certified virtual machine specifically includes:
步骤110、预设唯一约束的映像缓存记录表和映像缓存映射记录表,所述映像缓存记录表用于记录目标节点中的映像缓存,所述映像缓存映射记录表用于记录目标节点中的映像缓存映射。Step 110: Preset a uniquely constrained image cache record table and an image cache mapping record table, the image cache record table is used to record the image cache in the target node, and the image cache mapping record table is used to record the image in the target node cache map.
具体的,设置一个唯一约束的映像缓存记录表,所述映像缓存记录表包括第一ID、第一映像ID、存储目标、存储类型、分发状态和资源类型六个字段;所述第一ID为唯一约束字段,所述第一ID由所述第一映像ID、所述存储目标、所述存储类型和所述资源类型四个字段的值组合而成。Specifically, a uniquely constrained image cache record table is set, and the image cache record table includes six fields: first ID, first image ID, storage target, storage type, distribution status, and resource type; the first ID is A unique constraint field, where the first ID is formed by combining the values of the first image ID, the storage target, the storage type, and the resource type.
示例性的,存储目标是指缓存存储的目标位置,可选的,一般为存储池名称;存储类型包括node、vg和RBD;分发状态包括downloading、deleting和active;资源类型包括ISO和image。Exemplarily, the storage target refers to the target location of the cache storage, which is optional and generally the name of the storage pool; the storage type includes node, vg, and RBD; the distribution status includes downloading, deleting, and active; and the resource type includes ISO and image.
具体的,设置一个唯一约束的映像缓存映射记录表,所述映像缓存映射记录表包括第二ID、第二映像ID、节点名、存储池名、映射路径和映射状态六个字段;所述第二ID为唯一约束字段,所述第二ID由映像ID、节点名、存储池名三个字段的值组合而成。Specifically, a uniquely constrained image cache mapping record table is set, and the image cache mapping record table includes six fields: a second ID, a second image ID, a node name, a storage pool name, a mapping path, and a mapping state; The second ID is a unique constraint field, and the second ID is formed by combining the values of three fields: image ID, node name, and storage pool name.
示例性的,映射状态包括mapping和active;资源类型包括ISO和image。Exemplarily, the mapping state includes mapping and active; the resource type includes ISO and image.
步骤120、通过所述映像缓存记录表判断目标节点是否已经存在映像缓存。Step 120: Determine whether the target node already has an image cache by using the image cache record table.
可以理解的是,系统先通过映像缓存记录表判断目标节点上是否已经存在映像缓存,根据是否存在映像缓存来执行接下来的步骤。It can be understood that the system first determines whether an image cache already exists on the target node through the image cache record table, and performs the next steps according to whether there is an image cache.
步骤130、根据映像缓存的判断结果保存记录并向镜像节点组件发起映像分发请求。Step 130: Save a record according to the judgment result of the image cache and initiate an image distribution request to the mirror node component.
请参照图2,步骤130具体可以通过步骤1301-1304实现。Referring to FIG. 2 , step 130 can be specifically implemented through steps 1301-1304.
步骤1301、若存在映像缓存,且分发状态为活跃状态,则在映像缓存记录表中保存映像缓存记录。Step 1301: If there is an image cache and the distribution state is an active state, save the image cache record in the image cache record table.
具体的,若通过映像缓存记录表判断得到目标节点上存在映像缓存,判断此时的分发状态,若此时的分发状态为活跃(active)状态时,则尝试在映像缓存记录表中保存映像缓存记录。Specifically, if it is determined from the image cache record table that there is an image cache on the target node, the distribution state at this time is determined, and if the distribution state at this time is active (active), try to save the image cache in the image cache record table. Record.
步骤1302、若保存映像缓存记录成功,则设置分发操作的标记为第一标记,并向镜像节点组件发起映像分发请求。Step 1302: If saving the image cache record is successful, set the flag of the distribution operation as the first flag, and initiate an image distribution request to the mirror node component.
具体的,若在映像缓存记录表中保存映像缓存记录成功,因为第一ID由第 一映像ID、存储目标、存储类型和资源类型四个字段的值组合而成,并且唯一约束,如果保存映像缓存记录成功,表明此映像在目标节点上并没有缓存,也没有其它正在分发此映像到目标节点上的任务存在,此时给分发操作设置一个标记,记为第一标记,可选的,第一标记记为distribute,并向镜像节点组件发起映像分发请求;可以理解的是,镜像节点组件用于实现映像分发缓存。Specifically, if the image cache record is successfully saved in the image cache record table, because the first ID is composed of the values of the four fields of the first image ID, storage target, storage type and resource type, and it is uniquely constrained, if the image is saved The cache record is successful, indicating that the image is not cached on the target node, and there are no other tasks that are distributing the image to the target node. At this time, a mark is set for the distribution operation, which is recorded as the first mark, optional, the first mark. A tag is marked as distribute, and an image distribution request is issued to the mirror node component; it can be understood that the mirror node component is used to implement the image distribution cache.
步骤1303、若保存映像缓存记录失败,则设置分发操作的标记为第二标记,并向镜像节点组件发起映像分发请求。Step 1303: If saving the image cache record fails, set the flag of the distribution operation as the second flag, and initiate an image distribution request to the mirror node component.
若在映像缓存记录表中保存映像缓存记录失败,表明有其它操作正在分发此映像到目标节点,此时给分发操作设置一个标记,记为第二标记,可选的,第二标记记为check,并向镜像节点组件发起映像分发请求。If saving the image cache record in the image cache record table fails, it indicates that other operations are distributing the image to the target node. At this time, a flag is set for the distribution operation, which is recorded as the second flag. Optionally, the second flag is marked as check , and initiate an image distribution request to the mirror node component.
步骤1304、若不存在映像缓存,则重新通过所述映像缓存记录表判断目标节点是否已经存在映像缓存。Step 1304: If there is no image cache, re-determine whether the target node already has an image cache through the image cache record table.
其中,若通过映像缓存记录表判断得到目标节点上不存在映像缓存,则重新通过所述映像缓存记录表判断目标节点是否已经存在映像缓存。Wherein, if it is determined through the image cache record table that there is no image cache on the target node, then it is re-determined through the image cache record table whether the target node already has an image cache.
示例性的,在虚拟机的批量创建的时候,第一台虚拟机的流程步骤会分发映像,其他台虚拟机会一直检测映像的状态,检测映像是否已经分发完成,检测到完成就进入下一步;即虚拟机的创建是并行创建的。Exemplarily, when virtual machines are created in batches, the process steps of the first virtual machine will distribute the image, and the other virtual machines will always check the status of the image, check whether the image has been distributed, and go to the next step when the completion is detected; That is, the creation of virtual machines is created in parallel.
步骤140、所述镜像节点组件收到映像分发请求后,根据预设的映像分发规则,进行映像分发缓存。Step 140: After receiving the image distribution request, the image node component performs image distribution and caching according to a preset image distribution rule.
请参照图3,步骤140具体可以通过步骤1401-1403实现。Referring to FIG. 3 , step 140 can be specifically implemented through steps 1401-1403.
步骤1401、所述镜像节点组件收到映像分发请求后,判断分发操作的标记,若分发操作的标记为第一标记,则进行映像分发缓存。Step 1401: After receiving the image distribution request, the mirror node component determines the mark of the distribution operation, and if the mark of the distribution operation is the first mark, performs image distribution and cache.
具体的,镜像节点组件收到映像分发请求后,判断分发操作的标记,若分发操作的标记为第一标记,则为distribute时,进行正常的映像分发操作;可选的,映像分发操作为:本地存储映像分发到指定节点上;分布式存储分发到分布式存储;集中存储分发到集中存储的vg上(跟虚拟机所在vg一致)。Specifically, after receiving the image distribution request, the mirror node component determines the mark of the distribution operation. If the mark of the distribution operation is the first mark, then when it is distribute, the normal image distribution operation is performed; optionally, the image distribution operation is: The local storage image is distributed to the specified node; the distributed storage is distributed to the distributed storage; the centralized storage is distributed to the vg of the centralized storage (the same as the vg where the virtual machine is located).
步骤1402、若分发操作的标记为第二标记,则进行循环检测,通过控制节点调用分发状态的同步消息,直到分发状态为活跃状态则反馈给控制节点映像缓存分发成功.Step 1402: If the mark of the distribution operation is the second mark, perform loop detection, call the synchronization message of the distribution status through the control node, and feed back to the control node that the image cache distribution is successful until the distribution status is active.
可选的,若分发操作的标记为第二标记,则为check时,则进行循环检测,向控制节点调用获取映像缓存分发状态的同步消息,直到映像缓存分发状态为 活跃(active)状态时则反馈给控制节点映像缓存分发成功,让挂载ISO流程继续执行下一个步骤。Optionally, if the flag of the distribution operation is the second flag, then when it is check, the loop detection is performed, and the synchronization message to obtain the distribution status of the image cache is called to the control node until the distribution state of the image cache is active (active) state. Feedback to the control node image cache distribution is successful, let the process of mounting the ISO continue to the next step.
步骤1403、当循环检测时间超过预设门限值,则反馈映像缓存分发失败状态给控制节点,进入回滚状态。Step 1403: When the loop detection time exceeds the preset threshold value, the image cache distribution failure state is fed back to the control node, and the rollback state is entered.
可以理解的是,如果循环检测超时,即当循环检测时间超过预设门限值,说明映像缓存未能分发成功,则反馈给控制节点映像缓存分发失败状态消息,挂载ISO流程将进入回滚状态,即执行前面步骤的回滚操作;可以理解的是,循环检测的预设门限值的具体值可以根据需求进行设置,本申请实施例对具体的值不作限定。It is understandable that if the loop detection times out, that is, when the loop detection time exceeds the preset threshold, it means that the image cache has failed to be distributed successfully, and the image cache distribution failure status message will be fed back to the control node, and the process of mounting the ISO will be rolled back. state, that is, performing the rollback operation of the previous steps; it can be understood that the specific value of the preset threshold value for loop detection can be set according to requirements, and the specific value is not limited in this embodiment of the present application.
步骤150、通过所述映像缓存映射记录表判断目标节点是否已经存在映像缓存映射。Step 150: Determine whether the target node already has an image cache mapping by using the image cache mapping record table.
可以理解的是,系统先通过映像缓存映射记录表判断目标节点上是否已经存在映像缓存映射,根据是否存在映像缓存映射来执行接下来的步骤。It can be understood that the system first determines whether an image cache mapping already exists on the target node through the image cache mapping record table, and performs the next steps according to whether there is an image cache mapping.
步骤160、根据映像缓存映射的判断结果保存映像缓存映射记录并向计算节点组件发起映像缓存映射请求。Step 160: Save the image cache mapping record according to the judgment result of the image cache mapping and initiate an image cache mapping request to the computing node component.
请参照图4,步骤160具体可以通过步骤1601-1604实现。Referring to FIG. 4 , step 160 may be specifically implemented through steps 1601-1604.
步骤1601、若存在映像缓存映射,且映射状态为活跃状态,则在映像缓存映射记录表中保存映像缓存映射记录。Step 1601: If there is an image cache mapping and the mapping state is active, save the image cache mapping record in the image cache mapping record table.
具体的,若通过映像缓存映射记录表判断得到目标节点上存在映像缓存映射,判断此时的映射状态,若此时的映射状态为活跃(active)状态时,则尝试在映像缓存映射表中保存映像缓存映射记录。Specifically, if it is judged that there is an image cache mapping on the target node through the image cache mapping record table, the mapping state at this time is judged, and if the mapping state at this time is active (active), try to save it in the image cache mapping table Image cache mapping record.
步骤1602、若保存映像缓存映射记录成功,则设置映射操作的标记为第三标记,并向计算节点组件发起映像缓存映射请求; Step 1602, if saving the image cache mapping record is successful, set the tag of the mapping operation as the third tag, and initiate an image cache mapping request to the computing node component;
具体的,若在映像缓存映射记录表中保存映像缓存映射记录成功,因为第二ID由第二映像ID、节点名和存储池名三个字段的值组合而成,并且唯一约束,如果保存映像缓存映射记录成功,表明此映像在目标节点上并没有缓存映射,也没有其它正在映射此映像到目标节点上的任务存在,此时给映射操作设置一个标记,记为第三标记,可选的,第三标记记为map,并向计算节点组件发起映像缓存映射请求;可以理解的是,计算节点组件用于实现映像缓存映射。Specifically, if the image cache mapping record is successfully saved in the image cache mapping record table, because the second ID is composed of the values of the second image ID, node name and storage pool name, and it is a unique constraint, if the image cache is saved The mapping record is successful, indicating that the image has no cache mapping on the target node, and there are no other tasks that are mapping this image to the target node. At this time, a flag is set for the mapping operation, recorded as the third flag, optional, The third mark is marked as map, and an image cache mapping request is initiated to the computing node component; it can be understood that the computing node component is used to implement the image cache mapping.
步骤1603、若保存映像缓存映射记录失败,则设置映射操作的标记为第四标记,并向计算节点组件发起映像缓存映射请求; Step 1603, if saving the image cache mapping record fails, set the mark of the mapping operation as the fourth mark, and initiate an image cache mapping request to the computing node component;
若在映像缓存映射记录表中保存映像缓存映射记录失败,表明有其它操作正在分发此映像缓存到目标节点,此时给映射操作设置一个标记,记为第四标记,可选的,第二标记记为check,并向计算节点组件发起映像缓存映射请求。If it fails to save the image cache mapping record in the image cache mapping record table, it indicates that other operations are distributing the image cache to the target node. At this time, a mark is set for the mapping operation, which is recorded as the fourth mark, optional, the second mark Record it as check, and initiate an image cache mapping request to the compute node component.
步骤1604、若不存在映像缓存映射,则重新通过所述映像缓存映射记录表判断目标节点是否已经存在映像缓存映射。Step 1604: If there is no image cache mapping, re-determine whether the target node already has an image cache mapping through the image cache mapping record table.
其中,若通过映像缓存映射记录表判断得到目标节点上不存在映像缓存映射,则重新通过所述映像缓存映射记录表判断目标节点是否已经存在映像缓存映射。Wherein, if it is determined through the image cache mapping record table that there is no image cache mapping on the target node, then it is judged again whether the image cache mapping already exists on the target node through the image cache mapping record table.
步骤170、所述计算节点组件收到映像缓存映射请求后,根据预设的映像缓存映射规则,进行映像缓存映射。Step 170: After receiving the image cache mapping request, the computing node component performs image cache mapping according to a preset image cache mapping rule.
请参照图5,步骤170具体可以通过步骤1701-1703实现。Referring to FIG. 5 , step 170 can be specifically implemented through steps 1701-1703.
步骤1701、所述计算节点组件收到映像缓存映射请求后,判断映射操作的标记,若映射操作的标记为第三标记,则进行映像缓存映射;Step 1701: After receiving the image cache mapping request, the computing node component determines the mark of the mapping operation, and if the mark of the mapping operation is the third mark, performs the image cache mapping;
具体的,计算节点组件收到映像缓存映射请求后,判断映射操作的标记,若映射操作的标记为第三标记,则为map时,进行正常的映像缓存映射操作;可选的,映像缓存映射操作为:通过RBD块的map命令将RBD块设备映射到虚拟机操作系统。Specifically, after receiving the image cache mapping request, the computing node component determines the mark of the mapping operation. If the mark of the mapping operation is the third mark, then when it is a map, the normal image cache mapping operation is performed; optionally, the image cache mapping operation is performed. The operation is: map the RBD block device to the virtual machine operating system through the map command of the RBD block.
步骤1702、若映射操作的标记为第四标记,则进行循环检测,通过控制节点调用映射状态,直到映射状态为活跃状态时则反馈给控制节点映像缓存映射成功;Step 1702: If the mark of the mapping operation is the fourth mark, perform loop detection, call the mapping state through the control node, and feed back to the control node that the mapping of the image cache is successful when the mapping state is active;
可选的,若映射操作的标记为第四标记,则为check时,则进行循环检测,向控制节点调用获取映像缓存映射状态的同步消息,直到映像缓存映射状态为活跃(active)状态时则反馈给控制节点映像缓存映射成功,让挂载ISO流程继续执行下一个步骤。Optionally, if the mark of the mapping operation is the fourth mark, then when it is check, loop detection is performed, and the synchronization message to obtain the mapping status of the image cache is called to the control node until the mapping status of the image cache is active. Feedback to the control node that the image cache mapping is successful, let the ISO mount process continue to the next step.
步骤1703、当循环检测时间超过预设门限值,则反馈映像缓存映射失败状态给控制节点,进入回滚状态。Step 1703: When the loop detection time exceeds the preset threshold value, the image cache mapping failure state is fed back to the control node, and the rollback state is entered.
可以理解的是,如果循环检测超时,即当循环检测时间超过预设门限值,说明映像缓存未能映射成功,则反馈给控制节点映像缓存映射失败状态消息,挂载ISO流程将进入回滚状态,即执行前面步骤的回滚操作。It can be understood that if the loop detection times out, that is, when the loop detection time exceeds the preset threshold value, it means that the image cache has not been successfully mapped, and the image cache mapping failure status message will be fed back to the control node, and the process of mounting the ISO will be rolled back. Status, that is, to perform the rollback operation of the previous steps.
在上述实施例的基础上,批量ISO创建CephX认证虚拟机的实现方法还可 以具体化为:所述计算节点组件收到映像缓存映射请求后,根据预设的映像缓存映射规则,进行映像缓存映射之后,还包括:On the basis of the above embodiment, the method for implementing the batch ISO creation of CephX certified virtual machines can also be embodied as follows: after the computing node component receives the image cache mapping request, it performs image cache mapping according to the preset image cache mapping rules After that, also include:
通过映射ISO缓存的设备路径来修改虚拟机的配置文件。Modify the virtual machine's configuration file by mapping the ISO cached device path.
示例性的,将相关挂载配置写进虚拟机的配置文件里,重启虚拟机一遍之后光盘依然挂载在虚拟机上。Exemplarily, the relevant mounting configuration is written into the configuration file of the virtual machine, and the optical disc is still mounted on the virtual machine after the virtual machine is restarted once.
以上步骤并不是严格按照编号描述的顺序依次执行,其应作为一个整体方案进行理解。The above steps are not strictly performed in the order described by the numbers, and should be understood as a whole solution.
在上述实施例的基础上,图6为本申请实施例提供的一种批量ISO创建CephX认证虚拟机的实现装置的结构示意图。参考图6,本实施例提供的图像处理装置具体包括:记录表预设模块301、映像缓存判断模块302、分发请求发送模块303、分发缓存执行模块304、映像缓存映射判断模块305、映射请求发送模块306和映像缓存映射执行模块307。On the basis of the foregoing embodiment, FIG. 6 is a schematic structural diagram of a device for implementing a batch ISO to create a CephX authentication virtual machine according to an embodiment of the present application. 6 , the image processing apparatus provided in this embodiment specifically includes: a record table preset module 301, an image cache judgment module 302, a distribution request sending module 303, a distribution cache execution module 304, an image cache mapping judgment module 305, and a mapping request sending module Module 306 and image cache mapping execution module 307.
其中,记录表预设模块301用于预设唯一约束的映像缓存记录表和映像缓存映射记录表,所述映像缓存记录表用于记录目标节点中的映像缓存,所述映像缓存映射记录表用于记录目标节点中的映像缓存映射;映像缓存判断模块302用于通过所述映像缓存记录表判断目标节点是否已经存在映像缓存;分发请求发送模块303用于根据映像缓存的判断结果保存记录并向镜像节点组件发起映像分发请求;分发缓存执行模块304用于所述镜像节点组件收到映像分发请求后,根据预设的映像分发规则,进行映像分发缓存;映像缓存映射判断模块305用于通过所述映像缓存映射记录表判断目标节点是否已经存在映像缓存映射;映射请求发送模块306用于根据映像缓存映射的判断结果保存记录并向计算节点组件发起映像缓存映射请求;映像缓存映射执行模块307用于所述计算节点组件收到映像缓存映射请求后,根据预设的映像缓存映射规则,进行映像缓存映射。The record table preset module 301 is used to preset a uniquely constrained image cache record table and an image cache mapping record table, the image cache record table is used to record the image cache in the target node, and the image cache mapping record table is used for To record the image cache mapping in the target node; the image cache judgment module 302 is used to judge whether the target node already has an image cache through the image cache record table; the distribution request sending module 303 is used to save the record according to the judgment result of the image cache and send it to the image cache. The mirror node component initiates an image distribution request; the distribution cache execution module 304 is used for the mirror node component to perform image distribution and cache according to a preset image distribution rule after receiving the image distribution request; the image cache mapping judgment module 305 is used to pass the The image cache mapping record table judges whether the target node already has an image cache mapping; the mapping request sending module 306 is used to save records according to the judgment result of the image cache mapping and initiate an image cache mapping request to the computing node component; the image cache mapping execution module 307 uses After the computing node component receives the image cache mapping request, it performs image cache mapping according to a preset image cache mapping rule.
进一步的,所述分发请求发送模块303包括:缓存记录保存单元、第一标记设置模块、第二标记设置模块和映像缓存节点判断单元;Further, the distribution request sending module 303 includes: a cache record keeping unit, a first marker setting module, a second marker setting module, and an image cache node judgment unit;
所述缓存记录保存单元用于实现若存在映像缓存,且分发状态为活跃状态,则在映像缓存记录表中保存映像缓存记录;所述第一标记设置模块用于实现若保存映像缓存记录成功,则设置分发操作的标记为第一标记,并向镜像节点组件发起映像分发请求;所述第二标记设置模块用于实现若保存映像缓存记录失 败,则设置分发操作的标记为第二标记,并向镜像节点组件发起映像分发请求;所述映像缓存节点判断单元用于实现若不存在映像缓存,则重新通过所述映像缓存记录表判断目标节点是否已经存在映像缓存。The cache record keeping unit is configured to save the image cache record in the image cache record table if there is an image cache and the distribution state is active; the first mark setting module is configured to realize that if the image cache record is saved successfully, Then, the mark of the distribution operation is set as the first mark, and an image distribution request is initiated to the mirror node component; the second mark setting module is used to realize that if saving the image cache record fails, the mark of the distribution operation is set as the second mark, and Initiating an image distribution request to the image node component; the image cache node judgment unit is configured to determine whether the target node already has an image cache through the image cache record table if there is no image cache.
进一步的,所述分发缓存执行模块304包括:分发缓存执行单元、分发循环检测单元和分发回滚状态单元;Further, the distribution cache execution module 304 includes: a distribution cache execution unit, a distribution loop detection unit, and a distribution rollback status unit;
所述分发缓存执行单元用于实现所述镜像节点组件收到映像分发请求后,判断分发操作的标记,若分发操作的标记为第一标记,则进行映像分发缓存;所述分发循环检测单元用于实现若分发操作的标记为第二标记,则进行循环检测,通过控制节点调用分发状态的同步消息,直到分发状态为活跃状态则反馈给控制节点映像缓存分发成功;所述分发回滚状态单元用于实现当循环检测时间超过预设门限值,则反馈映像缓存分发失败状态给控制节点,进入回滚状态。The distribution cache execution unit is used to realize that after the mirror node component receives the image distribution request, determine the mark of the distribution operation, and if the mark of the distribution operation is the first mark, perform image distribution and cache; the distribution loop detection unit uses In order to realize that if the mark of the distribution operation is the second mark, loop detection is performed, and the synchronization message of the distribution state is called by the control node, and until the distribution state is the active state, it is fed back to the control node that the image cache is successfully distributed; the distribution rollback state unit It is used to realize that when the loop detection time exceeds the preset threshold value, the image cache distribution failure status is fed back to the control node, and the rollback status is entered.
进一步的,所述映射请求发送模块306包括:映射缓存记录保存单元、第三标记设置模块、第四标记设置模块和缓存映射节点判断单元;Further, the mapping request sending module 306 includes: a mapping cache record saving unit, a third marker setting module, a fourth marker setting module, and a cache mapping node judgment unit;
所述映射缓存记录保存单元用于实现若存在映像缓存映射,且映射状态为活跃状态,则在映像缓存映射记录表中保存映像缓存映射记录;所述第三标记设置模块用于实现若保存映像缓存映射记录成功,则设置映射操作的标记为第三标记,并向计算节点组件发起映像缓存映射请求;所述第四标记设置模块用于实现若保存映像缓存映射记录失败,则设置映射操作的标记为第四标记,并向计算节点组件发起映像缓存映射请求;所述缓存映射节点判断单元用于实现若不存在映像缓存映射,则重新通过所述映像缓存映射记录表判断目标节点是否已经存在映像缓存映射。The mapping cache record saving unit is used to realize that if there is an image cache mapping and the mapping state is an active state, the image cache mapping record is saved in the image cache mapping record table; the third mark setting module is used to realize that if the image is saved If the cache mapping record is successful, the tag of the mapping operation is set as the third tag, and an image cache mapping request is initiated to the computing node component; the fourth tag setting module is used to realize that if saving the image cache mapping record fails, set the mapping operation. The mark is the fourth mark, and an image cache mapping request is initiated to the computing node component; the cache mapping node judging unit is used to realize that if there is no image cache mapping, re-judging whether the target node already exists through the image cache mapping record table Image cache mapping.
进一步的,所述映像缓存映射执行模块307包括:缓存映射执行单元、映射循环检测单元和映射回滚状态单元;Further, the image cache mapping execution module 307 includes: a cache mapping execution unit, a mapping loop detection unit, and a mapping rollback status unit;
所述缓存映射执行单元用于所述计算节点组件收到映像缓存映射请求后,判断映射操作的标记,若映射操作的标记为第三标记,则进行映像缓存映射;The cache mapping execution unit is used for the computing node component to determine the mark of the mapping operation after receiving the image cache mapping request, and to perform the image cache mapping if the mark of the mapping operation is the third mark;
所述映射循环检测单元用于若映射操作的标记为第四标记,则进行循环检测,通过控制节点调用映射状态,直到映射状态为活跃状态时则反馈给控制节点映像缓存映射成功;The mapping loop detection unit is configured to perform loop detection if the mark of the mapping operation is the fourth mark, call the mapping state through the control node, and feed back to the control node that the mapping of the image cache is successful when the mapping state is an active state;
所述映射回滚状态单元用于当循环检测时间超过预设门限值,则反馈映像缓存映射失败状态给控制节点,进入回滚状态。The mapping rollback state unit is configured to feed back the mapping failure status of the image cache to the control node and enter the rollback state when the loop detection time exceeds the preset threshold value.
进一步的,所述映像缓存映射执行模块307还用于通过RBD块的map命令 将RBD块设备映射到虚拟机操作系统。Further, the image cache mapping execution module 307 is further configured to map the RBD block device to the virtual machine operating system through the map command of the RBD block.
进一步的,还包括:虚拟机光盘配置模块,所述虚拟机光盘配置模块用于通过映射ISO缓存的设备路径来修改虚拟机的配置文件。Further, it also includes: a virtual machine optical disk configuration module, the virtual machine optical disk configuration module is used to modify the configuration file of the virtual machine by mapping the device path of the ISO cache.
本申请实施例提供的批量ISO创建CephX认证虚拟机的实现装置可以用于执行上述实施例提供的批量ISO创建CephX认证虚拟机的实现方法,具备相应的功能和有益效果。The implementation device for creating a CephX authentication virtual machine in batches provided by the embodiments of the present application can be used to execute the implementation method for creating a CephX authentication virtual machine in batches provided by the above embodiments, and has corresponding functions and beneficial effects.
上述,通过预设唯一约束的映像缓存记录表和映像缓存映射记录表,通过映像缓存记录表进行映像缓存并保存记录,发起映像分发请求,根据预设的映像分发规则,进行映像分发缓存;通过映像缓存映射记录表进行映像缓存映射并保存记录,发起映像缓存映射请求,根据预设的映像缓存映射规则,进行映像缓存映射,解决使用CephX认证时不支持光盘热插拔的问题,同时实现同一个ISO和节点上可以并发执行,达到批量执行的效果。In the above, the image cache record table and the image cache mapping record table with the preset unique constraints are used to perform image cache and save records through the image cache record table, and an image distribution request is initiated, and the image distribution cache is performed according to the preset image distribution rules; The image cache mapping record table performs image cache mapping and saves records, initiates an image cache mapping request, and performs image cache mapping according to the preset image cache mapping rules. An ISO and a node can be executed concurrently to achieve the effect of batch execution.
本申请实施例还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行一种批量ISO创建CephX认证虚拟机的实现方法,该批量ISO创建CephX认证虚拟机的实现方法包括:预设唯一约束的映像缓存记录表和映像缓存映射记录表,所述映像缓存记录表用于记录目标节点中的映像缓存,所述映像缓存映射记录表用于记录目标节点中的映像缓存映射;通过所述映像缓存记录表判断目标节点是否已经存在映像缓存;根据映像缓存的判断结果保存记录并向镜像节点组件发起映像分发请求;所述镜像节点组件收到映像分发请求后,根据预设的映像分发规则,进行映像分发缓存;通过所述映像缓存映射记录表判断目标节点是否已经存在映像缓存映射;根据映像缓存映射的判断结果保存记录并向计算节点组件发起映像缓存映射请求;所述计算节点组件收到映像缓存映射请求后,根据预设的映像缓存映射规则,进行映像缓存映射。Embodiments of the present application further provide a storage medium containing computer-executable instructions, when the computer-executable instructions are executed by a computer processor, the computer-executable instructions are used to execute a method for implementing a batch ISO to create a CephX certified virtual machine. The implementation method of the CephX certified virtual machine includes: a preset unique constraint image cache record table and an image cache mapping record table, the image cache record table is used to record the image cache in the target node, and the image cache mapping record table is used for Record the image cache mapping in the target node; judge whether the target node already has an image cache through the image cache record table; save the record according to the judgment result of the image cache and initiate an image distribution request to the mirror node component; the mirror node component receives After the image distribution request, perform image distribution and cache according to the preset image distribution rules; determine whether the target node already has an image cache mapping by using the image cache mapping record table; save a record according to the judgment result of the image cache mapping and send it to the computing node component. An image cache mapping request is initiated; after receiving the image cache mapping request, the computing node component performs image cache mapping according to a preset image cache mapping rule.
存储介质——任何的各种类型的存储器设备或存储设备。术语“存储介质”旨在包括:安装介质,例如CD-ROM、软盘或磁带装置;计算机系统存储器或随机存取存储器,诸如DRAM、DDRRAM、SRAM、EDORAM,兰巴斯(Rambus)RAM等;非易失性存储器,诸如闪存、磁介质(例如硬盘或光存储);寄存器或其它相似类型的存储器元件等。存储介质可以还包括其它类型的存储 器或其组合。另外,存储介质可以位于程序在其中被执行的第一计算机系统中,或者可以位于不同的第二计算机系统中,第二计算机系统通过网络(诸如因特网)连接到第一计算机系统。第二计算机系统可以提供程序指令给第一计算机用于执行。术语“存储介质”可以包括可以驻留在不同位置中(例如在通过网络连接的不同计算机系统中)的两个或更多存储介质。存储介质可以存储可由一个或多个处理器执行的程序指令(例如具体实现为计算机程序)。storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROMs, floppy disks, or tape devices; computer system memory or random access memory, such as DRAM, DDRRAM, SRAM, EDORAM, Rambus RAM, etc.; non-volatile Volatile memory, such as flash memory, magnetic media (eg hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a second, different computer system connected to the first computer system through a network such as the Internet. The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (eg, in different computer systems connected by a network). The storage medium may store program instructions (eg, embodied as a computer program) executable by one or more processors.
当然,本申请实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的批量ISO创建CephX认证虚拟机的实现方法,还可以执行本申请任意实施例所提供的批量ISO创建CephX认证虚拟机的实现方法中的相关操作。Of course, a storage medium containing computer-executable instructions provided by the embodiments of the present application, the computer-executable instructions of which are not limited to the above-mentioned method for implementing batch ISO creation of a CephX certified virtual machine, and can also execute any embodiment of the present application. Relevant operations in the implementation method of the provided batch ISO to create a CephX certified virtual machine.
上述实施例中提供的批量ISO创建CephX认证虚拟机的实现装置、存储介质及计算机设备可执行本申请任意实施例所提供的批量ISO创建CephX认证虚拟机的实现方法,未在上述实施例中详尽描述的技术细节,可参见本申请任意实施例所提供的批量ISO创建CephX认证虚拟机的实现方法。The implementation device, storage medium, and computer equipment for creating a CephX certified virtual machine in batches provided in the above-mentioned embodiments can execute the implementation method for creating a CephX-certified virtual machine in batches provided by any embodiment of the present application, which is not described in detail in the above-mentioned embodiments. For the technical details of the description, reference may be made to the implementation method for batch ISO creation of a CephX certified virtual machine provided by any embodiment of this application.
上述仅为本申请的较佳实施例及所运用的技术原理。本申请不限于这里所述的特定实施例,对本领域技术人员来说能够进行的各种明显变化、重新调整及替代均不会脱离本申请的保护范围。因此,虽然通过以上实施例对本申请进行了较为详细的说明,但是本申请不仅仅限于以上实施例,在不脱离本申请构思的情况下,还可以包括更多其他等效实施例,而本申请的范围由权利要求的范围决定。The above are only the preferred embodiments of the present application and the applied technical principles. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not depart from the protection scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present application. The scope is determined by the scope of the claims.

Claims (10)

  1. 一种批量ISO创建CephX认证虚拟机的实现方法,其特征在于,所述方法包括以下步骤:A method for implementing a batch ISO to create a CephX certified virtual machine, characterized in that the method comprises the following steps:
    预设唯一约束的映像缓存记录表和映像缓存映射记录表,所述映像缓存记录表用于记录目标节点中的映像缓存,所述映像缓存映射记录表用于记录目标节点中的映像缓存映射;an image cache record table and an image cache mapping record table with preset unique constraints, the image cache record table is used to record the image cache in the target node, and the image cache mapping record table is used to record the image cache mapping in the target node;
    通过所述映像缓存记录表判断目标节点是否已经存在映像缓存;Determine whether the target node already has an image cache by using the image cache record table;
    根据映像缓存的判断结果保存记录并向镜像节点组件发起映像分发请求;Save the record according to the judgment result of the image cache and initiate an image distribution request to the mirror node component;
    所述镜像节点组件收到映像分发请求后,根据预设的映像分发规则,进行映像分发缓存;After receiving the image distribution request, the image node component performs image distribution and caching according to a preset image distribution rule;
    通过所述映像缓存映射记录表判断目标节点是否已经存在映像缓存映射;Determine whether the target node already has an image cache mapping by using the image cache mapping record table;
    根据映像缓存映射的判断结果保存记录并向计算节点组件发起映像缓存映射请求;According to the judgment result of the image cache mapping, save the record and initiate the image cache mapping request to the computing node component;
    所述计算节点组件收到映像缓存映射请求后,根据预设的映像缓存映射规则,进行映像缓存映射。After receiving the image cache mapping request, the computing node component performs image cache mapping according to a preset image cache mapping rule.
  2. 根据权利要求1所述的批量ISO创建CephX认证虚拟机的实现方法,其特征在于,所述根据映像缓存的判断结果保存记录并向镜像节点组件发起映像分发请求,包括:The method for creating a CephX certified virtual machine by batch ISO according to claim 1, wherein the storing a record according to the judgment result of the image cache and initiating an image distribution request to the mirror node component comprises:
    若存在映像缓存,且分发状态为活跃状态,则在映像缓存记录表中保存映像缓存记录;If there is an image cache and the distribution state is active, save the image cache record in the image cache record table;
    若保存映像缓存记录成功,则设置分发操作的标记为第一标记,并向镜像节点组件发起映像分发请求;If saving the image cache record is successful, set the mark of the distribution operation as the first mark, and initiate an image distribution request to the mirror node component;
    若保存映像缓存记录失败,则设置分发操作的标记为第二标记,并向镜像节点组件发起映像分发请求;If saving the image cache record fails, set the mark of the distribution operation as the second mark, and initiate an image distribution request to the mirror node component;
    若不存在映像缓存,则重新通过所述映像缓存记录表判断目标节点是否已经存在映像缓存。If there is no image cache, the image cache record table is used to determine whether the target node already has an image cache.
  3. 根据权利要求2所述的批量ISO创建CephX认证虚拟机的实现方法,其特征在于,所述镜像节点组件收到映像分发请求后,根据预设的映像分发规则,进行映像分发缓存,包括:The method for implementing a CephX certified virtual machine by batch ISO according to claim 2, wherein after receiving the image distribution request, the image node component performs image distribution and cache according to a preset image distribution rule, including:
    所述镜像节点组件收到映像分发请求后,判断分发操作的标记,若分发操作的标记为第一标记,则进行映像分发缓存;After receiving the image distribution request, the mirror node component determines the mark of the distribution operation, and if the mark of the distribution operation is the first mark, performs image distribution and cache;
    若分发操作的标记为第二标记,则进行循环检测,通过控制节点调用分发 状态的同步消息,直到分发状态为活跃状态则反馈给控制节点映像缓存分发成功;If the mark of the distribution operation is the second mark, then loop detection is carried out, and the synchronization message of the distribution state is called by the control node, until the distribution state is the active state, then feedback to the control node image cache distribution is successful;
    当循环检测时间超过预设门限值,则反馈映像缓存分发失败状态给控制节点,进入回滚状态。When the cycle detection time exceeds the preset threshold value, the image cache distribution failure state is fed back to the control node, and the rollback state is entered.
  4. 根据权利要求1所述的批量ISO创建CephX认证虚拟机的实现方法,其特征在于,所述根据映像缓存映射的判断结果保存记录并向计算节点组件发起映像缓存映射请求,包括:The method for creating a CephX certified virtual machine by batch ISO according to claim 1, wherein the storing a record according to the judgment result of the image cache mapping and initiating an image cache mapping request to the computing node component, comprising:
    若存在映像缓存映射,且映射状态为活跃状态,则在映像缓存映射记录表中保存映像缓存映射记录;If there is an image cache mapping and the mapping state is active, save the image cache mapping record in the image cache mapping record table;
    若保存映像缓存映射记录成功,则设置映射操作的标记为第三标记,并向计算节点组件发起映像缓存映射请求;If saving the image cache mapping record is successful, set the tag of the mapping operation as the third tag, and initiate an image cache mapping request to the computing node component;
    若保存映像缓存映射记录失败,则设置映射操作的标记为第四标记,并向计算节点组件发起映像缓存映射请求;If saving the image cache mapping record fails, set the tag of the mapping operation to the fourth tag, and initiate an image cache mapping request to the computing node component;
    若不存在映像缓存映射,则重新通过所述映像缓存映射记录表判断目标节点是否已经存在映像缓存映射。If there is no image cache mapping, the image cache mapping record table is used to determine whether the target node already has an image cache mapping.
  5. 根据权利要求4所述的批量ISO创建CephX认证虚拟机的实现方法,其特征在于,所述计算节点组件收到映像缓存映射请求后,根据预设的映像缓存映射规则,进行映像缓存映射,包括:The method for implementing a batch ISO to create a CephX certified virtual machine according to claim 4, wherein after receiving the image cache mapping request, the computing node component performs image cache mapping according to a preset image cache mapping rule, comprising: :
    所述计算节点组件收到映像缓存映射请求后,判断映射操作的标记,若映射操作的标记为第三标记,则进行映像缓存映射;After receiving the image cache mapping request, the computing node component determines the mark of the mapping operation, and if the mark of the mapping operation is the third mark, performs the image cache mapping;
    若映射操作的标记为第四标记,则进行循环检测,通过控制节点调用映射状态,直到映射状态为活跃状态时则反馈给控制节点映像缓存映射成功;If the mark of the mapping operation is the fourth mark, perform loop detection, call the mapping state through the control node, and feed back to the control node image cache that the mapping is successful until the mapping state is active;
    当循环检测时间超过预设门限值,则反馈映像缓存映射失败状态给控制节点,进入回滚状态。When the cycle detection time exceeds the preset threshold value, the image cache mapping failure state is fed back to the control node, and the rollback state is entered.
  6. 根据权利要求1所述的批量ISO创建CephX认证虚拟机的实现方法,其特征在于,所述映像缓存记录表包括第一ID、第一映像ID、存储目标、存储类型、分发状态和资源类型六个字段;所述第一ID为唯一约束字段,所述第一ID由所述第一映像ID、所述存储目标、所述存储类型和所述资源类型四个字段的值组合而成;The method for implementing batch ISO creation of CephX certified virtual machines according to claim 1, wherein the image cache record table includes a first ID, a first image ID, a storage target, a storage type, a distribution state, and a resource type VI. The first ID is a unique constraint field, and the first ID is formed by combining the values of the first image ID, the storage target, the storage type and the resource type four fields;
    所述映像缓存映射记录表包括第二ID、第二映像ID、节点名、存储池名、映射路径和映射状态六个字段;所述第二ID为唯一约束字段,所述第二ID由 映像ID、节点名、存储池名三个字段的值组合而成。The image cache mapping record table includes six fields: the second ID, the second image ID, the node name, the storage pool name, the mapping path and the mapping state; the second ID is a unique constraint field, and the second ID is determined by the image. It is composed of the values of the three fields of ID, node name, and storage pool name.
  7. 根据权利要求1所述的批量ISO创建CephX认证虚拟机的实现方法,其特征在于,所述进行映像缓存映射,包括:The method for implementing a batch ISO to create a CephX certified virtual machine according to claim 1, wherein the performing image cache mapping comprises:
    通过RBD块的map命令将RBD块设备映射到虚拟机操作系统。The RBD block device is mapped to the virtual machine operating system through the map command of the RBD block.
  8. 根据权利要求1所述的批量ISO创建CephX认证虚拟机的实现方法,其特征在于,所述计算节点组件收到映像缓存映射请求后,根据预设的映像缓存映射规则,进行映像缓存映射之后,还包括:The method for creating a CephX certified virtual machine by batch ISO according to claim 1, wherein after receiving the image cache mapping request, the computing node component performs image cache mapping according to a preset image cache mapping rule, Also includes:
    通过映射ISO缓存的设备路径来修改虚拟机的配置文件。Modify the virtual machine's configuration file by mapping the ISO cached device path.
  9. 一种批量ISO创建CephX认证虚拟机的实现装置,其特征在于,包括:A realization device for creating a CephX certified virtual machine in batches by ISO, comprising:
    记录表预设模块,用于预设唯一约束的映像缓存记录表和映像缓存映射记录表,所述映像缓存记录表用于记录目标节点中的映像缓存,所述映像缓存映射记录表用于记录目标节点中的映像缓存映射;A record table preset module is used to preset a uniquely constrained image cache record table and an image cache mapping record table, the image cache record table is used to record the image cache in the target node, and the image cache mapping record table is used to record Image cache mapping in the target node;
    映像缓存判断模块,用于通过所述映像缓存记录表判断目标节点是否已经存在映像缓存;an image cache judging module, configured to judge whether the target node already has an image cache through the image cache record table;
    分发请求发送模块,用于根据映像缓存的判断结果保存记录并向镜像节点组件发起映像分发请求;The distribution request sending module is used to save the record according to the judgment result of the image cache and initiate an image distribution request to the mirror node component;
    分发缓存执行模块,用于所述镜像节点组件收到映像分发请求后,根据预设的映像分发规则,进行映像分发缓存;a distribution cache execution module, configured to perform image distribution and cache according to preset image distribution rules after the image node component receives the image distribution request;
    映像缓存映射判断模块,用于通过所述映像缓存映射记录表判断目标节点是否已经存在映像缓存映射;an image cache mapping judging module, used for judging whether the target node already has an image cache mapping through the image cache mapping record table;
    映射请求发送模块,用于根据映像缓存映射的判断结果保存记录并向计算节点组件发起映像缓存映射请求;The mapping request sending module is used to save the record according to the judgment result of the image cache mapping and initiate the image cache mapping request to the computing node component;
    映像缓存映射执行模块,用于所述计算节点组件收到映像缓存映射请求后,根据预设的映像缓存映射规则,进行映像缓存映射。The image cache mapping execution module is configured to perform image cache mapping according to preset image cache mapping rules after the computing node component receives the image cache mapping request.
  10. 一种包含计算机可执行指令的存储介质,其特征在于,所述计算机可执行指令在由计算机处理器执行时用于执行如权利要求1-8任一所述的一种批量ISO创建CephX认证虚拟机的实现方法。A storage medium comprising computer-executable instructions, wherein the computer-executable instructions, when executed by a computer processor, are used to execute a batch ISO creation CephX authentication virtual machine according to any one of claims 1-8. machine implementation method.
PCT/CN2021/085465 2020-12-30 2021-04-02 Method and apparatus for implementing batch iso creation of cephx authentication virtual machines WO2022141922A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011626993.5A CN112631732B (en) 2020-12-30 2020-12-30 Implementation method and device for creating CephX authentication virtual machines by batch ISO
CN202011626993.5 2020-12-30

Publications (1)

Publication Number Publication Date
WO2022141922A1 true WO2022141922A1 (en) 2022-07-07

Family

ID=75290025

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/085465 WO2022141922A1 (en) 2020-12-30 2021-04-02 Method and apparatus for implementing batch iso creation of cephx authentication virtual machines

Country Status (2)

Country Link
CN (1) CN112631732B (en)
WO (1) WO2022141922A1 (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101419535A (en) * 2008-11-19 2009-04-29 北京航空航天大学 Distributed virtual magnetic disc system of virtual machine
KR20130126257A (en) * 2012-05-11 2013-11-20 네이버비즈니스플랫폼 주식회사 File cache system and method using allocation table and system and method for distributing file cache application
US20140108722A1 (en) * 2012-10-15 2014-04-17 Red Hat Israel, Ltd. Virtual machine installation image caching
US8806489B2 (en) * 2012-07-05 2014-08-12 International Business Machines Corporation Virtual machine image distribution network
CN105573820A (en) * 2015-12-15 2016-05-11 国云科技股份有限公司 Hot plug method for Xen virtual machine compact disc
CN106095527A (en) * 2016-06-07 2016-11-09 国云科技股份有限公司 A kind of storage pool implementation method being applicable to cloud platform virtual machine
CN107329704A (en) * 2017-06-30 2017-11-07 杭州宏杉科技股份有限公司 One kind caching mirror method and controller
CN107634853A (en) * 2017-08-28 2018-01-26 深圳市云舒网络技术有限公司 A kind of customizable distributed caching method based on object storage
CN111831399A (en) * 2020-07-21 2020-10-27 浪潮云信息技术股份公司 Data synchronization method and system of shared disk based on Ceph storage back-end volume

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102307207A (en) * 2010-09-25 2012-01-04 广东电子工业研究院有限公司 System and method for online customizing virtual machine image
CN105573679B (en) * 2015-12-18 2019-10-11 国云科技股份有限公司 A method of suitable for distributed memory system storage pool resource impact rule
US10896129B2 (en) * 2017-08-07 2021-01-19 Dynavisor, Inc. Method and system for storage virtualization
CN111638855A (en) * 2020-06-03 2020-09-08 山东汇贸电子口岸有限公司 Method for physical bare computer to support Ceph back-end volume

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101419535A (en) * 2008-11-19 2009-04-29 北京航空航天大学 Distributed virtual magnetic disc system of virtual machine
KR20130126257A (en) * 2012-05-11 2013-11-20 네이버비즈니스플랫폼 주식회사 File cache system and method using allocation table and system and method for distributing file cache application
US8806489B2 (en) * 2012-07-05 2014-08-12 International Business Machines Corporation Virtual machine image distribution network
US20140108722A1 (en) * 2012-10-15 2014-04-17 Red Hat Israel, Ltd. Virtual machine installation image caching
CN105573820A (en) * 2015-12-15 2016-05-11 国云科技股份有限公司 Hot plug method for Xen virtual machine compact disc
CN106095527A (en) * 2016-06-07 2016-11-09 国云科技股份有限公司 A kind of storage pool implementation method being applicable to cloud platform virtual machine
CN107329704A (en) * 2017-06-30 2017-11-07 杭州宏杉科技股份有限公司 One kind caching mirror method and controller
CN107634853A (en) * 2017-08-28 2018-01-26 深圳市云舒网络技术有限公司 A kind of customizable distributed caching method based on object storage
CN111831399A (en) * 2020-07-21 2020-10-27 浪潮云信息技术股份公司 Data synchronization method and system of shared disk based on Ceph storage back-end volume

Also Published As

Publication number Publication date
CN112631732A (en) 2021-04-09
CN112631732B (en) 2024-03-29

Similar Documents

Publication Publication Date Title
JP6529617B2 (en) Selective retention of application program data to be migrated from system memory to non-volatile data storage
US10819701B2 (en) Autonomous secrets management for a managed service identity
US9426147B2 (en) Protected device management
JP4782871B2 (en) Device access control program, device access control method, and information processing apparatus
US9720721B2 (en) Protected guests in a hypervisor controlled system
EP3766203B1 (en) Autonomous secrets renewal and distribution
US20190286813A1 (en) Autonomous secrets management for a temporary shared access signature service
US9639691B2 (en) Dynamic database and API-accessible credentials data store
JP4941556B2 (en) ENCRYPTION DEVICE, ENCRYPTION METHOD, AND ENCRYPTION PROGRAM
CN107817951B (en) Method and device for realizing Ceph cluster fusion
US10992746B2 (en) Automatic system response to external field-replaceable unit (FRU) process
TWI550630B (en) Access controlled memory region
US20170139637A1 (en) A method of live migration
US20230221784A1 (en) System and method for power state enforced subscription management
CN111858077A (en) Recording method, device and equipment for IO request log in storage system
WO2022141922A1 (en) Method and apparatus for implementing batch iso creation of cephx authentication virtual machines
EP3777017A1 (en) Ephemeral regions within non-volatile memory devices
CN111414610A (en) Method and device for determining database verification password
WO2023016414A1 (en) Credential rotation method, computing device, and storage medium
JP2020135571A (en) Computer system, computer device and lincense management method
US9058503B2 (en) Systems and methods for secure storage on a mobile device
US20240095338A1 (en) Isolated runtime environments for securing secrets used to access remote resources from compute instances
US11757648B2 (en) System and method for remote startup management
CN113485790B (en) Restarting method, migration method and related equipment of virtual machine
US20230155997A1 (en) System and method for authenticating devices in distributed environment

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

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

Country of ref document: EP

Kind code of ref document: A1