HCX migration fails with error: Failed to create migrated VM. Error while selecting best host for vm placement
search cancel

HCX migration fails with error: Failed to create migrated VM. Error while selecting best host for vm placement

book

Article ID: 386973

calendar_today

Updated On:

Products

VMware HCX

Issue/Introduction

  • When performing a VM migration using HCX, the following error is seen in the Migration UI:
    Failed to create migrated VM. Failed to prepare parameters for creating VM in 300000 ms - Error while selecting best host for vm placement
  • In the app log (common/logs/admin/app.log), the following messages are around the failure time:
    • Failed to update NsxT Inventory
    • unable to find valid certification path to requested target
  • Example:
    2025-01-22 08:17:06.306 UTC [NSXService_SvcThread-61456, Ent: HybridityAdmin, , TxId: ############] ERROR c.v.v.h.s.n.NsxTInventorySyncJob- Failed to update NsxT Inventory com.vmware.vchs.hybridity.adapters.https.UntrustedCertificateException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
  • Sometimes, networks are disconnected on the destination VM, and /common/logs/admin/app.log Shows the following error. 
    2025-02-25 10:01:08.477 UTC [ReplicationTransferService_SvcThread-68177, Ent: HybridityAdmin, , TxId: TxId: ############] INFO  c.v.h.s.r.jobs.InstantiateVmJob- Switchover ############ running in state CONFIGURE_NETWORKS
    2025-02-25 10:01:08.482 UTC [ReplicationTransferService_SvcThread-68177, Ent: HybridityAdmin, , TxId: TxId: ############] INFO  c.v.h.s.r.jobs.InstantiateVmJob- Switchover[############] Network mapping {"0":{"nicIndex":0,"connected":true,"sourceBacking":{"networkId":"network-######","networkType":"Network"},"targetBacking":{"networkId":"/infra/segments/############-####-####-####-############","networkType":"NsxtSegment"}}
    2025-02-25 10:01:08.697 UTC [ReplicationTransferService_SvcThread-68177, Ent: HybridityAdmin, , TxId: TxId: ############] ERROR c.v.h.s.r.jobs.InstantiateVmJob- Encountered exception trying to reconfigure VM Nics.
    2025-02-25 10:01:19.618 UTC [NSXService_SvcThread-109881, Ent: HybridityAdmin, , TxId: ############] ERROR c.v.v.h.s.n.NsxTInventorySyncJob- Failed to update NsxT Inventory
    com.vmware.vchs.hybridity.adapters.https.UntrustedCertificateException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Environment

VMware HCX

Cause

The NSX Certificate is mismatched. This can occur after updating the certificate on NSX.

Resolution

Re-import the newly updated NSX Manager certificate. 

  • Navigate to the HCX appliance management interface: https://hcx-ip-or-fqdn:9443.
  • Navigate to the Administration tab.
  • Select Certificate > Trusted CA Certificate on the side menu.
  • Select the certificate import option: URL
  • Enter the IP or FQDN for the NSX Manager registered with HCX. 
  • Click Apply.

Additional Information