Removing stored password aliases in Fleet Management using Swagger UI
search cancel

Removing stored password aliases in Fleet Management using Swagger UI

book

Article ID: 428244

calendar_today

Updated On:

Products

VCF Operations

Issue/Introduction

Password aliases are visible within the Fleet Management Lifecycle UI; however, the interface does not currently provide an option to modify or delete existing stored password aliases for management components.

Environment

VCF Operations 9.x

Resolution

To remove a password alias, you must retrieve the internal vmid and use the Locker API via the Fleet Management Swagger UI.

  1. SSH into the Fleet Management appliance as the root user.
  2. Enable Swagger UI access by creating the following trigger file:
    touch /var/lib/vrlcm/UI_ENABLED
  3. Generate a Base64 encoded token for the admin@local user by running the following command:
    echo -n 'admin@local:<PASSWORD>' | base64

    Note: Replace <PASSWORD> with the actual admin@local password and copy the resulting string for use in a later step.

  4. Identify the unique ID (vmid) for the alias you wish to delete (for example, EXAMPLE_PW) by running these commands in your SSH session:
    pwAlias='EXAMPLE_PW'
    rootPW=$(systemd-ask-password "Enter Fleet Manager root user password: ")
    adminPW=$(systemd-ask-password "Enter Fleet Manager admin@local user password: ")
    vmid=$(curl -sSk -u "admin@local:$adminPW" "https://localhost/lcm/locker/api/v2/passwords?aliasQuery=$pwAlias" | grep -Po '(?<=vmid\":\")[^\"]+')
    echo $vmid
  5. Record the vmid output, then clear your variables by running:
    unset pwAlias adminPW vmid
  6. Open a web browser and log in to the Fleet Management UI at https://<FM_FQDN> using the admin@local credentials.
  7. In the same browser session, navigate to the Swagger UI at https://<FM_FQDN>/api/swagger-ui.
  8. Select 2.private-internal-api from the specification dropdown menu.
  9. Click Authorize. In the Value field, enter the following:
    Basic <Encoded_Token_from_Step_3>
  10. Navigate to the Locker Password Controller section and locate the following endpoint:

    DELETE /lcm/locker/api/passwords/{vmid}

  11. Click Try it out, enter the vmid you retrieved in Step 4, and click Execute.