Fix/preserve ip should not work for vm with no ip#1663
Open
Fix/preserve ip should not work for vm with no ip#1663
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Free Tier Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Alert persists after user enters IP manually
- Updated the
missingVmtoolsIpUI condition to also require an empty typed IP so the alert clears when the user manually enters an address.
- Updated the
Or push these changes by commenting:
@cursor push 321974ee67
Preview (321974ee67)
diff --git a/ui/src/features/migration/VmsSelectionStep.tsx b/ui/src/features/migration/VmsSelectionStep.tsx
--- a/ui/src/features/migration/VmsSelectionStep.tsx
+++ b/ui/src/features/migration/VmsSelectionStep.tsx
@@ -2142,7 +2142,7 @@
!isPoweredOff && bulkPreserveIp?.[vmName]?.[interfaceIndex] !== false
const preserveMac = bulkPreserveMac?.[vmName]?.[interfaceIndex] !== false
const missingVmtoolsIp =
- preserveIp && !networkInterface?.ipAddress && !vm.ipAddress
+ preserveIp && !networkInterface?.ipAddress && !vm.ipAddress && !ip.trim()
return (
<React.Fragment key={interfaceIndex}>
<BoxThis Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What this PR does / why we need it
Fixed the following :
Migration failing with - Failed - failed to create port group: subnet not found for IP [Powered on VM couldn't fetch IP using vmtools]
VM is powered On
Couldn't get the IP, and preserve IP and preserve MAC are toggled on as its a powered on VM
Didn't assign any IP as its not mandatory for powered on VM, and both preserve IP and preserve MAC are toggled on by default
Migration failed with Failed to create port group: subnet not found for IP
Which issue(s) this PR fixes
(optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged)fixes #1649
Special notes for your reviewer
Testing done
please add testing details (logs, screenshots, etc.)
Note
Medium Risk
Adds new preflight validation that can now block migrations earlier when VMware Tools doesn’t report an IP and no manual IP is provided, changing migration initiation behavior. Risk is limited to network configuration paths and should mainly improve error clarity but could surface false-positives if IP detection/override indexing is wrong.
Overview
Prevents confusing late-stage failures (e.g., "subnet not found") by failing early when Preserve IP is enabled but a NIC has neither a VMware Tools–detected IPv4 nor a user-assigned IP.
This validation is added both in the k8s controller before creating a
Migration(validatePreserveIPConfig) and inv2v-helperduring port creation, and the UI bulk IP editor now shows an inline error alert when Preserve IP is on but no VMTools IP is present.Written by Cursor Bugbot for commit 94c5394. This will update automatically on new commits. Configure here.