Virtualization platform-based host resource synchronization method, system and device

文档序号:1875311 发布日期:2021-11-23 浏览:14次 中文

阅读说明:本技术 一种基于虚拟化平台的主机资源同步方法、系统及装置 (Virtualization platform-based host resource synchronization method, system and device ) 是由 郑维栋 颜秉珩 于 2021-07-30 设计创作,主要内容包括:本发明公开了一种基于虚拟化平台的主机资源同步方法、系统及装置,在检测到虚拟化平台对应的物理主机异常断电时,基于物理主机上的任务运行情况,为物理主机配置资源同步信息,并将资源同步信息保存至预设主机资源同步配置库;在检测到目标主机上线后,判断主机资源同步配置库中是否存在目标主机对应的目标资源同步信息;若是,则根据目标资源同步信息,执行目标主机的同步资源操作,并在同步资源操作成功完成后,允许目标主机上线;若否,则允许目标主机直接上线。可见,本申请可在虚拟化平台对应的物理主机上线后,自动同步主机资源,保证了管理层和主机层的资源一致性,且提高了资源同步效率。(The invention discloses a method, a system and a device for synchronizing host resources based on a virtualization platform, wherein when abnormal power failure of a physical host corresponding to the virtualization platform is detected, resource synchronization information is configured for the physical host based on task running conditions on the physical host, and the resource synchronization information is stored in a preset host resource synchronization configuration library; after detecting that the target host is on-line, judging whether target resource synchronization information corresponding to the target host exists in a host resource synchronization configuration library or not; if yes, executing the synchronous resource operation of the target host according to the target resource synchronous information, and allowing the target host to be online after the synchronous resource operation is successfully completed; and if not, allowing the target host to be directly on-line. Therefore, the method and the system can automatically synchronize the host resources after the physical host corresponding to the virtualization platform is online, ensure the resource consistency of the management layer and the host layer, and improve the resource synchronization efficiency.)

1. A host resource synchronization method based on a virtualization platform is applied to a processor and comprises the following steps:

when detecting that a physical host corresponding to a virtualization platform is abnormally powered off, configuring resource synchronization information for the physical host based on a task running condition on the physical host, and storing the resource synchronization information to a preset host resource synchronization configuration library;

after detecting that a target host is on-line, judging whether target resource synchronization information corresponding to the target host exists in the host resource synchronization configuration library or not; wherein the target host is any one of the physical hosts;

if yes, executing the synchronous resource operation of the target host according to the target resource synchronous information, and allowing the target host to be online after the synchronous resource operation is successfully completed;

and if not, allowing the target host to be directly on-line.

2. The virtualization platform-based host resource synchronization method of claim 1, wherein the process of configuring the resource synchronization information for the physical host based on the task running condition on the physical host comprises:

based on the target task which is executed in failure on the physical host and the executed degree of the target task, configuring resource synchronization event information representing the event to be synchronized corresponding to the target task, and configuring a plurality of host resources related to the event to be synchronized and a plurality of event item information representing the resource synchronization process for the event to be synchronized one by one; wherein the resource synchronization event information and the event item information together constitute the resource synchronization information.

3. The virtualization platform-based host resource synchronization method according to claim 2, wherein the resource synchronization event information includes a host id of the physical host, a target task id, an event id and an event state to be synchronized, an execution order of each target task, and an execution order of each event to be synchronized within the same target task;

executing the process of synchronizing the resource operation of the physical host according to the resource synchronization event information and the event item information, including:

determining an abnormally powered-off physical host according to the host id in the resource synchronization event information;

determining a target task which is failed to execute and corresponds to the abnormally powered-off physical host according to a target task id in the resource synchronization event information;

determining the event to be synchronized corresponding to the target task which fails to execute according to the event id to be synchronized in the resource synchronization event information;

determining the event to be synchronized to be executed according to the event state of the event to be synchronized;

determining the execution sequence of all to-be-synchronized events to be executed corresponding to each target task according to the execution sequence of each target task and the execution sequence of each to-be-synchronized event in the same target task;

and sequentially executing the events to be synchronized according to the execution sequence of all the events to be synchronized waiting for execution and a plurality of event item information corresponding to each event to be synchronized.

4. The virtualization platform-based host resource synchronization method of claim 3, wherein the event item information includes a resource type, a rest interface address used by the synchronization resource, a resource id, an event item priority, a retry number, a timeout time, and whether a failure is skipped or not;

executing the process of the event to be synchronized according to the information of the event items corresponding to the event to be synchronized, including:

determining the execution sequence of each event item corresponding to the event to be synchronized according to the priority of the event item in the target event item information; the target event item information represents event item information corresponding to a target event item, and the target event item is any one event item;

and executing each event item in sequence according to the execution sequence of each event item, the resource type corresponding to the target event item, the rest interface address used by the synchronous resource, the resource id, the retry frequency, the timeout time and whether the failure skips the series of information.

5. The virtualization platform-based host resource synchronization method of claim 4, wherein the executing the target event item according to a series of information including a resource type corresponding to the target event item, a rest interface address used by a synchronization resource, a resource id, a retry number, a timeout time, and whether a failure skips over the target event item comprises:

determining the resource type related to the target event item according to the resource type in the target event item information;

determining a rest interface of the resource related to the target event item according to the rest interface address used by the synchronous resource in the target event item information;

determining the resource to be synchronized corresponding to the target event item according to the resource id in the target event item information;

according to the retry times, the timeout time and whether the failure is skipped in the target event item information, sequentially determining the times of the target event item allowed to be repeatedly executed, the allowed longest execution time and whether the final execution failure allows the next event item to be directly skipped and executed;

and executing the target event item according to a series of information including a rest interface corresponding to the target event item, resources to be synchronized, the number of times of allowing repeated execution, the allowed longest execution time and whether the final execution failure allows the execution of the next event item to be directly skipped.

6. The virtualization platform-based host resource synchronization method of claim 5, wherein the resource types include a CPU, a memory, a virtual machine, a storage pool, a disk, a network card, and a port;

determining the resource type related to the target event item according to the resource type in the target event item information, wherein the process comprises the following steps:

and determining the resource type related to the target event item from a plurality of resource types including a CPU, a memory, a virtual machine, a storage pool, a disk, a network card and a port according to the resource type in the target event item information.

7. The virtualization platform-based host resource synchronization method of claim 2, wherein the process of executing the synchronization resource operation of the target host according to the target resource synchronization information comprises:

loading all resource synchronization event information and event item information corresponding to the target host from the host resource synchronization configuration library into a queue to be executed;

and sequentially executing synchronous resource operation of the target host based on the resource synchronous event information and the event item information in the queue to be executed.

8. The virtualization platform based host resource synchronization method of any one of claims 1-7, wherein the virtualization platform based host resource synchronization method further comprises:

recording resource synchronization related logs into a preset synchronization log library when the synchronous resource operation of the target host is executed;

and if the synchronous resource operation of the target host fails, carrying out manual intervention reminding so as to manually finish the synchronous resource operation of the target host according to the log information in the synchronous log library.

9. A virtualization platform-based host resource synchronization system, comprising:

the information configuration module is used for configuring resource synchronization information for the physical host based on the task running condition on the physical host when detecting that the physical host corresponding to the virtualization platform is abnormally powered off, and storing the resource synchronization information to a preset host resource synchronization configuration library;

the synchronization judging module is used for judging whether target resource synchronization information corresponding to a target host exists in the host resource synchronization configuration library or not after the target host is detected to be on-line; if yes, executing a synchronous online module; if not, executing a direct online module; wherein the target host is any one of the physical hosts;

the synchronous online module is used for executing synchronous resource operation of the target host according to the target resource synchronous information and allowing the target host to be online after the synchronous resource operation is successfully completed;

and the direct online module is used for allowing the target host to be directly online.

10. A virtualization platform-based host resource synchronization apparatus, comprising:

a memory for storing a computer program;

a processor for implementing the steps of the virtualization platform based host resource synchronization method according to any one of claims 1-8 when executing said computer program.

Technical Field

The present invention relates to the field of virtualization platforms, and in particular, to a method, a system, and an apparatus for host resource synchronization based on a virtualization platform.

Background

In the virtualization platform, a management end of the virtualization platform issues a task to a physical host corresponding to the virtualization platform, the physical host executes an operation step corresponding to the task according to the issued task, and feeds back a message that the task is completed to the platform management end when the task is completed. If the physical host is abnormally powered off, the task in the running state on the physical host fails to execute. For these tasks that fail to be executed, the physical host may have already executed some operations for creating resources, for example, a task includes operations for creating a disk and configuring a network card, and the physical host may have already completed operations for creating a disk when the physical host is abnormally powered off, but after the physical host is abnormally powered off, the platform management end loses communication with the physical host, and the platform management end only knows that the physical host has failed to execute the task and does not know that the physical host has completed operations for creating a disk, and in this case, the host resources displayed on the management interface do not have a created disk corresponding to the task, resulting in inconsistency between resources of the management layer and the host layer. At present, after the physical host goes online again, manual intervention is needed to realize resource synchronization of the management layer and the host layer, but the resource synchronization mode of manual intervention is time-consuming, so that the resource synchronization efficiency is low.

Therefore, how to provide a solution to the above technical problem is a problem that needs to be solved by those skilled in the art.

Disclosure of Invention

The invention aims to provide a method, a system and a device for synchronizing host resources based on a virtualization platform, which can automatically synchronize host resources after a physical host corresponding to the virtualization platform is online, ensure the resource consistency of a management layer and a host layer and improve the resource synchronization efficiency.

In order to solve the above technical problem, the present invention provides a virtualization platform-based host resource synchronization method, applied to a processor, including:

when detecting that a physical host corresponding to a virtualization platform is abnormally powered off, configuring resource synchronization information for the physical host based on a task running condition on the physical host, and storing the resource synchronization information to a preset host resource synchronization configuration library;

after detecting that a target host is on-line, judging whether target resource synchronization information corresponding to the target host exists in the host resource synchronization configuration library or not; wherein the target host is any one of the physical hosts;

if yes, executing the synchronous resource operation of the target host according to the target resource synchronous information, and allowing the target host to be online after the synchronous resource operation is successfully completed;

and if not, allowing the target host to be directly on-line.

Preferably, the process of configuring resource synchronization information for the physical host based on the task running condition on the physical host includes:

based on the target task which is executed in failure on the physical host and the executed degree of the target task, configuring resource synchronization event information representing the event to be synchronized corresponding to the target task, and configuring a plurality of host resources related to the event to be synchronized and a plurality of event item information representing the resource synchronization process for the event to be synchronized one by one; wherein the resource synchronization event information and the event item information together constitute the resource synchronization information.

Preferably, the resource synchronization event information includes a host id of the physical host, a target task id, an event id to be synchronized, an event state, an execution sequence of each target task, and an execution sequence of each event to be synchronized in the same target task;

executing the process of synchronizing the resource operation of the physical host according to the resource synchronization event information and the event item information, including:

determining an abnormally powered-off physical host according to the host id in the resource synchronization event information;

determining a target task which is failed to execute and corresponds to the abnormally powered-off physical host according to a target task id in the resource synchronization event information;

determining the event to be synchronized corresponding to the target task which fails to execute according to the event id to be synchronized in the resource synchronization event information;

determining the event to be synchronized to be executed according to the event state of the event to be synchronized;

determining the execution sequence of all to-be-synchronized events to be executed corresponding to each target task according to the execution sequence of each target task and the execution sequence of each to-be-synchronized event in the same target task;

and sequentially executing the events to be synchronized according to the execution sequence of all the events to be synchronized waiting for execution and a plurality of event item information corresponding to each event to be synchronized.

Preferably, the event item information includes a resource type, a rest interface address used by a synchronization resource, a resource id, an event item priority, a retry number, a timeout time, and whether a failure is skipped;

executing the process of the event to be synchronized according to the information of the event items corresponding to the event to be synchronized, including:

determining the execution sequence of each event item corresponding to the event to be synchronized according to the priority of the event item in the target event item information; the target event item information represents event item information corresponding to a target event item, and the target event item is any one event item;

and executing each event item in sequence according to the execution sequence of each event item, the resource type corresponding to the target event item, the rest interface address used by the synchronous resource, the resource id, the retry frequency, the timeout time and whether the failure skips the series of information.

Preferably, the process of executing the target event item according to a series of information including a resource type corresponding to the target event item, a rest interface address used by a synchronization resource, a resource id, a retry number, a timeout time, and whether a failure skips or not includes:

determining the resource type related to the target event item according to the resource type in the target event item information;

determining a rest interface of the resource related to the target event item according to the rest interface address used by the synchronous resource in the target event item information;

determining the resource to be synchronized corresponding to the target event item according to the resource id in the target event item information;

according to the retry times, the timeout time and whether the failure is skipped in the target event item information, sequentially determining the times of the target event item allowed to be repeatedly executed, the allowed longest execution time and whether the final execution failure allows the next event item to be directly skipped and executed;

and executing the target event item according to a series of information including a rest interface corresponding to the target event item, resources to be synchronized, the number of times of allowing repeated execution, the allowed longest execution time and whether the final execution failure allows the execution of the next event item to be directly skipped.

Preferably, the resource types include a CPU, a memory, a virtual machine, a storage pool, a disk, a network card, and a port;

determining the resource type related to the target event item according to the resource type in the target event item information, wherein the process comprises the following steps:

and determining the resource type related to the target event item from a plurality of resource types including a CPU, a memory, a virtual machine, a storage pool, a disk, a network card and a port according to the resource type in the target event item information.

Preferably, the process of executing the synchronous resource operation of the target host according to the target resource synchronization information includes:

loading all resource synchronization event information and event item information corresponding to the target host from the host resource synchronization configuration library into a queue to be executed;

and sequentially executing synchronous resource operation of the target host based on the resource synchronous event information and the event item information in the queue to be executed.

Preferably, the virtualization platform-based host resource synchronization method further includes:

recording resource synchronization related logs into a preset synchronization log library when the synchronous resource operation of the target host is executed;

and if the synchronous resource operation of the target host fails, carrying out manual intervention reminding so as to manually finish the synchronous resource operation of the target host according to the log information in the synchronous log library.

In order to solve the above technical problem, the present invention further provides a system for synchronizing host resources based on a virtualization platform, including:

the information configuration module is used for configuring resource synchronization information for the physical host based on the task running condition on the physical host when detecting that the physical host corresponding to the virtualization platform is abnormally powered off, and storing the resource synchronization information to a preset host resource synchronization configuration library;

the synchronization judging module is used for judging whether target resource synchronization information corresponding to a target host exists in the host resource synchronization configuration library or not after the target host is detected to be on-line; if yes, executing a synchronous online module; if not, executing a direct online module; wherein the target host is any one of the physical hosts;

the synchronous online module is used for executing synchronous resource operation of the target host according to the target resource synchronous information and allowing the target host to be online after the synchronous resource operation is successfully completed;

and the direct online module is used for allowing the target host to be directly online.

Preferably, the process of configuring resource synchronization information for the physical host based on the task running condition on the physical host includes:

and configuring resource synchronization event information representing events to be synchronized corresponding to the target tasks based on the target tasks which are executed in failure on the physical host and the executed degree of the target tasks, and configuring a plurality of host resources related to the events to be synchronized and a plurality of event item information representing the resource synchronization process for the events to be synchronized one by one.

Preferably, the resource synchronization event information includes a host id of the physical host, a target task id, an event id to be synchronized, an event state, an execution sequence of each target task, and an execution sequence of each event to be synchronized in the same target task;

the event item information comprises a resource type, a rest interface address used by a synchronous resource, a resource id, an event item priority, retry times, timeout time and whether failure is skipped or not.

In order to solve the above technical problem, the present invention further provides a virtualization platform-based host resource synchronization apparatus, including:

a memory for storing a computer program;

a processor for implementing the steps of any one of the above virtualization platform based host resource synchronization methods when executing the computer program.

The invention provides a host resource synchronization method based on a virtualization platform, which is applied to a processor. When detecting that a physical host corresponding to the virtualization platform is abnormally powered off, configuring resource synchronization information for the physical host based on task running conditions on the physical host, and storing the resource synchronization information to a preset host resource synchronization configuration library; after detecting that the target host is on-line, judging whether target resource synchronization information corresponding to the target host exists in a host resource synchronization configuration library or not; if yes, executing the synchronous resource operation of the target host according to the target resource synchronous information, and allowing the target host to be online after the synchronous resource operation is successfully completed; and if not, allowing the target host to be directly on-line. Therefore, the method and the system can automatically synchronize the host resources after the physical host corresponding to the virtualization platform is online, ensure the resource consistency of the management layer and the host layer, and improve the resource synchronization efficiency.

The invention also provides a system and a device for synchronizing the host resources based on the virtualization platform, which have the same beneficial effects as the host resource synchronization method.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed in the prior art and the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.

Fig. 1 is a flowchart of a host resource synchronization method based on a virtualization platform according to an embodiment of the present invention;

fig. 2 is a flowchart illustrating a host power-off exception handling process based on a virtualization platform according to an embodiment of the present invention;

fig. 3 is a flowchart of a host online resource synchronization process based on a virtualization platform according to an embodiment of the present invention;

fig. 4 is a schematic structural diagram of a host resource synchronization system based on a virtualization platform according to an embodiment of the present invention.

Detailed Description

The core of the invention is to provide a method, a system and a device for synchronizing host resources based on a virtualization platform, which can synchronize host resources after a physical host corresponding to the virtualization platform is online, ensure the resource consistency of a management layer and a host layer and improve the resource synchronization efficiency.

In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Referring to fig. 1, fig. 1 is a flowchart illustrating a host resource synchronization method based on a virtualization platform according to an embodiment of the present invention.

The host resource synchronization method based on the virtualization platform comprises the following steps:

step S1: when detecting that a physical host corresponding to the virtualization platform is abnormally powered off, configuring resource synchronization information for the physical host based on task running conditions on the physical host, and storing the resource synchronization information to a preset host resource synchronization configuration library.

Specifically, the virtualization platform has more than one corresponding physical host. The method includes the steps of detecting whether each physical host corresponding to a virtualization platform is abnormally powered off or not, if the physical host corresponding to the virtualization platform is detected to be abnormally powered off, acquiring task running conditions on the physical host which is abnormally powered off, automatically configuring resource synchronization information for guiding host resource synchronization for the physical host which is abnormally powered off based on the task running conditions on the physical host which is abnormally powered off, and automatically storing the resource synchronization information to a preset host resource synchronization configuration library to provide basis for subsequent synchronous host resources.

More specifically, it is known that a management end of a virtualization platform issues a task to a physical host corresponding to the virtualization platform, the physical host executes an operation step corresponding to the task according to the task issued by the management end, if the physical host is abnormally powered off, the task in a running state on the physical host fails to be executed, the tasks that fail to be executed are key to cause resource inconsistency between a management layer and a host layer, and a process of acquiring a task running condition on the physical host that is abnormally powered off specifically includes: the method comprises the steps of obtaining tasks which are currently run by a physical host during abnormal power failure and the executed degrees of the tasks, determining the tasks which are currently run as failed-to-execute tasks corresponding to the physical host during abnormal power failure, and configuring resource synchronization information for the physical host during abnormal power failure based on the failed-to-execute tasks corresponding to the physical host during abnormal power failure and the executed degrees of the tasks.

Step S2: after detecting that the target host is on-line, judging whether target resource synchronization information corresponding to the target host exists in a host resource synchronization configuration library or not; if yes, go to step S3; if not, step S4 is executed. Step S3: and executing the synchronous resource operation of the target host according to the target resource synchronous information, and allowing the target host to be on-line after the synchronous resource operation is successfully completed. Step S4: allowing the target host to go directly online.

It should be noted that the target host in the present application refers to any physical host corresponding to the virtualization platform.

Specifically, the method detects whether a target host is online, automatically judges whether resource synchronization information (called target resource synchronization information) corresponding to the target host exists in a host resource synchronization configuration library if the target host is online, automatically executes synchronous resource operation of the target host according to the target resource synchronization information if the target resource synchronization information corresponding to the target host exists in the host resource synchronization configuration library and indicates that the resource of the target host is necessary to be synchronized, and allows the target host to be online after the synchronous resource operation of the target host is successfully completed (resource synchronization mode → online mode); if the target resource synchronization information corresponding to the target host does not exist in the host resource synchronization configuration library, which indicates that the resource of the target host does not need to be synchronized, the target host is allowed to be directly online (online mode).

Therefore, the method and the system can automatically synchronize the host resources after the physical host corresponding to the virtualization platform is online, ensure the resource consistency of the management layer and the host layer, and improve the resource synchronization efficiency.

On the basis of the above-described embodiment:

referring to fig. 2 and fig. 3, fig. 2 is a flowchart illustrating a host power-off exception handling method based on a virtualization platform according to an embodiment of the present invention, and fig. 3 is a flowchart illustrating a host online resource synchronization method based on a virtualization platform according to an embodiment of the present invention.

As an alternative embodiment, the process of configuring resource synchronization information for a physical host based on task running conditions on the physical host includes:

based on a target task which fails to be executed on a physical host and the executed degree of the target task, resource synchronization event information representing an event to be synchronized corresponding to the target task is configured, and a plurality of host resources related to the characterization event and a plurality of event item information of a resource synchronization process are configured for the event to be synchronized; and the resource synchronization event information and the event item information jointly form resource synchronization information.

Specifically, the configuration process of the resource synchronization information for guiding host resource synchronization in the present application is:

for any physical host with abnormal power failure, firstly, determining a task (called a target task) with execution failure corresponding to the physical host with abnormal power failure and the executed degree of the target task, then configuring resource synchronization event information (stored in a resource synchronization event library) for representing an event to be synchronized corresponding to the target task, and simultaneously configuring a plurality of host resources related to the characterization event and a plurality of event item information (stored in an event item library) of a resource synchronization process for the event to be synchronized corresponding to the target task, namely, one event item information represents one host resource related to the event to be synchronized and the synchronization process of the host resource.

For example, the task of creating a virtual machine by a physical host includes the following steps: 1) configuring a CPU (central processing unit); 2) configuring a memory; 3) creating a disk 1 and a disk 2; 4) and configuring a network card 1 and a network card 2. If a physical host only has one task of creating a first virtual machine, and is abnormally powered off when the disk 2 is created and the network card 1 is not configured, and the platform management end only knows that the task execution of the physical host fails, the process of configuring the resource synchronization information for the physical host is as follows: firstly, it is determined that a target task corresponding to the physical host, which is failed to execute, is a task for creating a first virtual machine, and the executed degree of the target task is that a disk 2 is created and a network card 1 is not configured, and it can be understood that events to be synchronized corresponding to the target task are: deleting the resources generated by the physical host when executing the task of creating the first virtual machine; the event to be synchronized corresponds to 4 event items, which are respectively the CPU resource generated when the physical host executes the task of creating the first virtual machine, the memory resource generated when the physical host executes the task of creating the first virtual machine, the disk 1 created when the physical host executes the task of creating the first virtual machine and the disk 2 created when the physical host executes the task of creating the first virtual machine, so that the resource synchronization event information is configured for the target task, and the event item information is configured for the event to be synchronized.

As an optional embodiment, the resource synchronization event information includes a host id of a physical host, a target task id, an event id to be synchronized, an event state, an execution sequence of each target task, and an execution sequence of each event to be synchronized in the same target task;

executing the process of resource synchronization operation of the physical host according to the resource synchronization event information and the event item information, including:

determining an abnormally powered-off physical host according to a host id in the resource synchronization event information;

determining a target task which is failed to be executed and corresponds to the physical host with abnormal power failure according to a target task id in the resource synchronization event information;

determining an event to be synchronized corresponding to a target task which fails to be executed according to an event id to be synchronized in the resource synchronization event information;

determining a to-be-synchronized event waiting to be executed according to the event state of the to-be-synchronized event;

determining the execution sequence of all to-be-synchronized events to be executed corresponding to each target task according to the execution sequence of each target task and the execution sequence of each to-be-synchronized event in the same target task;

and sequentially executing the events to be synchronized according to the execution sequence of all the events to be synchronized waiting for execution and the information of the event items corresponding to each event to be synchronized.

Specifically, the resource synchronization event information of the present application includes: 1) the host id (Identity document) of the abnormally powered-off physical host can determine the abnormally powered-off physical host through the host id; 2) the target task id of the execution failure corresponding to the abnormally powered-off physical host can determine the target task of the execution failure corresponding to the abnormally powered-off physical host through the target task id; 3) the id and the event state (default to be executed) of the event to be synchronized corresponding to the target task can determine the event to be synchronized corresponding to the target task through the id of the event to be synchronized, and determine the event to be synchronized to be executed based on the event state of the event to be synchronized; 4) the execution sequence of each target task and the execution sequence of each event to be synchronized in the same target task are used for sequentially executing each event to be synchronized in each target task based on a plurality of event item information corresponding to each event to be synchronized according to the execution sequence.

As an optional embodiment, the event item information includes a resource type, a rest interface address used by the synchronization resource, a resource id, an event item priority, a retry number, a timeout time, and whether a failure is skipped or not;

executing the process of the event to be synchronized according to the information of the event items corresponding to the event to be synchronized, wherein the process comprises the following steps:

determining the execution sequence of each event item corresponding to the event to be synchronized according to the priority of the event items in the target event item information; the target event item information represents event item information corresponding to the target event item, and the target event item is any event item;

and executing each event item in sequence according to the execution sequence of each event item, the resource type corresponding to the target event item, the rest interface address used by the synchronous resource, the resource id, the retry times, the timeout time and whether the failure skips the series of information.

This embodiment is described in detail in the following embodiments, and the description of this application is omitted here.

As an optional embodiment, according to a series of information including a resource type corresponding to the target event item, a rest interface address used by the synchronization resource, a resource id, a retry number, a timeout time, and whether a failure skips, a process of executing the target event item includes:

determining the resource type related to the target event item according to the resource type in the target event item information;

determining a rest interface of the resource related to the synchronous target event item according to the rest interface address used by the synchronous resource in the target event item information;

determining a resource to be synchronized corresponding to the target event item according to the resource id in the target event item information;

sequentially determining the times of allowing the target event item to be repeatedly executed, the allowed longest execution time and whether the final execution failure allows the next event item to be directly skipped to be executed or not according to the retry times, the timeout time and whether the failure is skipped or not in the target event item information;

and executing the target event item according to a series of information including a rest interface corresponding to the target event item, resources to be synchronized, the number of times of allowing repeated execution, the allowed longest execution time and whether the final execution failure allows the next event item to be directly skipped to be executed.

Specifically, the event item information of the present application includes: 1) the resource type related to the event item is the CPU resource if the event item is the CPU resource release; 2) a rest interface address used by the synchronous resource (the rest interface is specifically an atomic operation rest interface, and supports functions of creating the resource, synchronizing the resource state and deleting the resource); 3) and determining the resources (namely resources to be synchronized) of the operation corresponding to the event item through the resource id, and if the event item is a CPU resource generated when the task of the first virtual machine is created, determining the resources of the operation corresponding to the event item through the resource id as follows: creating CPU resources generated during a task of a first virtual machine; 4) event item priority, the execution order of the event items can be determined by the event item priority; 5) the retry number is used for setting the number of times that the single event item is allowed to fail, and the retry number can be repeatedly executed until the execution is successful; 6) the overtime time is used for setting the longest execution time of a single event item, and preventing the host from being in a resource synchronization mode for a long time and being incapable of being used normally; 7) whether the failure is skipped or not is used for setting whether the single event item is allowed to finally fail to execute but the normal execution result of the whole synchronous event is not influenced, namely whether the single event item is allowed to finally fail to finally execute the next event item or not is allowed to directly skip to execute the next event item (if the failure is allowed to skip, the next event item can be directly skipped to execute after the single event item is finally failed to execute, and if only the event item which is allowed to skip by the failure fails to execute, the synchronous resource operation is finally considered to be successful; if the failure does not allow skipping, the next event item is not executed after the final execution of the single event item fails, and the synchronous resource operation is determined to fail directly), so that the normal online of the host is ensured as much as possible. It should be noted that, the case where the single event item finally fails to execute is: the number of repeated executions of the single event item exceeds the set number of retries, and/or the execution time of the single event item exceeds the set timeout.

As an optional embodiment, the resource types include a CPU, a memory, a virtual machine, a storage pool, a disk, a network card, and a port;

determining the resource type related to the target event item according to the resource type in the target event item information, wherein the process comprises the following steps:

and determining the resource type related to the target event item from a plurality of resource types including a CPU, a memory, a virtual machine, a storage pool, a disk, a network card and a port according to the resource type in the target event item information.

Specifically, the resource types related to the event to be synchronized include a CPU (central processing unit), a memory, a virtual machine, a storage pool, a disk, a network card, and a port.

As an alternative embodiment, the process of performing a synchronous resource operation of a target host according to target resource synchronization information includes:

loading all resource synchronization event information and event item information corresponding to a target host from a host resource synchronization configuration library into a queue to be executed;

and sequentially executing synchronous resource operation of the target host based on the resource synchronous event information and the event item information in the queue to be executed.

Specifically, when the synchronous resource operation of the target host is executed according to the target resource synchronization information, all resource synchronization event information and event item information corresponding to the target host may be loaded from the host resource synchronization configuration library into the queue to be executed, and then the synchronous resource operation of the target host is sequentially executed based on the resource synchronization event information and the event item information in the queue to be executed.

As an optional embodiment, the method for host resource synchronization based on a virtualization platform further includes:

recording resource synchronization related logs into a preset synchronization log library when the synchronous resource operation of the target host is executed;

and if the synchronous resource operation of the target host fails, carrying out manual intervention reminding so as to manually complete the synchronous resource operation of the target host according to the log information in the synchronous log library.

Further, the method and the device can record the resource synchronization related logs into the preset synchronization log library when the synchronization resource operation of the target host is executed. If the synchronous resource operation of the target host fails, a resource synchronous failure mode is entered, specifically, manual intervention reminding is performed, so that the purpose is to enable a worker to complete the synchronous resource operation of the target host according to the log information in the synchronous log library, and the target host is allowed to enter an online mode after the manual intervention processing is successful, and at the moment, the virtualization platform can normally use all resources of the target host.

In summary, as shown in fig. 2, after the host is abnormally powered off, the resource synchronization event information is configured to the resource synchronization event library, the event item information (e.g., the event item 1, the event item 2, and the event item 3) is configured to the event item library (the resource synchronization event library and the event item library together form the host resource synchronization configuration library), and after the configuration is completed, the event item status is to be executed.

As shown in fig. 3, after the host goes online again, the resource synchronization event information and the event item information are read from the host resource synchronization configuration library, the resource synchronization event (including the event item 1, the event item 2, and the event item 3) is executed, after synchronization is completed, the log is recorded in the synchronization log library, and the resource synchronization result is checked, if synchronization is successful, the host online mode is entered; and if the synchronization fails, entering a resource synchronization failure mode, and manually online after the repair.

Referring to fig. 4, fig. 4 is a schematic structural diagram of a host resource synchronization system based on a virtualization platform according to an embodiment of the present invention.

The virtualization platform-based host resource synchronization system comprises:

the information configuration module 1 is used for configuring resource synchronization information for the physical host based on task running conditions on the physical host when detecting that the physical host corresponding to the virtualization platform is abnormally powered off, and storing the resource synchronization information to a preset host resource synchronization configuration library;

the synchronization judging module 2 is used for judging whether target resource synchronization information corresponding to the target host exists in the host resource synchronization configuration library or not after the target host is detected to be on-line; if yes, executing a synchronous online module 3; if not, executing the direct online module 4; the target host is any physical host;

the synchronous online module 3 is used for executing the synchronous resource operation of the target host according to the target resource synchronous information and allowing the target host to be online after the synchronous resource operation is successfully completed;

and the direct online module 4 is used for allowing the target host to be directly online.

As an alternative embodiment, the process of configuring resource synchronization information for a physical host based on task running conditions on the physical host includes:

based on the target task which fails to be executed on the physical host and the executed degree of the target task, resource synchronization event information representing the event to be synchronized corresponding to the target task is configured, and a plurality of host resources related to the characterization event and a plurality of event item information of the resource synchronization process are configured for the event to be synchronized.

As an optional embodiment, the resource synchronization event information includes a host id of a physical host, a target task id, an event id to be synchronized, an event state, an execution sequence of each target task, and an execution sequence of each event to be synchronized in the same target task;

the event item information comprises the resource type, the rest interface address used by the synchronous resource, the resource id, the event item priority, the retry times, the timeout time and whether the failure is skipped or not.

For introduction of the host resource synchronization system provided in the present application, reference is made to the above embodiments of the host resource synchronization method, and details of the present application are not repeated herein.

The present application further provides a host resource synchronization device based on a virtualization platform, including:

a memory for storing a computer program;

a processor for implementing the steps of any of the above virtualization platform based host resource synchronization methods when executing a computer program.

For introduction of the host resource synchronization apparatus provided in the present application, reference is made to the above embodiments of the host resource synchronization method, and details of the method are not repeated herein.

It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种多控存储设备硬件故障的自动化注入验证方法与系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!