Upgrades APIs

Upgrades APIs

APIs for managing Upgrades

Table of Contents

1. Perform Upgrade

Perform Upgrade API is used to perform upgrades. Upgrades are sequential. So in order to upgrade to a release, your environment must be on the version before that release. Upgrades are applied on a workload domain basis. The management domain contains the core infrastructure, so you must upgrade the management domain before upgrading the other workload domains. You must upgrade all required components to keep your system in an optimum state.

Note : Performing upgrades is supported on VMware Cloud Foundation 3.5 BOM resources and above.

1.1. Steps to Perform Upgrade.

  1. Download the required bundle.

  2. Execute Get the Upgradables API to retrieve the list of upgradables (bundle and resource detail) in the system.

  3. Execute Prechecks API to perform required system level health checks.

  4. Perform upgrade and monitor the upgrade progress.

2. Domain Upgrade

2.1. Prerequisites

The following data is required:

  • Bundle ID.

  • Resource Type. Ex: DOMAIN.

  • One or more Resource upgrade specifications.

  • Each Resource upgrade specification should contain.

    • Resource ID. Ex: Domain ID.

    • Upgrade scheduled time or Upgrade now option.

The following data is optional:

  • A boolean for parallel ESXi upgrade (default is 'true')

  • A boolean for quickboot run for ESXi upgrade (default is 'false')

Tip : Refer to: UpgradeSpec and ResourceUpgradeSpec.

2.2. Steps

  • Invoke the API. This API returns a task which can be polled and monitored.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/upgrades' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "bundleId" : "4686aa89-fc52-429f-86cf-6fe4f34fe361",
  "resourceType" : "DOMAIN",
  "parallelUpgrade" : true,
  "resourceUpgradeSpecs" : [ {
    "resourceId" : "ef16054d-1981-4d82-bb42-35f1b3f1a488",
    "scheduledTimestamp" : "2023-05-16T03:12:14.637Z",
    "upgradeNow" : false,
    "enableQuickboot" : true
  } ]
}'

HTTP Request

POST /v1/upgrades HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 321
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "bundleId" : "4686aa89-fc52-429f-86cf-6fe4f34fe361",
  "resourceType" : "DOMAIN",
  "parallelUpgrade" : true,
  "resourceUpgradeSpecs" : [ {
    "resourceId" : "ef16054d-1981-4d82-bb42-35f1b3f1a488",
    "scheduledTimestamp" : "2023-05-16T03:12:14.637Z",
    "upgradeNow" : false,
    "enableQuickboot" : true
  } ]
}

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/494d2943-1cca-464f-81b1-cc35f9c9787c
Content-Length: 478

{
  "id" : "494d2943-1cca-464f-81b1-cc35f9c9787c",
  "name" : "Upgrade DOMAIN - [acme-domain] using BUNDLE - PSC:6.7.0-13010631 VCENTER:6.7.0-13010631",
  "type" : "UPGRADE",
  "status" : "IN_PROGRESS",
  "creationTimestamp" : "2023-05-16T03:12:14.637Z",
  "resources" : [ {
    "resourceId" : "ef16054d-1981-4d82-bb42-35f1b3f1a488",
    "type" : "DOMAIN"
  }, {
    "resourceId" : "4686aa89-fc52-429f-86cf-6fe4f34fe361",
    "type" : "BUNDLE"
  } ],
  "isCancellable" : false
}
  • Poll the status of the task using the task API with the ID from the response of the previous API.

Tip : Refer to: Get a Task.

3. Cluster Upgrade

Note : For Cluster level upgrades, the Cluster ID's can be retrieved based on the Host's that are available for upgrade, Refer to: Get the Hosts and Get the Clusters API's.

3.1. Prerequisites

The following data is required:

  • Bundle ID.

  • Resource Type. Ex: CLUSTER.

  • One or more Resource upgrade specifications.

  • Each Resource upgrade specification should contain.

    • Resource ID. Ex: Cluster ID.

    • Upgrade scheduled time or Upgrade now option.

The following data is optional:

  • A boolean for parallel ESXi upgrade (default is 'true')

  • A boolean for quickboot run for ESXi upgrade (default is 'false')

Tip : Refer to: UpgradeSpec and ResourceUpgradeSpec.

3.2. Steps

  • Invoke the API. This API returns a task which can be polled and monitored.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/upgrades' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "bundleId" : "4686aa89-fc52-429f-86cf-6fe4f34fe361",
  "resourceType" : "CLUSTER",
  "parallelUpgrade" : true,
  "resourceUpgradeSpecs" : [ {
    "resourceId" : "9dc61549-cf5f-41bd-bc5c-c72149303731",
    "scheduledTimestamp" : "2023-05-16T04:12:16.533Z",
    "upgradeNow" : false,
    "enableQuickboot" : true
  } ]
}'

HTTP Request

POST /v1/upgrades HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 322
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "bundleId" : "4686aa89-fc52-429f-86cf-6fe4f34fe361",
  "resourceType" : "CLUSTER",
  "parallelUpgrade" : true,
  "resourceUpgradeSpecs" : [ {
    "resourceId" : "9dc61549-cf5f-41bd-bc5c-c72149303731",
    "scheduledTimestamp" : "2023-05-16T04:12:16.533Z",
    "upgradeNow" : false,
    "enableQuickboot" : true
  } ]
}

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/494d2943-1cca-464f-81b1-cc35f9c9787c
Content-Length: 456

{
  "id" : "494d2943-1cca-464f-81b1-cc35f9c9787c",
  "name" : "Upgrade DOMAIN - [acme-domain] using BUNDLE - HOST:6.7.0-13006603",
  "type" : "UPGRADE",
  "status" : "IN_PROGRESS",
  "creationTimestamp" : "2023-05-16T03:12:16.533Z",
  "resources" : [ {
    "resourceId" : "ef16054d-1981-4d82-bb42-35f1b3f1a488",
    "type" : "DOMAIN"
  }, {
    "resourceId" : "4686aa89-fc52-429f-86cf-6fe4f34fe361",
    "type" : "BUNDLE"
  } ],
  "isCancellable" : false
}
  • Poll the status of the task using the task API with the ID from the response of the previous API.

Tip : Refer to: Get a Task.

4. vLCM Cluster Upgrade

Note : For vLCM Cluster level upgrades, the Cluster ID's can be retrieved based on the Host's that are available for upgrade, Refer to: Get the Hosts and Get the Clusters API's.

4.1. Prerequisites

The following data is required:

  • Bundle ID.

  • Resource Type. Ex: CLUSTER.

  • Optional Draft Mode.

  • One or more Resource upgrade specifications.

  • Each Resource upgrade specification should contain.

    • Resource ID. Ex: Cluster ID.

    • Upgrade scheduled time or Upgrade now option.

    • Personality Spec

      • Personality ID

      • Optional Hardware Support Specs

The following data is optional:

  • A boolean for quickboot run for ESXi upgrade (default is 'true' if not specified)

Tip : Refer to: UpgradeSpec, ResourceUpgradeSpec, PersonalitySpec and HardwareSupportSpec.

4.2. Steps

  • Invoke the API. This API returns a task which can be polled and monitored. If the API is invoked with draftMode set to true, see Step 3

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/upgrades' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "bundleId" : "4686aa89-fc52-429f-86cf-6fe4f34fe361",
  "resourceType" : "CLUSTER",
  "draftMode" : false,
  "resourceUpgradeSpecs" : [ {
    "resourceId" : "9dc61549-cf5f-41bd-bc5c-c72149303731",
    "scheduledTimestamp" : "2023-05-16T04:12:14.347Z",
    "upgradeNow" : false,
    "personalitySpec" : {
      "personalityId" : "bbde7baa-1df9-4bde-8643-23f66c7cfa5b",
      "hardwareSupportSpecs" : [ {
        "name" : "HSM",
        "packageSpec" : {
          "name" : "HSP",
          "version" : "1.0.0"
        }
      } ]
    },
    "enableQuickboot" : true
  } ]
}'

HTTP Request

POST /v1/upgrades HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 575
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "bundleId" : "4686aa89-fc52-429f-86cf-6fe4f34fe361",
  "resourceType" : "CLUSTER",
  "draftMode" : false,
  "resourceUpgradeSpecs" : [ {
    "resourceId" : "9dc61549-cf5f-41bd-bc5c-c72149303731",
    "scheduledTimestamp" : "2023-05-16T04:12:14.347Z",
    "upgradeNow" : false,
    "personalitySpec" : {
      "personalityId" : "bbde7baa-1df9-4bde-8643-23f66c7cfa5b",
      "hardwareSupportSpecs" : [ {
        "name" : "HSM",
        "packageSpec" : {
          "name" : "HSP",
          "version" : "1.0.0"
        }
      } ]
    },
    "enableQuickboot" : true
  } ]
}

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/494d2943-1cca-464f-81b1-cc35f9c9787c
Content-Length: 452

{
  "id" : "494d2943-1cca-464f-81b1-cc35f9c9787c",
  "name" : "Upgrade SDDC_MANAGER - [] using BUNDLE - HOST:6.7.0-13006603",
  "type" : "UPGRADE",
  "status" : "IN_PROGRESS",
  "creationTimestamp" : "2023-05-16T03:12:14.347Z",
  "resources" : [ {
    "resourceId" : "9dc61549-cf5f-41bd-bc5c-c72149303731",
    "type" : "CLUSTER"
  }, {
    "resourceId" : "4686aa89-fc52-429f-86cf-6fe4f34fe361",
    "type" : "BUNDLE"
  } ],
  "isCancellable" : false
}
  • Poll the status of the task using the task API with the ID from the response of the previous API.

Tip : Refer to: Get a Task.

  • If the upgrade is created with draftMode set to true, the upgrade status will be in "DRAFT" state and you can trigger a hardware compatibility and compliance check before scheduling the upgrade. Invoke the API, with the upgrade ID from step 1, to trigger/start the hardware compatibility and compliance check.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/upgrades/1e89ad99-4054-4a87-930d-9ee417386e80/prechecks' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

POST /v1/upgrades/1e89ad99-4054-4a87-930d-9ee417386e80/prechecks HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /v1/tasks/f29b477c-bacc-4893-a019-f43dcb98aca7
Content-Length: 2008

{
  "id" : "f29b477c-bacc-4893-a019-f43dcb98aca7",
  "name" : "PRECHECK",
  "type" : "PRECHECK",
  "status" : "IN_PROGRESS",
  "creationTimestamp" : "2023-05-16T03:12:14.546Z",
  "completionTimestamp" : "2023-05-16T03:12:14.546Z",
  "subTasks" : [ {
    "name" : "vLCM Precheck for cluster: acme-cluster",
    "description" : "vLCM Precheck for cluster: acme-cluster",
    "status" : "IN_PROGRESS",
    "creationTimestamp" : "2023-05-16T03:12:14.547Z",
    "stages" : [ {
      "name" : "vLCM cluster health check",
      "description" : "Perform Stage - Perform Stage - Precheck if the cluster are in a good state to be updated with the desired software image",
      "status" : "UNKNOWN",
      "errors" : [ ]
    } ],
    "resources" : [ {
      "resourceId" : "9dc61549-cf5f-41bd-bc5c-c72149303731",
      "type" : "CLUSTER"
    } ],
    "subTasks" : [ {
      "name" : "vLCM Precheck for host: 10.0.0.100",
      "description" : "vLCM Precheck for host: 10.0.0.100",
      "status" : "IN_PROGRESS",
      "creationTimestamp" : "2023-05-16T03:12:14.547Z",
      "stages" : [ {
        "name" : "vLCM image scan",
        "description" : "Perform Stage - Perform Stage - Host compliance",
        "status" : "UNKNOWN",
        "errors" : [ ]
      }, {
        "name" : "vLCM image baseOS scan",
        "description" : "Perform Stage - Perform Stage - Validating the baseOS version.",
        "status" : "FAILED",
        "errors" : [ {
          "errorCode" : "com.vmware.vcIntegrity.lifecycle.HostScan.BaseImageDowngrade",
          "errorType" : "ERROR",
          "message" : "Desired Base Image version 7.0.0-1.20.16321839 is a downgrade of the installed version ESXi.",
          "remediationMessage" : "Replace the Base Image in the desired state with one of the same or higher version."
        } ]
      } ],
      "resources" : [ {
        "resourceId" : "3f20a699-ce25-4bb2-8922-5d341d3dab84",
        "type" : "ESX"
      } ],
      "subTasks" : [ ]
    } ]
  } ],
  "isCancellable" : false
}

Tip : Refer to: performPrechecks API

  • Poll the status of the hardware compatibility and compliance check task using the task API with the ID from the response of the previous API.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/upgrades/1e89ad99-4054-4a87-930d-9ee417386e80/prechecks/1e89ad99-4054-4a87-930d-9ee417386e80' -i -X GET \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/upgrades/1e89ad99-4054-4a87-930d-9ee417386e80/prechecks/1e89ad99-4054-4a87-930d-9ee417386e80 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2008

{
  "id" : "f29b477c-bacc-4893-a019-f43dcb98aca7",
  "name" : "PRECHECK",
  "type" : "PRECHECK",
  "status" : "IN_PROGRESS",
  "creationTimestamp" : "2023-05-16T03:12:15.095Z",
  "completionTimestamp" : "2023-05-16T03:12:15.095Z",
  "subTasks" : [ {
    "name" : "vLCM Precheck for cluster: acme-cluster",
    "description" : "vLCM Precheck for cluster: acme-cluster",
    "status" : "IN_PROGRESS",
    "creationTimestamp" : "2023-05-16T03:12:15.095Z",
    "stages" : [ {
      "name" : "vLCM cluster health check",
      "description" : "Perform Stage - Perform Stage - Precheck if the cluster are in a good state to be updated with the desired software image",
      "status" : "UNKNOWN",
      "errors" : [ ]
    } ],
    "resources" : [ {
      "resourceId" : "9dc61549-cf5f-41bd-bc5c-c72149303731",
      "type" : "CLUSTER"
    } ],
    "subTasks" : [ {
      "name" : "vLCM Precheck for host: 10.0.0.100",
      "description" : "vLCM Precheck for host: 10.0.0.100",
      "status" : "IN_PROGRESS",
      "creationTimestamp" : "2023-05-16T03:12:15.095Z",
      "stages" : [ {
        "name" : "vLCM image scan",
        "description" : "Perform Stage - Perform Stage - Host compliance",
        "status" : "UNKNOWN",
        "errors" : [ ]
      }, {
        "name" : "vLCM image baseOS scan",
        "description" : "Perform Stage - Perform Stage - Validating the baseOS version.",
        "status" : "FAILED",
        "errors" : [ {
          "errorCode" : "com.vmware.vcIntegrity.lifecycle.HostScan.BaseImageDowngrade",
          "errorType" : "ERROR",
          "message" : "Desired Base Image version 7.0.0-1.20.16321839 is a downgrade of the installed version ESXi.",
          "remediationMessage" : "Replace the Base Image in the desired state with one of the same or higher version."
        } ]
      } ],
      "resources" : [ {
        "resourceId" : "3f20a699-ce25-4bb2-8922-5d341d3dab84",
        "type" : "ESX"
      } ],
      "subTasks" : [ ]
    } ]
  } ],
  "isCancellable" : false
}
  • Once the hardware compatibility and compliance check task is completed and result is reviewed, schedule the upgrade.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/upgrades/1e89ad99-4054-4a87-930d-9ee417386e80' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "scheduledTimestamp" : "2023-05-16T04:12:16.326Z",
  "upgradeNow" : false
}'

HTTP Request

PATCH /v1/upgrades/1e89ad99-4054-4a87-930d-9ee417386e80 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 79
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "scheduledTimestamp" : "2023-05-16T04:12:16.326Z",
  "upgradeNow" : false
}

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 564

{
  "id" : "1e89ad99-4054-4a87-930d-9ee417386e80",
  "bundleId" : "4686aa89-fc52-429f-86cf-6fe4f34fe361",
  "resourceType" : "CLUSTER",
  "resourceUpgradeSpecs" : [ {
    "resourceId" : "9dc61549-cf5f-41bd-bc5c-c72149303731",
    "shutdownVms" : null,
    "toVersion" : null,
    "scheduledTimestamp" : "2023-05-16T04:12:16.326Z",
    "upgradeNow" : null,
    "personalitySpec" : null,
    "customISOSpec" : null,
    "enableQuickboot" : false,
    "evacuateOfflineVms" : false
  } ],
  "status" : "SCHEDULED",
  "taskId" : "1e89ad99-4054-4a87-930d-9ee417386e80"
}

Tip : Refer to Commit/Reschedule Upgrade API

  • Poll the status of the upgrade task using the task API with the ID from the response of the previous API.

Tip : Refer to: Get a Task.

Last updated 2023-05-21 23:30:49 PDT

Operations
PATCH
Commit Reschedule Upgrade
Commit/Reschedule Upgrade
GET
Get Upgrade By Id
Get Upgrade By Id
GET
Get Upgrade Precheck
Get Upgrade Precheck Details
GET
Get Upgrades
Get Upgrades
POST
Perform Upgrade
Perform Upgrade
POST
Perform Upgrade Precheck
Perform Upgrade Prechecks