Error: "Failed to attach all ports" seen when a vMotion task fails
book
Article ID: 373660
calendar_today
Updated On:
Products
VMware NSX
Issue/Introduction
Customer is unable to vMotion any VM to a particular host\transport node or subset of hosts in the cluster. The VM vMotion\migration task fails with the following error:
ERROR: "Failed to attach all ports"
The host or hosts with the issue recently had NSX uninstalled\unprepared and installed\prepared again.
VM's connected to NSX-T segments.
Manually trying to connect a powered-off VM vNIC to the vDS\virtual switch on a host with the issue fails as well.
In the /var/run/log/hostd.log log of the vMotion destination host a log message like the following will be observed:
2024-04-02T07:59:24.998Z info hostd[2101935] [Originator@6876 sub=Solo.Vmomi opID=lj3y4hja-21051468-auto-cj7f1-h5:72192407-e0-01-ff-3c13 user=vpxuser:user\domain] Result: --> (vim.fault.PlatformConfigFault) { --> text = "Failed to attach all ports", --> msg = "", --> } 2024-04-02T07:59:24.998Z error hostd[2101935] [Originator@6876 sub=Req@internalvim25... opID=lj3y4hja-21051468-auto-cj7f1-h5:72192407-e0-01-ff-3c13 user=vpxuser:user\domain] Method >vim.host.VMotionManager.initiateDestination threw undeclared fault of type vim.fault.PlatformConfigFault
In the /var/run/log/nsx-syslog.log an error will be seen indicating there is a problem in creating a port because it cannot be found:
2024-04-02T07:59:24.797Z nsx-opsagent[2103639]: NSX 2103639 - [nsx@6876 comp="nsx-esx" subcomp="opsagent" s2comp="nsxa" tid="2104234" level="ERROR" errorCode="MPA44205"] [PortOp] Host switch info with uuid >for tzId > [<UUID>] was not found [..] 2024-04-02T07:59:24.797Z nsx-opsagent[2103639]: NSX 2103639 - [nsx@6876 comp="nsx-esx" subcomp="opsagent" s2comp="nsxa" tid="2104234" level="ERROR" errorCode="MPA42001"] [CreateLocalDvPort] >createPort(uuid=<UUID>, zone=<UUID>) failed: Failed to create port <UUID> with VIF <UUID> >because DVS id is >not found by transport-zone id <UUID>
Environment
NSX 3.1.X.
Cause
The VM cannot be connected to the destination host, since the vDS cannot be found due to it being in a disabled state.
The vDS is in this state due to the following settings being configured on it. Please note the configuration of the vDS can be retrieved by running the 'net-dvs -l' command:
- com.vmware.common.opaqueDvs.status.component.vswitch = up , propType = RUNTIME
The vSwitch parameters are set that way when the host has NSX uninstalled\unprepared, but fail to be configured correctly when the host is prepared again as a transport node.
Resolution
This issue is resolved in 3.2.0 due to changes made on host sync. If a variation of this issue is seen on a later version, then export the NSX Manager and host logs as soon as possible. Open a NSX support case with the logs referencing this KB.
The workaround to enable the vDS on the host is to do the following:
com.vmware.common.opaqueDvs.status.component.vswitch = up , propType = RUNTIME ---------------> propType needs to be set to CONFIG, instead of runtime
com.vmware.vswitch.disabled = false , propType = CONFIG ---------------> this needs to be removed
The steps for the workaround are the following:
Verify that the host\transport node is reporting state 'success' in the NSX Manager UI. If it is,
Then manually remove “com.vmware.vswitch.disabled” property using the following command: