Rolling maintenance fails with ErrorInMaintenance because the cluster it disables is excluded as VM migration destination
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- java
调研方向
Start with RollingMaintenanceManagerImpl.disableClusterIfEnabled() and startRollingMaintenanceHostInCluster(), then trace how DeploymentPlanningManagerImpl filters disabled clusters for VmWorkMigrateAway. Reproduce in a two-host, single-cluster zone with migrate.vm.across.clusters=false and inspect migration tests around rolling maintenance and destination selection. Done means VMs can evacuate to the remaining host, maintenance completes, and an aborted run does not leave the cluster disabled.
由索引模型根据 Issue 内容生成。
描述
problem
startRollingMaintenance disables the cluster itself (RollingMaintenanceManagerImpl.disableClusterIfEnabled() sets the allocation state to Disabled) before putting hosts into maintenance. The VMs on the host then cannot be migrated to the other host in the same cluster, because the deployment planner excludes Disabled clusters. The host ends up in ErrorInMaintenance after the maintenance timeout, and the cluster is left in Disabled state.
Management server log:
DEBUG [c.c.d.DeploymentPlanningManagerImpl] Adding clusters [1] of pod [1] to the void set because these clusters are in the Disabled state.
WARN [c.c.d.DeploymentPlanningManagerImpl] VM last host ID: 2 belongs to zone ID: 1 for which config - migrate.vm.across.clusters is false and storage migration would be needed for inter-cluster migration, therefore, adding all other clusters except ID: 1 from this zone to avoid list
WARN [c.c.v.ClusteredVirtualMachineManagerImpl] Unable to find destination for migrating the vm VM instance {"id":786,"instanceName":"i-2-786-VM","type":"User",...}
ERROR [c.c.v.VmWorkJobDispatcher] Unable to complete AsyncJob {"cmd":"com.cloud.vm.VmWorkMigrateAway",...}
InsufficientServerCapacityException: Unable to find a server to migrate to.Scope=interface com.cloud.dc.DataCenter; id=1
...
ERROR [c.c.r.RollingMaintenanceManagerImpl] Timeout: waited 1800000ms for host <uuid>(<host>) to be in Maintenance state, but after timeout it is in ErrorInMaintenance
at RollingMaintenanceManagerImpl.waitForHostInMaintenance(RollingMaintenanceManagerImpl.java:775)
at RollingMaintenanceManagerImpl.putHostIntoMaintenance(RollingMaintenanceManagerImpl.java:411)
at RollingMaintenanceManagerImpl.startRollingMaintenanceHostInCluster(RollingMaintenanceManagerImpl.java:327)
at RollingMaintenanceManagerImpl.startRollingMaintenance(RollingMaintenanceManagerImpl.java:210)
The same migrate-away failure occurs for the system VMs, the virtual router and the user VMs on the host.
Root cause (from code and logs):
startRollingMaintenancecallsdisableClusterIfEnabled()beforestartRollingMaintenanceHostInCluster().DeploymentPlanningManagerImplvoids Disabled clusters, so withmigrate.vm.across.clusters=false(or a single-cluster zone) no destination is left.attemptMaintain()then finds running VMs and no pending migration retries, and callssetHostIntoErrorInMaintenance().
versions
- CloudStack: main branch (4.22.1.0-SNAPSHOT)
- Hypervisor: KVM (Ubuntu 26.04)
- Zone with a single cluster of 2 hosts,
migrate.vm.across.clusters=false
The steps to reproduce the bug
- Have an Enabled cluster with 2 KVM hosts, with system VMs, a VR and user VMs running on the second host.
- Run
startRollingMaintenanceon the cluster (cmk:start rollingmaintenance clusterids=<cluster id>). - Wait for the first host to enter maintenance.
What to do about it?
Expected: VMs are migrated to the other host, the host reaches Maintenance, rolling maintenance continues, and the cluster is re-enabled at the end.
Actual: the host goes to ErrorInMaintenance after the timeout and the cluster stays Disabled.
Possible fixes:
- Allow migrations triggered by host maintenance (
VmWorkMigrateAway) to target hosts in a cluster disabled by rolling maintenance, or do not use theDisabledallocation state to block new deployments. - Always re-enable the clusters that rolling maintenance disabled when it aborts.
- Fail fast instead of waiting for the full timeout when all migrations have failed.
- 主要语言
- Java
- 星标
- 3.1k
- 派生
- 1.4k
- 平均合并
- 7 天 16 小时
- 30 天内合并 PR
- 15
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/cloudstack 的其他 Issue
-
resizeVolume of a running system VM's volume is accepted but the VM never sees the new size可能已有人在做 @bhouse-nexthop 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
apache/cloudstack#14645 · 1 条评论 ·
维护者通常 1 天内回复
-
VR reports a load balancer change as applied when haproxy.cfg cannot be replaced可能已有人在做 @bhouse-nexthop 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
apache/cloudstack#14633 · 1 条评论 ·
维护者通常 1 天内回复
-
restartNetwork reports a ResourceUnavailableException as an unexpected error (530), unlike restartVPC (534)可能已有人在做 @bhouse-nexthop 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
apache/cloudstack#14631 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
apache/cloudstack#14625 · 1 条评论 ·
维护者通常 1 天内回复
-
Remote access VPN users are disconnected on every LB, ACL, port forward or firewall change (xl2tpd restarted on every iptables pass)可能已有人在做 @willbennett-devops 于 12 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
apache/cloudstack#14545 · 1 条评论 ·
维护者通常 1 天内回复
查看 apache/cloudstack 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
ls1intum/thesis-management#1473 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
LunaDeerMC/Dominion#301 · 1 条评论 ·
-
[FEATURE] Expose external refresh, node-level translog and warmer stats可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭untriaged
难度 2/5 1-3 小时 新手友好度 68/100
opensearch-project/opensearch-prometheus-exporter#680 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 2 天内回复