Recently, I ran into an interesting problem in my lab where I couldn’t get rid of an unused Virtual Service in NSX ALB. The attempt to delete was failing with an error: “VS cannot be deleted! ‘It is being referred to by SystemConfiguration object”
I tried deleting the VS via API and it returned the same error
|
1 2 3 4 5 6 7 |
DELETEhttps://siteb-alb.sddc.lab/api/virtualservice/virtualservice-68679e6f-f10b-45ee-ab7d-d714ff8766aa Response: { "error":"siteb-local-dns-vs cannot be deleted! 'siteb-local-dns-vs' is being referred to by SystemConfiguration object" } |
To figure out where this VS is being referenced, I looked through the pool members and other settings in NSX ALB, but I couldn’t discover anything particular. Internet searches were also not very helpful.
I then checked this issue in internal tools and got a hint that I needed to remove the VS reference from the system configuration through API first.
The procedure to do so is given below.
1: Fetch NSX ALB System Configuration
|
1 2 3 |
Method:GET URL:https://{{alb_url}}/api/systemconfiguration |
In the response body of the above API call, you will get a reference to the DNS VS. Look for the field “dns_virtualservice_refs”
I have attached a sample response here just for reference.
[bg_collapse view=”button-green” color=”#4a4949″ expand_text=”Show More” collapse_text=”Show Less” ]
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
----snippedoutput---- { "url":"https://siteb-alb.sddc.lab/api/systemconfiguration", "uuid":"default", "dns_configuration":{ "server_list":[ { "addr":"10.196.88.2", "type":"V4" } ], "search_domain":"sddc.lab" }, "ntp_configuration":{ "ntp_servers":[ { "server":{ "addr":"10.84.55.42", "type":"V4" } } ] }, "default_license_tier":"ENTERPRISE", "secure_channel_configuration":{ "sslkeyandcertificate_refs":[ "https://siteb-alb.sddc.lab/api/sslkeyandcertificate/sslkeyandcertificate-33c1ebca-0d7b-48ed-8513-c6458345fc22" ] }, "welcome_workflow_complete":true, "fips_mode":false, "enable_cors":false, "common_criteria_mode":false, "host_key_algorithm_exclude":"", "kex_algorithm_exclude":"", "dns_virtualservice_refs":[ "https://siteb-alb.sddc.lab/api/virtualservice/virtualservice-68679e6f-f10b-45ee-ab7d-d714ff8766aa" ] } |
[/bg_collapse]
2: Update NSX ALB System Configuration
Take the response output and change the dns_virtualservice_refs to blank.
For an example payload, refer to the screenshot below.
|
1 2 3 |
Method:PUT URL:https://{{alb_url}}/api/systemconfiguration |
Switch back to the NSX ALB UI and delete the VS. It should be deleted without any further hiccups.
I hope you enjoyed reading this post. Feel free to share this on social media if it is worth sharing.

