Skip to content

Retrying host maintenance falsely marks already-migrated VMs as stopped #14026

Open

Description

@Damans227

CLOUDSTACK VERSION
4.22.1.1, KVM hypervisor

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.

Activity

  1. added this to the 4.22.2 milestone on Sep 2, 2026
  2. DaanHoogland commented on Sep 2, 2026

    @DaanHoogland
    Contributor

    @Damans227 is this a regression, and in comparison to what version?

  3. github-actions commented on Sep 2, 2026

    @github-actions

    🎯 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

    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.

    Generated by Daily Issue Triage · sonnet50 135.6K · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/daily-issue-triage.md@d7c1dc4b72b00607a67caaffdcc216cb64379cf9
    
  4. modified the milestones: 4.22.2, 4.22.3 on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions