How To: Adjust Version Alias Using the API
search cancel

How To: Adjust Version Alias Using the API

book

Article ID: 330354

calendar_today

Updated On:

Products

VMware Cloud Foundation

Issue/Introduction

How to update the version alias file using the API

Symptoms:
Installed component version does not match the BOM version

Environment

VCF

Resolution

Using the Command Line:
  1. SSH to the SDDC-Manager appliance (vcf user)
  2. Change to root user:
su
  1. Generate API bearer token:
curl -X POST -H "Content-Type: application/json" -d '{"username": "<SSO-username>","password": "<SSO-password>"}' --insecure https://<SDDC-MANAGER_FQDN>/v1/tokens | json_pp
  1. Run the following to update the version alias:
curl http://localhost/v1/system/settings/version-aliases/<COMPONENT>/<EXPECTED_BOM_VERSION> -i -X PUT \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer <BEARER-TOKEN-FROM-3>' \
    -d '{
  "forceUpdate": true,
  "aliases": ["<CURRENT-VERSION>"]
}'

Example:
curl http://localhost/v1/system/settings/version-aliases/DOMAIN_MANAGER/4.2.1-vcf4210RELEASE-18016088 -i -X PUT \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJhZmI2MjNkZS1kZjIwLTQ1NWEtOWQ3NC1mYzgwZmFjNzM5ZGUiLCJpYXQiOjE1ODIxOTcxODcsInN1YiI6InZjZi1zZWN1cmUtdXNlckB2c3BoZXJlLmxvY2FsIiwiaXNzIjoidmNmLWF1dGgiLCJhdWQiOiJzZGRjLXNlcnZpY2VzIiwibmJmIjoxNTgyMTk3MTg3LCJleHAiOjE1ODIyMDA3ODcsInVzZXIiOiJ2Y2Ytc2VjdXJlLXVzZXJAdnNwaGVyZS5sb2NhbCIsIm5hbWUiOiJ2Y2Ytc2VjdXJlLXVzZXJAdnNwaGVyZS5sb2NhbCIsInNjb3BlIjpbIkJBQ0tVUF9DT05GSUdfUkVBRCIsIkNSRURFTlRJQUxfUkVBRCIsIlVTRVJfV1JJVEUiLCJPVEhFUl9XUklURSIsIkJBQ0tVUF9DT05GSUdfV1JJVEUiLCJPVEhFUl9SRUFEIiwiVVNFUl9SRUFEIiwiQ1JFREVOVElBTF9XUklURSJdfQ._92IFJCQsbRbAWd4PQmBDczWXtuVCWPOsL1ZyCdKEMU' \
    -d '{
  "forceUpdate": true,
  "aliases": ["4.2.1-vcf4210RELEASE-18153716"]
}'
  1. Verify the version alias:
cat /opt/vmware/vcf/lcm/lcm-app/conf/VersionAlias.yml
 
Using the Developer Center UI:
  1. Log into SDDC Manager
  2. Go to Developer Center > API Explorer
  3. Filter for "version"
image.png
  1. To check the current version alias, run GET /v1/system/settings/version-aliases
  2. To edit the version alias, click on PUT /v1/system/settings/version-aliases/{bundleComponentType}/{version}
  3. Select the component  you want to alias:
image.png
  1. Select the component from the bundleComponentType
  2. version should be the BOM version you want to alias (usually the build before the version you want to upgrade to)
  3. aliasSpec should be the currently installed build