Delete a tenant
When you delete a tenant from
VMware Workspace ONE Access
, you also delete the
resources created under it. So before deleting a tenant using the Tenant Management Controller
APIs, you must verify that it is not associated with a product.- Verify that all general prerequisites have been satisfied. See Tenant management usingVMware Aria Suite Lifecycle APIs.
- Verify thatVMware Workspace ONE Accesshas multi-tenancy enabled.
- Verify that you have the following input values for the tenant created inVMware Workspace ONE Access.
- vidmHostnameVMware Workspace ONE Accessdomain name.
- baseTenantHostnameVMware Workspace ONE Accessbase tenant or default tenant alias.
- VMware Workspace ONE Accessadministrator password.
- VMware Workspace ONE Accessadministrator user name.
- vidmHostHostname or load-balanced FQDN of theVMware Workspace ONE Accesshost.
- vidmOAuthServiceClientIdUse the default valueservice__Oauth2Client.
- vidmOAuthServiceClientSecretTo obtain the value, see the client configuration on the OAuth2 Client page inVMware Workspace ONE Access. From theVMware Workspace ONE Accessconsole Catalog tab, select .
- VMware Workspace ONE Accesstenant name.
The following procedure shows how to
check for tenant association with a product before deleting the tenant. To help you understand
the required input, the steps include example values.
- Check to see if the tenant is associated with a product.curl -X POST \ '$url/lcm/authzn/api/idp/tenants/referenceexists' \ -H 'Authorization: Basic YWRtaW5AbG9jYWw6VGhpc0lzUGFzc3dvcmQ=' \ -H 'Content-Type: application/json' \ -d '{ "vidmDomainName": "sqa.local", "baseTenantHostname": "newmaster48-179.sqa.local", "vidmAdminPassword": "locker:password:33e75543-9e32-4232-9b2f-8d92d6e2888b:installerPassword", "vidmHost": "newmaster48-179.sqa.local", "vidmAdminUser": "admin", "vidmVersion": "3.3.6", "vidmRootPassword": "locker:password:33e75543-9e32-4232-9b2f-8d92d6e2888b:installerPassword", "vidmSshPassword": "locker:password:33e75543-9e32-4232-9b2f-8d92d6e2888b:installerPassword", "vidmOAuthServiceClientId": "Service__OAuth2Client", "vidmOAuthServiceClientSecret": "5ICAFUqkN32yiAPK0fByW8MEtpzfmnog", "tenancyEnabled": true, "vidmProductCertificate": "locker:certificate:74902017-aa3e-4d4c-b85a-7ebb0d97f3bf:GSAN", "clusteredVidm": true, "vidmTenant": "PEPSITEST48-179" } ' | jq "."Examine the response. Thevmidis the request ID that you use to track your request.{ "vmid": "698cf49c-2ce4-496f-9804-6534527be83e", "transactionId": null, "tenant": "default", "requestName": "tenantreferenceexists", "requestReason": "Validate if the tenant has references", "requestType": "Validate if the tenant has references", "requestSource": null, "requestSourceType": "user", "inputMap": { "vidmHostBaseExDTO": { "vidmHost":"newmaster48-179.sqa.local", "vidmTenant":"PEPSITEST48-179", "useServiceClient":false, "isTenantConfiguredByPath":false, "vidmAdminUser":"admin", "vidmAdminPassword":"locker:password:33e75543-9e32-4232-9b2f-8d92d6e2888b:installerPassword", "vidmOAuthServiceClientId":"Service__OAuth2Client", "vidmOAuthServiceClientSecret":"5ICAFUqkN32yiAPK0fByW8MEtpzfmnog", "vidmDomainName":"sqa.local", "baseTenantHostname":"newmaster48-179.sqa.local", "requestId":"null", "tenantvalandassocproducts":"false" }, "outputMap": {}, "state": "CREATED", "executionId": null, "executionPath": null, "executionStatus": null, "errorCause": null, "resultSet": null, "isCancelEnabled": null, "lastUpdatedOn": 1658400394933, "createdBy": null } }
- Assign the variable for the requestId.requestId = "698cf49c-2ce4-496f-9804-6534527be83e"
- Use therequestIdto track your request.curl -X GET '$url/lcm/request/api/requests/$requestId' -H 'Authorization: Basic YWRtaW5AbG9jYWw6VGhpc0lzUGFzc3dvcmQ=' | jq "."
- Examine the response.When the status showsCOMPLETED, check the values forresponseandmessage.
- If both are false, then the tenant is not associated with a product.
- If both are true, then the tenant is associated with a product and cannot be deleted.
... "status":"COMPLETED", "lastUpdatedOn":1658836815181 }, "errorCause": null, "resultSet": [ { "vmid":"3c6bfe28-4e79-4c8b-8e8b-dba663f0cbe5", "transactionId":null, "tenant":"default", "sourceOfTheRequest":"02439556-7fce-428a-9015-c3c2d4ea4400", "resultKey":"vidmTaskResult", "resultType":"java.lang.String", "resultText": { "status":"SUCCESS", "statusCode":200, "responseType":"String", "response":"false", "message":"false", "currentState":null, "currentTask":null }, "eventId":"acb1ff10-4706-41c6-a9ae-8845299eac9b", "machineInstanceId":"23ac1249-6eec-4ce1-8d34-f0dc977a9277" } ], "isCancelEnabled": null, "lastUpdatedOn": 1658836817630, "createdBy": "admin@local" }In this example,"response":"false"and"message":"false"so you can delete the tenant. - Delete the tenant.curl -X POST \ '$url/lcm/authzn/api/idp/tenants/delete' \ -H 'Authorization: Basic YWRtaW5AbG9jYWw6VGhpc0lzUGFzc3dvcmQ=' \ -H 'Content-Type: application/json' \ -d '{ "vidmDomainName": "sqa.local", "baseTenantHostname": "newmaster48-179.sqa.local", "vidmAdminPassword": "locker:password:33e75543-9e32-4232-9b2f-8d92d6e2888b:installerPassword", "vidmHost": "newmaster48-179.sqa.local", "vidmAdminUser": "admin", "vidmVersion": "3.3.6", "vidmRootPassword": "locker:password:33e75543-9e32-4232-9b2f-8d92d6e2888b:installerPassword", "vidmSshPassword": "locker:password:33e75543-9e32-4232-9b2f-8d92d6e2888b:installerPassword", "vidmOAuthServiceClientId": "Service__OAuth2Client", "vidmOAuthServiceClientSecret": "5ICAFUqkN32yiAPK0fByW8MEtpzfmnog", "tenancyEnabled": true, "vidmProductCertificate": "locker:certificate:74902017-aa3e-4d4c-b85a-7ebb0d97f3bf:GSAN", "clusteredVidm": true, "tenantToBeDeleted": "PEPSITEST48-179" } ' | jq "."Examine the response. Thevmidis the request ID that you use to track your request.{ "vmid": "540e7eb7-1bed-4d59-b516-ac1176998548", "transactionId": null, "tenant": "default", "requestName": "deletetenant", "requestReason": "Delete tenant", "requestType": "Delete tenant", "requestSource": null, "requestSourceType": "user", "inputMap": { "vidmTenantDeleteRequestDTO": { "vidmHost":"newmaster48-179.sqa.local", "vidmTenant":null, "useServiceClient":false, "isTenantConfiguredByPath":false, "vidmAdminUser":"admin", "vidmAdminPassword":"locker:password:33e75543-9e32-4232-9b2f-8d92d6e2888b:installerPassword", "vidmOAuthServiceClientId":"Service__OAuth2Client", "vidmOAuthServiceClientSecret":"5ICAFUqkN32yiAPK0fByW8MEtpzfmnog", "vidmDomainName":"sqa.local", "baseTenantHostname":"newmaster48-179.sqa.local", "requestId":null, "tenantToBeDeleted":"PEPSITEST48-179" }, "tenantvalandassocproducts": "false" }, "outputMap": {}, "state": "CREATED", "executionId": null, "executionPath": null, "executionStatus": null, "errorCause": null, "resultSet": null, "isCancelEnabled": null, "lastUpdatedOn": 1658837473065, "createdBy": null }
- Assign the variable for the requestId.requestId = "540e7eb7-1bed-4d59-b516-ac1176998548"
- Use therequestIDto track your request.curl -X GET '$url/lcm/request/api/requests/$requestId' -H 'Authorization: Basic YWRtaW5AbG9jYWw6VGhpc0lzUGFzc3dvcmQ=' | jq "."Examine the response. When the status showsCOMPLETED, and the values forresponseandmessageshowTenant deleted successfully, the tenant is deleted.... "status": "COMPLETED", "lastUpdatedOn": 1658837473978 }, "errorCause": null, "resultSet": [ { "vmid":"43f7fb53-0e79-46c5-aea0-63b2e819c0d6", "transactionId":null, "tenant":"default", "sourceOfTheRequest":"b0ff51d6-3bd8-431e-a84b-11b876cc399e", "resultKey":"vidmTaskResult", "resultType":"java.lang.String", "resultText": { "status": "SUCCESS", "statusCode": 200, "responseType": "String", "response": "Tenant deleted successfully", "message": "Tenant deleted successfully", "currentState": null, "currentTask": null }, "eventId": "86a8631b-733b-4f21-aa08-7abbcd1ce6cc", "machineInstanceId": "7dae400c-7f29-47ee-9b42-f1f7c0fff692" } ], "isCancelEnabled": null, "lastUpdatedOn": 1658837477052, "createdBy": "admin@local" }