[ ########-####-####-########1008 ] NAT rule ##### has an invalid vnic value 0 . The value should be a vnic index number.
/opt/vmware/vcloud-director/logs/vcloud-container-debug.log the error below is present:DATE TIME| DEBUG | Backend-activity-pool-119545 | NsxTVAppNetwork | Exception occurred while deploying and attaching network to vApp edge EDGE_NAME with id ########-####-####-########4a3e. | requestId=########-####-####-########1008,request=POST https://cloud.example.com/api/vApp/vapp-########-####-####-########fccc/action/deploy,requestTime=1748616245118,remoteAddress=##.##.##.##:53060,userAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ...,accept=application/*+xml;version 39.0.0-alpha vcd=########-####-####-########aa98,task=########-####-####-########ddd6 activity=(com.vmware.vcloud.backendbase.management.system.TaskActivity,urn:uuid:########-####-####-########ddd6) activity=(com.vmware.ssdc.backend.services.impl.DeployVAppActivity,urn:uuid:########-####-####-########5b43) activity=(com.vmware.ssdc.backend.DeployVAppVmSubsetActivity,urn:uuid:########-####-####-########638e)com.vmware.vcloud.api.presentation.service.BadRequestException: NAT rule ##### has an invalid vnic value 0. The value should be a vnic index number.
[...]DATE TIME | ERROR | Backend-activity-pool-119545 | DeployVAppVmSubsetActivity | [Activity Execution] Uncaught Exception during Activity execution. Recent phase: com.vmware.ssdc.backend.DeployVAppVmSubsetActivity$DeployNetworksPhase@185a067b - Handle: urn:uuid:########-####-####-########638e, Current Phase: DeployVAppVmSubsetActivity$DeployNetworksPhase | requestId=########-####-####-########008,request=POST https://cloud.example.com/api/vApp/vapp-########-####-####-########fccc/action/deploy,requestTime=1748616245118,remoteAddress=##.##.##.##:53060,userAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ...,accept=application/*+xml;version 39.0.0-alpha vcd=########-####-####-########aa98,task=########-####-####-########ddd6 activity=(com.vmware.vcloud.backendbase.management.system.TaskActivity,urn:uuid:########-####-####-########ddd6) activity=(com.vmware.ssdc.backend.services.impl.DeployVAppActivity,urn:uuid:########-####-####-########f5b43) activity=(com.vmware.ssdc.backend.DeployVAppVmSubsetActivity,urn:uuid:########-####-####-########638e)java.util.concurrent.ExecutionException: com.vmware.vcloud.api.presentation.service.BadRequestException: NAT rule 65,544 has an invalid vnic value 0. The value should be a vnic index number. at com.vmware.vcloud.activity.executors.ActivityRunner.run(ActivityRunner.java:136) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)Caused by: com.vmware.vcloud.api.presentation.service.BadRequestException: NAT rule ##### has an invalid vnic value 0. The value should be a vnic index number.[...]
The issue is caused because of the presence of some ghost entries in the NAT settings of the certain vApp networks. The issue is also caused because of The NAT rule that has invalid vnic "0" index.
Engineering are aware of this issue and will be fixed in a future release of VMware Cloud Director.
Please Subscribe to this KB Article to be notified with any updates.
As a workaround, the below SQL Query helps identify which vApps are facing this behaviour.
Warning: Modifications to the VCD Database are not supported without Broadcom Global Support.
sudo -i -u postgres psql vcloudWITH network_nat_details AS ( SELECT ln.id AS logical_network_id, ln.name AS logical_network_name, ln.scope_id AS vapp_sg_id, COALESCE((xpath('/object/void[@property="vmNicIndex"]/int/text()', nat_spec.rule_xml))[1]::text, '0') AS nic_number, (xpath('/object/void[@property="vappScopedVmId"]/string/text()', nat_spec.rule_xml))[1]::text AS vapp_scoped_vm_id, (xpath('/object/void[@property="ruleId"]/int/text()', nat_spec.rule_xml))[1]::text AS natrule_id, gw.id AS gateway_id FROM logical_network ln JOIN gateway_interface gi ON ln.id = gi.logical_network_id JOIN gateway gw ON gi.gateway_id = gw.id CROSS JOIN LATERAL ( SELECT unnest(xpath('//object[@class="com.vmware.vcloud.fabric.net.gateway.services.impl.NatRuleSpecImpl"]', gw.service_config::xml)) AS rule_xml ) AS nat_spec WHERE ln.scope_type = 3 AND gw.service_config IS NOT NULL)
SELECT nd.logical_network_id, nd.logical_network_name, nd.vapp_sg_id, nd.gateway_id, nd.vapp_scoped_vm_id, nd.nic_number as nic_index, nd.natrule_id as natrule, vapp.name as vapp_name, org.name as org_name, ovdc.name as ovdc_name FROM network_nat_details nd left join vm_container vapp on nd.vapp_sg_id=vapp.sg_id left join organization org on org.org_id = vapp.org_id left join org_prov_vdc ovdc on ovdc.id=vapp.org_vdc_idwhere vapp.sg_type=1 and not exists (select 1 from vapp_vm vm where vm.vapp_scoped_vm_id=nd.vapp_scoped_vm_id and vm.vapp_id=nd.vapp_sg_id);