Deleting Stuck NSX-T Service Deployments Using API
search cancel

Deleting Stuck NSX-T Service Deployments Using API

book

Article ID: 303348

calendar_today

Updated On:

Products

VMware vDefend Firewall

Issue/Introduction

This article will document the steps to delete a service deployment in NSX-T when deleting via the UI is unavailable.

This should only be used when deleting via the UI is unsuccessful such as in instances were the initial deployment failed leaving it in an incomplete state.
 

 

Environment

VMware NSX-T Data Center

Resolution

From the NSX-T UI:

  1. Security --> Network Introspection --> Delete Service Chain/Service Profile
  2. Delete all of the target services from NSX-T > System > Service Deployments > Deployment (This may give an error hence the API calls)


The following will be run from an NSX-T manager in engineer mode

  1. SSH to the active NSX-T Manager
  2. Enable engineer mode 
    1. # st en
    2. provide password
  3. Run the following API calls to identify object IDs then the subsequent command to delete the object:
Get the Service Reference ID
# curl -k -X GET -u <username>:<password> https://<NSX_Manager_IP>/policy/api/v1/infra/service-references/

Delete the Service Reference
# curl -k -X DELETE -u <username>:<password> https://<NSX_Manager_IP>/policy/api/v1/infra/service-references/<Service_Reference_ID>/

Get the Service Manager ID
# curl -k -X GET -u <username>:<password> https://<NSX_Manager_IP>/api/v1/serviceinsertion/service-managers/

Delete the Service Manager
# curl -k -X DELETE -u <username>:<password> https://<NSX_Manager_IP>/api/v1/serviceinsertion/service-managers/<Service_Manager_ID>/

Get the Service ID
# curl -k -X GET -u <username>:<password> https://<NSX_Manager_IP>/api/v1/serviceinsertion/services/

Get the Vendor Template ID
# curl -k -X GET -u <username>:<password> https://<NSX_Manager_IP>/api/v1/serviceinsertion/services/<Service_ID>/vendor-templates/

Delete the Vendor Templates
# curl -k -X DELETE -u <username>:<password> https://<NSX_Manager_IP>/api/v1/serviceinsertion/services/<Service_ID>/vendor-templates/<Vendor_Template_ID>/

Delete the Service
# curl -k -X DELETE -u <username>:<password> https://<NSX_Manager_IP>/api/v1/serviceinsertion/services/<Service_ID>/