Upgrading a
Supervisor

You can use the
vSphere Supervisor
APIs to upgrade a single or a group of clusters to a specific version.
vSphere Supervisor
supports rolling upgrades through the
vSphere Automation
APIs for
Supervisor
s and for the infrastructure supporting these clusters. This model ensures that there is minimal downtime for the cluster workloads during the upgrade process.
To retrieve a list of all available
vSphere Supervisor
upgrade versions for a specific
vCenter Server
system, use the Cluster Available Versions service. You can get information about the release version, name, description, release date, and release notes for each available upgrade.
You must use the Software Clusters service for upgrading a
Supervisor
. You can retrieve upgrade information about all
Supervisor
s enabled on a
vCenter Server
system by using the
list()
Java method
. You receive a list of basic upgrade-related information for each cluster, such as the current software version, the date of the last successful upgrade, the upgrade status of the cluster, and so on. In case some of the clusters are in the process of upgrading, you can retrieve also information about their desired upgrade version. If you want to view a more detailed upgrade-related information about a cluster, you must use the
get(cluster_ID)
method
.
After you view the details about the upgrade versions that you can apply on a single or multiple
Supervisor
s, you can create upgrade specifications that define the versions you want to upgrade to. When you upgrade a batch of
Supervisor
and for some reason one of the clusters fails to upgrade, you receive information about the pre-check exceptions that led to that cluster upgrade failure.
Java
This example upgrades a
Supervisor
.
The following code snippet is part of the
UpgradeSupervisorCluster.java
sample. Some parts of the original code sample are omitted to save space. You can view the complete and up-to-date version of this sample in the
vsphere-automation-sdk-java
VMware repository at GitHub.
@Override protected void run() throws Exception { System.out.println("We are building the Spec for upgrading vSphere supervisor cluster"); com.vmware.vcenter.namespace_management.software.ClustersTypes.UpgradeSpec spec = new UpgradeSpec(); spec.setIgnorePrecheckWarnings(true); spec.setDesiredVersion(this.desiredVersion); this.wcpUpdateService.upgrade(clusterId, spec); System.out.println( "Invocation is successful for updating vSphere supervisor cluster, check H5C, track the status using GET API"); }