Movatterモバイル変換


[0]ホーム

URL:


CN118567689A - Virtualization system updating method, computer device, storage medium and program product - Google Patents

Virtualization system updating method, computer device, storage medium and program product
Download PDF

Info

Publication number
CN118567689A
CN118567689ACN202411026196.1ACN202411026196ACN118567689ACN 118567689 ACN118567689 ACN 118567689ACN 202411026196 ACN202411026196 ACN 202411026196ACN 118567689 ACN118567689 ACN 118567689A
Authority
CN
China
Prior art keywords
updated
entity
detecting
response
update
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202411026196.1A
Other languages
Chinese (zh)
Other versions
CN118567689B (en
Inventor
栗丽霞
闫冬冬
杨聪敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Jinan data Technology Co ltd
Original Assignee
Inspur Jinan data Technology Co ltd
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 Inspur Jinan data Technology Co ltdfiledCriticalInspur Jinan data Technology Co ltd
Priority to CN202411026196.1ApriorityCriticalpatent/CN118567689B/en
Publication of CN118567689ApublicationCriticalpatent/CN118567689A/en
Application grantedgrantedCritical
Publication of CN118567689BpublicationCriticalpatent/CN118567689B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本申请涉及一种虚拟化系统更新方法、计算机设备、存储介质和程序产品,所属领域为虚拟化技术领域,所述方法包括:获取至少一个更新包,并基于构建的待更新实体,从所述更新包中确定目标更新包,其中,所述虚拟化系统中包括至少一个待更新实体;基于所述待更新实体的第一时间值和所述目标更新包的第二时间值,确定目标更新方式;基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务。本申请能够提高虚拟化系统更新的灵活性,避免人工操作失误引起的一系列问题,提高了虚拟化系统更新的可靠性和可维护性,降低了成本。

The present application relates to a virtualization system update method, computer equipment, storage medium and program product, and belongs to the field of virtualization technology. The method includes: obtaining at least one update package, and determining a target update package from the update package based on the constructed entity to be updated, wherein the virtualization system includes at least one entity to be updated; determining a target update method based on a first time value of the entity to be updated and a second time value of the target update package; and controlling the entity to be updated to perform a corresponding update task based on the target update method and the target update package. The present application can improve the flexibility of virtualization system updates, avoid a series of problems caused by manual operation errors, improve the reliability and maintainability of virtualization system updates, and reduce costs.

Description

Translated fromChinese
虚拟化系统更新方法、计算机设备、存储介质和程序产品Virtualization system updating method, computer device, storage medium and program product

技术领域Technical Field

本申请涉及虚拟化技术领域,特别是涉及一种虚拟化系统更新方法、计算机设备、存储介质和程序产品。The present application relates to the field of virtualization technology, and in particular to a virtualization system updating method, computer equipment, storage medium and program product.

背景技术Background Art

现有技术中,大多数虚拟化系统的更新升级需要提前跟客户预约时间窗口,此升级方法会造成虚拟机业务停机,而且在多架构的情况下通常需要经过多次操作,一个架构一个架构的去操作,最终完成虚拟化系统中所有主机的升级更新,对于用户来说,易用性比较差,而且人工操作难免会出错,造成维护成本的增加。In the prior art, the update and upgrade of most virtualization systems require an appointment window with the customer in advance. This upgrade method will cause the virtual machine business to be shut down, and in the case of multiple architectures, it usually requires multiple operations, one architecture at a time, to finally complete the upgrade and update of all hosts in the virtualization system. For users, the usability is relatively poor, and manual operations are inevitably prone to errors, resulting in increased maintenance costs.

因此,亟需提出一种能提高升级更新灵活性、易用性和可维护性的虚拟化系统更新方法、计算机设备、存储介质和程序产品。Therefore, there is an urgent need to propose a virtualization system update method, computer equipment, storage medium and program product that can improve the flexibility, usability and maintainability of upgrades and updates.

发明内容Summary of the invention

基于此,有必要针对上述技术问题,提供一种能提高升级更新灵活性、易用性和可维护性的虚拟化系统更新方法、计算机设备、存储介质和程序产品。Based on this, it is necessary to provide a virtualization system update method, computer equipment, storage medium and program product that can improve the flexibility, ease of use and maintainability of upgrades and updates in response to the above technical problems.

第一方面,提供一种虚拟化系统更新方法,所述方法包括:In a first aspect, a virtualization system update method is provided, the method comprising:

获取至少一个更新包,并基于构建的待更新实体,从所述更新包中确定目标更新包,其中,所述虚拟化系统中包括至少一个待更新实体;Acquire at least one update package, and determine a target update package from the update packages based on the constructed entity to be updated, wherein the virtualization system includes at least one entity to be updated;

基于所述待更新实体的第一时间值和所述目标更新包的第二时间值,确定目标更新方式,其中,更新方式至少包括原地热升级、滚动热升级和冷升级,所述第一时间值用于描述待更新实体可用于重新启动的时长,所述第二时间值用于描述更新包的更新时长;Determine a target update mode based on a first time value of the entity to be updated and a second time value of the target update package, wherein the update mode includes at least in-place hot upgrade, rolling hot upgrade and cold upgrade, the first time value is used to describe the duration of the entity to be updated that can be used for restarting, and the second time value is used to describe the update duration of the update package;

基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务。Based on the target update mode and the target update package, the entity to be updated is controlled to execute a corresponding update task.

可选的,在获取至少一个更新包之前,所述方法还包括:Optionally, before obtaining at least one update package, the method further includes:

检测更新包的名称是否符合预设标准;Check whether the name of the update package meets the preset standard;

响应于检测到所述更新包的名称符合预设标准时,对所述更新包进行解压并解析;In response to detecting that the name of the update package meets a preset standard, decompressing and parsing the update package;

对解析后的更新包进行校验;Verify the parsed update package;

响应于检测到更新包已校验通过时,将解析后的更新包存储至主节点的数据库;In response to detecting that the update package has passed the verification, storing the parsed update package in the database of the master node;

同时,检测是否存在备节点;At the same time, check whether there is a backup node;

响应于检测到存在备节点时,将解析后的更新包同步至备节点的数据库。In response to detecting the presence of a standby node, the parsed update package is synchronized to a database of the standby node.

可选的,所述待更新实体的构建方法包括:Optionally, the method for constructing the entity to be updated includes:

获取实体的属性参数,并对所述属性参数进行筛选,得到用于更新的属性参数;Acquire attribute parameters of the entity, and filter the attribute parameters to obtain attribute parameters for updating;

基于所述用于更新的属性参数与对应的实体形成的映射关系,生成所述待更新实体。The entity to be updated is generated based on the mapping relationship formed between the attribute parameters for updating and the corresponding entity.

可选的,所述目标更新包的确定方法包括:Optionally, the method for determining the target update package includes:

获取待更新实体的属性参数;Get the attribute parameters of the entity to be updated;

基于所述待更新实体的属性参数,匹配数据库中的更新包,定义匹配成功的更新包为所述目标更新包。Based on the attribute parameters of the entity to be updated, the update packages in the database are matched, and the update package that is successfully matched is defined as the target update package.

可选的,基于所述待更新实体的第一时间值和所述目标更新包的第二时间值,确定目标更新方式包括:Optionally, determining the target update mode based on the first time value of the entity to be updated and the second time value of the target update package includes:

获取所述待更新实体所属的业务场景,并基于所述业务场景,确定第一时间值;Acquire a business scenario to which the entity to be updated belongs, and determine a first time value based on the business scenario;

获取所述目标更新包对应的第二时间值;Obtaining a second time value corresponding to the target update package;

响应于检测到所述第一时间值小于或等于第一预设阈值时,确定目标更新方式为滚动热升级或原地热升级;In response to detecting that the first time value is less than or equal to a first preset threshold, determining that the target update mode is a rolling hot upgrade or an in-place hot upgrade;

响应于检测到所述第一时间值大于第一预设阈值时,比较所述第一时间值和所述第二时间值;In response to detecting that the first time value is greater than a first preset threshold, comparing the first time value and the second time value;

基于比较结果,确定目标更新方式。Based on the comparison results, the target update method is determined.

可选的,基于比较结果,确定目标更新方式包括:Optionally, based on the comparison result, determining the target update method includes:

响应于检测到所述第二时间值小于或等于第一时间值,且当前时刻距目标时刻的时间范围在预设时间范围内时,确定目标更新方式为冷升级;In response to detecting that the second time value is less than or equal to the first time value, and the time range between the current time and the target time is within a preset time range, determining that the target update mode is a cold upgrade;

响应于检测到所述第二时间值大于第一时间值,且当前时刻距目标时刻的时间范围在预设时间范围内时,确定目标更新方式为冷升级,和,原地热升级或滚动热升级;In response to detecting that the second time value is greater than the first time value, and the time range between the current time and the target time is within a preset time range, determining that the target update mode is a cold upgrade, an in-place hot upgrade, or a rolling hot upgrade;

响应于检测到所述第一时间值大于第一预设阈值,且当前时刻距目标时刻的时间范围不在预设时间范围内时,确定目标更新方式为原地热升级或滚动热升级。In response to detecting that the first time value is greater than a first preset threshold and the time range between the current time and the target time is not within the preset time range, determining that the target update mode is an in-place hot upgrade or a rolling hot upgrade.

可选的,响应于检测到目标更新方式为原地热升级或滚动热升级时,所述方法还包括:Optionally, in response to detecting that the target update mode is an in-place hot upgrade or a rolling hot upgrade, the method further includes:

响应于检测到需要进行业务资源迁移时,确定目标更新方式为滚动热升级;In response to detecting that a business resource migration is required, determining that a target update mode is a rolling hot upgrade;

响应于检测到不需要进行业务资源迁移时,确定目标更新方式为原地热升级。In response to detecting that no business resource migration is required, determining that the target update mode is an in-place hot upgrade.

可选的,在基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务之前,所述方法还包括:Optionally, before controlling the to-be-updated entity to perform a corresponding update task based on the target update mode and the target update package, the method further includes:

构建检查结果集合和检查项;Build inspection result sets and inspection items;

基于所述检查项,对虚拟化系统的环境进行检查,并将检查结果加入至所述检查结果集合中;Based on the inspection items, inspect the environment of the virtualization system, and add the inspection results to the inspection result set;

响应于检测到检查项在所述检查结果集合中均标记为通过时,基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务。In response to detecting that all check items in the check result set are marked as passed, the to-be-updated entity is controlled to execute a corresponding update task based on the target update mode and the target update package.

可选的,响应于检测到目标更新方式为原地热升级时,控制所述待更新实体执行对应的更新任务包括:Optionally, in response to detecting that the target update mode is an in-place hot upgrade, controlling the entity to be updated to perform a corresponding update task includes:

响应于检测到更新任务时,控制所述待更新实体进入维护模式;In response to detecting an update task, controlling the entity to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,基于所述目标更新包对所述待更新实体进行更新;In response to detecting that the entity to be updated has entered a maintenance mode, updating the entity to be updated based on the target update package;

响应于检测到更新结果时,退出维护模式,并同步待更新实体的配置,以完成更新任务的执行。In response to detecting the update result, the maintenance mode is exited, and the configuration of the entity to be updated is synchronized to complete the execution of the update task.

可选的,响应于检测到目标更新方式为冷升级时,控制所述待更新实体执行对应的更新任务包括:Optionally, in response to detecting that the target update mode is a cold upgrade, controlling the entity to be updated to perform a corresponding update task includes:

响应于检测到更新任务时,控制所述待更新实体进入维护模式;In response to detecting an update task, controlling the entity to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,基于所述目标更新包,在目标分区对所述待更新实体进行更新;In response to detecting that the entity to be updated has entered a maintenance mode, updating the entity to be updated in a target partition based on the target update package;

响应于检测到虚拟化系统中存在已更新完成的待更新实体时,检测主备管理节点对应的待更新实体是否重启完成;In response to detecting that there is an entity to be updated that has been updated in the virtualization system, detecting whether the entity to be updated corresponding to the active and standby management nodes has been restarted;

响应于检测到主备管理节点对应的待更新实体均已重启完成时,安装第三方包、刷新引导项并关闭待更新实体中运行的虚拟机;In response to detecting that the entities to be updated corresponding to the active and standby management nodes have all been restarted, installing a third-party package, refreshing the boot item, and shutting down the virtual machine running in the entity to be updated;

响应于检测到待更新实体中运行的虚拟机均已关闭成功时,重新启动所述待更新实体;In response to detecting that all virtual machines running in the entity to be updated have been successfully shut down, restarting the entity to be updated;

响应于检测到待更新实体中存在至少一个运行的虚拟机未关闭成功时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复。In response to detecting that at least one running virtual machine in the entities to be updated has not been successfully shut down, re-detecting whether there are entities to be updated that have been updated in the virtualization system, and repeating the cycle.

可选的,响应于检测到存在未重启完成得主备管理节点时,所述方法包括:Optionally, in response to detecting that there are active and standby management nodes that have not been completely restarted, the method includes:

检测当前待更新实体是否属于主备管理节点;Check whether the entity to be updated currently belongs to the primary and backup management nodes;

响应于检测到当前待更新实体属于主备管理节点时,安装第三方包、刷新引导项并关闭当前待更新实体中运行的虚拟机;In response to detecting that the current entity to be updated belongs to the primary and standby management nodes, installing a third-party package, refreshing the boot item, and shutting down the virtual machine running in the current entity to be updated;

响应于检测到待更新实体中运行的虚拟机均已关闭成功时,重新启动所述待更新实体;In response to detecting that all virtual machines running in the entity to be updated have been successfully shut down, restarting the entity to be updated;

响应于检测到待更新实体中存在至少一个运行的虚拟机未关闭成功时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复;In response to detecting that at least one running virtual machine in the entities to be updated has not been successfully shut down, re-detecting whether there is an entity to be updated that has been updated in the virtualization system, and repeating the process in a loop;

响应于检测到当前节点不是主备管理节点,且存在主备管理节点对应的待更新实体未重启完成时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复。In response to detecting that the current node is not the active/standby management node and that there are entities to be updated corresponding to the active/standby management nodes that have not been restarted, re-detecting whether there are entities to be updated that have been updated in the virtualization system is repeated, and the cycle is repeated.

可选的,响应于检测到待更新实体已重启成功时,所述方法包括:Optionally, in response to detecting that the entity to be updated has been restarted successfully, the method includes:

退出维护模式,并同步待更新实体的配置;Exit maintenance mode and synchronize the configuration of the entity to be updated;

检测待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored and mounted;

响应于检测到待更新实体的存储池已恢复挂载时,开启关闭的虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored to mount, the shut down virtual machine is started to complete the execution of the update task.

可选的,响应于检测到目标更新方式为滚动热升级时,控制所述待更新实体执行对应的更新任务包括:Optionally, in response to detecting that the target update mode is a rolling hot upgrade, controlling the entity to be updated to perform a corresponding update task includes:

响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;

响应于检测到所述待更新实体属于主备管理节点时,控制所述待更新实体进入维护模式;In response to detecting that the entity to be updated belongs to the primary and standby management nodes, controlling the entity to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,检测所述待更新实体中是否存在正在运行的虚拟机;In response to detecting that the entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the entity to be updated;

响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;

响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述待更新实体进行更新;In response to detecting that the running virtual machine has been successfully migrated, updating the entity to be updated in the target partition;

响应于检测到所述待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动待更新实体;In response to detecting that the entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the entity to be updated;

响应于检测到待更新实体已重新启动成功时,退出维护模式,并同步待更新实体的配置;In response to detecting that the entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the entity to be updated;

检测待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored and mounted;

响应于检测到待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.

可选的,响应于检测到目标更新方式为滚动热升级时,控制所述待更新实体执行对应的更新任务包括:Optionally, in response to detecting that the target update mode is a rolling hot upgrade, controlling the entity to be updated to perform a corresponding update task includes:

响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;

响应于检测到所述待更新实体不属于主备管理节点时,判断属于主备管理节点的待更新实体是否均已更新完成;In response to detecting that the entity to be updated does not belong to the primary and standby management nodes, determining whether all entities to be updated that belong to the primary and standby management nodes have been updated;

响应于检测到属于主备管理节点的待更新实体均已更新完成时,控制所述待更新实体进入维护模式;In response to detecting that all entities to be updated belonging to the primary and standby management nodes have completed updating, controlling the entities to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,检测所述待更新实体中是否存在正在运行的虚拟机;In response to detecting that the entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the entity to be updated;

响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;

响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述待更新实体进行更新;In response to detecting that the running virtual machine has been successfully migrated, updating the entity to be updated in the target partition;

响应于检测到所述待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动待更新实体;In response to detecting that the entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the entity to be updated;

响应于检测到待更新实体已重新启动成功时,退出维护模式,并同步待更新实体的配置;In response to detecting that the entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the entity to be updated;

检测待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored and mounted;

响应于检测到待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.

可选的,响应于检测到目标更新方式为滚动热升级时,控制所述待更新实体执行对应的更新任务包括:Optionally, in response to detecting that the target update mode is a rolling hot upgrade, controlling the entity to be updated to perform a corresponding update task includes:

响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;

响应于检测到所述待更新实体不属于主备管理节点时,判断属于主备管理节点的待更新实体是否均已更新完成;In response to detecting that the entity to be updated does not belong to the primary and standby management nodes, determining whether all entities to be updated that belong to the primary and standby management nodes have been updated;

响应于检测到存在属于主备管理节点的目标待更新实体未更新完成时,控制所述目标待更新实体进入维护模式;In response to detecting that there is a target entity to be updated that belongs to the primary and standby management nodes and has not been updated, controlling the target entity to be updated to enter a maintenance mode;

响应于检测到所述目标待更新实体已进入维护模式时,检测所述目标待更新实体中是否存在正在运行的虚拟机;In response to detecting that the target entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the target entity to be updated;

响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;

响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述目标待更新实体进行更新;In response to detecting that the running virtual machine has been successfully migrated, updating the target entity to be updated in the target partition;

响应于检测到所述目标待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动所述目标待更新实体;In response to detecting that the target entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the target entity to be updated;

响应于检测到目标待更新实体已重新启动成功时,退出维护模式,并同步目标待更新实体的配置;In response to detecting that the target entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the target entity to be updated;

检测目标待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the target entity to be updated has been restored and mounted;

响应于检测到目标待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the target entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.

可选的,所述方法还包括:Optionally, the method further includes:

响应于检测到虚拟机未迁移成功或存储池未恢复挂载或虚拟机未迁回成功时,重新判断待更新实体是否属于主备管理节点,并循环往复。In response to detecting that the virtual machine has not been successfully migrated or the storage pool has not been restored or the virtual machine has not been successfully migrated back, it is re-determined whether the entity to be updated belongs to the primary or standby management node, and the process is repeated.

可选的,在迁移虚拟机之前,所述方法还包括:Optionally, before migrating the virtual machine, the method further includes:

基于预设函数,计算确定虚拟机迁移后的存储池使用率,其中,所述预设函数包括:Based on a preset function, the storage pool usage rate after the virtual machine migration is calculated and determined, wherein the preset function includes:

;

其中,K表示虚拟机迁移后的存储池使用率,x表示存储池使用率,y表示存储池总容量,D表示当前虚拟机磁盘容量,f表示存储池总容量;Wherein,K represents the storage pool usage rate after the virtual machine is migrated,x represents the storage pool usage rate,y represents the total capacity of the storage pool,D represents the current virtual machine disk capacity, andf represents the total capacity of the storage pool;

响应于检测到所述虚拟机迁移后的存储池使用率大于第二预设阈值时,关闭目标数量的虚拟机。In response to detecting that the storage pool usage after the migration of the virtual machine is greater than a second preset threshold, shutting down a target number of virtual machines.

可选的,所述目标数量的确定方法包括:Optionally, the method for determining the target quantity includes:

根据虚拟机的重要程度,按照从高到低的顺序对虚拟机进行排序;Sort the virtual machines in descending order according to their importance;

基于预设区间,对排序完成的虚拟机进行划分,得到多个虚拟机区间,并基于区间内的虚拟机重要程度之和,按照从高到低的顺序对虚拟机区间进行标记;Based on the preset intervals, the sorted virtual machines are divided to obtain multiple virtual machine intervals, and the virtual machine intervals are marked in descending order based on the sum of the importance of the virtual machines in the intervals;

根据所述虚拟机迁移后的存储池使用率与第二预设阈值之间的差值,确定存储池资源使用超出量;Determining an excess amount of storage pool resource usage according to a difference between the storage pool usage rate after the virtual machine migration and a second preset threshold;

基于所述存储池资源使用超出量,按照从低到高的标记顺序确定需要关闭虚拟机的虚拟机区间;Based on the excess usage of the storage pool resources, determine the virtual machine intervals that need to shut down the virtual machines in order of marking from low to high;

响应于检测到目标虚拟机区间中的虚拟机无需全部关闭时,根据当前存储池资源使用超出量以及目标虚拟机区间中每个虚拟机的资源占用量,匹配确定所述目标虚拟机区间中需要关闭的虚拟机;In response to detecting that all virtual machines in the target virtual machine interval do not need to be shut down, matching and determining virtual machines in the target virtual machine interval that need to be shut down according to the current excess storage pool resource usage and the resource occupancy of each virtual machine in the target virtual machine interval;

基于需要关闭的虚拟机,确定所述目标数量。The target number is determined based on the virtual machines that need to be shut down.

可选的,所述虚拟机的迁移方法包括:Optionally, the virtual machine migration method includes:

获取待更新实体中当前正在运行的虚拟机,生成一一映射关系,并根据虚拟机的负载,按照从大到小的顺序进行排序;Obtain the currently running virtual machines in the entity to be updated, generate a one-to-one mapping relationship, and sort them in descending order according to the load of the virtual machines;

根据虚拟机的存储区域,确定虚拟机的迁移方式;Determine the migration method of the virtual machine based on the storage area of the virtual machine;

获取目标实体列表,基于排序顺序和目标迁移方式,多线程地将所述虚拟机逐步迁移至目标实体。A target entity list is obtained, and based on a sorting order and a target migration mode, the virtual machines are gradually migrated to the target entities in a multi-threaded manner.

第二方面,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:In a second aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:

获取至少一个更新包,并基于构建的待更新实体,从所述更新包中确定目标更新包,其中,所述虚拟化系统中包括至少一个待更新实体;Acquire at least one update package, and determine a target update package from the update packages based on the constructed entity to be updated, wherein the virtualization system includes at least one entity to be updated;

基于所述待更新实体的第一时间值和所述目标更新包的第二时间值,确定目标更新方式,其中,更新方式至少包括原地热升级、滚动热升级和冷升级,所述第一时间值用于描述待更新实体可用于重新启动的时长,所述第二时间值用于描述更新包的更新时长;Determine a target update mode based on a first time value of the entity to be updated and a second time value of the target update package, wherein the update mode includes at least in-place hot upgrade, rolling hot upgrade and cold upgrade, the first time value is used to describe the duration of the entity to be updated that can be used for restarting, and the second time value is used to describe the update duration of the update package;

基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务。Based on the target update mode and the target update package, the entity to be updated is controlled to execute a corresponding update task.

第三方面,提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:In a third aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

获取至少一个更新包,并基于构建的待更新实体,从所述更新包中确定目标更新包,其中,所述虚拟化系统中包括至少一个待更新实体;Acquire at least one update package, and determine a target update package from the update packages based on the constructed entity to be updated, wherein the virtualization system includes at least one entity to be updated;

基于所述待更新实体的第一时间值和所述目标更新包的第二时间值,确定目标更新方式,其中,更新方式至少包括原地热升级、滚动热升级和冷升级,所述第一时间值用于描述待更新实体可用于重新启动的时长,所述第二时间值用于描述更新包的更新时长;Determine a target update mode based on a first time value of the entity to be updated and a second time value of the target update package, wherein the update mode includes at least in-place hot upgrade, rolling hot upgrade and cold upgrade, the first time value is used to describe the duration of the entity to be updated that can be used for restarting, and the second time value is used to describe the update duration of the update package;

基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务。Based on the target update mode and the target update package, the entity to be updated is controlled to execute a corresponding update task.

第四方面,提供了一种计算机程序产品,所述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时实现以下步骤:In a fourth aspect, a computer program product is provided, the computer program product comprising a computer program, and when the computer program is executed by a processor, the following steps are implemented:

获取至少一个更新包,并基于构建的待更新实体,从所述更新包中确定目标更新包,其中,所述虚拟化系统中包括至少一个待更新实体;Acquire at least one update package, and determine a target update package from the update packages based on the constructed entity to be updated, wherein the virtualization system includes at least one entity to be updated;

基于所述待更新实体的第一时间值和所述目标更新包的第二时间值,确定目标更新方式,其中,更新方式至少包括原地热升级、滚动热升级和冷升级,所述第一时间值用于描述待更新实体可用于重新启动的时长,所述第二时间值用于描述更新包的更新时长;Determine a target update mode based on a first time value of the entity to be updated and a second time value of the target update package, wherein the update mode includes at least in-place hot upgrade, rolling hot upgrade and cold upgrade, the first time value is used to describe the duration of the entity to be updated that can be used for restarting, and the second time value is used to describe the update duration of the update package;

基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务。Based on the target update mode and the target update package, the entity to be updated is controlled to execute a corresponding update task.

上述虚拟化系统更新方法、计算机设备、存储介质和程序产品,所述方法包括:获取至少一个更新包,并基于构建的待更新实体,从所述更新包中确定目标更新包,其中,所述虚拟化系统中包括至少一个待更新实体;基于所述待更新实体的第一时间值和所述目标更新包的第二时间值,确定目标更新方式,其中,更新方式至少包括原地热升级、滚动热升级和冷升级,所述第一时间值用于描述待更新实体可用于重新启动的时长,所述第二时间值用于描述更新包的更新时长;基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务,本申请能够应用于多架构虚拟化环境,并可以根据不同的环境以及多样的更新场景,提供不同的更新方式及对应的更新策略,提高了虚拟化系统更新的灵活性,避免人工操作失误引起的一系列问题,提高了虚拟化系统更新的可靠性和可维护性,降低了成本。The above-mentioned virtualization system update method, computer device, storage medium and program product, the method includes: obtaining at least one update package, and determining a target update package from the update package based on the constructed entity to be updated, wherein the virtualization system includes at least one entity to be updated; determining a target update method based on a first time value of the entity to be updated and a second time value of the target update package, wherein the update method at least includes in-place hot upgrade, rolling hot upgrade and cold upgrade, the first time value is used to describe the length of time that the entity to be updated can be used for restarting, and the second time value is used to describe the update duration of the update package; based on the target update method and the target update package, controlling the entity to be updated to perform a corresponding update task, the present application can be applied to a multi-architecture virtualization environment, and can provide different update methods and corresponding update strategies according to different environments and various update scenarios, thereby improving the flexibility of virtualization system updates, avoiding a series of problems caused by manual operation errors, improving the reliability and maintainability of virtualization system updates, and reducing costs.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为一个实施例中虚拟化系统更新方法的应用环境图;FIG1 is an application environment diagram of a virtualization system update method in one embodiment;

图2为一个实施例中虚拟化系统更新方法的流程示意图;FIG2 is a schematic diagram of a flow chart of a virtualization system updating method in one embodiment;

图3为一个实施例中虚拟化系统更新方法的另一流程示意图;FIG3 is another schematic diagram of a flow chart of a virtualization system updating method in one embodiment;

图4为一个实施例中虚拟化系统更新方法的更新包上传流程示意图;FIG4 is a schematic diagram of an update package uploading process of a virtualization system update method in one embodiment;

图5为一个实施例中虚拟化系统更新方法的更新前环境检查流程示意图;FIG5 is a schematic diagram of a pre-update environment check process of a virtualization system update method in one embodiment;

图6为一个实施例中虚拟化系统更新方法的更新任务提交流程示意图;FIG6 is a schematic diagram of an update task submission process of a virtualization system update method in one embodiment;

图7为一个实施例中虚拟化系统更新方法的原地热升级流程示意图;FIG7 is a schematic diagram of an in-situ hot upgrade process of a virtualization system update method in one embodiment;

图8为一个实施例中虚拟化系统更新方法的冷升级流程示意图;FIG8 is a schematic diagram of a cold upgrade process of a virtualization system update method in one embodiment;

图9为一个实施例中虚拟化系统更新方法的滚动热升级流程示意图;FIG9 is a schematic diagram of a rolling hot upgrade process of a virtualization system update method in one embodiment;

图10为一个实施例中虚拟化系统更新方法的滚动热升级在升级前虚拟机调度流程示意图;FIG10 is a schematic diagram of a virtual machine scheduling process before an upgrade of a rolling hot upgrade of a virtualization system update method in one embodiment;

图11为一个实施例中计算机设备的内部结构图。FIG. 11 is a diagram showing the internal structure of a computer device in one embodiment.

具体实施方式DETAILED DESCRIPTION

为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

应当理解,在本申请的描述中,除非上下文明确要求,否则整个说明书中的“包括”、“包含”等类似词语应当解释为包含的含义而不是排他或穷举的含义;也就是说,是“包括但不限于”的含义。It should be understood that in the description of the present application, unless the context clearly requires otherwise, words such as "include", "comprises", and the like throughout the specification should be interpreted as including rather than being exclusive or exhaustive; that is, as including but not limited to.

还应当理解,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。此外,在本申请的描述中,除非另有说明,“多个”的含义是两个或两个以上。It should also be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more.

需要注意的是,术语“S1”、“S2”等仅用于步骤的描述目的,并非特别指称次序或顺位的意思,亦非用以限定本申请,其仅仅是为了方便描述本申请的方法,而不能理解为指示步骤的先后顺序。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。It should be noted that the terms "S1", "S2", etc. are only used for the purpose of describing the steps, and do not specifically refer to the order or sequence, nor are they used to limit the present application. They are only for the convenience of describing the method of the present application, and cannot be understood as indicating the order of the steps. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present application.

本申请提供的虚拟化系统更新方法,可以应用于如图1所示的应用环境中。其中,终端102通过网络与设置于服务器104上的数据处理平台进行通信,其中,终端102可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备,服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The virtualized system update method provided in the present application can be applied in the application environment shown in FIG1 . The terminal 102 communicates with the data processing platform set on the server 104 through the network, wherein the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.

在一个实施例中,如图2-图3所示,提供了一种虚拟化系统更新方法,以该方法应用于图1中的终端为例进行说明,包括以下步骤:In one embodiment, as shown in FIG. 2-FIG 3, a virtualization system update method is provided, which is described by taking the method applied to the terminal in FIG. 1 as an example, including the following steps:

S1:获取至少一个更新包,并基于构建的待更新实体,从所述更新包中确定目标更新包,其中,所述虚拟化系统中包括至少一个待更新实体。S1: Acquire at least one update package, and determine a target update package from the update packages based on a constructed entity to be updated, wherein the virtualization system includes at least one entity to be updated.

需要说明的是,更新包是包含主机升级所需文件、脚本、配置信息等信息的一个压缩包,可以包括补丁包和升级包,待更新实体指的是需要升级或者打补丁的实体,可以包括管理节点、计算节点、数据中心、集群等,其由主机构成,如待更新实体为配置有更新参数的待更新主机,虚拟化系统由多个主机构成,虚拟化系统部署后在同一虚拟化环境中可能运行着多个数据中心,每个数据中心下也可能会部署着多个不同CPU(Central ProcessingUnit,中央处理器)架构的集群,例如x86_64或者aarch64,本申请包括管理节点(1台或者2台)和若干个计算节点,管理节点和计算节点上都运行着底层升级组件,管理节点不仅运行着底层升级组件,还包括平台层面的升级服务,完成整个升级任务的统一控制与任务调度。It should be noted that the update package is a compressed package containing files, scripts, configuration information and other information required for the host upgrade, which may include patch packages and upgrade packages. The entity to be updated refers to the entity that needs to be upgraded or patched, which may include management nodes, computing nodes, data centers, clusters, etc., which are composed of hosts. For example, the entity to be updated is a host to be updated configured with update parameters. The virtualization system is composed of multiple hosts. After the virtualization system is deployed, multiple data centers may be running in the same virtualization environment. Each data center may also be deployed with multiple clusters of different CPU (Central Processing Unit) architectures, such as x86_64 or aarch64. The present application includes a management node (1 or 2) and several computing nodes. The underlying upgrade components are running on both the management node and the computing node. The management node not only runs the underlying upgrade components, but also includes platform-level upgrade services to complete unified control and task scheduling of the entire upgrade task.

在一些具体实施方式中,如图4所示,在获取至少一个更新包之前,所述方法还包括:In some specific implementations, as shown in FIG4 , before obtaining at least one update package, the method further includes:

检测更新包的名称是否符合预设标准,即检查更新包命名是否符合规范,其中,规范一般指的是现有的服务器应用规范,在此不再赘述;Check whether the name of the update package meets the preset standard, that is, check whether the name of the update package meets the specification, wherein the specification generally refers to the existing server application specification, which will not be repeated here;

响应于检测到所述更新包的名称符合预设标准时,对所述更新包进行解压并解析,其中,解压和解析均为常用方法,在此不再赘述;In response to detecting that the name of the update package meets the preset standard, the update package is decompressed and parsed, wherein the decompression and parsing are both common methods and will not be described in detail here;

对解析后的更新包进行校验,其中,此处是对解析后的更新包的信息进行校验,一般为对包的完整性进行校验,其为常用的校验方法,在此不再赘述;Verify the parsed update package, wherein here the information of the parsed update package is verified, generally the integrity of the package is verified, which is a commonly used verification method and will not be described in detail here;

响应于检测到更新包已校验通过时,将解析后的更新包存储至主节点的数据库;In response to detecting that the update package has passed the verification, storing the parsed update package in the database of the master node;

同时,检测是否存在备节点;At the same time, check whether there is a backup node;

响应于检测到存在备节点时,将解析后的更新包同步至备节点的数据库;In response to detecting the existence of a standby node, synchronizing the parsed update package to a database of the standby node;

其中,主节点和备节点均有数据库服务,但是备节点的数据库服务一般处于关闭状态,只有主节点的数据库服务出于运行状态,若存在备节点时,将解析的信息同时同步至备节点的数据库中存储,以实现更新包信息的持久化。Among them, both the master node and the standby node have database services, but the database service of the standby node is generally in a closed state, and only the database service of the master node is in a running state. If there is a standby node, the parsed information will be synchronized to the database of the standby node for storage to achieve persistence of the update package information.

在一些具体实施方式中,所述待更新实体的构建方法包括:In some specific implementations, the method for constructing the entity to be updated includes:

获取实体的属性参数,并对所述属性参数进行筛选,得到用于更新的属性参数,其中,实体的属性参数一般指的是主机的规格参数,如硬件配置参数、性能指标参数和接口性能等,筛选出的参数一般是在主机更新时需要用到的参数,如内存信息、性能指标、版本号等参数;Acquire attribute parameters of the entity, and filter the attribute parameters to obtain attribute parameters for updating, wherein the attribute parameters of the entity generally refer to specification parameters of the host, such as hardware configuration parameters, performance index parameters and interface performance, etc. The filtered parameters are generally parameters required when the host is updated, such as memory information, performance index, version number and other parameters;

基于所述用于更新的属性参数与对应的实体形成的映射关系,生成所述待更新实体,即对实体构建详细的实体更新信息,并形成对应的映射关系,以生成待更新实体。Based on the mapping relationship formed between the attribute parameters for updating and the corresponding entities, the entity to be updated is generated, that is, detailed entity update information is constructed for the entity, and a corresponding mapping relationship is formed to generate the entity to be updated.

在一些具体实施方式中,所述目标更新包的确定方法包括:In some specific implementations, the method for determining the target update package includes:

获取待更新实体的属性参数;Get the attribute parameters of the entity to be updated;

基于所述待更新实体的属性参数,匹配数据库中的更新包,定义匹配成功的更新包为所述目标更新包,其中,此处一般是通过更新包的版本号、依赖版本号与待更新实体版本作比较看是否匹配,检查更新包适用的CPU架构与待更新实体的CPU架构是否匹配,以及更新包使用的产品类型与待更新实体的产品类型是否匹配等,匹配成功后,则定义匹配成功的更新包为目标更新包,并进行下载。Based on the attribute parameters of the entity to be updated, the update packages in the database are matched, and the successfully matched update package is defined as the target update package, wherein here, generally, the version number and the dependent version number of the update package are compared with the version of the entity to be updated to see whether they match, and whether the CPU architecture applicable to the update package matches the CPU architecture of the entity to be updated, and whether the product type used by the update package matches the product type of the entity to be updated, etc. After a successful match, the successfully matched update package is defined as the target update package and downloaded.

在上述实施方式中,通过构建待更新实体,可以准确快速地匹配到更新包,从而提高虚拟化系统更新效率和准确性。In the above implementation, by constructing the entity to be updated, the update package can be matched accurately and quickly, thereby improving the update efficiency and accuracy of the virtualization system.

S2:基于所述待更新实体的第一时间值和所述目标更新包的第二时间值,确定目标更新方式,其中,更新方式至少包括原地热升级、滚动热升级和冷升级,所述第一时间值用于描述待更新实体可用于重新启动的时长,所述第二时间值用于描述更新包的更新时长。S2: Based on the first time value of the entity to be updated and the second time value of the target update package, determine the target update method, wherein the update method includes at least in-place hot upgrade, rolling hot upgrade and cold upgrade, the first time value is used to describe the duration of the entity to be updated that can be used for restarting, and the second time value is used to describe the update duration of the update package.

需要说明的是,补丁包和升级包均支持原地热升级、滚动热升级以及冷升级三种升级方式,其中,补丁包的升级一般是原地升级,即所有更新的RPM包(RedhatLinuxPacketManager,Redhat的包管理器,是LINUX下的一种软件的可执行程序)都直接写入配置文件,RPM源文件也拷贝到升级到特定目录下,升级时直接调用RPM安装命令直接升级,升级包对应的原地热升级更新实现流程与补丁包的热升级一致,滚动热升级和冷升级在底层是在第二分区进行升级,升级成功后,重启主机后完成分区切换,进一步的,热或冷是针对虚拟机在升级过程中是否停机来说的,如果用户业务运行暂停一些时间,那么就建议采用冷升级方式,升级前或者重启前自动将运行的虚拟机关闭,等升级完成并重启后再将虚拟机自动启动;滚动热升级主要解决用户业务不能停,虚拟机不允许关闭的情况下,提供的一种方式,使用这种方式时,集群中的主机需要串行进行升级,升级某个主机前,先将上面运行的虚拟机迁移至其他主机,然后该主机升级并重启后,再将迁走的虚拟机迁回到该主机后,再继续升级下一台主机,最终再不影响虚拟机业务的前提下,完成集群中所有主机的升级,原地热升级在升级过程对待升级服务器的业务无影响,不需要提前迁移走业务资源。It should be noted that both patch packages and upgrade packages support three upgrade methods: in-place hot upgrade, rolling hot upgrade and cold upgrade. Among them, the upgrade of patch packages is generally in-place upgrade, that is, all updated RPM packages (Redhat Linux Packet Manager, Redhat's package manager, is an executable program of software under LINUX) are directly written into the configuration file, and the RPM source files are also copied to the specific directory to be upgraded. When upgrading, the RPM installation command is directly called to upgrade directly. The in-place hot upgrade implementation process corresponding to the upgrade package is consistent with the hot upgrade of the patch package. The rolling hot upgrade and cold upgrade are upgraded in the second partition at the bottom layer. After the upgrade is successful, the partition switching is completed after the host is restarted. Furthermore, hot or cold refers to whether the virtual machine is stopped during the upgrade process. For machines, if the user's business operation is suspended for some time, it is recommended to use the cold upgrade method. Before the upgrade or restart, the running virtual machine will be automatically shut down, and the virtual machine will be automatically started after the upgrade is completed and restarted; rolling hot upgrade is mainly used to solve the problem that the user's business cannot be stopped and the virtual machine is not allowed to be shut down. When using this method, the hosts in the cluster need to be upgraded serially. Before upgrading a host, migrate the virtual machines running on it to other hosts. Then, after the host is upgraded and restarted, migrate the migrated virtual machines back to the host, and then continue to upgrade the next host. Finally, under the premise of not affecting the virtual machine business, the upgrade of all hosts in the cluster is completed. In the process of upgrading, the in-place hot upgrade has no impact on the business of the upgraded server, and there is no need to migrate business resources in advance.

在一些具体实施方式中,基于所述待更新实体和所述目标更新包,确定目标更新方式包括:In some specific implementations, determining the target update mode based on the entity to be updated and the target update package includes:

获取所述待更新实体所属的业务场景,并基于所述业务场景,确定第一时间值,其中,通常可以基于大数据,来根据业务场景确定第一时间值,业务场景可以包括主机运行场景,如金融业务等,第一时间值一般指的是不同业务场景下,主机可以用于重新启动的时长,如金融业务场景下,通常要求虚拟机业务不能停机或者停机窗口时间有限,此时需要确定对应的第一时间值,以用于确定具体的更新方式;Acquire the business scenario to which the entity to be updated belongs, and determine the first time value based on the business scenario, wherein the first time value can usually be determined based on big data according to the business scenario, and the business scenario can include a host operation scenario, such as financial business, etc. The first time value generally refers to the length of time that the host can be used for restarting in different business scenarios. For example, in a financial business scenario, it is usually required that the virtual machine business cannot be shut down or the downtime window time is limited. At this time, it is necessary to determine the corresponding first time value to determine the specific update method;

获取所述目标更新包对应的第二时间值,其中,第二时间值指的是更新包进行更新时需要用的时间长度;Obtaining a second time value corresponding to the target update package, wherein the second time value refers to the length of time required for the update package to be updated;

响应于检测到所述第一时间值小于或等于第一预设阈值时,确定目标更新方式为滚动热升级或原地热升级,其中,第一预设阈值可以根据实际需求进行设置,优选的,第一预设阈值可以为0,即主机可以用于重新启动的时长为0,则选择的更新方式为滚动热升级或原地热升级;In response to detecting that the first time value is less than or equal to a first preset threshold, determining that the target update mode is a rolling hot upgrade or an in-place hot upgrade, wherein the first preset threshold can be set according to actual needs, preferably, the first preset threshold can be 0, that is, the time length that the host can be used for restarting is 0, and the selected update mode is a rolling hot upgrade or an in-place hot upgrade;

响应于检测到所述第一时间值大于第一预设阈值时,比较所述第一时间值和所述第二时间值;In response to detecting that the first time value is greater than a first preset threshold, comparing the first time value and the second time value;

基于比较结果,确定目标更新方式。Based on the comparison results, the target update method is determined.

在一些具体实施方式中,基于比较结果,确定目标更新方式包括:In some specific implementations, determining the target update method based on the comparison result includes:

响应于检测到所述第二时间值小于或等于第一时间值,且当前时刻距目标时刻的时间范围在预设时间范围内时,确定目标更新方式为冷升级,其中,目标时刻为主机可以用于重新启动的时刻,如凌晨3点等,预设时间范围可以根据实际需求设定,如30分钟、1小时等,若一些主机需要立马进行更新,则设定的时间范围可以为1分钟等等,在此不再赘述举例;In response to detecting that the second time value is less than or equal to the first time value, and the time range between the current time and the target time is within the preset time range, determining that the target update mode is a cold upgrade, wherein the target time is a time when the host can be used for restarting, such as 3 a.m., and the preset time range can be set according to actual needs, such as 30 minutes, 1 hour, etc. If some hosts need to be updated immediately, the set time range can be 1 minute, etc., and examples are not repeated here;

响应于检测到所述第二时间值大于第一时间值,且当前时刻距目标时刻的时间范围在预设时间范围内时,确定目标更新方式为冷升级,和,原地热升级或滚动热升级,其中,第二时间值大于第一时间值指的是更新时长大于可以重启的时长,此时,确定更新方式为冷升级,以及和原地热升级或滚动热升级其中的一种进行结合,冷升级为在可以重启时间段时进行的升级方式,原地热升级或滚动热升级为超出可以重启时间段进行的升级方式;In response to detecting that the second time value is greater than the first time value, and the time range between the current moment and the target moment is within the preset time range, determining that the target update mode is a cold upgrade, and an in-place hot upgrade or a rolling hot upgrade, wherein the second time value is greater than the first time value means that the update duration is greater than the restartable duration, at this time, determining that the update mode is a cold upgrade, and combining it with an in-place hot upgrade or a rolling hot upgrade, the cold upgrade is an upgrade mode performed during the restartable time period, and the in-place hot upgrade or the rolling hot upgrade is an upgrade mode performed beyond the restartable time period;

响应于检测到所述第一时间值大于第一预设阈值,且当前时刻距目标时刻的时间范围不在预设时间范围内时,确定目标更新方式为原地热升级或滚动热升级,即当前时刻距离目标时刻时间范围过长,若要等待冷升级可能会影响业务的处理速度等问题,此时,定义更新方式为原地热升级或滚动热升级。In response to detecting that the first time value is greater than a first preset threshold, and the time range between the current moment and the target moment is not within the preset time range, the target update mode is determined to be an in-place hot upgrade or a rolling hot upgrade, that is, the time range between the current moment and the target moment is too long, and waiting for a cold upgrade may affect the processing speed of the business. At this time, the update mode is defined as an in-place hot upgrade or a rolling hot upgrade.

在一些具体实施方式中,响应于检测到目标更新方式为原地热升级或滚动热升级时,所述方法还包括:In some specific implementations, in response to detecting that the target update mode is an in-place hot upgrade or a rolling hot upgrade, the method further includes:

响应于检测到需要进行业务资源迁移时,确定目标更新方式为滚动热升级,即根据业务场景的业务重要程度等信息,确定是否需要进行业务迁移,若用户业务不能停,虚拟机不允许关闭的情况,则采用滚动热升级方式进行更新;In response to detecting the need for business resource migration, determining the target update mode as rolling hot upgrade, that is, determining whether business migration is required based on information such as the business importance of the business scenario. If the user business cannot be stopped and the virtual machine is not allowed to be shut down, the rolling hot upgrade mode is used for update;

响应于检测到不需要进行业务资源迁移时,确定目标更新方式为原地热升级,同样的,若判断可以进行业务迁移,则采用原地热升级方式进行更新。In response to detecting that no business resource migration is required, the target update mode is determined to be an in-place hot upgrade. Similarly, if it is determined that business migration is possible, the in-place hot upgrade mode is used for updating.

具体的,在多架构的虚拟化环境下,即系统中的主机包括X86_64和aarch64时,系统可以通过上述方式自动过滤出两种架构对应的不同的可用更新包,下发更新任务后,后台在构建更新子任务时,将根据节点的架构类型选择适合该架构的更新包进行更新,以实现多架构环境下所有节点的更新,若选择了冷升级方式,则需要选择重启方式,默认是立即重启,也可以更改为手动重启或计划时间重启,若选择了滚动热升级,则重启方式只能是自动重启,并且可以调整集群中主机的顺序,选择主机顺序后,系统会进行升级前检查,检查所选的主机上运行的虚拟机是否都可以迁移至其他主机,滚动热升级要求系统中有足够的空闲资源,若空闲资源不足,则将不重要的虚拟机提前关闭。Specifically, in a multi-architecture virtualization environment, that is, when the hosts in the system include X86_64 and aarch64, the system can automatically filter out the different available update packages corresponding to the two architectures in the above manner. After issuing the update task, the background will select the update package suitable for the architecture according to the architecture type of the node when building the update subtask, so as to achieve the update of all nodes in the multi-architecture environment. If the cold upgrade method is selected, you need to select the restart method. The default is to restart immediately, which can also be changed to manual restart or scheduled restart. If rolling hot upgrade is selected, the restart method can only be automatic restart, and the order of hosts in the cluster can be adjusted. After selecting the host order, the system will perform a pre-upgrade check to check whether the virtual machines running on the selected hosts can be migrated to other hosts. The rolling hot upgrade requires sufficient free resources in the system. If the free resources are insufficient, unimportant virtual machines will be shut down in advance.

在上述实施方式中,通过时间值等相关信息确定对应的更新方式,以满足不用用户虚拟机业务的个性化需求,提高了更新方式选择的灵活性,极大地提高了易用性、易维护性及产品竞争力。In the above implementation, the corresponding update method is determined by time value and other related information to meet the personalized needs of different user virtual machine services, improve the flexibility of update method selection, and greatly improve usability, maintainability and product competitiveness.

S3:基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务。S3: Based on the target update mode and the target update package, control the entity to be updated to execute a corresponding update task.

在一些具体实施方式中,如图5-图6所示,在基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务之前,所述方法还包括对虚拟化环境进行检查,具体为:In some specific implementations, as shown in FIG. 5-FIG. 6, before controlling the entity to be updated to perform the corresponding update task based on the target update mode and the target update package, the method further includes checking the virtualization environment, specifically:

构建检查结果集合和检查项,其中,检查项可以包括许可证检测、是否存在正在运行的任务、软件包一致性检测、坏盘检测、日志分区是否已满等等可能会对更新产生影响的因素;Build a check result set and check items, where the check items may include license check, whether there are running tasks, software package consistency check, bad disk check, whether the log partition is full, and other factors that may affect the update;

基于所述检查项,对虚拟化系统的环境进行检查,并将检查结果加入至所述检查结果集合中,其中,若检查项满足标准,则标记为通过,若不满足,则标记为不通过,并提示详细原因,同时将检查结果加入至所述检查结果集合;Based on the inspection items, the environment of the virtualization system is inspected, and the inspection results are added to the inspection result set, wherein if the inspection item meets the standard, it is marked as passed, and if not, it is marked as failed, and a detailed reason is prompted, and the inspection result is added to the inspection result set;

响应于检测到检查项在所述检查结果集合中均标记为通过时,即检查项全部通过,提交更新任务,并在所有主机(即待更新实体)均提交更新任务后,基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务。In response to detecting that all check items are marked as passed in the check result set, that is, all check items are passed, the update task is submitted, and after all hosts (that is, the entity to be updated) have submitted the update task, based on the target update method and the target update package, the entity to be updated is controlled to execute the corresponding update task.

在一些具体实施方式中,如图7所示,响应于检测到目标更新方式为原地热升级时,控制所述待更新实体执行对应的更新任务包括:In some specific implementations, as shown in FIG. 7 , in response to detecting that the target update mode is an in-place hot upgrade, controlling the entity to be updated to perform a corresponding update task includes:

响应于检测到更新任务时,控制所述待更新实体进入维护模式;In response to detecting an update task, controlling the entity to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,基于所述目标更新包对所述待更新实体进行更新;In response to detecting that the entity to be updated has entered a maintenance mode, updating the entity to be updated based on the target update package;

响应于检测到更新结果时,退出维护模式,并同步待更新实体的配置,以完成更新任务的执行,其中,更新结果可以是更新任务执行成功或更新任务执行失败,其通过升级状态判断是否执行成功,如未升级成功,则任务执行失败,此时主机退出维护模式,并同步主机的配置。In response to detecting an update result, the maintenance mode is exited and the configuration of the entity to be updated is synchronized to complete the execution of the update task, wherein the update result may be successful execution of the update task or failed execution of the update task. Whether the execution is successful is determined by the upgrade status. If the upgrade is not successful, the task execution fails. At this time, the host exits the maintenance mode and synchronizes the configuration of the host.

在一些具体实施方式中,如图8所示,响应于检测到目标更新方式为冷升级时,控制所述待更新实体执行对应的更新任务包括:In some specific implementations, as shown in FIG8 , in response to detecting that the target update mode is a cold upgrade, controlling the entity to be updated to perform a corresponding update task includes:

响应于检测到更新任务时,控制虚拟化系统所有待更新实体启动待更新实体升级任务,并控制所述待更新实体进入维护模式;In response to detecting an update task, controlling all entities to be updated in the virtualization system to start an entity upgrade task to be updated, and controlling the entities to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式,且所有待更新实体均已开始升级任务时,基于所述目标更新包,在目标分区对所述待更新实体进行更新,其中,目标分区为底层用于更新的第二分区,以防止更新过程中意外中断导致主机瘫痪等问题,提高系统升级的可靠性;In response to detecting that the entity to be updated has entered the maintenance mode and all entities to be updated have started the upgrade task, based on the target update package, the entity to be updated is updated in the target partition, wherein the target partition is the second partition used for updating at the bottom layer, so as to prevent problems such as host paralysis caused by accidental interruption during the update process, and improve the reliability of system upgrade;

响应于检测到虚拟化系统中存在已更新完成的待更新实体时,检测主备管理节点对应的待更新实体是否重启完成,其中,在虚拟化系统中,优先更新并重启属于主备管理节点的主机,若主备管理节点对应的待更新实体已全部重启完成,则继续更新重启其他节点的主机,此处的待更新实体为非主备管理节点所属的待更新实体;In response to detecting that there is an entity to be updated that has been updated in the virtualization system, detecting whether the entity to be updated corresponding to the active and standby management nodes has been restarted, wherein in the virtualization system, the hosts belonging to the active and standby management nodes are updated and restarted first, and if the entities to be updated corresponding to the active and standby management nodes have all been restarted, then continue to update and restart the hosts of other nodes, where the entity to be updated is the entity to be updated that does not belong to the active and standby management nodes;

响应于检测到主备管理节点对应的待更新实体均已重启完成时,安装第三方包、刷新引导项并关闭待更新实体中运行的虚拟机,其中,第三方包指的是非装机时安装的包,客户因为某种需要额外安装的组件,例如杀毒软件包等,引导项指的是指在启动主机时,用于选择不同操作系统版本或不同启动配置的一组菜单项;In response to detecting that the entities to be updated corresponding to the active and standby management nodes have all been restarted, installing a third-party package, refreshing the boot item, and shutting down the virtual machine running in the entity to be updated, wherein the third-party package refers to a package that is not installed during installation, and is a component that the customer needs to install additionally for some reason, such as an antivirus software package, etc., and the boot item refers to a group of menu items used to select different operating system versions or different startup configurations when starting the host;

响应于检测到待更新实体中运行的虚拟机均已关闭成功时,重新启动所述待更新实体;In response to detecting that all virtual machines running in the entity to be updated have been successfully shut down, restarting the entity to be updated;

响应于检测到待更新实体中存在至少一个运行的虚拟机未关闭成功时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复,即循环重复上述步骤,直至更新结束。In response to detecting that at least one running virtual machine in the entities to be updated has not been successfully shut down, re-detect whether there are entities to be updated that have been updated in the virtualization system, and repeat the above steps in a loop until the update is completed.

在一些具体实施方式中,响应于检测到存在未重启完成得主备管理节点时,即系统中存在未更新并重启的主备管理节点,所述方法包括:In some specific implementations, in response to detecting that there are active and standby management nodes that have not been completely restarted, that is, there are active and standby management nodes that have not been updated and restarted in the system, the method includes:

检测当前待更新实体是否属于主备管理节点;Check whether the entity to be updated currently belongs to the primary and backup management nodes;

响应于检测到当前待更新实体属于主备管理节点时,安装第三方包、刷新引导项并关闭当前待更新实体中运行的虚拟机,其中,此处步骤同上,在此不再赘述;In response to detecting that the current entity to be updated belongs to the primary and standby management nodes, the third-party package is installed, the boot item is refreshed, and the virtual machine running in the current entity to be updated is shut down, wherein the steps here are the same as above and will not be repeated here;

响应于检测到待更新实体中运行的虚拟机均已关闭成功时,重新启动所述待更新实体;In response to detecting that all virtual machines running in the entity to be updated have been successfully shut down, restarting the entity to be updated;

响应于检测到待更新实体中存在至少一个运行的虚拟机未关闭成功时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复,即循环重复上述步骤,直至更新结束;In response to detecting that at least one running virtual machine in the entity to be updated has not been successfully shut down, re-detecting whether there is an entity to be updated that has been updated in the virtualization system, and looping back and forth, that is, looping and repeating the above steps until the update is completed;

响应于检测到当前节点不是主备管理节点,且存在主备管理节点对应的待更新实体未重启完成时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复,即循环重复上述步骤,直至更新结束。In response to detecting that the current node is not the active/standby management node and that there are entities to be updated corresponding to the active/standby management nodes that have not been restarted, recheck whether there are entities to be updated that have been updated in the virtualization system, and repeat the above steps in a loop until the update is completed.

在一些具体实施方式中,响应于检测到待更新实体已重启成功时,所述方法包括:In some specific implementations, in response to detecting that the entity to be updated has been successfully restarted, the method includes:

待更新实体退出维护模式,并同步待更新实体的配置;The entity to be updated exits maintenance mode and synchronizes the configuration of the entity to be updated;

检测轮询待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored;

响应于检测到待更新实体的存储池已恢复挂载时,开启关闭的虚拟机,此处指的是开启升级前关闭的虚拟机,以完成更新任务的执行,若轮询超时则退出。In response to detecting that the storage pool of the entity to be updated has been restored and mounted, the shut down virtual machine is started, which refers to starting the virtual machine shut down before the upgrade, to complete the execution of the update task, and exits if the polling times out.

在一些具体实施方式中,如图9所示,响应于检测到目标更新方式为滚动热升级时,控制所述待更新实体执行对应的更新任务包括:In some specific implementations, as shown in FIG9 , in response to detecting that the target update mode is a rolling hot upgrade, controlling the entity to be updated to perform a corresponding update task includes:

响应于检测到更新任务时,判断待更新实体是否属于主备管理节点,此步骤是为了优先处理主备管理节点对应的待更新实体;In response to detecting an update task, determining whether the entity to be updated belongs to the primary and backup management nodes. This step is to give priority to processing the entities to be updated corresponding to the primary and backup management nodes;

响应于检测到所述待更新实体属于主备管理节点时,控制所述待更新实体进入维护模式;In response to detecting that the entity to be updated belongs to the primary and standby management nodes, controlling the entity to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,检测所述待更新实体中是否存在正在运行的虚拟机;In response to detecting that the entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the entity to be updated;

响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移,其中,一般是将虚拟机迁移至其他无需更新的主机;In response to detecting the existence of a running virtual machine, migrating the running virtual machine, wherein generally the virtual machine is migrated to another host that does not need to be updated;

响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述待更新实体进行更新,其中,同上,目标分区为用于更新的第二分区;In response to detecting that the running virtual machine has been successfully migrated, updating the entity to be updated in the target partition, wherein, as above, the target partition is the second partition for updating;

响应于检测到所述待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动待更新实体,该步骤同上,在此不再赘述;In response to detecting that the entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the entity to be updated, the steps are the same as above and will not be repeated here;

响应于检测到待更新实体已重新启动成功时,退出维护模式,并同步待更新实体的配置;In response to detecting that the entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the entity to be updated;

检测待更新实体的存储池是否已恢复挂载,该步骤同上,在此不再赘述;Check whether the storage pool of the entity to be updated has been restored and mounted. This step is the same as above and will not be repeated here;

响应于检测到待更新实体的存储池已恢复挂载时,迁回虚拟机,即将迁移出的虚拟机回迁至原主机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored and mounted, the virtual machine is migrated back, that is, the migrated virtual machine is migrated back to the original host to complete the execution of the update task.

在一些具体实施方式中,响应于检测到目标更新方式为滚动热升级时,控制所述待更新实体执行对应的更新任务包括:In some specific implementations, in response to detecting that the target update mode is a rolling hot upgrade, controlling the entity to be updated to perform a corresponding update task includes:

响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;

响应于检测到所述待更新实体不属于主备管理节点时,判断属于主备管理节点的待更新实体是否均已更新完成,此步骤是为了优先更新系统中主备管理节点对应的待更新实体;In response to detecting that the entity to be updated does not belong to the primary and standby management nodes, determining whether the entities to be updated that belong to the primary and standby management nodes have all been updated. This step is to give priority to updating the entities to be updated corresponding to the primary and standby management nodes in the system;

响应于检测到属于主备管理节点的待更新实体均已更新完成时,控制所述待更新实体进入维护模式;In response to detecting that all entities to be updated belonging to the primary and standby management nodes have completed updating, controlling the entities to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,检测所述待更新实体中是否存在正在运行的虚拟机;In response to detecting that the entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the entity to be updated;

响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;

响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述待更新实体进行更新,其中,同上,目标分区为用于更新的第二分区;In response to detecting that the running virtual machine has been successfully migrated, updating the entity to be updated in the target partition, wherein, as above, the target partition is the second partition for updating;

响应于检测到所述待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动待更新实体,同上文,在此不再赘述;In response to detecting that the entity to be updated has been successfully updated, installing the third-party package, refreshing the boot item, and restarting the entity to be updated, as described above, which will not be repeated here;

响应于检测到待更新实体已重新启动成功时,退出维护模式,并同步待更新实体的配置;In response to detecting that the entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the entity to be updated;

检测待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored and mounted;

响应于检测到待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.

在一些具体实施方式中,响应于检测到目标更新方式为滚动热升级时,控制所述待更新实体执行对应的更新任务包括:In some specific implementations, in response to detecting that the target update mode is a rolling hot upgrade, controlling the entity to be updated to perform a corresponding update task includes:

响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;

响应于检测到所述待更新实体不属于主备管理节点时,判断属于主备管理节点的待更新实体是否均已更新完成;In response to detecting that the entity to be updated does not belong to the primary and standby management nodes, determining whether all entities to be updated that belong to the primary and standby management nodes have been updated;

响应于检测到存在属于主备管理节点的目标待更新实体未更新完成时,控制所述目标待更新实体进入维护模式,其中,目标待更新实体为主备管理节点对应的待更新实体且未更新完成;In response to detecting that there is a target entity to be updated that belongs to the primary and standby management nodes and has not been updated, controlling the target entity to be updated to enter a maintenance mode, wherein the target entity to be updated is an entity to be updated corresponding to the primary and standby management nodes and has not been updated;

响应于检测到所述目标待更新实体已进入维护模式时,检测所述目标待更新实体中是否存在正在运行的虚拟机;In response to detecting that the target entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the target entity to be updated;

响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;

响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述目标待更新实体进行更新;In response to detecting that the running virtual machine has been successfully migrated, updating the target entity to be updated in the target partition;

响应于检测到所述目标待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动所述目标待更新实体;In response to detecting that the target entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the target entity to be updated;

响应于检测到目标待更新实体已重新启动成功时,退出维护模式,并同步目标待更新实体的配置;In response to detecting that the target entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the target entity to be updated;

检测目标待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the target entity to be updated has been restored and mounted;

响应于检测到目标待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the target entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.

在一些具体实施方式中,所述方法还包括:In some embodiments, the method further comprises:

响应于检测到虚拟机未迁移成功或存储池未恢复挂载或虚拟机未迁回成功时,重新判断待更新实体是否属于主备管理节点,并循环往复,即循环重复上述步骤,直至更新结束。In response to detecting that the virtual machine has not been successfully migrated or the storage pool has not been restored or the virtual machine has not been successfully migrated back, it is re-determined whether the entity to be updated belongs to the primary or standby management node, and the above steps are repeated repeatedly until the update is completed.

在上述实施方式中,针对不同的迁移方式提出不同的迁移策略,实现从当前任意版本升级到最新版本,从而能够极大满足用户的个性化业务需求,提高了虚拟化系统更新的灵活性、易用性和可维护性。In the above implementation, different migration strategies are proposed for different migration methods to achieve upgrading from any current version to the latest version, thereby greatly meeting the personalized business needs of users and improving the flexibility, usability and maintainability of virtualization system updates.

在一些具体实施方式中,如图10所示,在迁移虚拟机之前,所述方法还包括:In some specific implementations, as shown in FIG10 , before migrating the virtual machine, the method further includes:

基于预设函数,计算确定虚拟机迁移后的存储池使用率,其中,所述预设函数包括:Based on a preset function, the storage pool usage rate after the virtual machine migration is calculated and determined, wherein the preset function includes:

;

其中,K表示虚拟机迁移后的存储池使用率,x表示存储池使用率,y表示存储池总容量,D表示当前虚拟机磁盘容量,f表示存储池总容量,该存储池指的是目标主机的存储池;Wherein,K represents the storage pool usage rate after the virtual machine is migrated,x represents the storage pool usage rate,y represents the total capacity of the storage pool,D represents the current virtual machine disk capacity,f represents the total capacity of the storage pool, and the storage pool refers to the storage pool of the target host;

响应于检测到所述虚拟机迁移后的存储池使用率大于第二预设阈值时,关闭目标数量的虚拟机,其中,第二预设阈值可以根据实际需求设置,如90%等,即存储池使用率不能高于某个值(如90%),避免迁移后因为存储池负载过高而导致虚拟机暂停。In response to detecting that the storage pool usage after the virtual machine migration is greater than a second preset threshold, a target number of virtual machines are shut down, wherein the second preset threshold can be set according to actual needs, such as 90%, that is, the storage pool usage cannot be higher than a certain value (such as 90%), to avoid virtual machine suspension due to excessive storage pool load after migration.

在一些具体实施方式中,所述目标数量的确定方法包括:In some specific embodiments, the method for determining the target quantity includes:

根据虚拟机的重要程度,按照从高到低的顺序对虚拟机进行排序,此处的虚拟机重要程度主要通过其处理的任务重要程度来判断,一般可以通过专业人员来评估对应的重要程度并进行排序,将重要程度较高的排在前面,重要程度较低的排在后面;Sort the virtual machines according to their importance from high to low. The importance of the virtual machines here is mainly determined by the importance of the tasks they process. Generally, professionals can evaluate the corresponding importance and sort them, with the more important ones being placed in front and the less important ones being placed in the back.

基于预设区间,对排序完成的虚拟机进行划分,得到多个虚拟机区间,并基于区间内的虚拟机重要程度之和,按照从高到低的顺序对虚拟机区间进行标记,其中,预设区间可以是以数值形式进行划分,如有100个虚拟机,那么预设区间对应的值为5,即按顺序,将5个虚拟机定义为一组,并进行标记,如第一个区间标记为20,第二个区间标记为19等等,其中,标记20对应的虚拟机区间的重要程度之和最大;Based on the preset intervals, the sorted virtual machines are divided to obtain multiple virtual machine intervals, and based on the sum of the importance of the virtual machines in the intervals, the virtual machine intervals are marked in descending order, wherein the preset intervals may be divided in numerical form, such as if there are 100 virtual machines, then the value corresponding to the preset interval is 5, that is, 5 virtual machines are defined as a group in order and marked, such as the first interval is marked as 20, the second interval is marked as 19, and so on, wherein the virtual machine interval corresponding to the mark 20 has the largest sum of importance;

根据所述虚拟机迁移后的存储池使用率与第二预设阈值之间的差值,确定存储池资源使用超出量,如虚拟机迁移后的存储池使用率为95%,第二预设阈值为90%,则存储池资源使用超出量为5%;Determine the excess amount of storage pool resource usage according to the difference between the storage pool usage rate after the virtual machine migration and the second preset threshold value. For example, if the storage pool usage rate after the virtual machine migration is 95% and the second preset threshold value is 90%, the excess amount of storage pool resource usage is 5%;

基于所述存储池资源使用超出量,按照从低到高的标记顺序确定需要关闭虚拟机的虚拟机区间,即将重要程度较低且迁移过去之后可能会导致负载过大的虚拟机进行关闭;Based on the excess usage of the storage pool resources, determine the virtual machine intervals that need to shut down the virtual machines in order of marking from low to high, that is, shut down the virtual machines that are less important and may cause excessive load after migration;

响应于检测到目标虚拟机区间中的虚拟机无需全部关闭时,根据当前存储池资源使用超出量以及目标虚拟机区间中每个虚拟机的资源占用量,匹配确定所述目标虚拟机区间中需要关闭的虚拟机,具体的,若根据存储池资源使用超出量以及每个虚拟机区间的虚拟机资源占用量,确定需要关闭的虚拟机区间为2个加上第三个虚拟机区间中的部分虚拟机,则判断关闭两个虚拟机区间的虚拟机之后,还剩余多少存储池资源使用超出量,根据该超出量选取出第三个区间内单个或累加后最接近的超出量的虚拟机,作为需要关闭的虚拟机,其中,此处优先比较单个虚拟机的资源占用量,之后再考虑多个虚拟机累加后的资源占用量,从而减少关闭的虚拟机数量,以避免出现业务数据丢失等问题;In response to detecting that all virtual machines in the target virtual machine interval do not need to be shut down, the virtual machines that need to be shut down in the target virtual machine interval are matched and determined according to the current excess storage pool resource usage and the resource occupancy of each virtual machine in the target virtual machine interval. Specifically, if it is determined that the virtual machine intervals that need to be shut down are 2 plus some virtual machines in the third virtual machine interval according to the excess storage pool resource usage and the virtual machine resource occupancy of each virtual machine interval, then it is determined how much excess storage pool resource usage remains after shutting down the virtual machines in the two virtual machine intervals, and according to the excess, a single virtual machine or a virtual machine with the closest excess after cumulative addition in the third interval is selected as the virtual machine that needs to be shut down, wherein the resource occupancy of a single virtual machine is compared first, and then the accumulated resource occupancy of multiple virtual machines is considered, thereby reducing the number of virtual machines to be shut down to avoid problems such as business data loss;

基于需要关闭的虚拟机,确定所述目标数量,即根据需要关闭的虚拟机确定对应的数量,如需要关闭2个虚拟机区间以及第三个虚拟机区间内的三个虚拟机,则对应的目标数量为13个。The target number is determined based on the virtual machines that need to be shut down, that is, the corresponding number is determined according to the virtual machines that need to be shut down. For example, if two virtual machine intervals and three virtual machines in the third virtual machine interval need to be shut down, the corresponding target number is 13.

在一些具体实施方式中,所述虚拟机的迁移方法包括:In some specific implementations, the virtual machine migration method includes:

获取待更新实体中当前正在运行的虚拟机,生成一一映射关系,并根据虚拟机的负载,按照从大到小的顺序进行排序,其中,虚拟机的负载可以根据内存计算逻辑内存、内存、CPU、磁盘的运行情况确定,对其进行排序以便于后续优先为高负载的虚拟机匹配目标主机,避免出现大配置虚拟机最后调度,找不到可用主机,阻止升级的情况;Get the currently running virtual machines in the entity to be updated, generate a one-to-one mapping relationship, and sort them in descending order according to the load of the virtual machine. The load of the virtual machine can be determined according to the operation status of the memory computing logic memory, memory, CPU, and disk. Sorting them is to facilitate the subsequent priority matching of the target host for the virtual machine with high load, so as to avoid the situation where the large configuration virtual machine is scheduled last and cannot find an available host, thus preventing the upgrade;

根据虚拟机的存储区域,确定虚拟机的迁移方式,其中,若虚拟机在共享存储上时,使用计算迁移,若虚拟机在本地存储上时,使用整机迁移,计算迁移只变更主机,整机迁移为跨主机跨存储迁移;Determine the migration method of the virtual machine based on the storage area of the virtual machine. If the virtual machine is on shared storage, use computing migration. If the virtual machine is on local storage, use whole machine migration. Computing migration only changes the host, while whole machine migration is cross-host and cross-storage migration.

获取目标实体列表,基于排序顺序和目标迁移方式,多线程地将所述虚拟机逐步迁移至目标实体,其中,目标实体指的是无需进行更新的主机,按照负载从大到小顺序及对应的迁移方式对虚拟机进行迁移。Obtain a list of target entities, and based on the sorting order and the target migration method, gradually migrate the virtual machines to the target entities in a multi-threaded manner, wherein the target entity refers to a host that does not need to be updated, and migrate the virtual machines in order of load from large to small and in a corresponding migration method.

具体的,在虚拟机进行迁移之前,获取主机运行虚拟机列表并创建虚拟机和目标主机集合,遍历虚拟机列表,同时,遍历非当前虚拟机所运行的非宿主机列表和当前虚拟机所运行的主机列表,基于虚拟机存储区域以及存储池等判断需要迁移的虚拟机,并将虚拟机和当前主机加入值配对结合中,此时,遍历配对集合并迁移对应虚拟机。Specifically, before the virtual machine is migrated, a list of virtual machines running on the host is obtained and a set of virtual machines and target hosts is created. The list of virtual machines is traversed. At the same time, a list of non-host machines where the current virtual machine is not running and a list of hosts where the current virtual machine is running are traversed. The virtual machines that need to be migrated are determined based on the virtual machine storage area and storage pool, and the virtual machines and the current host are added to the value pairing combination. At this time, the pairing set is traversed and the corresponding virtual machines are migrated.

进一步的,在虚拟机选择目标主机时,需满足以下原则:为避免虚拟机都迁往同一台主机导致排队耗时,在目标主机满足条件的情况下,尽可能将虚拟机分散迁移至不同主机,尽可能多地并发迁移更多虚拟机;主机上运行的虚拟机按照负载(内存计算逻辑内存,同时需要考虑内存、CPU、磁盘等)从高到底进行排序,优先为高负载的虚拟机匹配目标主机,避免出现大配置虚拟机最后调度,找不到可用主机,阻止升级的情况;升级过程中迁移虚拟机取消限速或者尽可能提高限速;共享存储上的虚拟机使用计算迁移,本地存储上的虚拟机使用整机迁移;计算存储池容量是否满足时,不仅考虑利用率,也考虑剩余容量,通过预设函数计算出虚拟机迁移后的存储池使用率,这个使用率越小优先级越高,最后的存储池使用率不能高于某个值(90%),避免迁移后因为存储池负载过高而导致虚拟机暂停;减少虚拟机迁移次数,一台虚拟机只迁移两次,即迁出和回迁;提供方式支持升级前进行迁移规划,并整理成特定格式的迁移规划配置文件,迁移虚拟机时优先根据该配置文件进行迁移。Furthermore, when a virtual machine selects a target host, the following principles must be met: To avoid queuing and wasting time when all virtual machines are migrated to the same host, if the target host meets the conditions, virtual machines should be migrated to different hosts as much as possible, and as many virtual machines as possible should be migrated concurrently; virtual machines running on the host should be sorted from high to low according to load (memory calculation logical memory, and memory, CPU, disk, etc. should also be considered), and target hosts should be matched with high-load virtual machines first to avoid the situation where large-configuration virtual machines are scheduled last and cannot find available hosts, thus preventing upgrades; during the upgrade process, the speed limit for migrating virtual machines should be canceled or increased as much as possible; on shared storage The virtual machines on the local storage use compute migration, and the virtual machines on the local storage use whole machine migration. When calculating whether the storage pool capacity is sufficient, not only the utilization rate but also the remaining capacity is considered. The storage pool utilization rate after the virtual machine migration is calculated through the preset function. The lower the utilization rate, the higher the priority. The final storage pool utilization rate cannot be higher than a certain value (90%) to avoid virtual machine suspension due to excessive storage pool load after migration. Reduce the number of virtual machine migrations. A virtual machine is migrated only twice, namely, migration out and migration back. Provide a method to support migration planning before upgrading, and organize it into a migration planning configuration file in a specific format. When migrating virtual machines, migration is performed according to this configuration file first.

更进一步的,本申请针对不同的升级方式配置对应的升级策略,在选择待更新实体和更新包后,系统会进行环境检测,检测通过,则会根据更新包信息以及所选的待更新实体具体情况给出建议的升级方式,不同的升级方式对应的升级策略也是不同的,例如冷升级支持配置重启方式,重启方式支持立即重启、手动重启和计划时间重启,滚动热升级支持集群中的主机调整升级顺序,并且滚动热升级在升级前会进行迁移前检查,如果存在某个节点的虚拟机不支持迁移到其他主机,则会报错提示用户,阻止升级,更新包的滚动热升级与冷升级,在更新后如果用户想回退,可以支持回退到上一个版本,只需刷新引导项,重启切换到原分区即可,更新任务下发后,支持轮播的形式展示升级详情,包括该任务所更新节点的各个更新关键步骤的开始时间、结束时间、状态、描述等信息,也会展示整个更新任务的总体进度以及总耗时时间,在更新成功后,会将各个节点的更新信息记录到更新历史中。Furthermore, the present application configures corresponding upgrade strategies for different upgrade methods. After selecting the entity to be updated and the update package, the system will perform an environmental test. If the test passes, it will give a recommended upgrade method based on the update package information and the specific situation of the selected entity to be updated. The upgrade strategies corresponding to different upgrade methods are also different. For example, cold upgrade supports the configuration of restart method. The restart method supports immediate restart, manual restart and scheduled restart. The rolling hot upgrade supports the hosts in the cluster to adjust the upgrade order, and the rolling hot upgrade will perform a pre-migration check before the upgrade. If the virtual machine of a certain node does not support migration to other hosts, an error will be reported to the user to prevent the upgrade. The rolling hot upgrade and cold upgrade of the update package, if the user wants to roll back after the update, it can support rolling back to the previous version. Just refresh the boot item and restart and switch to the original partition. After the update task is issued, it supports the display of upgrade details in the form of a carousel, including the start time, end time, status, description and other information of each key update step of the node updated by the task, and also displays the overall progress and total time of the entire update task. After the update is successful, the update information of each node will be recorded in the update history.

在上述实施方式中,通过对虚拟机需关闭个数进行确定,并在迁移之前关闭对应个数的虚拟机,避免迁移后因为存储池负载过高而导致虚拟机暂停,且多并发地对虚拟机进行迁移,避免出现大配置虚拟机最后调度,找不到可用主机,阻止升级的情况,提高了虚拟化系统更新的可靠性。In the above implementation, by determining the number of virtual machines that need to be shut down and shutting down the corresponding number of virtual machines before migration, it is avoided that the virtual machines are suspended due to excessive storage pool load after migration, and the virtual machines are migrated concurrently to avoid the situation where a large-configuration virtual machine is last scheduled and cannot find an available host, thereby preventing the upgrade, thereby improving the reliability of the virtualization system update.

上述虚拟化系统更新方法中,所述方法包括:获取至少一个更新包,并基于构建的待更新实体,从所述更新包中确定目标更新包,其中,所述虚拟化系统中包括至少一个待更新实体;基于所述待更新实体和所述目标更新包,确定目标更新方式,其中,更新方式至少包括原地热升级、滚动热升级和冷升级;基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务,本申请能够应用于多架构虚拟化环境,并可以根据不同的环境以及多样的更新场景,提供不同的更新方式及对应的更新策略,提高了虚拟化系统更新的灵活性,避免人工操作失误引起的一系列问题,提高了虚拟化系统更新的可靠性和可维护性,降低了成本。In the above-mentioned virtualization system update method, the method includes: obtaining at least one update package, and based on the constructed entity to be updated, determining a target update package from the update package, wherein the virtualization system includes at least one entity to be updated; based on the entity to be updated and the target update package, determining a target update method, wherein the update method at least includes in-place hot upgrade, rolling hot upgrade and cold upgrade; based on the target update method and the target update package, controlling the entity to be updated to perform a corresponding update task. The present application can be applied to a multi-architecture virtualization environment, and can provide different update methods and corresponding update strategies according to different environments and various update scenarios, thereby improving the flexibility of virtualization system updates, avoiding a series of problems caused by manual operation errors, improving the reliability and maintainability of virtualization system updates, and reducing costs.

应该理解的是,虽然图2-图3的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-图3中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the various steps in the flow charts of Fig. 2-Fig. 3 are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in Fig. 2-Fig. 3 may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图11所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种虚拟化系统更新方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG11. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a virtualized system update method is implemented. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

本领域技术人员可以理解,图11中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art will understand that the structure shown in FIG. 11 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现以下步骤:In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

S1:获取至少一个更新包,并基于构建的待更新实体,从所述更新包中确定目标更新包,其中,所述虚拟化系统中包括至少一个待更新实体;S1: obtaining at least one update package, and determining a target update package from the update packages based on the constructed entity to be updated, wherein the virtualization system includes at least one entity to be updated;

S2:基于所述待更新实体的第一时间值和所述目标更新包的第二时间值,确定目标更新方式,其中,更新方式至少包括原地热升级、滚动热升级和冷升级,所述第一时间值用于描述待更新实体可用于重新启动的时长,所述第二时间值用于描述更新包的更新时长;S2: Determine a target update mode based on a first time value of the entity to be updated and a second time value of the target update package, wherein the update mode includes at least in-place hot upgrade, rolling hot upgrade and cold upgrade, the first time value is used to describe the duration of the entity to be updated that can be used for restarting, and the second time value is used to describe the update duration of the update package;

S3:基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务。S3: Based on the target update mode and the target update package, control the entity to be updated to execute a corresponding update task.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

检测更新包的名称是否符合预设标准;Check whether the name of the update package meets the preset standard;

响应于检测到所述更新包的名称符合预设标准时,对所述更新包进行解压并解析;In response to detecting that the name of the update package meets a preset standard, decompressing and parsing the update package;

对解析后的更新包进行校验;Verify the parsed update package;

响应于检测到更新包已校验通过时,将解析后的更新包存储至主节点的数据库;In response to detecting that the update package has passed the verification, storing the parsed update package in the database of the master node;

同时,检测是否存在备节点;At the same time, check whether there is a backup node;

响应于检测到存在备节点时,将解析后的更新包同步至备节点的数据库。In response to detecting the existence of a standby node, the parsed update package is synchronized to the database of the standby node.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

获取实体的属性参数,并对所述属性参数进行筛选,得到用于更新的属性参数;Acquire attribute parameters of the entity, and filter the attribute parameters to obtain attribute parameters for updating;

基于所述用于更新的属性参数与对应的实体形成的映射关系,生成所述待更新实体。The entity to be updated is generated based on the mapping relationship formed between the attribute parameters for updating and the corresponding entity.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

获取待更新实体的属性参数;Get the attribute parameters of the entity to be updated;

基于所述待更新实体的属性参数,匹配数据库中的更新包,定义匹配成功的更新包为所述目标更新包。Based on the attribute parameters of the entity to be updated, the update packages in the database are matched, and the update package that is successfully matched is defined as the target update package.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

获取所述待更新实体所属的业务场景,并基于所述业务场景,确定第一时间值;Acquire a business scenario to which the entity to be updated belongs, and determine a first time value based on the business scenario;

获取所述目标更新包对应的第二时间值;Obtaining a second time value corresponding to the target update package;

响应于检测到所述第一时间值小于或等于第一预设阈值时,确定目标更新方式为滚动热升级或原地热升级;In response to detecting that the first time value is less than or equal to a first preset threshold, determining that the target update mode is a rolling hot upgrade or an in-place hot upgrade;

响应于检测到所述第一时间值大于第一预设阈值时,比较所述第一时间值和所述第二时间值;In response to detecting that the first time value is greater than a first preset threshold, comparing the first time value and the second time value;

基于比较结果,确定目标更新方式。Based on the comparison results, the target update method is determined.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

响应于检测到所述第二时间值小于或等于第一时间值,且当前时刻距目标时刻的时间范围在预设时间范围内时,确定目标更新方式为冷升级;In response to detecting that the second time value is less than or equal to the first time value, and the time range between the current time and the target time is within a preset time range, determining that the target update mode is a cold upgrade;

响应于检测到所述第二时间值大于第一时间值,且当前时刻距目标时刻的时间范围在预设时间范围内时,确定目标更新方式为冷升级,和,原地热升级或滚动热升级;In response to detecting that the second time value is greater than the first time value, and the time range between the current time and the target time is within a preset time range, determining that the target update mode is a cold upgrade, an in-place hot upgrade, or a rolling hot upgrade;

响应于检测到所述第一时间值大于第一预设阈值,且当前时刻距目标时刻的时间范围不在预设时间范围内时,确定目标更新方式为原地热升级或滚动热升级。In response to detecting that the first time value is greater than a first preset threshold and the time range between the current time and the target time is not within the preset time range, determining that the target update mode is an in-place hot upgrade or a rolling hot upgrade.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

响应于检测到需要进行业务资源迁移时,确定目标更新方式为滚动热升级;In response to detecting that a business resource migration is required, determining that a target update mode is a rolling hot upgrade;

响应于检测到不需要进行业务资源迁移时,确定目标更新方式为原地热升级。In response to detecting that no business resource migration is required, determining that the target update mode is an in-place hot upgrade.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

构建检查结果集合和检查项;Build inspection result sets and inspection items;

基于所述检查项,对虚拟化系统的环境进行检查,并将检查结果加入至所述检查结果集合中;Based on the inspection items, inspect the environment of the virtualization system, and add the inspection results to the inspection result set;

响应于检测到检查项在所述检查结果集合中均标记为通过时,基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务。In response to detecting that all check items in the check result set are marked as passed, the to-be-updated entity is controlled to execute a corresponding update task based on the target update mode and the target update package.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

响应于检测到更新任务时,控制所述待更新实体进入维护模式;In response to detecting an update task, controlling the entity to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,基于所述目标更新包对所述待更新实体进行更新;In response to detecting that the entity to be updated has entered a maintenance mode, updating the entity to be updated based on the target update package;

响应于检测到更新结果时,退出维护模式,并同步待更新实体的配置,以完成更新任务的执行。In response to detecting the update result, the maintenance mode is exited, and the configuration of the entity to be updated is synchronized to complete the execution of the update task.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

响应于检测到更新任务时,控制所述待更新实体进入维护模式;In response to detecting an update task, controlling the entity to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,基于所述目标更新包,在目标分区对所述待更新实体进行更新;In response to detecting that the entity to be updated has entered a maintenance mode, updating the entity to be updated in a target partition based on the target update package;

响应于检测到虚拟化系统中存在已更新完成的待更新实体时,检测主备管理节点对应的待更新实体是否重启完成;In response to detecting that there is an entity to be updated that has been updated in the virtualization system, detecting whether the entity to be updated corresponding to the active and standby management nodes has been restarted;

响应于检测到主备管理节点对应的待更新实体均已重启完成时,安装第三方包、刷新引导项并关闭待更新实体中运行的虚拟机;In response to detecting that the entities to be updated corresponding to the active and standby management nodes have all been restarted, installing a third-party package, refreshing the boot item, and shutting down the virtual machine running in the entity to be updated;

响应于检测到待更新实体中运行的虚拟机均已关闭成功时,重新启动所述待更新实体;In response to detecting that all virtual machines running in the entity to be updated have been successfully shut down, restarting the entity to be updated;

响应于检测到待更新实体中存在至少一个运行的虚拟机未关闭成功时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复。In response to detecting that at least one running virtual machine in the entities to be updated has not been successfully shut down, re-detecting whether there are entities to be updated that have been updated in the virtualization system, and repeating the cycle.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

检测当前待更新实体是否属于主备管理节点;Check whether the entity to be updated currently belongs to the primary and backup management nodes;

响应于检测到当前待更新实体属于主备管理节点时,安装第三方包、刷新引导项并关闭当前待更新实体中运行的虚拟机;In response to detecting that the current entity to be updated belongs to the primary and standby management nodes, installing a third-party package, refreshing the boot item, and shutting down the virtual machine running in the current entity to be updated;

响应于检测到待更新实体中运行的虚拟机均已关闭成功时,重新启动所述待更新实体;In response to detecting that all virtual machines running in the entity to be updated have been successfully shut down, restarting the entity to be updated;

响应于检测到待更新实体中存在至少一个运行的虚拟机未关闭成功时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复;In response to detecting that at least one running virtual machine in the entities to be updated has not been successfully shut down, re-detecting whether there is an entity to be updated that has been updated in the virtualization system, and repeating the process in a loop;

响应于检测到当前节点不是主备管理节点,且存在主备管理节点对应的待更新实体未重启完成时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复。In response to detecting that the current node is not the active/standby management node and that there are entities to be updated corresponding to the active/standby management nodes that have not been restarted, re-detecting whether there are entities to be updated that have been updated in the virtualization system is repeated, and the cycle is repeated.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

退出维护模式,并同步待更新实体的配置;Exit maintenance mode and synchronize the configuration of the entity to be updated;

检测待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored and mounted;

响应于检测到待更新实体的存储池已恢复挂载时,开启关闭的虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored to mount, the shut down virtual machine is started to complete the execution of the update task.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;

响应于检测到所述待更新实体属于主备管理节点时,控制所述待更新实体进入维护模式;In response to detecting that the entity to be updated belongs to the primary and standby management nodes, controlling the entity to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,检测所述待更新实体中是否存在正在运行的虚拟机;In response to detecting that the entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the entity to be updated;

响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;

响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述待更新实体进行更新;In response to detecting that the running virtual machine has been successfully migrated, updating the entity to be updated in the target partition;

响应于检测到所述待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动待更新实体;In response to detecting that the entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the entity to be updated;

响应于检测到待更新实体已重新启动成功时,退出维护模式,并同步待更新实体的配置;In response to detecting that the entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the entity to be updated;

检测待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored and mounted;

响应于检测到待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;

响应于检测到所述待更新实体不属于主备管理节点时,判断属于主备管理节点的待更新实体是否均已更新完成;In response to detecting that the entity to be updated does not belong to the primary and standby management nodes, determining whether all entities to be updated that belong to the primary and standby management nodes have been updated;

响应于检测到属于主备管理节点的待更新实体均已更新完成时,控制所述待更新实体进入维护模式;In response to detecting that all entities to be updated belonging to the primary and standby management nodes have completed updating, controlling the entities to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,检测所述待更新实体中是否存在正在运行的虚拟机;In response to detecting that the entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the entity to be updated;

响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;

响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述待更新实体进行更新;In response to detecting that the running virtual machine has been successfully migrated, updating the entity to be updated in the target partition;

响应于检测到所述待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动待更新实体;In response to detecting that the entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the entity to be updated;

响应于检测到待更新实体已重新启动成功时,退出维护模式,并同步待更新实体的配置;In response to detecting that the entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the entity to be updated;

检测待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored and mounted;

响应于检测到待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;

响应于检测到所述待更新实体不属于主备管理节点时,判断属于主备管理节点的待更新实体是否均已更新完成;In response to detecting that the entity to be updated does not belong to the primary and standby management nodes, determining whether all entities to be updated that belong to the primary and standby management nodes have been updated;

响应于检测到存在属于主备管理节点的目标待更新实体未更新完成时,控制所述目标待更新实体进入维护模式;In response to detecting that there is a target entity to be updated that belongs to the primary and standby management nodes and has not been updated, controlling the target entity to be updated to enter a maintenance mode;

响应于检测到所述目标待更新实体已进入维护模式时,检测所述目标待更新实体中是否存在正在运行的虚拟机;In response to detecting that the target entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the target entity to be updated;

响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;

响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述目标待更新实体进行更新;In response to detecting that the running virtual machine has been successfully migrated, updating the target entity to be updated in the target partition;

响应于检测到所述目标待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动所述目标待更新实体;In response to detecting that the target entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the target entity to be updated;

响应于检测到目标待更新实体已重新启动成功时,退出维护模式,并同步目标待更新实体的配置;In response to detecting that the target entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the target entity to be updated;

检测目标待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the target entity to be updated has been restored and mounted;

响应于检测到目标待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the target entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

响应于检测到虚拟机未迁移成功或存储池未恢复挂载或虚拟机未迁回成功时,重新判断待更新实体是否属于主备管理节点,并循环往复。In response to detecting that the virtual machine has not been successfully migrated or the storage pool has not been restored or the virtual machine has not been successfully migrated back, it is re-determined whether the entity to be updated belongs to the primary or standby management node, and the process is repeated.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

基于预设函数,计算确定虚拟机迁移后的存储池使用率,其中,所述预设函数包括:Based on a preset function, the storage pool usage rate after the virtual machine migration is calculated and determined, wherein the preset function includes:

;

其中,K表示虚拟机迁移后的存储池使用率,x表示存储池使用率,y表示存储池总容量,D表示当前虚拟机磁盘容量,f表示存储池总容量;Wherein,K represents the storage pool usage rate after the virtual machine is migrated,x represents the storage pool usage rate,y represents the total capacity of the storage pool,D represents the current virtual machine disk capacity, andf represents the total capacity of the storage pool;

响应于检测到所述虚拟机迁移后的存储池使用率大于第二预设阈值时,关闭目标数量的虚拟机。In response to detecting that the storage pool usage rate after the migration of the virtual machine is greater than a second preset threshold, shutting down a target number of virtual machines.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

根据虚拟机的重要程度,按照从高到低的顺序对虚拟机进行排序;Sort the virtual machines in descending order according to their importance;

基于预设区间,对排序完成的虚拟机进行划分,得到多个虚拟机区间,并基于区间内的虚拟机重要程度之和,按照从高到低的顺序对虚拟机区间进行标记;Based on the preset intervals, the sorted virtual machines are divided to obtain multiple virtual machine intervals, and the virtual machine intervals are marked in descending order based on the sum of the importance of the virtual machines in the intervals;

根据所述虚拟机迁移后的存储池使用率与第二预设阈值之间的差值,确定存储池资源使用超出量;Determining an excess amount of storage pool resource usage according to a difference between the storage pool usage rate after the virtual machine migration and a second preset threshold;

基于所述存储池资源使用超出量,按照从低到高的标记顺序确定需要关闭虚拟机的虚拟机区间;Based on the excess usage of the storage pool resources, determine the virtual machine intervals that need to shut down the virtual machines in order of marking from low to high;

响应于检测到目标虚拟机区间中的虚拟机无需全部关闭时,根据当前存储池资源使用超出量以及目标虚拟机区间中每个虚拟机的资源占用量,匹配确定所述目标虚拟机区间中需要关闭的虚拟机;In response to detecting that all virtual machines in the target virtual machine interval do not need to be shut down, matching and determining virtual machines in the target virtual machine interval that need to be shut down according to the current excess storage pool resource usage and the resource occupancy of each virtual machine in the target virtual machine interval;

基于需要关闭的虚拟机,确定所述目标数量。The target number is determined based on the virtual machines that need to be shut down.

在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

获取待更新实体中当前正在运行的虚拟机,生成一一映射关系,并根据虚拟机的负载,按照从大到小的顺序进行排序;Obtain the currently running virtual machines in the entity to be updated, generate a one-to-one mapping relationship, and sort them in descending order according to the load of the virtual machines;

根据虚拟机的存储区域,确定虚拟机的迁移方式;Determine the migration method of the virtual machine based on the storage area of the virtual machine;

获取目标实体列表,基于排序顺序和目标迁移方式,多线程地将所述虚拟机逐步迁移至目标实体。A target entity list is obtained, and based on a sorting order and a target migration mode, the virtual machines are gradually migrated to the target entities in a multi-threaded manner.

在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

S1:获取至少一个更新包,并基于构建的待更新实体,从所述更新包中确定目标更新包,其中,所述虚拟化系统中包括至少一个待更新实体;S1: obtaining at least one update package, and determining a target update package from the update packages based on the constructed entity to be updated, wherein the virtualization system includes at least one entity to be updated;

S2:基于所述待更新实体的第一时间值和所述目标更新包的第二时间值,确定目标更新方式,其中,更新方式至少包括原地热升级、滚动热升级和冷升级,所述第一时间值用于描述待更新实体可用于重新启动的时长,所述第二时间值用于描述更新包的更新时长;S2: Determine a target update mode based on a first time value of the entity to be updated and a second time value of the target update package, wherein the update mode includes at least in-place hot upgrade, rolling hot upgrade and cold upgrade, the first time value is used to describe the duration of the entity to be updated that can be used for restarting, and the second time value is used to describe the update duration of the update package;

S3:基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务。S3: Based on the target update mode and the target update package, control the entity to be updated to execute a corresponding update task.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

检测更新包的名称是否符合预设标准;Check whether the name of the update package meets the preset standard;

响应于检测到所述更新包的名称符合预设标准时,对所述更新包进行解压并解析;In response to detecting that the name of the update package meets a preset standard, decompressing and parsing the update package;

对解析后的更新包进行校验;Verify the parsed update package;

响应于检测到更新包已校验通过时,将解析后的更新包存储至主节点的数据库;In response to detecting that the update package has passed the verification, storing the parsed update package in the database of the master node;

同时,检测是否存在备节点;At the same time, check whether there is a backup node;

响应于检测到存在备节点时,将解析后的更新包同步至备节点的数据库。In response to detecting the existence of a standby node, the parsed update package is synchronized to the database of the standby node.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

获取实体的属性参数,并对所述属性参数进行筛选,得到用于更新的属性参数;Acquire attribute parameters of the entity, and filter the attribute parameters to obtain attribute parameters for updating;

基于所述用于更新的属性参数与对应的实体形成的映射关系,生成所述待更新实体。The entity to be updated is generated based on the mapping relationship formed between the attribute parameters for updating and the corresponding entity.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

获取待更新实体的属性参数;Get the attribute parameters of the entity to be updated;

基于所述待更新实体的属性参数,匹配数据库中的更新包,定义匹配成功的更新包为所述目标更新包。Based on the attribute parameters of the entity to be updated, the update packages in the database are matched, and the update package that is successfully matched is defined as the target update package.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

获取所述待更新实体所属的业务场景,并基于所述业务场景,确定第一时间值;Acquire a business scenario to which the entity to be updated belongs, and determine a first time value based on the business scenario;

获取所述目标更新包对应的第二时间值;Obtaining a second time value corresponding to the target update package;

响应于检测到所述第一时间值小于或等于第一预设阈值时,确定目标更新方式为滚动热升级或原地热升级;In response to detecting that the first time value is less than or equal to a first preset threshold, determining that the target update mode is a rolling hot upgrade or an in-place hot upgrade;

响应于检测到所述第一时间值大于第一预设阈值时,比较所述第一时间值和所述第二时间值;In response to detecting that the first time value is greater than a first preset threshold, comparing the first time value and the second time value;

基于比较结果,确定目标更新方式。Based on the comparison results, the target update method is determined.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

响应于检测到所述第二时间值小于或等于第一时间值,且当前时刻距目标时刻的时间范围在预设时间范围内时,确定目标更新方式为冷升级;In response to detecting that the second time value is less than or equal to the first time value, and the time range between the current time and the target time is within a preset time range, determining that the target update mode is a cold upgrade;

响应于检测到所述第二时间值大于第一时间值,且当前时刻距目标时刻的时间范围在预设时间范围内时,确定目标更新方式为冷升级,和,原地热升级或滚动热升级;In response to detecting that the second time value is greater than the first time value, and the time range between the current time and the target time is within a preset time range, determining that the target update mode is a cold upgrade, an in-place hot upgrade, or a rolling hot upgrade;

响应于检测到所述第一时间值大于第一预设阈值,且当前时刻距目标时刻的时间范围不在预设时间范围内时,确定目标更新方式为原地热升级或滚动热升级。In response to detecting that the first time value is greater than a first preset threshold and the time range between the current time and the target time is not within the preset time range, determining that the target update mode is an in-place hot upgrade or a rolling hot upgrade.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

响应于检测到需要进行业务资源迁移时,确定目标更新方式为滚动热升级;In response to detecting that a business resource migration is required, determining that a target update mode is a rolling hot upgrade;

响应于检测到不需要进行业务资源迁移时,确定目标更新方式为原地热升级。In response to detecting that no business resource migration is required, determining that the target update mode is an in-place hot upgrade.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

构建检查结果集合和检查项;Build inspection result sets and inspection items;

基于所述检查项,对虚拟化系统的环境进行检查,并将检查结果加入至所述检查结果集合中;Based on the inspection items, inspect the environment of the virtualization system, and add the inspection results to the inspection result set;

响应于检测到检查项在所述检查结果集合中均标记为通过时,基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务。In response to detecting that all check items in the check result set are marked as passed, the to-be-updated entity is controlled to execute a corresponding update task based on the target update mode and the target update package.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

响应于检测到更新任务时,控制所述待更新实体进入维护模式;In response to detecting an update task, controlling the entity to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,基于所述目标更新包对所述待更新实体进行更新;In response to detecting that the entity to be updated has entered a maintenance mode, updating the entity to be updated based on the target update package;

响应于检测到更新结果时,退出维护模式,并同步待更新实体的配置,以完成更新任务的执行。In response to detecting the update result, the maintenance mode is exited, and the configuration of the entity to be updated is synchronized to complete the execution of the update task.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

响应于检测到更新任务时,控制所述待更新实体进入维护模式;In response to detecting an update task, controlling the entity to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,基于所述目标更新包,在目标分区对所述待更新实体进行更新;In response to detecting that the entity to be updated has entered a maintenance mode, updating the entity to be updated in a target partition based on the target update package;

响应于检测到虚拟化系统中存在已更新完成的待更新实体时,检测主备管理节点对应的待更新实体是否重启完成;In response to detecting that there is an entity to be updated that has been updated in the virtualization system, detecting whether the entity to be updated corresponding to the active and standby management nodes has been restarted;

响应于检测到主备管理节点对应的待更新实体均已重启完成时,安装第三方包、刷新引导项并关闭待更新实体中运行的虚拟机;In response to detecting that the entities to be updated corresponding to the active and standby management nodes have all been restarted, installing a third-party package, refreshing the boot item, and shutting down the virtual machine running in the entity to be updated;

响应于检测到待更新实体中运行的虚拟机均已关闭成功时,重新启动所述待更新实体;In response to detecting that all virtual machines running in the entity to be updated have been successfully shut down, restarting the entity to be updated;

响应于检测到待更新实体中存在至少一个运行的虚拟机未关闭成功时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复。In response to detecting that at least one running virtual machine in the entities to be updated has not been successfully shut down, re-detecting whether there are entities to be updated that have been updated in the virtualization system, and repeating the cycle.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

检测当前待更新实体是否属于主备管理节点;Check whether the entity to be updated currently belongs to the primary and backup management nodes;

响应于检测到当前待更新实体属于主备管理节点时,安装第三方包、刷新引导项并关闭当前待更新实体中运行的虚拟机;In response to detecting that the current entity to be updated belongs to the primary and standby management nodes, installing a third-party package, refreshing the boot item, and shutting down the virtual machine running in the current entity to be updated;

响应于检测到待更新实体中运行的虚拟机均已关闭成功时,重新启动所述待更新实体;In response to detecting that all virtual machines running in the entity to be updated have been successfully shut down, restarting the entity to be updated;

响应于检测到待更新实体中存在至少一个运行的虚拟机未关闭成功时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复;In response to detecting that at least one running virtual machine in the entities to be updated has not been successfully shut down, re-detecting whether there is an entity to be updated that has been updated in the virtualization system, and repeating the process in a loop;

响应于检测到当前节点不是主备管理节点,且存在主备管理节点对应的待更新实体未重启完成时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复。In response to detecting that the current node is not the active/standby management node and that there are entities to be updated corresponding to the active/standby management nodes that have not been restarted, re-detecting whether there are entities to be updated that have been updated in the virtualization system is repeated, and the cycle is repeated.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

退出维护模式,并同步待更新实体的配置;Exit maintenance mode and synchronize the configuration of the entity to be updated;

检测待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored and mounted;

响应于检测到待更新实体的存储池已恢复挂载时,开启关闭的虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored to mount, the shut down virtual machine is started to complete the execution of the update task.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;

响应于检测到所述待更新实体属于主备管理节点时,控制所述待更新实体进入维护模式;In response to detecting that the entity to be updated belongs to the primary and standby management nodes, controlling the entity to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,检测所述待更新实体中是否存在正在运行的虚拟机;In response to detecting that the entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the entity to be updated;

响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;

响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述待更新实体进行更新;In response to detecting that the running virtual machine has been successfully migrated, updating the entity to be updated in the target partition;

响应于检测到所述待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动待更新实体;In response to detecting that the entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the entity to be updated;

响应于检测到待更新实体已重新启动成功时,退出维护模式,并同步待更新实体的配置;In response to detecting that the entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the entity to be updated;

检测待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored and mounted;

响应于检测到待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;

响应于检测到所述待更新实体不属于主备管理节点时,判断属于主备管理节点的待更新实体是否均已更新完成;In response to detecting that the entity to be updated does not belong to the primary and standby management nodes, determining whether all entities to be updated that belong to the primary and standby management nodes have been updated;

响应于检测到属于主备管理节点的待更新实体均已更新完成时,控制所述待更新实体进入维护模式;In response to detecting that all entities to be updated belonging to the primary and standby management nodes have completed updating, controlling the entities to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,检测所述待更新实体中是否存在正在运行的虚拟机;In response to detecting that the entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the entity to be updated;

响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;

响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述待更新实体进行更新;In response to detecting that the running virtual machine has been successfully migrated, updating the entity to be updated in the target partition;

响应于检测到所述待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动待更新实体;In response to detecting that the entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the entity to be updated;

响应于检测到待更新实体已重新启动成功时,退出维护模式,并同步待更新实体的配置;In response to detecting that the entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the entity to be updated;

检测待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored and mounted;

响应于检测到待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;

响应于检测到所述待更新实体不属于主备管理节点时,判断属于主备管理节点的待更新实体是否均已更新完成;In response to detecting that the entity to be updated does not belong to the primary and standby management nodes, determining whether all entities to be updated that belong to the primary and standby management nodes have been updated;

响应于检测到存在属于主备管理节点的目标待更新实体未更新完成时,控制所述目标待更新实体进入维护模式;In response to detecting that there is a target entity to be updated that belongs to the primary and standby management nodes and has not been updated, controlling the target entity to be updated to enter a maintenance mode;

响应于检测到所述目标待更新实体已进入维护模式时,检测所述目标待更新实体中是否存在正在运行的虚拟机;In response to detecting that the target entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the target entity to be updated;

响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;

响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述目标待更新实体进行更新;In response to detecting that the running virtual machine has been successfully migrated, updating the target entity to be updated in the target partition;

响应于检测到所述目标待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动所述目标待更新实体;In response to detecting that the target entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the target entity to be updated;

响应于检测到目标待更新实体已重新启动成功时,退出维护模式,并同步目标待更新实体的配置;In response to detecting that the target entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the target entity to be updated;

检测目标待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the target entity to be updated has been restored and mounted;

响应于检测到目标待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the target entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

响应于检测到虚拟机未迁移成功或存储池未恢复挂载或虚拟机未迁回成功时,重新判断待更新实体是否属于主备管理节点,并循环往复。In response to detecting that the virtual machine has not been successfully migrated or the storage pool has not been restored or the virtual machine has not been successfully migrated back, it is re-determined whether the entity to be updated belongs to the primary or standby management node, and the process is repeated.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

基于预设函数,计算确定虚拟机迁移后的存储池使用率,其中,所述预设函数包括:Based on a preset function, the storage pool usage rate after the virtual machine migration is calculated and determined, wherein the preset function includes:

;

其中,K表示虚拟机迁移后的存储池使用率,x表示存储池使用率,y表示存储池总容量,D表示当前虚拟机磁盘容量,f表示存储池总容量;Wherein,K represents the storage pool usage rate after the virtual machine is migrated,x represents the storage pool usage rate,y represents the total capacity of the storage pool,D represents the current virtual machine disk capacity, andf represents the total capacity of the storage pool;

响应于检测到所述虚拟机迁移后的存储池使用率大于第二预设阈值时,关闭目标数量的虚拟机。In response to detecting that the storage pool usage rate after the migration of the virtual machine is greater than a second preset threshold, shutting down a target number of virtual machines.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

根据虚拟机的重要程度,按照从高到低的顺序对虚拟机进行排序;Sort the virtual machines in descending order according to their importance;

基于预设区间,对排序完成的虚拟机进行划分,得到多个虚拟机区间,并基于区间内的虚拟机重要程度之和,按照从高到低的顺序对虚拟机区间进行标记;Based on the preset intervals, the sorted virtual machines are divided to obtain multiple virtual machine intervals, and the virtual machine intervals are marked in descending order based on the sum of the importance of the virtual machines in the intervals;

根据所述虚拟机迁移后的存储池使用率与第二预设阈值之间的差值,确定存储池资源使用超出量;Determining an excess amount of storage pool resource usage according to a difference between the storage pool usage rate after the virtual machine migration and a second preset threshold;

基于所述存储池资源使用超出量,按照从低到高的标记顺序确定需要关闭虚拟机的虚拟机区间;Based on the excess usage of the storage pool resources, determine the virtual machine intervals that need to shut down the virtual machines in order of marking from low to high;

响应于检测到目标虚拟机区间中的虚拟机无需全部关闭时,根据当前存储池资源使用超出量以及目标虚拟机区间中每个虚拟机的资源占用量,匹配确定所述目标虚拟机区间中需要关闭的虚拟机;In response to detecting that all virtual machines in the target virtual machine interval do not need to be shut down, matching and determining virtual machines in the target virtual machine interval that need to be shut down according to the current excess storage pool resource usage and the resource occupancy of each virtual machine in the target virtual machine interval;

基于需要关闭的虚拟机,确定所述目标数量。The target number is determined based on the virtual machines that need to be shut down.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

获取待更新实体中当前正在运行的虚拟机,生成一一映射关系,并根据虚拟机的负载,按照从大到小的顺序进行排序;Obtain the currently running virtual machines in the entity to be updated, generate a one-to-one mapping relationship, and sort them in descending order according to the load of the virtual machines;

根据虚拟机的存储区域,确定虚拟机的迁移方式;Determine the migration method of the virtual machine based on the storage area of the virtual machine;

获取目标实体列表,基于排序顺序和目标迁移方式,多线程地将所述虚拟机逐步迁移至目标实体。A target entity list is obtained, and based on a sorting order and a target migration mode, the virtual machines are gradually migrated to the target entities in a multi-threaded manner.

在一个实施例中,提供了一种计算机程序产品,所述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer program product is provided, the computer program product comprising a computer program, the computer program when executed by a processor implements the following steps:

S1:获取至少一个更新包,并基于构建的待更新实体,从所述更新包中确定目标更新包,其中,所述虚拟化系统中包括至少一个待更新实体;S1: obtaining at least one update package, and determining a target update package from the update packages based on the constructed entity to be updated, wherein the virtualization system includes at least one entity to be updated;

S2:基于所述待更新实体的第一时间值和所述目标更新包的第二时间值,确定目标更新方式,其中,更新方式至少包括原地热升级、滚动热升级和冷升级,所述第一时间值用于描述待更新实体可用于重新启动的时长,所述第二时间值用于描述更新包的更新时长;S2: Determine a target update mode based on a first time value of the entity to be updated and a second time value of the target update package, wherein the update mode includes at least in-place hot upgrade, rolling hot upgrade and cold upgrade, the first time value is used to describe the duration of the entity to be updated that can be used for restarting, and the second time value is used to describe the update duration of the update package;

S3:基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务。S3: Based on the target update mode and the target update package, control the entity to be updated to execute a corresponding update task.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

检测更新包的名称是否符合预设标准;Check whether the name of the update package meets the preset standard;

响应于检测到所述更新包的名称符合预设标准时,对所述更新包进行解压并解析;In response to detecting that the name of the update package meets a preset standard, decompressing and parsing the update package;

对解析后的更新包进行校验;Verify the parsed update package;

响应于检测到更新包已校验通过时,将解析后的更新包存储至主节点的数据库;In response to detecting that the update package has passed the verification, storing the parsed update package in the database of the master node;

同时,检测是否存在备节点;At the same time, check whether there is a backup node;

响应于检测到存在备节点时,将解析后的更新包同步至备节点的数据库。In response to detecting the existence of a standby node, the parsed update package is synchronized to the database of the standby node.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

获取实体的属性参数,并对所述属性参数进行筛选,得到用于更新的属性参数;Acquire attribute parameters of the entity, and filter the attribute parameters to obtain attribute parameters for updating;

基于所述用于更新的属性参数与对应的实体形成的映射关系,生成所述待更新实体。The entity to be updated is generated based on the mapping relationship formed between the attribute parameters for updating and the corresponding entity.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

获取待更新实体的属性参数;Get the attribute parameters of the entity to be updated;

基于所述待更新实体的属性参数,匹配数据库中的更新包,定义匹配成功的更新包为所述目标更新包。Based on the attribute parameters of the entity to be updated, the update packages in the database are matched, and the update package that is successfully matched is defined as the target update package.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

获取所述待更新实体所属的业务场景,并基于所述业务场景,确定第一时间值;Acquire a business scenario to which the entity to be updated belongs, and determine a first time value based on the business scenario;

获取所述目标更新包对应的第二时间值;Obtaining a second time value corresponding to the target update package;

响应于检测到所述第一时间值小于或等于第一预设阈值时,确定目标更新方式为滚动热升级或原地热升级;In response to detecting that the first time value is less than or equal to a first preset threshold, determining that the target update mode is a rolling hot upgrade or an in-place hot upgrade;

响应于检测到所述第一时间值大于第一预设阈值时,比较所述第一时间值和所述第二时间值;In response to detecting that the first time value is greater than a first preset threshold, comparing the first time value and the second time value;

基于比较结果,确定目标更新方式。Based on the comparison results, the target update method is determined.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

响应于检测到所述第二时间值小于或等于第一时间值,且当前时刻距目标时刻的时间范围在预设时间范围内时,确定目标更新方式为冷升级;In response to detecting that the second time value is less than or equal to the first time value, and the time range between the current time and the target time is within a preset time range, determining that the target update mode is a cold upgrade;

响应于检测到所述第二时间值大于第一时间值,且当前时刻距目标时刻的时间范围在预设时间范围内时,确定目标更新方式为冷升级,和,原地热升级或滚动热升级;In response to detecting that the second time value is greater than the first time value, and the time range between the current time and the target time is within a preset time range, determining that the target update mode is a cold upgrade, an in-place hot upgrade, or a rolling hot upgrade;

响应于检测到所述第一时间值大于第一预设阈值,且当前时刻距目标时刻的时间范围不在预设时间范围内时,确定目标更新方式为原地热升级或滚动热升级。In response to detecting that the first time value is greater than a first preset threshold and the time range between the current time and the target time is not within the preset time range, determining that the target update mode is an in-place hot upgrade or a rolling hot upgrade.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

响应于检测到需要进行业务资源迁移时,确定目标更新方式为滚动热升级;In response to detecting that a business resource migration is required, determining that a target update mode is a rolling hot upgrade;

响应于检测到不需要进行业务资源迁移时,确定目标更新方式为原地热升级。In response to detecting that no business resource migration is required, determining that the target update mode is an in-place hot upgrade.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

构建检查结果集合和检查项;Build inspection result sets and inspection items;

基于所述检查项,对虚拟化系统的环境进行检查,并将检查结果加入至所述检查结果集合中;Based on the inspection items, inspect the environment of the virtualization system, and add the inspection results to the inspection result set;

响应于检测到检查项在所述检查结果集合中均标记为通过时,基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务。In response to detecting that all check items in the check result set are marked as passed, the to-be-updated entity is controlled to execute a corresponding update task based on the target update mode and the target update package.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

响应于检测到更新任务时,控制所述待更新实体进入维护模式;In response to detecting an update task, controlling the entity to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,基于所述目标更新包对所述待更新实体进行更新;In response to detecting that the entity to be updated has entered a maintenance mode, updating the entity to be updated based on the target update package;

响应于检测到更新结果时,退出维护模式,并同步待更新实体的配置,以完成更新任务的执行。In response to detecting the update result, the maintenance mode is exited, and the configuration of the entity to be updated is synchronized to complete the execution of the update task.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

响应于检测到更新任务时,控制所述待更新实体进入维护模式;In response to detecting an update task, controlling the entity to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,基于所述目标更新包,在目标分区对所述待更新实体进行更新;In response to detecting that the entity to be updated has entered a maintenance mode, updating the entity to be updated in a target partition based on the target update package;

响应于检测到虚拟化系统中存在已更新完成的待更新实体时,检测主备管理节点对应的待更新实体是否重启完成;In response to detecting that there is an entity to be updated that has been updated in the virtualization system, detecting whether the entity to be updated corresponding to the active and standby management nodes has been restarted;

响应于检测到主备管理节点对应的待更新实体均已重启完成时,安装第三方包、刷新引导项并关闭待更新实体中运行的虚拟机;In response to detecting that the entities to be updated corresponding to the active and standby management nodes have all been restarted, installing a third-party package, refreshing the boot item, and shutting down the virtual machine running in the entity to be updated;

响应于检测到待更新实体中运行的虚拟机均已关闭成功时,重新启动所述待更新实体;In response to detecting that all virtual machines running in the entity to be updated have been successfully shut down, restarting the entity to be updated;

响应于检测到待更新实体中存在至少一个运行的虚拟机未关闭成功时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复。In response to detecting that at least one running virtual machine in the entities to be updated has not been successfully shut down, re-detecting whether there are entities to be updated that have been updated in the virtualization system, and repeating the cycle.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

检测当前待更新实体是否属于主备管理节点;Check whether the entity to be updated currently belongs to the primary and backup management nodes;

响应于检测到当前待更新实体属于主备管理节点时,安装第三方包、刷新引导项并关闭当前待更新实体中运行的虚拟机;In response to detecting that the current entity to be updated belongs to the primary and standby management nodes, installing a third-party package, refreshing the boot item, and shutting down the virtual machine running in the current entity to be updated;

响应于检测到待更新实体中运行的虚拟机均已关闭成功时,重新启动所述待更新实体;In response to detecting that all virtual machines running in the entity to be updated have been successfully shut down, restarting the entity to be updated;

响应于检测到待更新实体中存在至少一个运行的虚拟机未关闭成功时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复;In response to detecting that at least one running virtual machine in the entities to be updated has not been successfully shut down, re-detecting whether there is an entity to be updated that has been updated in the virtualization system, and repeating the process in a loop;

响应于检测到当前节点不是主备管理节点,且存在主备管理节点对应的待更新实体未重启完成时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复。In response to detecting that the current node is not the active/standby management node and that there are entities to be updated corresponding to the active/standby management nodes that have not been restarted, re-detecting whether there are entities to be updated that have been updated in the virtualization system is repeated, and the cycle is repeated.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

退出维护模式,并同步待更新实体的配置;Exit maintenance mode and synchronize the configuration of the entity to be updated;

检测待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored and mounted;

响应于检测到待更新实体的存储池已恢复挂载时,开启关闭的虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored to mount, the shut down virtual machine is started to complete the execution of the update task.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;

响应于检测到所述待更新实体属于主备管理节点时,控制所述待更新实体进入维护模式;In response to detecting that the entity to be updated belongs to the primary and standby management nodes, controlling the entity to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,检测所述待更新实体中是否存在正在运行的虚拟机;In response to detecting that the entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the entity to be updated;

响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;

响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述待更新实体进行更新;In response to detecting that the running virtual machine has been successfully migrated, updating the entity to be updated in the target partition;

响应于检测到所述待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动待更新实体;In response to detecting that the entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the entity to be updated;

响应于检测到待更新实体已重新启动成功时,退出维护模式,并同步待更新实体的配置;In response to detecting that the entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the entity to be updated;

检测待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored and mounted;

响应于检测到待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;

响应于检测到所述待更新实体不属于主备管理节点时,判断属于主备管理节点的待更新实体是否均已更新完成;In response to detecting that the entity to be updated does not belong to the primary and standby management nodes, determining whether all entities to be updated that belong to the primary and standby management nodes have been updated;

响应于检测到属于主备管理节点的待更新实体均已更新完成时,控制所述待更新实体进入维护模式;In response to detecting that all entities to be updated belonging to the primary and standby management nodes have completed updating, controlling the entities to be updated to enter a maintenance mode;

响应于检测到所述待更新实体已进入维护模式时,检测所述待更新实体中是否存在正在运行的虚拟机;In response to detecting that the entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the entity to be updated;

响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;

响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述待更新实体进行更新;In response to detecting that the running virtual machine has been successfully migrated, updating the entity to be updated in the target partition;

响应于检测到所述待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动待更新实体;In response to detecting that the entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the entity to be updated;

响应于检测到待更新实体已重新启动成功时,退出维护模式,并同步待更新实体的配置;In response to detecting that the entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the entity to be updated;

检测待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored and mounted;

响应于检测到待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;

响应于检测到所述待更新实体不属于主备管理节点时,判断属于主备管理节点的待更新实体是否均已更新完成;In response to detecting that the entity to be updated does not belong to the primary and standby management nodes, determining whether all entities to be updated that belong to the primary and standby management nodes have been updated;

响应于检测到存在属于主备管理节点的目标待更新实体未更新完成时,控制所述目标待更新实体进入维护模式;In response to detecting that there is a target entity to be updated that belongs to the primary and standby management nodes and has not been updated, controlling the target entity to be updated to enter a maintenance mode;

响应于检测到所述目标待更新实体已进入维护模式时,检测所述目标待更新实体中是否存在正在运行的虚拟机;In response to detecting that the target entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the target entity to be updated;

响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;

响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述目标待更新实体进行更新;In response to detecting that the running virtual machine has been successfully migrated, updating the target entity to be updated in the target partition;

响应于检测到所述目标待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动所述目标待更新实体;In response to detecting that the target entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the target entity to be updated;

响应于检测到目标待更新实体已重新启动成功时,退出维护模式,并同步目标待更新实体的配置;In response to detecting that the target entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the target entity to be updated;

检测目标待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the target entity to be updated has been restored and mounted;

响应于检测到目标待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the target entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

响应于检测到虚拟机未迁移成功或存储池未恢复挂载或虚拟机未迁回成功时,重新判断待更新实体是否属于主备管理节点,并循环往复。In response to detecting that the virtual machine has not been successfully migrated or the storage pool has not been restored or the virtual machine has not been successfully migrated back, it is re-determined whether the entity to be updated belongs to the primary or standby management node, and the process is repeated.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

基于预设函数,计算确定虚拟机迁移后的存储池使用率,其中,所述预设函数包括:Based on a preset function, the storage pool usage rate after the virtual machine migration is calculated and determined, wherein the preset function includes:

;

其中,K表示虚拟机迁移后的存储池使用率,x表示存储池使用率,y表示存储池总容量,D表示当前虚拟机磁盘容量,f表示存储池总容量;Wherein,K represents the storage pool usage rate after the virtual machine is migrated,x represents the storage pool usage rate,y represents the total capacity of the storage pool,D represents the current virtual machine disk capacity, andf represents the total capacity of the storage pool;

响应于检测到所述虚拟机迁移后的存储池使用率大于第二预设阈值时,关闭目标数量的虚拟机。In response to detecting that the storage pool usage rate after the migration of the virtual machine is greater than a second preset threshold, shutting down a target number of virtual machines.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

根据虚拟机的重要程度,按照从高到低的顺序对虚拟机进行排序;Sort the virtual machines in descending order according to their importance;

基于预设区间,对排序完成的虚拟机进行划分,得到多个虚拟机区间,并基于区间内的虚拟机重要程度之和,按照从高到低的顺序对虚拟机区间进行标记;Based on the preset intervals, the sorted virtual machines are divided to obtain multiple virtual machine intervals, and the virtual machine intervals are marked in descending order based on the sum of the importance of the virtual machines in the intervals;

根据所述虚拟机迁移后的存储池使用率与第二预设阈值之间的差值,确定存储池资源使用超出量;Determining an excess amount of storage pool resource usage according to a difference between the storage pool usage rate after the virtual machine migration and a second preset threshold;

基于所述存储池资源使用超出量,按照从低到高的标记顺序确定需要关闭虚拟机的虚拟机区间;Based on the excess usage of the storage pool resources, determine the virtual machine intervals that need to shut down the virtual machines in order of marking from low to high;

响应于检测到目标虚拟机区间中的虚拟机无需全部关闭时,根据当前存储池资源使用超出量以及目标虚拟机区间中每个虚拟机的资源占用量,匹配确定所述目标虚拟机区间中需要关闭的虚拟机;In response to detecting that all virtual machines in the target virtual machine interval do not need to be shut down, matching and determining virtual machines in the target virtual machine interval that need to be shut down according to the current excess storage pool resource usage and the resource occupancy of each virtual machine in the target virtual machine interval;

基于需要关闭的虚拟机,确定所述目标数量。The target number is determined based on the virtual machines that need to be shut down.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

获取待更新实体中当前正在运行的虚拟机,生成一一映射关系,并根据虚拟机的负载,按照从大到小的顺序进行排序;Obtain the currently running virtual machines in the entity to be updated, generate a one-to-one mapping relationship, and sort them in descending order according to the load of the virtual machines;

根据虚拟机的存储区域,确定虚拟机的迁移方式;Determine the migration method of the virtual machine based on the storage area of the virtual machine;

获取目标实体列表,基于排序顺序和目标迁移方式,多线程地将所述虚拟机逐步迁移至目标实体。A target entity list is obtained, and based on a sorting order and a target migration mode, the virtual machines are gradually migrated to the target entities in a multi-threaded manner.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink) DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and/or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application.

Claims (22)

Translated fromChinese
1.一种虚拟化系统更新方法,其特征在于,所述方法包括:1. A virtualization system update method, characterized in that the method comprises:获取至少一个更新包,并基于构建的待更新实体,从所述更新包中确定目标更新包,其中,所述虚拟化系统中包括至少一个待更新实体;Acquire at least one update package, and determine a target update package from the update packages based on the constructed entity to be updated, wherein the virtualization system includes at least one entity to be updated;基于所述待更新实体的第一时间值和所述目标更新包的第二时间值,确定目标更新方式,其中,更新方式至少包括原地热升级、滚动热升级和冷升级,所述第一时间值用于描述待更新实体可用于重新启动的时长,所述第二时间值用于描述更新包的更新时长;Determine a target update mode based on a first time value of the entity to be updated and a second time value of the target update package, wherein the update mode includes at least in-place hot upgrade, rolling hot upgrade and cold upgrade, the first time value is used to describe the duration of the entity to be updated that can be used for restarting, and the second time value is used to describe the update duration of the update package;基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务。Based on the target update mode and the target update package, the entity to be updated is controlled to execute a corresponding update task.2.根据权利要求1所述的虚拟化系统更新方法,其特征在于,在获取至少一个更新包之前,所述方法还包括:2. The virtualization system update method according to claim 1, characterized in that before obtaining at least one update package, the method further comprises:检测更新包的名称是否符合预设标准;Check whether the name of the update package meets the preset standard;响应于检测到所述更新包的名称符合预设标准时,对所述更新包进行解压并解析;In response to detecting that the name of the update package meets a preset standard, decompressing and parsing the update package;对解析后的更新包进行校验;Verify the parsed update package;响应于检测到更新包已校验通过时,将解析后的更新包存储至主节点的数据库;In response to detecting that the update package has passed the verification, storing the parsed update package in the database of the master node;同时,检测是否存在备节点;At the same time, check whether there is a backup node;响应于检测到存在备节点时,将解析后的更新包同步至备节点的数据库。In response to detecting the existence of a standby node, the parsed update package is synchronized to the database of the standby node.3.根据权利要求1所述的虚拟化系统更新方法,其特征在于,所述待更新实体的构建方法包括:3. The virtualization system updating method according to claim 1, wherein the method for constructing the entity to be updated comprises:获取实体的属性参数,并对所述属性参数进行筛选,得到用于更新的属性参数;Acquire attribute parameters of the entity, and filter the attribute parameters to obtain attribute parameters for updating;基于所述用于更新的属性参数与对应的实体形成的映射关系,生成所述待更新实体。The entity to be updated is generated based on the mapping relationship formed between the attribute parameters for updating and the corresponding entity.4.根据权利要求1所述的虚拟化系统更新方法,其特征在于,所述目标更新包的确定方法包括:4. The virtualization system update method according to claim 1, wherein the method for determining the target update package comprises:获取待更新实体的属性参数;Get the attribute parameters of the entity to be updated;基于所述待更新实体的属性参数,匹配数据库中的更新包,定义匹配成功的更新包为所述目标更新包。Based on the attribute parameters of the entity to be updated, the update packages in the database are matched, and the update package that is successfully matched is defined as the target update package.5.根据权利要求1所述的虚拟化系统更新方法,其特征在于,基于所述待更新实体的第一时间值和所述目标更新包的第二时间值,确定目标更新方式包括:5. The virtualization system update method according to claim 1, characterized in that determining the target update mode based on the first time value of the entity to be updated and the second time value of the target update package comprises:获取所述待更新实体所属的业务场景,并基于所述业务场景,确定第一时间值;Acquire a business scenario to which the entity to be updated belongs, and determine a first time value based on the business scenario;获取所述目标更新包对应的第二时间值;Obtaining a second time value corresponding to the target update package;响应于检测到所述第一时间值小于或等于第一预设阈值时,确定目标更新方式为滚动热升级或原地热升级;In response to detecting that the first time value is less than or equal to a first preset threshold, determining that the target update mode is a rolling hot upgrade or an in-place hot upgrade;响应于检测到所述第一时间值大于第一预设阈值时,比较所述第一时间值和所述第二时间值;In response to detecting that the first time value is greater than a first preset threshold, comparing the first time value and the second time value;基于比较结果,确定目标更新方式。Based on the comparison results, the target update method is determined.6.根据权利要求5所述的虚拟化系统更新方法,其特征在于,基于比较结果,确定目标更新方式包括:6. The virtualization system update method according to claim 5, wherein determining the target update method based on the comparison result comprises:响应于检测到所述第二时间值小于或等于第一时间值,且当前时刻距目标时刻的时间范围在预设时间范围内时,确定目标更新方式为冷升级;In response to detecting that the second time value is less than or equal to the first time value, and the time range between the current time and the target time is within a preset time range, determining that the target update mode is a cold upgrade;响应于检测到所述第二时间值大于第一时间值,且当前时刻距目标时刻的时间范围在预设时间范围内时,确定目标更新方式为冷升级,和,原地热升级或滚动热升级;In response to detecting that the second time value is greater than the first time value, and the time range between the current time and the target time is within a preset time range, determining that the target update mode is a cold upgrade, an in-place hot upgrade, or a rolling hot upgrade;响应于检测到所述第一时间值大于第一预设阈值,且当前时刻距目标时刻的时间范围不在预设时间范围内时,确定目标更新方式为原地热升级或滚动热升级。In response to detecting that the first time value is greater than a first preset threshold and the time range between the current time and the target time is not within the preset time range, determining that the target update mode is an in-place hot upgrade or a rolling hot upgrade.7.根据权利要求5或6所述的虚拟化系统更新方法,其特征在于,响应于检测到目标更新方式为原地热升级或滚动热升级时,所述方法还包括:7. The virtualization system update method according to claim 5 or 6, characterized in that, in response to detecting that the target update mode is an in-place hot upgrade or a rolling hot upgrade, the method further comprises:响应于检测到需要进行业务资源迁移时,确定目标更新方式为滚动热升级;In response to detecting that a business resource migration is required, determining that a target update mode is a rolling hot upgrade;响应于检测到不需要进行业务资源迁移时,确定目标更新方式为原地热升级。In response to detecting that no business resource migration is required, determining that the target update mode is an in-place hot upgrade.8.根据权利要求1所述的虚拟化系统更新方法,其特征在于,在基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务之前,所述方法还包括:8. The virtualization system update method according to claim 1, characterized in that before controlling the entity to be updated to perform a corresponding update task based on the target update mode and the target update package, the method further comprises:构建检查结果集合和检查项;Build inspection result sets and inspection items;基于所述检查项,对虚拟化系统的环境进行检查,并将检查结果加入至所述检查结果集合中;Based on the inspection items, inspect the environment of the virtualization system, and add the inspection results to the inspection result set;响应于检测到检查项在所述检查结果集合中均标记为通过时,基于所述目标更新方式和所述目标更新包,控制所述待更新实体执行对应的更新任务。In response to detecting that all check items in the check result set are marked as passed, the to-be-updated entity is controlled to execute a corresponding update task based on the target update mode and the target update package.9.根据权利要求1所述的虚拟化系统更新方法,其特征在于,响应于检测到目标更新方式为原地热升级时,控制所述待更新实体执行对应的更新任务包括:9. The virtualization system update method according to claim 1, characterized in that in response to detecting that the target update mode is an in-place hot upgrade, controlling the entity to be updated to perform a corresponding update task comprises:响应于检测到更新任务时,控制所述待更新实体进入维护模式;In response to detecting an update task, controlling the entity to be updated to enter a maintenance mode;响应于检测到所述待更新实体已进入维护模式时,基于所述目标更新包对所述待更新实体进行更新;In response to detecting that the entity to be updated has entered a maintenance mode, updating the entity to be updated based on the target update package;响应于检测到更新结果时,退出维护模式,并同步待更新实体的配置,以完成更新任务的执行。In response to detecting the update result, the maintenance mode is exited, and the configuration of the entity to be updated is synchronized to complete the execution of the update task.10.根据权利要求1所述的虚拟化系统更新方法,其特征在于,响应于检测到目标更新方式为冷升级时,控制所述待更新实体执行对应的更新任务包括:10. The virtualization system update method according to claim 1, wherein in response to detecting that the target update mode is a cold upgrade, controlling the entity to be updated to perform a corresponding update task comprises:响应于检测到更新任务时,控制所述待更新实体进入维护模式;In response to detecting an update task, controlling the entity to be updated to enter a maintenance mode;响应于检测到所述待更新实体已进入维护模式时,基于所述目标更新包,在目标分区对所述待更新实体进行更新;In response to detecting that the entity to be updated has entered a maintenance mode, updating the entity to be updated in a target partition based on the target update package;响应于检测到虚拟化系统中存在已更新完成的待更新实体时,检测主备管理节点对应的待更新实体是否重启完成;In response to detecting that there is an entity to be updated that has been updated in the virtualization system, detecting whether the entity to be updated corresponding to the active and standby management nodes has been restarted;响应于检测到主备管理节点对应的待更新实体均已重启完成时,安装第三方包、刷新引导项并关闭待更新实体中运行的虚拟机;In response to detecting that the entities to be updated corresponding to the active and standby management nodes have all been restarted, installing a third-party package, refreshing the boot item, and shutting down the virtual machine running in the entity to be updated;响应于检测到待更新实体中运行的虚拟机均已关闭成功时,重新启动所述待更新实体;In response to detecting that all virtual machines running in the entity to be updated have been successfully shut down, restarting the entity to be updated;响应于检测到待更新实体中存在至少一个运行的虚拟机未关闭成功时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复。In response to detecting that at least one running virtual machine in the entities to be updated has not been successfully shut down, re-detecting whether there are entities to be updated that have been updated in the virtualization system, and repeating the cycle.11.根据权利要求10所述的虚拟化系统更新方法,其特征在于,响应于检测到存在未重启完成得主备管理节点时,所述方法包括:11. The virtualization system update method according to claim 10, characterized in that, in response to detecting that there are active and standby management nodes that have not been completely restarted, the method comprises:检测当前待更新实体是否属于主备管理节点;Check whether the entity to be updated currently belongs to the primary and backup management nodes;响应于检测到当前待更新实体属于主备管理节点时,安装第三方包、刷新引导项并关闭当前待更新实体中运行的虚拟机;In response to detecting that the current entity to be updated belongs to the primary and standby management nodes, installing a third-party package, refreshing the boot item, and shutting down the virtual machine running in the current entity to be updated;响应于检测到待更新实体中运行的虚拟机均已关闭成功时,重新启动所述待更新实体;In response to detecting that all virtual machines running in the entity to be updated have been successfully shut down, restarting the entity to be updated;响应于检测到待更新实体中存在至少一个运行的虚拟机未关闭成功时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复;In response to detecting that at least one running virtual machine in the entities to be updated has not been successfully shut down, re-detecting whether there is an entity to be updated that has been updated in the virtualization system, and repeating the process in a loop;响应于检测到当前节点不是主备管理节点,且存在主备管理节点对应的待更新实体未重启完成时,重新检测虚拟化系统中是否存在已更新完成的待更新实体,并循环往复。In response to detecting that the current node is not the active/standby management node and that there are entities to be updated corresponding to the active/standby management nodes that have not been restarted, re-detecting whether there are entities to be updated that have been updated in the virtualization system is repeated, and the cycle is repeated.12.根据权利要求10所述的虚拟化系统更新方法,其特征在于,响应于检测到待更新实体已重启成功时,所述方法包括:12. The virtualization system update method according to claim 10, characterized in that, in response to detecting that the entity to be updated has been restarted successfully, the method comprises:退出维护模式,并同步待更新实体的配置;Exit maintenance mode and synchronize the configuration of the entity to be updated;检测待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored and mounted;响应于检测到待更新实体的存储池已恢复挂载时,开启关闭的虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored to mount, the shut down virtual machine is started to complete the execution of the update task.13.根据权利要求1所述的虚拟化系统更新方法,其特征在于,响应于检测到目标更新方式为滚动热升级时,控制所述待更新实体执行对应的更新任务包括:13. The virtualization system update method according to claim 1, wherein in response to detecting that the target update mode is a rolling hot upgrade, controlling the entity to be updated to execute the corresponding update task comprises:响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;响应于检测到所述待更新实体属于主备管理节点时,控制所述待更新实体进入维护模式;In response to detecting that the entity to be updated belongs to the primary and standby management nodes, controlling the entity to be updated to enter a maintenance mode;响应于检测到所述待更新实体已进入维护模式时,检测所述待更新实体中是否存在正在运行的虚拟机;In response to detecting that the entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the entity to be updated;响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述待更新实体进行更新;In response to detecting that the running virtual machine has been successfully migrated, updating the entity to be updated in the target partition;响应于检测到所述待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动待更新实体;In response to detecting that the entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the entity to be updated;响应于检测到待更新实体已重新启动成功时,退出维护模式,并同步待更新实体的配置;In response to detecting that the entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the entity to be updated;检测待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored and mounted;响应于检测到待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.14.根据权利要求1所述的虚拟化系统更新方法,其特征在于,响应于检测到目标更新方式为滚动热升级时,控制所述待更新实体执行对应的更新任务包括:14. The virtualization system update method according to claim 1, wherein in response to detecting that the target update mode is a rolling hot upgrade, controlling the entity to be updated to execute a corresponding update task comprises:响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;响应于检测到所述待更新实体不属于主备管理节点时,判断属于主备管理节点的待更新实体是否均已更新完成;In response to detecting that the entity to be updated does not belong to the primary and standby management nodes, determining whether all entities to be updated that belong to the primary and standby management nodes have been updated;响应于检测到属于主备管理节点的待更新实体均已更新完成时,控制所述待更新实体进入维护模式;In response to detecting that all entities to be updated belonging to the primary and standby management nodes have completed updating, controlling the entities to be updated to enter a maintenance mode;响应于检测到所述待更新实体已进入维护模式时,检测所述待更新实体中是否存在正在运行的虚拟机;In response to detecting that the entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the entity to be updated;响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述待更新实体进行更新;In response to detecting that the running virtual machine has been successfully migrated, updating the entity to be updated in the target partition;响应于检测到所述待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动待更新实体;In response to detecting that the entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the entity to be updated;响应于检测到待更新实体已重新启动成功时,退出维护模式,并同步待更新实体的配置;In response to detecting that the entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the entity to be updated;检测待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the entity to be updated has been restored and mounted;响应于检测到待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.15.根据权利要求1所述的虚拟化系统更新方法,其特征在于,响应于检测到目标更新方式为滚动热升级时,控制所述待更新实体执行对应的更新任务包括:15. The virtualization system update method according to claim 1, wherein in response to detecting that the target update mode is a rolling hot upgrade, controlling the entity to be updated to execute the corresponding update task comprises:响应于检测到更新任务时,判断待更新实体是否属于主备管理节点;In response to detecting an update task, determining whether the entity to be updated belongs to a primary or standby management node;响应于检测到所述待更新实体不属于主备管理节点时,判断属于主备管理节点的待更新实体是否均已更新完成;In response to detecting that the entity to be updated does not belong to the primary and standby management nodes, determining whether all entities to be updated that belong to the primary and standby management nodes have been updated;响应于检测到存在属于主备管理节点的目标待更新实体未更新完成时,控制所述目标待更新实体进入维护模式;In response to detecting that there is a target entity to be updated that belongs to the primary and standby management nodes and has not been updated, controlling the target entity to be updated to enter a maintenance mode;响应于检测到所述目标待更新实体已进入维护模式时,检测所述目标待更新实体中是否存在正在运行的虚拟机;In response to detecting that the target entity to be updated has entered a maintenance mode, detecting whether there is a running virtual machine in the target entity to be updated;响应于检测到存在正在运行的虚拟机时,对所述正在运行的虚拟机进行迁移;In response to detecting the existence of a running virtual machine, migrating the running virtual machine;响应于检测到所述正在运行的虚拟机已迁移成功时,在目标分区对所述目标待更新实体进行更新;In response to detecting that the running virtual machine has been successfully migrated, updating the target entity to be updated in the target partition;响应于检测到所述目标待更新实体已更新成功时,安装第三方包、刷新引导项并重新启动所述目标待更新实体;In response to detecting that the target entity to be updated has been successfully updated, installing a third-party package, refreshing the boot item, and restarting the target entity to be updated;响应于检测到目标待更新实体已重新启动成功时,退出维护模式,并同步目标待更新实体的配置;In response to detecting that the target entity to be updated has been successfully restarted, exiting the maintenance mode and synchronizing the configuration of the target entity to be updated;检测目标待更新实体的存储池是否已恢复挂载;Check whether the storage pool of the target entity to be updated has been restored and mounted;响应于检测到目标待更新实体的存储池已恢复挂载时,迁回虚拟机,以完成更新任务的执行。In response to detecting that the storage pool of the target entity to be updated has been restored and mounted, the virtual machine is migrated back to complete the execution of the update task.16.根据权利要求13~15任一项所述的虚拟化系统更新方法,其特征在于,所述方法还包括:16. The virtualization system updating method according to any one of claims 13 to 15, characterized in that the method further comprises:响应于检测到虚拟机未迁移成功或存储池未恢复挂载或虚拟机未迁回成功时,重新判断待更新实体是否属于主备管理节点,并循环往复。In response to detecting that the virtual machine has not been successfully migrated or the storage pool has not been restored or the virtual machine has not been successfully migrated back, it is re-determined whether the entity to be updated belongs to the primary or standby management node, and the process is repeated.17.根据权利要求13~15任一项所述的虚拟化系统更新方法,其特征在于,在迁移虚拟机之前,所述方法还包括:17. The virtualization system updating method according to any one of claims 13 to 15, characterized in that before migrating the virtual machine, the method further comprises:基于预设函数,计算确定虚拟机迁移后的存储池使用率,其中,所述预设函数包括:Based on a preset function, the storage pool usage rate after the virtual machine migration is calculated and determined, wherein the preset function includes: ;其中,K表示虚拟机迁移后的存储池使用率,x表示存储池使用率,y表示存储池总容量,D表示当前虚拟机磁盘容量,f表示存储池总容量;Wherein,K represents the storage pool usage rate after the virtual machine is migrated,x represents the storage pool usage rate,y represents the total capacity of the storage pool,D represents the current virtual machine disk capacity, andf represents the total capacity of the storage pool;响应于检测到所述虚拟机迁移后的存储池使用率大于第二预设阈值时,关闭目标数量的虚拟机。In response to detecting that the storage pool usage rate after the migration of the virtual machine is greater than a second preset threshold, shutting down a target number of virtual machines.18.根据权利要求17所述的虚拟化系统更新方法,其特征在于,所述目标数量的确定方法包括:18. The virtualization system update method according to claim 17, wherein the method for determining the target number comprises:根据虚拟机的重要程度,按照从高到低的顺序对虚拟机进行排序;Sort the virtual machines in descending order according to their importance;基于预设区间,对排序完成的虚拟机进行划分,得到多个虚拟机区间,并基于区间内的虚拟机重要程度之和,按照从高到低的顺序对虚拟机区间进行标记;Based on the preset intervals, the sorted virtual machines are divided to obtain multiple virtual machine intervals, and the virtual machine intervals are marked in descending order based on the sum of the importance of the virtual machines in the intervals;根据所述虚拟机迁移后的存储池使用率与第二预设阈值之间的差值,确定存储池资源使用超出量;Determining an excess amount of storage pool resource usage according to a difference between the storage pool usage rate after the virtual machine migration and a second preset threshold;基于所述存储池资源使用超出量,按照从低到高的标记顺序确定需要关闭虚拟机的虚拟机区间;Based on the excess usage of the storage pool resources, determine the virtual machine intervals that need to shut down the virtual machines in order of marking from low to high;响应于检测到目标虚拟机区间中的虚拟机无需全部关闭时,根据当前存储池资源使用超出量以及目标虚拟机区间中每个虚拟机的资源占用量,匹配确定所述目标虚拟机区间中需要关闭的虚拟机;In response to detecting that all virtual machines in the target virtual machine interval do not need to be shut down, matching and determining virtual machines in the target virtual machine interval that need to be shut down according to the current excess storage pool resource usage and the resource occupancy of each virtual machine in the target virtual machine interval;基于需要关闭的虚拟机,确定所述目标数量。The target number is determined based on the virtual machines that need to be shut down.19.根据权利要求17所述的虚拟化系统更新方法,其特征在于,所述虚拟机的迁移方法包括:19. The virtualization system updating method according to claim 17, wherein the virtual machine migration method comprises:获取待更新实体中当前正在运行的虚拟机,生成一一映射关系,并根据虚拟机的负载,按照从大到小的顺序进行排序;Obtain the currently running virtual machines in the entity to be updated, generate a one-to-one mapping relationship, and sort them in descending order according to the load of the virtual machines;根据虚拟机的存储区域,确定虚拟机的迁移方式;Determine the migration method of the virtual machine based on the storage area of the virtual machine;获取目标实体列表,基于排序顺序和目标迁移方式,多线程地将所述虚拟机逐步迁移至目标实体。A target entity list is obtained, and based on a sorting order and a target migration mode, the virtual machines are gradually migrated to the target entities in a multi-threaded manner.20.一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至19中任一项所述的方法。20. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 19 when executing the computer program.21.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至19中任一项所述的方法。21. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 19 is implemented.22.一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时实现权利要求1至19中任一项所述的方法。22. A computer program product, characterized in that the computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 19 is implemented.
CN202411026196.1A2024-07-302024-07-30Virtualization system updating method, computer device, storage medium, and program productActiveCN118567689B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202411026196.1ACN118567689B (en)2024-07-302024-07-30Virtualization system updating method, computer device, storage medium, and program product

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202411026196.1ACN118567689B (en)2024-07-302024-07-30Virtualization system updating method, computer device, storage medium, and program product

Publications (2)

Publication NumberPublication Date
CN118567689Atrue CN118567689A (en)2024-08-30
CN118567689B CN118567689B (en)2025-01-03

Family

ID=92478269

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202411026196.1AActiveCN118567689B (en)2024-07-302024-07-30Virtualization system updating method, computer device, storage medium, and program product

Country Status (1)

CountryLink
CN (1)CN118567689B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20170147227A1 (en)*2014-09-162017-05-25Kove Ip, LlcExternal memory for virtualization
US20170177323A1 (en)*2015-12-212017-06-22International Business Machines CorporationAutomatic online system upgrade
CN107291507A (en)*2017-06-282017-10-24联想(北京)有限公司The upgrade method and electronic equipment of a kind of virtual machine virtual hard disk
CN108958770A (en)*2018-06-272018-12-07郑州云海信息技术有限公司A kind of virtualization system upgrade method and device
CN109408195A (en)*2018-09-052019-03-01华为技术有限公司Live migration of virtual machine method and device
WO2020063879A1 (en)*2018-09-302020-04-02华为技术有限公司Method and apparatus for migrating virtual machine
US11301235B1 (en)*2020-02-182022-04-12Amazon Technologies, Inc.Application downtime reduction using detached mode operation during operating system updates
CN117453242A (en)*2023-09-282024-01-26超聚变数字技术有限公司Application updating method of virtual machine, computing equipment and computing system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20170147227A1 (en)*2014-09-162017-05-25Kove Ip, LlcExternal memory for virtualization
US20170177323A1 (en)*2015-12-212017-06-22International Business Machines CorporationAutomatic online system upgrade
CN107291507A (en)*2017-06-282017-10-24联想(北京)有限公司The upgrade method and electronic equipment of a kind of virtual machine virtual hard disk
CN108958770A (en)*2018-06-272018-12-07郑州云海信息技术有限公司A kind of virtualization system upgrade method and device
CN109408195A (en)*2018-09-052019-03-01华为技术有限公司Live migration of virtual machine method and device
WO2020063879A1 (en)*2018-09-302020-04-02华为技术有限公司Method and apparatus for migrating virtual machine
US11301235B1 (en)*2020-02-182022-04-12Amazon Technologies, Inc.Application downtime reduction using detached mode operation during operating system updates
CN117453242A (en)*2023-09-282024-01-26超聚变数字技术有限公司Application updating method of virtual machine, computing equipment and computing system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
姜文;刘立康;: "应用软件补丁测试问题研究", 软件工程, no. 02, 5 February 2020 (2020-02-05)*

Also Published As

Publication numberPublication date
CN118567689B (en)2025-01-03

Similar Documents

PublicationPublication DateTitle
US10678649B2 (en)Interfacing with a virtual database system
US9280554B2 (en)Using confidence values for synchronizing file systems
US9276987B1 (en)Identifying nodes already storing indicated input data to perform distributed execution of an indicated program in a node cluster
US9047162B2 (en)Dynamic software version selection
US20190220266A1 (en)Upgrading Bundled Applications In A Distributed Computing System
US20210004000A1 (en)Automated maintenance window predictions for datacenters
US10809922B2 (en)Providing data protection to destination storage objects on remote arrays in response to assignment of data protection to corresponding source storage objects on local arrays
WO2018177107A1 (en)Data migration method, migration server, and storage medium
CN110347483B (en)Method and device for migrating physical machine to virtual machine and storage medium
CN111124475A (en)Method for storage management, electronic device and computer-readable storage medium
CN114443294B (en)Big data service component deployment method, system, terminal and storage medium
US11892918B2 (en)System and method for availability group database patching
CN109213570A (en)A kind of virtual machine migration method, device, equipment and readable storage medium storing program for executing
US11461131B2 (en)Hosting virtual machines on a secondary storage system
US11973839B1 (en)Microservice throttling based on learned demand predictions
JP2019020798A (en)Information processing device and program
CN119025188A (en) Function cold start optimization method, device, equipment and medium
CN118567689A (en) Virtualization system updating method, computer device, storage medium and program product
CN115509861A (en) Process monitoring method, system, computer device and storage medium
CN116414417A (en)Version updating method and device, nonvolatile storage medium and electronic equipment
CN117130987B (en)Flight control management method for large-scale unmanned aerial vehicle cluster
US20250231756A1 (en)Synchronized activation of firmware on a distributed computing system
US12445530B2 (en)Microservice throttling based on learned demand predictions
US20250244987A1 (en)Staged activation of firmware in a computing system
US12445529B2 (en)Microservice admission control based on learned demand predictions

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp