Script enable_ens.py fails with Field level validation errors
search cancel

Script enable_ens.py fails with Field level validation errors

book

Article ID: 439845

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

Sample error
ERROR - Failed to PUT https://###.###.##.##/policy/api/v1/infra/sites/default/enforcement-points/default/host-transport-nodes/########-####-####-####-############ with status: 400 and reason: {
"httpStatus" : "BAD_REQUEST",
"error_code" : 255,
"module_name" : "common-services",
"error_message" : "Field level validation errors: {required property host_switch_spec.host_switches[0].transport_zone_endpoints[1].transport_zone_profile_ids[0].profile_id is missing}"
}
ERROR - Error while enabling UENS on TN: ########-####-####-####-############. 400: Field level validation errors: {required property host_switch_spec.host_switches[0].transport_zone_endpoints[1].transport_zone_profile_ids[0].profile_id is missing} for url: https://###.###.##.##/policy/api/v1/infra/sites/default/enforcement-points/default/host-transport-nodes/########-####-####-####-############
ERROR - Traceback (most recent call last):
File "/opt/vmware/migration-coordinator-tomcat/bin/uens-adoption/config/service/process_tn.py", line 148, in process_tn
  self.change_switch_mode_from_standard_to_ens_interrupt_for_tn(
File "/opt/vmware/migration-coordinator-tomcat/bin/uens-adoption/config/service/process_tn.py", line 43, in change_switch_mode_from_standard_to_ens_interrupt_for_tn
  self.nsx_utils.nsx_client.put("policy/api/v1/infra/sites/default/enforcement-points/default"
File "/opt/vmware/migration-coordinator-tomcat/bin/uens-adoption/config/clients/nsx_client.py", line 131, in put
  return self._rest_call(method='PUT',
File "/opt/vmware/migration-coordinator-tomcat/bin/uens-adoption/config/clients/nsx_client.py", line 118, in _rest_call
  raise DetailedHttpError(response)
clients.nsx_client.DetailedHttpError: 400: Field level validation errors: {required property host_switch_spec.host_switches[0].transport_zone_endpoints[1].transport_zone_profile_ids[0].profile_id is missing} for url: https://###.###.##.##/policy/api/v1/infra/sites/default/enforcement-points/default/host-transport-nodes/########-####-####-####-############

Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.

Environment

VMware NSX 4.X

VCF 9

Cause

Some Transport Zone Profiles may not have a property profile_id populated. The script published on the documentation page doesn't handle these objects properly.

Resolution

This issue is resolved in VCF 9.0.2, available at Broadcom downloads.

If you are having difficulty finding and downloading software, please review the Download Broadcom products and software KB.

Workaround:

  1. Download the patched script attached to this article: uens-enable-423.tgz
  2. SCP the file to the NSX Manager as root in /root (same node as previous run).
  3. SSH the NSX Manager as root.
  4. Change directory: cd /opt/vmware/migration-coordinator-tomcat/bin
  5. Patch the script with the newer version: tar -xvzf /root/uens-enable-423.tgz
  6. Correct file permissions: chown -R umc:umc uens-adoption
  7. Change directory: cd uens-adoption/config/
  8. Follow instruction in the README file to use run the enable_uens.py with the same config file used last time.

Additional Information

Similar issue: Transport nodes fail to exit maintenance mode after running the enable EDP standard “enable_uens” script on a brownfield cluster