Repository navigation
fix: wait for guest info to repopulate after add_nic reconfiguration - #865
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Branch Management
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
Security Checks
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
PR Summary by QodoWait for vSphere guest info after NIC reconfiguration
AI Description
Merge Risk
|
Code Review by Qodo
1.
|
|
/qodo The following review comments were reviewed and a decision was made:
|
Both review findings are resolved in commit
The report lists no active findings. The |
|
Code review by qodo was updated up to the latest commit a45d740 |
Wait for guest.guestFamily in wait_for_vmware_guest_info and fail fast when the wait times out at the conftest call sites (power-on and add_nic reconfiguration), so NIC checks and guest-operations detection see fresh inventory data instead of stale guest info.
wait_guest_info_or_fail() previously raised on every guest-info timeout even
when the caller's metadata collection is best-effort. Add a required flag:
on timeout it raises only when required, otherwise it logs a warning and
returns.
All three conftest.py call sites pass required=plan.get("preserve_static_ips",
False), so static-IP preservation still fails fast while best-effort plans keep
the existing unavailable-guest-info fallback in
collect_linux_guest_static_ip_metadata(). Also type provider_vm_api as
vim.VirtualMachine instead of Any.
a45d740 to
654c76b
Compare
|
/verified |
|
/lgtm |
|
New container for ghcr.io/redhatqe/mtv-api-tests:latest published |
What
add_nichot-adds a NIC to a powered-on vSphere clone. That reconfiguration makes vCenter reset the VM's guest info —guest.netandguest.guestFamilygo empty until VMware Tools re-reports (~15s). Two problems followed from that:VMWareProvider.wait_for_vmware_guest_info()decided "guest info is ready" frompowerState,guest.netandtoolsStatus, but notguestFamily. It could therefore return whileguestFamilywas still empty — andguestFamilyis what Guest Operations needs to identify the guest OS, so downstream IP-origin / NIC-name detection ran against stale data.NIC ...: IP origin not available, followed by a Guest-Operations fallback).Changes
libs/providers/vmware.py— addvm.guest.guestFamilyto the readiness predicate, so the wait cannot return before Tools has repopulated the guest family.utilities/vmware_guest_operations.py— newwait_guest_info_or_fail(): wraps the wait and raisesValueErrornaming the VM when it times out, instead of silently continuing.conftest.py— route the two power-on waits and a new post-add_nicwait throughwait_guest_info_or_fail(). Theadd_nicwait is skipped when the VM is powered off (a powered-off clone has no guest info to wait for and the wait would always time out).Behaviour change to be aware of
A previously silent 120s wait timeout now surfaces as
ValueError. That is intended (fail fast instead of using stale guest info), but it can appear on a host where Tools genuinely never reports — worth knowing when reading CI results.Why it matters
Only tests with
add_nic: true(multi-NIC / per-NIC NetworkMap scenarios) are exposed, and the race is timing-dependent: on an idle host Tools repopulates before the next read, so it passes; under parallel clones / loaded storage it does not, and the failure shows up as a wrong or missing NIC-name / static-IP assertion rather than anything pointing at guest info.Testing
pre-commit run --all-files— all hooks pass.-m "tier0 and vsphere"), which exercises theadd_nicpath in the cold sanity class.