Skip to content

Fix/preserve ip should not work for vm with no ip#1663

Open
sanya-pf9 wants to merge 4 commits intomainfrom
fix/preserve-ip-should-not-work-for-VM-with-no-ip
Open

Fix/preserve ip should not work for vm with no ip#1663
sanya-pf9 wants to merge 4 commits intomainfrom
fix/preserve-ip-should-not-work-for-VM-with-no-ip

Conversation

@sanya-pf9
Copy link
Contributor

@sanya-pf9 sanya-pf9 commented Mar 11, 2026

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 in v2v-helper during 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.

Copy link
Contributor

@windsurf-bot windsurf-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 To request another review, post a new comment with "/windsurf-review".

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Alert persists after user enters IP manually
    • Updated the missingVmtoolsIp UI condition to also require an empty typed IP so the alert clears when the user manually enters an address.

Create PR

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}>
                         <Box

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

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.

Migration failing with - Failed to create port group: subnet not found for IP [Powered on VM couldn't fetch IP using vmtools]

1 participant