You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Retrying host maintenance falsely marks already-migrated VMs as stopped #14026
SUMMARY
Putting a host into maintenance moves its VMs off one at a time, which
can take a while. Requesting maintenance again on the same host before
the first request finishes causes it to retry moving every VM still
listed against that host, including ones already moved. That retry
fails as expected, but for some VMs it confuses CloudStack into
thinking the VM was powered off, and it gets marked stopped even though
it was never touched and kept running the whole time.
EXPECTED
Requesting maintenance again should not retry VMs already moved.
ACTUAL
Some already-moved VMs get falsely marked stopped.
NOTE
The false "stopped" status seems to come from CloudStack losing track
of which VMs are on which host. That could plausibly happen from causes
other than this one, but we only have evidence of it via this scenario.
When a second "enter maintenance" request is issued for a KVM host before an earlier in-progress maintenance operation has finished migrating all VMs, CloudStack retries migration for VMs that were already moved. The retry naturally fails (VM is no longer on the host), but in some cases this causes CloudStack to lose track of the VM's actual host and mark it as "stopped" even though it is still running. A maintainer has asked the reporter whether this is a regression and against which version; that has not yet been answered.
📊 Assessment
Dimension
Value
Reasoning
Type
type:bug
Reproducible incorrect state transition (VM falsely marked stopped)
Component
component:management-server
Issue concerns host-maintenance orchestration and VM state tracking, which lives in the management server, not the hypervisor agent
Severity
Severity:Major
Produces incorrect VM power-state data (false "stopped"), which can affect automation/HA relying on state, but requires a specific race (duplicate maintenance requests) to trigger
Labels
type:bug, component:management-server
Coding agent
Needs more info
The maintainer's question about regression/version is still open, and root cause ("losing track of which VMs are on which host") is not yet pinpointed to a specific code path
🔗 Similar issues
No duplicate or closely related open issues found.
💡 Notes and suggestions
Reproduction hinges on a timing race: issuing a second PrepareForMaintenance/maintain API call while the first is still migrating VMs off the host. Confirming exact API call sequence and CloudStack version comparison (as asked by @DaanHoogland) would help narrow this down.
Worth checking whether host-maintenance logic properly checks current VM-host assignment before retrying a migration, and whether a failed migration retry incorrectly triggers a VM state update path shared with host-down/fencing handling.
Reviewing HighAvailabilityManager / ManagementServerImpl host-maintenance related VM state transitions and any place that marks a VM Stopped in response to a migration failure would be a good starting point.
Activity
DaanHoogland commentedon Sep 2, 2026
@Damans227 is this a regression, and in comparison to what version?
github-actions commentedon Sep 2, 2026
🎯 Triage report
When a second "enter maintenance" request is issued for a KVM host before an earlier in-progress maintenance operation has finished migrating all VMs, CloudStack retries migration for VMs that were already moved. The retry naturally fails (VM is no longer on the host), but in some cases this causes CloudStack to lose track of the VM's actual host and mark it as "stopped" even though it is still running. A maintainer has asked the reporter whether this is a regression and against which version; that has not yet been answered.
📊 Assessment
🔗 Similar issues
No duplicate or closely related open issues found.
💡 Notes and suggestions
PrepareForMaintenance/maintainAPI call while the first is still migrating VMs off the host. Confirming exact API call sequence and CloudStack version comparison (as asked by@DaanHoogland) would help narrow this down.HighAvailabilityManager/ManagementServerImplhost-maintenance related VM state transitions and any place that marks a VMStoppedin response to a migration failure would be a good starting point.Add this agentic workflows to your repo
To install this agentic workflow, run