Skip to content

Failed to change offering of ROOT volume on VMware #13261

Closed

Description

@weizhouapache

problem

the power_state is not update immediately when vm is stopped, which cause an issue when change offering of ROOT volume on VMware.

resizing volume works well.

Steps to reproduce the issue:

  • create a vm and start it on VMware
mysql> select id,name,uuid,state,power_state,power_state_update_time,host_id,last_host_id from vm_instance where id=7;
+----+----------+--------------------------------------+---------+-------------+-------------------------+---------+--------------+
| id | name     | uuid                                 | state   | power_state | power_state_update_time | host_id | last_host_id |
+----+----------+--------------------------------------+---------+-------------+-------------------------+---------+--------------+
|  7 | test-wei | 07618433-1617-4ca6-869a-b8abbe4a3db6 | Running | PowerOn     | 2026-05-27 07:28:43     |       1 |            1 |
+----+----------+--------------------------------------+---------+-------------+-------------------------+---------+--------------+
1 row in set (0.00 sec)
  • stop the vm, the state is updated, but power_state is still PowerOn
mysql> select id,name,uuid,state,power_state,power_state_update_time,host_id,last_host_id from vm_instance where id=7;
+----+----------+--------------------------------------+----------+-------------+-------------------------+---------+--------------+
| id | name     | uuid                                 | state    | power_state | power_state_update_time | host_id | last_host_id |
+----+----------+--------------------------------------+----------+-------------+-------------------------+---------+--------------+
|  7 | test-wei | 07618433-1617-4ca6-869a-b8abbe4a3db6 | Stopping | PowerOn     | 2026-05-27 07:28:43     |       1 |            1 |
+----+----------+--------------------------------------+----------+-------------+-------------------------+---------+--------------+
1 row in set (0.00 sec)

mysql> select id,name,uuid,state,power_state,power_state_update_time,host_id,last_host_id from vm_instance where id=7;
+----+----------+--------------------------------------+---------+-------------+-------------------------+---------+--------------+
| id | name     | uuid                                 | state   | power_state | power_state_update_time | host_id | last_host_id |
+----+----------+--------------------------------------+---------+-------------+-------------------------+---------+--------------+
|  7 | test-wei | 07618433-1617-4ca6-869a-b8abbe4a3db6 | Stopped | PowerOn     | 2026-05-27 07:28:43     |    NULL |            1 |
+----+----------+--------------------------------------+---------+-------------+-------------------------+---------+--------------+
1 row in set (0.00 sec)
  • change the disk offering of the ROOT volume

got an exception

Image
  • retry when the power_state is updated to PowerOff, it worked
mysql> select id,name,uuid,state,power_state,power_state_update_time,host_id,last_host_id,update_time from vm_instance where id=7;
+----+----------+--------------------------------------+---------+-------------+-------------------------+---------+--------------+---------------------+
| id | name     | uuid                                 | state   | power_state | power_state_update_time | host_id | last_host_id | update_time         |
+----+----------+--------------------------------------+---------+-------------+-------------------------+---------+--------------+---------------------+
|  7 | test-wei | 07618433-1617-4ca6-869a-b8abbe4a3db6 | Stopped | PowerOff    | 2026-05-27 11:24:43     |    NULL |            1 | 2026-05-27 11:24:12 |
+----+----------+--------------------------------------+---------+-------------+-------------------------+---------+--------------+---------------------+
1 row in set (0.00 sec)

versions

ACS 4.22.0.0
VMware 8

it should impact other versions too

The steps to reproduce the bug

...

What to do about it?

No response

Activity

  1. added this to the 4.22.2 milestone on May 27, 2026
  2. added theissue type on May 27, 2026
  3. DaanHoogland commented on May 27, 2026

    @DaanHoogland
    Contributor

    @weizhouapache is this vmware 8 only, i.e. when you say "should impact other versions too” is this ACS only or vmware as well?

  4. weizhouapache commented on May 27, 2026

    @weizhouapache
    MemberAuthor

    @weizhouapache is this vmware 8 only, i.e. when you say "should impact other versions too” is this ACS only or vmware as well?

    I think the VMware version does not matter
    the error comes from the ACS mgmt server, before sending the command to VMware.

    it should impact other ACS versions too

  5. DaanHoogland commented on May 27, 2026

    @DaanHoogland
    Contributor

    But do you agree the root issue is the powerstate not being updated, is it? Not the error on change offering.

  6. weizhouapache commented on May 27, 2026

    @weizhouapache
    MemberAuthor

    But do you agree the root issue is the powerstate not being updated, is it? Not the error on change offering.

    I think it is good that the powerstate is updated when mgmt server receives the vm states from agent (kvm or vmware).

    the root cause is, changing offering for root volume should NOT rely on the power state as it is NOT the real-time state of VM. Instead, similar to all other vm/volume operations, it should rely on the VM state (Stopped, not power state/PowerOff).

    the fix could be just 1 line of code change

  7. github-actions commented on Jun 11, 2026

    @github-actions

    🏷️ Issue Triaged

    Hi @weizhouapache! I've categorized this issue as bug based on the following analysis:

    Reasoning: This issue reports that power_state is not updated immediately when a VM is stopped on VMware, causing the "change offering of ROOT volume" operation to fail with an exception. It includes clear reproduction steps and database state evidence.

    View Triage Details

    Analysis

    • Keywords detected: power_state, stopped, exception, VMware, reproduce, failed
    • Issue type indicators: Clear problem description with steps to reproduce, database state showing incorrect power_state=PowerOn after VM stop, and error screenshot
    • Confidence: High

    Recommended Next Steps

    • Review the VMware VM stop flow to ensure power_state is updated synchronously, or that the disk-offering-change operation waits for the power state to be consistent
    • Consider adding a check that validates power_state matches expected state before allowing disk offering changes

    References: Triage run §27329568210

    Generated by 🔧 Issue Triage Agent · sonnet46 1.6M · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add github/gh-aw/.github/workflows/issue-triage-agent.md@359795d49ada21681ab616bd4cbcb144a7387115
    
  8. github-actions commented on Jun 16, 2026

    @github-actions

    🏷️ Issue Triaged

    Hi @weizhouapache! I've categorized this issue as bug based on the following analysis:

    Reasoning: The power_state field is not updated synchronously when a VM is stopped on VMware, causing a race condition where an attempt to change the ROOT volume offering fails with an exception while the state still shows PowerOn despite the VM being in Stopped state.

    View Triage Details

    Analysis

    • Keywords detected: power_state, VMware, Stopped state mismatch, ROOT volume, offering change, exception
    • Issue type indicators: Clear steps to reproduce, DB state evidence, workaround confirmed (retrying after power_state updates to PowerOff succeeds), version info provided
    • Confidence: High

    Recommended Next Steps

    • Investigate whether the power_state update for VMware can be made synchronous (or at least awaited) during the VM stop flow before allowing volume operations
    • Consider adding a guard in the volume offering change path to validate power_state consistency before proceeding

    📋 Batch triage note: This run also triaged and labeled the following related unlabeled issues as bug: #13244, #13124, #13067, #12999, #12998

    References: Triage run §27631885429

    Generated by 🔧 Issue Triage Agent · sonnet46 1.2M · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add github/gh-aw/.github/workflows/issue-triage-agent.md@359795d49ada21681ab616bd4cbcb144a7387115
    
  9. DaanHoogland commented on Jul 6, 2026

    @DaanHoogland
    Contributor

    fixed in #13271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions