Logical switch object and dvPortGroup remain after segment deletion
search cancel

Logical switch object and dvPortGroup remain after segment deletion

book

Article ID: 419512

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • After deleting an NSX segment, the associated dvPortGroup remains visible in the vSphere Client.
  • The API GET /policy/api/v1/infra/segments/<segment_id> returns NOT_FOUND.
    {
      "httpStatus" : "NOT_FOUND",
      "error_code" : 600,
      "module_name" : "common-services",
      "error_message" : "The requested object : <Segment_Path> could not be found. Object identifiers are case sensitive."
    }


  • You can see the logical switch associated to the deleted segment with the API GET /api/v1/logical-switches. The creation time is nearly the segment deletion time and the revision is set as 0. 
    ..snip..
    {
        "switch_type" : "DEFAULT",
        "transport_zone_id" : "<UUID>",
        "vni_pool_id" : "<UUID>",
        "vni" :<ID>,
        "admin_state" : "UP",
        "replication_mode" : "MTEP",
        "switching_profile_ids" : [ {
          "key" : "SwitchSecuritySwitchingProfile",
          "value" : "<UUID>"
        }, {
          "key" : "SpoofGuardSwitchingProfile",
          "value" : "<UUID>"
        }, {
          "key" : "IpDiscoverySwitchingProfile",
          "value" : "<UUID>"
        }, {
          "key" : "MacManagementSwitchingProfile",
          "value" : "<UUID>"
        }, {
          "key" : "QosSwitchingProfile",
          "value" : "<UUID>"
        } ],
        "hybrid" : false,
        "global_vni" : 0,
        "span" : [ ],
        "ns_arp_enabled" : false,
        "recommended" : false,
        "node_local_switch" : false,
        "resource_type" : "LogicalSwitch",
        "id" : "<UUID>", << This uuid is used to clean up stale objects
        "display_name" : "overlay_segment",
        "tags" : [ {
          "scope" : "policyPath",
          "tag" : "<Segment_Path>" << Target segment policy path
        } ],
        "_system_owned" : false,
        "_protection" : "REQUIRE_OVERRIDE",
        "_create_time" :<UNIX_Timestamp>, << The creation UNIX time
        "_create_user" : "nsx_policy",
        "_last_modified_time" :<UNIX_Timestamp>,
        "_last_modified_user" : "nsx_policy",
        "_revision" : 0, << This is set as 0 after recreation
        "_schema" : "/v1/schema/LogicalSwitch"
      }
    ..snip..

Environment

VMware NSX

Cause

Due to a race condition during the deletion of an NSX segment, the underlying Logical Switch is unintentionally re-created. Consequently, the Logical Switch persists on the Manager side even though the Segment object has been successfully removed from the Policy side.

Resolution