Skip to content

Scope host tag-rule matches to deployment plan in FirstFit/Random allocators#8

Draft
Copilot wants to merge 2 commits into
4.20from
copilot/fix-vm-deployment-issue
Draft

Scope host tag-rule matches to deployment plan in FirstFit/Random allocators#8
Copilot wants to merge 2 commits into
4.20from
copilot/fix-vm-deployment-issue

Conversation

Copilot AI commented Jun 15, 2026

Copy link
Copy Markdown

Automatic VM placement could fail when a service offering combined host tags and storage tags because rule-tagged hosts were appended without zone/pod/cluster scoping, allowing out-of-scope hosts into allocation. This made host candidates diverge from storage-pool scope and broke valid host+pool pairing in planner flow.

  • Host selection scope correction

    • Updated both FirstFitAllocator.allocateTo(...) overloads to append rule-tag hosts using deployment scope (dcId, podId, clusterId) instead of the unscoped DAO call.
    • Applied the same scoped behavior in RandomAllocator where rule-tag hosts are unioned into candidates.
  • DAO API extension for scoped rule-tag lookup

    • Added a scoped overload on HostDao:
      • findHostsWithTagRuleThatMatchComputeOferringTags(String computeOfferingTags, Long clusterId, Long podId, Long dcId)
    • Implemented in HostDaoImpl by reusing existing rule evaluation and filtering returned hosts by deployment scope.
  • Regression-focused allocator tests

    • Added FirstFitAllocatorTest coverage for scoped rule-tag lookup in the prefiltered-host allocation path.
    • Extended RandomAllocatorTest to verify scoped DAO usage and prevent fallback to unscoped lookup.
// before (unscoped)
clusterHosts.addAll(_hostDao.findHostsWithTagRuleThatMatchComputeOferringTags(hostTagOnOffering));

// after (scoped to plan)
clusterHosts.addAll(
    _hostDao.findHostsWithTagRuleThatMatchComputeOferringTags(
        hostTagOnOffering, clusterId, podId, dcId
    )
);

Copilot AI changed the title [WIP] Fix automatic VM deployments for service offerings with host and storage tags Scope host tag-rule matches to deployment plan in FirstFit/Random allocators Jun 15, 2026
Copilot AI requested a review from DaanHoogland June 15, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants