Steps to upgrade manually the VCG database in vCenter Servers without internet connectivity
search cancel

Steps to upgrade manually the VCG database in vCenter Servers without internet connectivity

book

Article ID: 405839

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Steps to upgrade manually the VCG database in vCenter Servers without internet connectivity

Environment

VMware vCenter Server 8.x

 

Resolution

Steps to follow:
 

  1. Login to the offline vCenter using the root account and access the bash shell.
  2. Run the following command:

    # grep 'client_' /usr/lib/vmware-updatemgr/config/vvs-config.json

    Note the
     client_id and client_secret values. These are going to be used in later steps

  3.  Download a copy of the VCG database. Below are two examples using curl and PowerShell:

    Using curl

    CLIENT_ID="<replace with values from step 2>"
    CLIENT_SECRET="<replace with values from step 2>"
    JSON=$(curl -d "client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}&grant_type=client_credentials" -X POST
    https://auth.esp.vmware.com/api/auth/v1/tokens)
    TOKEN=$(echo $JSON | jq -r .access_token)
    curl -L -H "X-Vmw-Esp-Client: $TOKEN" -X GET "https://vvs.esp.vmware.com/v1/compatible/vcg/bundles/all?format=gz" -o vlcm-vcg-offline.gz

     or 

    Using PowerShell

    $CLIENT_ID="<replace with values from step 2>"
    $CLIENT_SECRET="<replace with values from step 2>"
    $JSON = Invoke-WebRequest -Uri "
    https://auth.esp.vmware.com/api/auth/v1/tokens" -Method POST -Body "client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}&grant_type=client_credentials"
    $TOKEN = ($JSON.Content | ConvertFrom-Json).access_token
    Invoke-WebRequest -Uri "https://vvs.esp.vmware.com/v1/compatible/vcg/bundles/all?format=gz" -Method GET -Headers @{"X-Vmw-Esp-Client"="${TOKEN}"} -OutFile vlcm-vcg-offline.gz



  4. Upload the vlcm-vcg-offline.gz downloaded on step 3 using an SCP client to the offline vCenter.

  5. Unzip the file:

    gzip -d vlcm-vcg-offline.gz

  6. Update the local vLCM VCG database from our offline file

    /usr/lib/vmware-updatemgr/python/hcl/hcl_datastore.py update-offline --filePath /<path to the file>/vlcm-vcg-offline

  7. Then to check:

    /usr/lib/vmware-updatemgr/python/hcl/hcl_datastore.py information