Translate

Total Pageviews

My YouTube Channel

Tuesday 26 September 2017

Unable to delete Tenant in vRA 7 with Error "System Exception"

Today i was trying to delete a tenant in vRA 7 and it was not working. Error was "System Exception"
Solution:-
It is documented in this KB
This is known Issue and currently there is no solution. Only workaround is available to handle this issue.
  1. Take a snapshot or backup of your vRA appliance(s).
  2. Copy this script into a file and save it as recover-tenant.sh on your vRA appliance in the  /tmp directory.

    #!/bin/bash
    export PYTHONIOENCODING=utf8

    administrator_password=${1?"Usage: $0 <SSO ADMINISTRATOR PASSWORD> <TENANT ID> [HOST]"}
    tenant_id=${2?"Usage: $0 <SSO ADMINISTRATOR PASSWORD> <TENANT ID> [HOST]"}
    host="${3:-localhost}"

    token=$(curl -v -s -S -k -X POST -H "Accept: application/json" -H "Content-type: application/json" -d '{"username":"administrator","password":"'"$administrator_password"'","tenant":"vsphere.local"}' 
    https://$host/identity/api/tokens/ | \
       python -c "import sys, json; print json.load(sys.stdin)['id']")
    tenant=$(curl -v -s -S -k -H "Accept: application/json" -H "Content-type: application/json" -H "Authorization: Bearer $token" 
    https://$host/identity/api/tenants/$tenant_id )
    tenant=$(curl -v -s -S -k -H "Accept: application/json" -H "Content-type: application/json" -H "Authorization: Bearer $token" -X PUT -d "$tenant" 
    https://$host/identity/api/tenants/$tenant_id )
    echo $tenant

  3. Grant execution permissions to the file by running the command:

    chmod +x /tmp/recover-tenant.sh
  4. Execute the file by running the command:

    /tmp/recover-tenant.sh <SSO ADMINISTRATOR PASSWORD>


    Note: Replace <SSO ADMINISTRATOR PASSWORD> with your administrator@vsphere.local password.
  5. Capture the output of the script's execution, this may be needed in case of failure or if the issue is not resolved.
  6. Attempt to remove the tenant from the vRA UI again.

No comments:

Post a Comment