VMware Networking Community
rajkumar49
Contributor
Contributor

NSX- T 3.0 - delete instance run-times in service insertion

i want to perform the below operation using REST API using DELETE method:

DELETE https://10.204.x.x/api/v1/serviceinsertion/services/6f2ba321-48d7-49f0-9579-227d134329fc701/service-...

but the method is not allowed.

any suggestion ?

Tags (1)
Reply
0 Kudos
11 Replies
Lalegre
Virtuoso
Virtuoso

You are facing that is issue because DELETE method is not available for that Syntax.

For deleting the Service Instances you need to use this: POST /api/v1/serviceinsertion/services/<service-id>/service-instances/<service-instance-id>/instance...

Take a look at this: NSX-T Data Center REST API - VMware API Explorer - VMware {code}

Also maybe you want to take a look at te Service Insertion whole section and the DELETE methods that are allowed.

Reply
0 Kudos
rajkumar49
Contributor
Contributor

hi Lalegre,

thaks for the info.

i tried the below POST method with /instance-runtimes?action=delete

we are getting 202 accepted.

but still, if we run GET /instance-runtimes , we are getting one un-deletable instance-runtime with below details :

"resource_type": "InstanceRuntime",

      "id": "2df91623-eb1e-4365-9507-fdfd932cf673fa6a",

      "display_name": "ServiceInsertion-NS-5c62b702-ccd7-49d4-99b2-3536f3443ee4fca0-1",

      "_create_user": "system",

      "_create_time": 1596102542085,

      "_last_modified_user": "admin",

      "_last_modified_time": 1597668823683,

      "_system_owned": false,

      "_protection": "NOT_PROTECTED",

      "_revision": 10713

    }

  ],

  "result_count": 1

}

So, one Instance Runtime is un-deletable for some reason.

any idea how to remove this instance-runtime ?

Reply
0 Kudos
Lalegre
Virtuoso
Virtuoso

Could you check in vCenter if you still have any Service VM? Everything should be deleted once your service VMs are deleted.

Reply
0 Kudos
rajkumar49
Contributor
Contributor

hi laligre,

i think we undeployed the service instance already.

any API command to delete this stuck instance-runtime entry ?

Reply
0 Kudos
Lalegre
Virtuoso
Virtuoso

The command should be the same, try it again please.

As the method says:

"Undeploy one service VM as standalone or two service VMs as HA. Associated deployment information and instance

runtime will also be deleted once service VMs have been un-deployed successfully"

Maybe the operation succeded because the Method is acceptable but the operation did not finalized or worked in vCenter.

Reply
0 Kudos
rajkumar49
Contributor
Contributor

hi Lalegre,

thanks, for the info.

still out LAB setup has no luck .

unable to delete the Sevice instance.

after waiting for sometime , if we run the GET command , we can able to list the instance runtimes.

API request :

GET https://10.204.253.19/api/v1/serviceinsertion/services/6f2ba321-48d7-49f0-9579-227d129fc701/service-...

response :

{

  "results": [

    {

      "runtime_status": "NOT_AVAILABLE",

      "runtime_health_status_by_partner": "NOT_RESPONDING",

      "maintenance_mode": "ON",

      "deployment_status": "UNDEPLOYMENT_FAILED",

      "service_instance_id": "5c62b702-ccd7-49d4-99b2-3536fee4fca0",

      "service_vm_id": "vm-227",

      "vm_nic_info": {

        "nic_infos": [

          {

            "nic_metadata": {

              "interface_label": "eth",

              "interface_index": 0,

              "interface_type": "MANAGEMENT",

              "user_configurable": true

            },

            "network_id": "network-159",

            "ip_address": "10.204.253.38",

            "subnet_mask": "255.255.240.0",

            "gateway_address": "10.204.247.254",

            "ip_allocation_type": "STATIC"

          },

          {

            "nic_metadata": {

              "interface_label": "eth",

              "interface_index": 2,

              "interface_type": "DATA2"

            },

            "network_id": "e0d6a2bf-ab1a-45bf-9406-c0e8ed708b6e",

            "ip_allocation_type": "NONE"

          },

          {

            "nic_metadata": {

              "interface_label": "eth",

              "interface_index": 1,

              "interface_type": "DATA1"

            },

            "network_id": "897ded12-3baf-4d73-9d2d-77ba1ed1ef53",

            "ip_allocation_type": "NONE"

          }

        ]

      },

      "error_message": "The requested object : ComputeManagerModel/a82cb779-3135-4526-80cb-e733bb7cfa49 could not be found. Object identifiers are case sensitive.",

      "resource_type": "InstanceRuntime",

      "id": "2df91623-eb1e-4365-9507-932cf673fa6a",

      "display_name": "ServiceInsertion-NS-5c62b702-ccd7-49d4-99b2-3536fee4fca0-1",

      "_create_user": "system",

      "_create_time": 1596102542085,

      "_last_modified_user": "system",

      "_last_modified_time": 1597747801333,

      "_system_owned": false,

      "_protection": "NOT_PROTECTED",

      "_revision": 11505

    }

  ],

  "result_count": 1

}

Reply
0 Kudos
Lalegre
Virtuoso
Virtuoso

Looking at the Body i can see that you have this:

"deployment_status": "UNDEPLOYMENT_FAILED",

It seems that if failed to undeploy and in consecuence to be deleted because of having some dependencies. Go into the NSX-T GUI to see the reason of why it is failing and then we can think on how to do it using API.

Reply
0 Kudos
rajkumar49
Contributor
Contributor

hi Lalegre,

checked the GUI for the error message

please check the screenshot in attachements.

it says "deletion in progress".

Reply
0 Kudos
Lalegre
Virtuoso
Virtuoso

Hey,

At the right you have a red info box and it says failed which error is displayed there?

Reply
0 Kudos
rajkumar49
Contributor
Contributor

please check the attachement :

Reply
0 Kudos
Lalegre
Virtuoso
Virtuoso

I guess that the issue that you are facing is that the Instance Runtime is not being able to be deleted because you still have some Service Profiles attached or/and some EPP Rules. Please take a look at this: Delete Partner Services

Reply
0 Kudos