HCX - GuestOS customization during migration is not setting gateway and DNS
search cancel

HCX - GuestOS customization during migration is not setting gateway and DNS

book

Article ID: 381080

calendar_today

Updated On:

Products

VMware HCX

Issue/Introduction

  • You are using HCX API or HCX UI to change the IP address, subnet, gateway, DNS, and other related fields during an HCX bulk migration.
  • During validation, HCX bulk migration does not display any errors, and the VM migrates successfully.
  • After migration, the IP address and subnet are correctly applied; however, the gateway and DNS settings are not configured as expected - gateway and DNS are not set.
  • In the C:\Windows\Temp\vmware-imc\guestcust.log, the Primary NIC is displayed as 0:

    [<timestamps>                    GenericNic:  DEBUG] NIC [MAC 00:50:##:##:##:##, Primary 0]

Environment

HCX 4.x

Cause

When the 'Primary NIC' flag is not set, the gateway and DNS settings are not applied. Prior to HCX 4.10, the 'isPrimaryNic' field was selected by default for all NICs, which could cause issues with virtual machines that have multiple NICs. Starting with HCX 4.10, this option is no longer set by default, so if it is not selected, the gateway and DNS settings are not applied.

Resolution

Please ensure that the 'Primary NIC' option is selected for the primary interface:

For the HCX API, the required field "isPrimaryNic": true should be configured under NetworkMappings.