Skip to content

Failed cross-cluster VM migration rollback leaks target cluster quota and decrements source cluster quota #8191

Closed

Description

@trukhinyuri

Description
In VirtualMachineAPI::migrate (src/rm/api/VirtualMachineAPI.cc), when migrating a VM across clusters (c_cluster_id != cluster_id), lines 1173-1183 authorize quota on the target cluster_id and then set quota_tmpl.replace("CLUSTER_ID", c_cluster_id) before calling quota_rollback on the source cluster.

If add_history (lines 1205-1210) or dm->migrate / dm->live_migrate (lines 1234-1239) subsequently fails, the rollback block executes:

if (c_cluster_id != cluster_id)
{
    Quotas::vm_add(vm_perms.uid, vm_perms.gid, &quota_tmpl);

    Quotas::vm_del(vm_perms.uid, vm_perms.gid, &quota_tmpl);
}

Because quota_tmpl still has CLUSTER_ID set to c_cluster_id, Quotas::vm_add adds the usage back to c_cluster_id and Quotas::vm_del immediately subtracts it from c_cluster_id again instead of subtracting it from cluster_id.

To Reproduce

  1. Initiate a cross-cluster VM migration (c_cluster_id != cluster_id) that fails at dm->migrate or dm->live_migrate.
  2. Inspect the user/group cluster quota usage for both clusters: the source cluster loses the VM quota and the target cluster retains the leaked VM quota.

Expected behavior
Before calling Quotas::vm_del(vm_perms.uid, vm_perms.gid, &quota_tmpl) in both rollback blocks, quota_tmpl.replace("CLUSTER_ID", cluster_id) should be called so the target cluster quota is released while the source cluster quota remains restored.

Details

  • Affected Component: oned (src/rm/api/VirtualMachineAPI.cc)
  • Version: master and 7.0.1

Progress Status

  • Code committed
  • Testing - QA
  • Documentation (Release notes - resolved issues, compatibility, known issues)

Activity

  1. added a commit that references this issue on Nov 2, 2026
  2. added this to the Release 7.4.2 milestone on Nov 2, 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

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions