Log Location: /var/log/pods/vmware-system-vmop_vmware-system-vmop-controller-manager-<Pod-ID>/manager/
EMMDD HH:MM:SS 1 virtualmachine_controller.go:263] VirtualMachine "msg"="Failed to reconcile VirtualMachine" "error"="deploy from content library failed for image \"ubuntu-20-xxxxxxxx\": deploy error: The operation failed due to An error occurred during host configuration: Failed to attach VIF: The requested object : LogicalSwitch/9xxxxxxx-xxxx-xxxx-xxxx-xxxxxx2 could not be found. Object identifiers are case sensitive.." controller/virtualmachine "msg"="Reconciler error" "error"="deploy from content library failed for image \"ubuntu-20\": deploy error: The operation failed due to An error occurred during host configuration: Failed to attach VIF: The requested object : LogicalSwitch/9xxxxxxx-xxxx-xxxx-xxxx-xxxxxx2 could not be found. Object identifiers are case sensitive.." "name"="<VM_Name>" "namespace"="<namespace_name>" "reconciler group"="vmoperator.vmware.com" "reconciler kind"="VirtualMachine" EMMDD HH:MM:SS 1 virtualmachine_controller.go:352] VirtualMachine "msg"="Reconciling VirtualMachine"
VMware vCenter Server
vSphere with Tanzu
Content Library looks for a logical switch while assigning a virtual Network Interface which is no longer there in any of the NSX-T segments but existed in vCenter's database attached to few of the distributed port groups. VM's could not be assigned with any Network Interface and no IP address is being assigned to them as Content Library is trying to pick up a Logical Switch from the NSX which is already deleted.
service-control --stop vpxd
/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
select * from vpx_dvportgroup where logicalswitch_uuid like '%9xxxxxxx-xxxx-xxxx-xxxx-xxxxxx2%';
This will give the name of the Port Group to which logical switch is mapped to.
Note : Logical Switch ID needs to be replaced as observed in the /var/log/pods/vmware-system-vmop_vmware-system-vmop-controller-manager-<Pod-ID>/manager/
logs.
select * from vpx_entity where name = 'vnet-domain-cxx:xxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx0-34';
delete from vpx_dvportgroup where logicalswitch_uuid like '%9xxxxxxx-xxxx-xxxx-xxxx-xxxxxx2%';
delete from vpx_entity where name = 'vnet-domain-cxx:xxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx0-34';
service-control --start vpxd