Synchronize inventory versions after out-of-band upgrade in a VMware Cloud Foundation Environment
search cancel

Synchronize inventory versions after out-of-band upgrade in a VMware Cloud Foundation Environment

book

Article ID: 324050

calendar_today

Updated On:

Products

VMware Cloud Foundation VMware SDDC Manager

Issue/Introduction

  • After out-of-band upgrade has been made in a VMware Cloud Foundation Environment, if the system has not automatically synchronized the versions of the products, manual version synchronization can be perform through the provided public APIs.
  • Upgrade Precheck for out-of-band upgrade fails.

 

Environment

VMware Cloud Foundation 5.2

Cause

Daily automatic synchronization of the inventory version has not ran after out-of-band upgrade has been made in a VMware Cloud Foundation Environment.

Resolution

Version synchronization can be performed using POST /v1/resources/version-syncs. This API can be used for both global and per domain inventory version synchronization, based on the input.

Global version synchronization is used to update the versions stored in the VCF inventory for all the managed products - vCenter, ESXi, NSX and VxRail.
Request body:
  {
    "resourceType" : "SYSTEM"
  }
Domain version synchronization is used to update the versions stored in the VCF inventory for domain’s managed products - vCenter, ESXi, NSX and VxRail. The resource ID is the id of the specific domain from VCF inventory.
Request body:
  {
    "resourceId" : "########-####-####-####-########abde",
    "resourceType" : "DOMAIN"
  }
Optionally to both global and domain input spec, filter for product types to be synced can be provided. Accepted values are: VCENTER, ESXI, NSX and VXRAIL.
Request body:
  {
    "resourceType" : "SYSTEM",
    "productTypes" : [ "VCENTER", "ESXI" ]
  }


Example with ssh to SDDC Manager:

  1. SSH to SDDC Manager with vcf and su to root.

  2. Generate access token:
    TOKEN=$(curl -X POST -H "Content-Type: application/json" -d '{"username": "<ssoUsername>","password": "<ssoPassword>"}' http://localhost/v1/tokens | jq -r '.accessToken')

    Note: Token created remains valid for one hour.

  3. Invoke version synchronization API with desired request payload
    curl -X POST -H 'Content-type: application/json' -H 'Accept: application/json' -H "Authorization: Bearer $TOKEN" http://localhost/v1/resources/version-syncs -d '{"resourceType":"SYSTEM"}'

  4. Workflow execution status can be observed from the task panel in the SDDC Manager UI

Example without ssh to SDDC Manager:

  1. Generate access token by invoking the tokens API and providing the SSO username and password for SDDC Manager authentication.
    API:
    https://<sddcManagerFqdn>/v1/tokens
    HTTP Request Method: POST
    Headers: Content-Type: application/json
    Request Body: {"username": "<ssoUsername>","password": "<ssoPassword>"}

  2. From the response body of the above API, copy the "accessToken" value.

  3. Invoke version synchronization API with desired request payload, by using the access token obtained in the previous step, as an Authorization header.
    API:
    https://<sddcManagerFqdn>/v1/resources/version-syncs
    HTTP Request Method: POST
    Headers: Content-type: application/json, Accept: application/json, Authorization: Bearer <accessToken>
    Request Body: {"resourceType":"SYSTEM"}

  4. Workflow execution status can be observed from the task panel in the SDDC Manager UI


Workaround:

Wait for the daily version synchronization to synchronize the inventory versions after the out-of-band upgrade.

Inventory Sync is run daily at 0300 local server time. 

How to modify inventory version synchronization cron job schedule in a VMware Cloud Foundation Environment?


Additional Information