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)


Use the following API calls to remove all stale SVI objects:

Get the Service Reference ID
GET https://<NSX_Manager_IP>/policy/api/v1/infra/service-references/

Delete the Service Reference
DELETE https://<NSX_Manager_IP>/policy/api/v1/infra/service-references/<Service_Reference_ID>/

Get the Service Manager ID
GET https://<NSX_Manager_IP>/api/v1/serviceinsertion/service-managers/

Delete the Service Manager
DELETE https://<NSX_Manager_IP>/api/v1/serviceinsertion/service-managers/<Service_Manager_ID>/

Get the Service ID
GET https://<NSX_Manager_IP>/api/v1/serviceinsertion/services/

Get the Vendor Template ID
GET https://<NSX_Manager_IP>/api/v1/serviceinsertion/services/<Service_ID>/vendor-templates/

Delete the Vendor Templates
DELETE https://<NSX_Manager_IP>/api/v1/serviceinsertion/services/<Service_ID>/vendor-templates/<Vendor_Template_ID>/

Delete the Service
DELETE https://<NSX_Manager_IP>/api/v1/serviceinsertion/services/<Service_ID>/

Note: You may see the following error message:

{
    "httpStatus": "BAD_REQUEST",
    "error_code": 289,
    "module_name": "common-services",
    "error_message": "Principal 'admin' with role '[enterprise_admin]' attempts to delete or modify an object of type GiServiceProfile it doesn't own. (createUser=nsx_policy, allowOverwrite=null)"
}

Please add a header: X-Allow-Overwrite : true