Add ability to use hv with sno deployments - #839
Conversation
|
Skipping CI for Draft Pull Request. |
|
Warning Review limit reached
Next review available in: 49 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds ChangesSNO Virtual Spoke Cluster (hv_inventory)
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
90123ea to
3d97fbd
Compare
akrzos
left a comment
There was a problem hiding this comment.
Thanks Alex, I looked at this PR with claude code to help find what things we should improve with the new deployment topology (SNO + Virtual Spoke Clusters) that this is adding.
hv_countusage: For MNO with spoke virtual clusters, all leftover nodes after bastion + controlplane + workers become hypervisors — no limit. The SNO+HV topology is the same shape (bastion, SNO hub, then everything else), so I'd suggest dropping thehv_countgating here and simplifying toocpinventory.json.nodes[2:]. This also removes the need for the validation assert and keeps things consistent with MNO. The original commented-out block at line 431 had this same approach.Node overlap:
ocpinventory_sno_nodesis set tonodes[1:](all nodes after bastion), but the new hv block also assigns nodes starting at index 2. The same physical machines end up in both[sno](commented out) and[hv](active) inventory groups. Similarly, ifworker_node_countis set alongsidehv_inventory, both workers and hv nodes slice from index 2 and would overlap. Compare with MNO where workers getnodes[4:max_nodes]and HV getsnodes[max_nodes:]— properly partitioned. Consider trimmingocpinventory_sno_nodesto exclude the hv nodes whenhv_inventoryis true, and starting the hv slice after any workers.HV IP addressing: The
[hv]IP formula in the template usesmno_worker_node_offset(default 7), which is MNO-specific. SNO nodes usesno_controlplane_ip_offset(default 3). With enough SNO nodes this could produce IP collisions — unlikely in the typical single-hub case but worth guarding against.Small stuff:
- Missing newline at end of
inventory-sno.j2- Typo on line 224: "populates" → "populate"
- The old commented-out
# SNO - Set ocpinventory hv nodesblock (lines 427-431) can be removed now that it's implemented- New validation assert is missing
success_msg(every other assert in the file has one)hv_countdefault comment indefaults/main/main.ymlstill says "For VMNO cluster type" — needs updating if it stays
For the current work, I don't think we need to support SNO + Workers + HVs, and we can always extend that if it is ever needed, so I suggest just having it mimic the MNO pattern for now.
3d97fbd to
1cacb41
Compare
I've fixed the small stuff and other issues, for the remaining node overlap, I've trimmed the sno list to just one when hv is in use, I don't think I'm gonna look into sno + worker + hv as a part of this PR. Similar to the previous item, current use-case should not see any problem (single sno + hvs), let's revisit it if we get into more complicated setup |
0d3200a to
b97b9ed
Compare
b97b9ed to
9f5c484
Compare
9f5c484 to
ac80107
Compare
|
Okay, current version got rid of the hv_count limiter and creates cleaner inventory of 1 bastion, 1 sno (no commented nodes) and rest of the nodes go into the hv section and populated with VMs respectively. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ansible/roles/create-inventory/tasks/main.yml`:
- Around line 370-375: The SNO task setting ocpinventory_worker_nodes does not
prevent node overlap with hypervisor assignments. Since line 444 assigns
ocpinventory_hv_nodes from the same node slice (starting at index 2) when
hv_inventory is true, both variables can reference the same hosts. Add a
condition to the when clause of the SNO task that excludes the case when
hv_inventory is true, ensuring ocpinventory_worker_nodes is only set when
hypervisor inventory mode is not enabled.
In `@ansible/roles/create-inventory/templates/inventory-sno.j2`:
- Line 174: The conditional check for hv_inventory on line 174 does not properly
handle string boolean values like "false", which are evaluated as truthy
non-empty strings in Jinja2. Apply the bool filter to coerce the hv_inventory
variable to a proper boolean value by changing the if condition from checking
hv_inventory directly to using the bool filter, so that string values like
"false" are correctly interpreted as false.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 4cf35ce1-061c-42cb-a707-26c4b79c0d39
📒 Files selected for processing (3)
ansible/roles/create-inventory/defaults/main/main.ymlansible/roles/create-inventory/tasks/main.ymlansible/roles/create-inventory/templates/inventory-sno.j2
ac80107 to
b0664f3
Compare
|
/test deploy-sno |
b0664f3 to
eb46c53
Compare
|
/test deploy-sno |
|
@agurenko Would you be able to close the loop on those last few comments and rebase this so we can get this merged? |
|
@akrzos yeah, I'm gonna finalize it today |
eb46c53 to
0a64385
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
ansible/roles/create-inventory/tasks/main.yml (1)
412-414: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse a descriptive task name.
set json query factdoes not identify themac_queryfact. Rename the task to state that it sets the MAC-address JSON query fact.As per path instructions, “All tasks must have clear, descriptive names.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ansible/roles/create-inventory/tasks/main.yml` around lines 412 - 414, Rename the task currently named “set json query fact” to a clear, descriptive name stating that it sets the MAC-address JSON query fact. Keep the existing mac_query set_fact and query value unchanged.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ansible/roles/create-inventory/tasks/main.yml`:
- Around line 339-341: In the SNO allocation flow before the “SNO - Set
ocpinventory hv nodes” task, add an assertion requiring at least three inventory
nodes when cluster_type is "sno" and hv_inventory is enabled. Preserve the
existing allocation behavior for other cluster types or when hypervisor
inventory is disabled.
- Around line 396-410: Keep the existing SNO-node enrichment task, and add an
equivalent bond MAC enrichment task for hypervisors that updates
`ocpinventory_hv_nodes` and loops over that collection. Preserve the same
`enable_bond`/`public_vlan` condition and `bond0_macs` construction using
`bond0_port1` and `bond0_port2`.
- Around line 365-384: Enable TLS certificate validation in both Foreman
requests, “SNO - Get lab data for each sno” and “SNO - Get lab mac address for
worker nodes,” by setting their ansible.builtin.uri validate_certs options to
true. Ensure the control host trusts the Foreman CA so both requests continue to
authenticate successfully.
---
Nitpick comments:
In `@ansible/roles/create-inventory/tasks/main.yml`:
- Around line 412-414: Rename the task currently named “set json query fact” to
a clear, descriptive name stating that it sets the MAC-address JSON query fact.
Keep the existing mac_query set_fact and query value unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c66fff0c-bdb7-40ed-a82a-b56fc4b298dd
📒 Files selected for processing (2)
ansible/roles/create-inventory/tasks/main.ymlansible/roles/create-inventory/templates/inventory-sno.j2
🚧 Files skipped from review as they are similar to previous changes (1)
- ansible/roles/create-inventory/templates/inventory-sno.j2
0a64385 to
0e8ea5e
Compare
|
/test deploy-sno |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: akrzos The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
dc1d398
into
redhat-performance:main
Add ability to use hypervisors with sno deployments for the SNO HUB + Virtual Spoke deployment use case
Summary by CodeRabbit
New Features
Bug Fixes