Route advertisement rules deleted from Tier-1 Gateway after API PATCH update.
search cancel

Route advertisement rules deleted from Tier-1 Gateway after API PATCH update.

book

Article ID: 422518

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

After executing a PATCH API call to update a Tier-1 Edge Gateway, you observe that route advertisement rules or other configuration settings have been unexpectedly deleted.

  • The API call was made with a payload containing only a single parameter, such as {"enable_standby_relocation": true}.

  • Upon review, the system interpreted this request as the complete desired state for the object, resulting in the removal of any existing settings (like route advertisements) that were not included in the payload.

Environment

VMware NSX

Cause

The root cause is the default behavior of standard PATCH and PUT requests for NSX configuration objects.

By default, the NSX API treats the payload of a standard request as the complete definition of the object's configuration. It does not automatically merge new parameters with existing ones. Therefore, if you send a payload that contains only one specific setting (e.g., enabling standby relocation) but omits the existing configuration (e.g., route advertisement rules), the system assumes the omitted settings are no longer desired and removes them.

Resolution

To update specific parameters without losing existing configuration data, you must use one of the following methods.

Method 1: Full Payload Workflow

This is the safest and most reliable method for updating configuration via API.

  1. GET: Perform a GET API call to retrieve the entire current configuration of the Tier-1 Edge Gateway.

  2. MODIFY: In the retrieved JSON body, locate and modify only the specific parameter you wish to change (e.g., set "enable_standby_relocation": true). Do not remove other fields.

  3. PATCH/PUT: Send the complete, modified JSON body back in your PATCH or PUT request.

Method 2: Explicit Partial Patch

If your automation constraints require sending a minimal payload (only the changed fields), you must explicitly invoke the "partial patch" functionality. This instructs the NSX Manager to merge the new values with the existing configuration instead of overwriting it.

  • To perform a partial patch, you must append the query parameter ?partial_patch=true to your API request URL.

  • Example: PATCH https://<nsx-manager>/policy/api/v1/infra/tier-1s/<tier-1-id>?partial_patch=true