September 25, 2023

Import and Export Supervisor configuration

Author: Desislava Gerenska

Currently, the process of activating a Supervisor involves a large number of settings spread across multiple steps. These settings often require various network details such as Supervisor Management Network, Workload Network, and Load Balancer configurations. 

Many fields need to be completed before the entire activation process can be finished.

Typically, users store the values of these fields in spreadsheets or documents. However, transferring these values from documents to the user interface (UI) can be both time-consuming and error-prone. This becomes especially frustrating when deploying a second Supervisor with a similar or identical configuration.

The release of vSphere 8.0 U2 introduces significant enhancements to the Supervisor activation workflow.

In earlier versions, the Supervisor configuration required manual entry at every step of the activation workflow, resulting in significant time and effort expenses.

Now, with the new release, the configuration for a Supervisor can be saved and exported as a JSON file once the activation wizard is completed. This JSON file can then be imported when initiating a new Supervisor activation, streamlining the setup process.

Additionally, the configuration settings of an existing operational Supervisor can also be exported, preserved, and imported for future use.

Exporting a configured Supervisor's settings offers several advantages:

  • Preserving Configurations: All previous configurations can be saved, making it simple to replicate them for future use.
  • Efficient Troubleshooting: In the event of a failed activation, adjustments to the configuration can be swiftly made, and the process restarted. This allows for quick troubleshooting, as modifications can be directly applied to the JSON file before importing.
  • Streamlined Administration: These configurations can be shared among administrators, facilitating the setup of other Supervisors with similar settings.
  • Consistent Format: The exported configurations adhere to a standardized format, which is applicable to various supported deployment types. This includes VDS and NSX network stacks, NSX, HA Proxy Load Balancers, and more. This format is used by both vSphere and Service Installer for VMware Tanzu.

Export the configuration during the Supervisor activation workflow

The current configuration of the Supervisor can be preserved at the end of the activation workflow by selecting the “Export configuration” option:

A screenshot of a computer</p>
<p>Description automatically generated

Upon completing the workflow by clicking the "Finish" button, the configuration will be exported. It will be saved in a zip file named "wcp-config.zip" and stored locally on the disk in the browser’s default download folder. Within the zip file, you will find:

  • A JSON file containing the Supervisor configuration named "wcp-config.json"
  • A valid JSON schema file named "wcp-config-schema.json"

A screenshot of a computer</p>
<p>Description automatically generated

The "wcp-config.json" file contains the preserved configuration for the Supervisor. Each setting has a corresponding name and place within the JSON file.

This JSON file adheres to a hierarchical data structure. It utilizes the same field names as the sample input file used by the Service Installer for VMware Tanzu to Activate Supervisor. A JSON file exported via the Service Installer can subsequently be imported into the Supervisor activation workflow within the vSphere Client.

It's important to note that settings irrelevant to the current Supervisor configuration are not included in the export. All available settings are comprehensively detailed in the JSON schema file.

Below is an illustrative example of the JSON file that is generated during the activation of Supervisor, configured with AVI load balancer and VDS network settings:  

{

   "specVersion": "1.0",

   "supervsiorSpec": {

      "supervsiorName": "primary-supervisor",

   },

   "envSpec":{

      "vcenterDetails":{

         "vcenterAddress": "vcenter.org.co",

         "vcenterDatacenter": "EMEA",

         "vcenterCluster": "Sofia",

      },

   },

   "tkgsComponentSpec": {

      "controlPlaneSize": "SMALL",

      "aviComponents": {

         "aviName": "lb-1",

         "aviUsername": "admin",

         "aviController01Ip": "10.186.67.63:5556",

 "aviCertAuthorityChain": "-----BEGIN CERTIFICATE-----\nMIIDQjCCAioCAQAwDQYJKoZIhvcNAQELBQAwZzELMAkGA1UEBhMCVVMxCzAJBgNV\nBAgMAkNBMRIwEAYDVQQHDAlQYWxvIEFsdG8xDzANBgNVBAoMBlZNd2FyZTEMMAoG\nA1UECwwDV0NQMRgwFgYDVQQDDA9IQXByb3h5IFJvb3QgQ0EwHhcNMjAwNzA4MDAz\nNDQ4WhcNMjUwNzA3MDAzNDQ4WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0Ex\nEjAQBgNVBAcMCVBhbG8gQWx0bzEPMA0GA1UECgwGVk13YXJlMQwwCgYDVQQLDANX\nQ1AxGDAWBgNVBAMMD0hBcHJveHkgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQAD\nggEPADCCAQoCggEBAM97x5dpqPblK45Hv3ktGUEhmlrH//FOMSJVvq9/WK86+K88\n/dAuos5XkORZ/IoV4uvK3wyUq5rHLqFeFZfFDTqSrmBEUlr65F8IKFjLh5RRn3EQ\nItAChxL+UHcsE2JXBOHFEHiXIEWjZKqeRDCXuNJUg88McZq8B7XhCxfFHhDutsP/\nPQ5C9Z6yefykPAnf6PatRCKoTTZri7MVKqc/IqGCgdC9hfiUkxqG1GqUxm843u2B\nA+I1wenQK3EFVJsKvy915a1VP+6rwFNMqZ40zT1tVQFNtHra/+QYU8lkBHfUKHIC\nwfL2CoXxFA+5Hf9Cnoxgt07fj5nvt/UtKIazJSkCAwEAATANBgkqhkiG9w0BAQsF\nAAOCAQEAvyMtIdoVRji3hd6t9wmAYNRlTt4xIcA2Z9bak471XGJYlUIhHwDvWln7\nIO1YJohuXW4LJIPoxMpIyoap4jKdas6rRZzNpAUofs2PZASRKmbKtMsPeYNAvQE8\nk9T/0Bvb/5DwzZ+S12I3MjAWyG7CID3f1oj54yNaToOxn20xEwFoOS5br68jTD9y\njHASd8COcqUpg84t0lSt4I7y7RottPQ3lw1gxTtjczfBk8eg5g1lycpjt4lC5Qha\nNP3x4bmrAy1MbBx0mjUp5hQpajGHKezn103OxuSURp1eRHm4EV+l4G3Z9c0cdz2t\nehnMBCft0xnD9dbnI5Tia3hXj8D6lQ==\n-----END CERTIFICATE-----",

      },

      "tkgsMgmtNetworkSpec": {

         "tkgsMgmtIpAssignmentMode": "STATIC",

         "tkgsMgmtNetworkName": "Management Network",

         "tkgsMgmtNetworkGatewayCidr": "10.186.67.252/20",

         "tkgsMgmtNetworkStartingIp": "10.186.67.76",

         "tkgsMgmtNetworkDnsServers": ["10.186.66.1, 10.186.66.2"],

         "tkgsMgmtNetworkSearchDomains": ["org.co"],

         "tkgsMgmtNetworkNtpServers": ["ntp.org.co"]

      },

      "tkgsStoragePolicySpec":{

         "masterStoragePolicy": "supervisor-policy",

         "ephemeralStoragePolicy": "supervisor-policy",

         "imageStoragePolicy": "supervisor-policy"

      },

      "tkgsPrimaryWorkloadNetwork": {

         "tkgsPrimaryWorkloadIpAssignmentMode": "STATICRANGE",

         "tkgsPrimaryWorkloadPortgroupName": "primary—k8n-dvpg",

         "tkgsPrimaryWorkloadNetworkName": "primary—k8n-dvpg",

         "tkgsPrimaryWorkloadNetworkGatewayCidr": "192.168.1.1/24",

         "tkgsPrimaryWorkloadNetworkStartRange": "192.168.1.2",

         "tkgsPrimaryWorkloadNetworkEndRange": "192.168.1.100",

         "tkgsWorkloadDnsServers": ["192.168.1.1"],

         "tkgsWorkloadNtpServers": ["ntp.org.co"],

     },

   }

}

The second file included in the exported zip file is the JSON schema file. This file serves as a reference point. It comprehensively outlines all exportable settings for the Supervisor, encompassing their type, location within the JSON file, and whether they are required. The schema file serves as a foundation for generating a sample configuration JSON file, which can then be manually populated and imported into a fresh activation workflow.

Importantly, during the import of a configuration, the JSON schema file should not be uploaded. The vSphere Client dynamically generates a JSON schema at runtime based on the supported Supervisor configuration in the vSphere Client. This mechanism also includes validations of the imported settings, ensuring their accuracy and maintaining consistency.

Export the configuration from an existing Supervisor

The configuration of an existing Supervisor can also be exported and persisted. A new "Export Config" action has been introduced at the top of the supervisors' grid within Workload Management. This action facilitates the export of the chosen supervisor's configuration in the same manner as it occurs during the Supervisor activation workflow. This results in the generation of a "wcp-config.zip" file, which is then downloaded locally. 

This feature is useful in scenarios where troubleshooting a supervisor requires deactivation and subsequent reactivation. It effectively reduces the time and effort involved in manually inputting all the settings during the subsequent activation. Furthermore, it facilitates the easy replication of configurations and enables straightforward sharing among administrators.

A screenshot of a computer</p>
<p>Description automatically generated

Import the configuration from a JSON file into Supervisor activation workflow

To import the Supervisor configuration into the activation workflow, simply click the "Import Config" button at the top of the wizard.

A screenshot of a computer</p>
<p>Description automatically generated

A screenshot of a computer</p>
<p>Description automatically generated

The info message in the dialog box explains that certain imported settings are specific to particular environments and are not applicable in the current context.

Additionally, sensitive information such as passwords for the load balancer cannot be exported. Consequently, fields containing this kind of information within the user interface will not be automatically populated and will require manual input.

Before the upload, the vSphere Client conducts a verification process on the file. Errors might be displayed if the uploaded file is found to be invalid or corrupted JSON. Similarly, errors will appear if the JSON file lacks the spec version or if the spec version exceeds what is currently supported by the client.

If the uploaded file successfully passes validation, the configuration is imported, and a confirmation message is displayed.

The message highlights any missing values in the imported configuration, specifically focusing on fields that are marked as required but remain unspecified (empty) in the JSON file. In such cases, the message provides descriptions of the absent fields and indicates where within the UI they can be filled in.

Furthermore, the user interface conducts validations on the imported configuration and, if any incompatible settings are detected, a warning message is presented to the user.

A screenshot of a computer</p>
<p>Description automatically generated

When warnings are issued, the configuration is still imported, and the relevant settings are automatically pre-selected or populated within the inputs in the corresponding workflow pages.

In cases where all the imported settings are both applicable and relevant, the entire Supervisor activation workflow can be completed by simply clicking the "Next" button. This streamlined process significantly reduces the need for manual input and saves valuable time and effort.

The export and import functionality of the supervisor configuration offers benefits beyond automatic population of settings. It allows for the preservation of the current supervisor configuration and facilitates easy sharing among administrators.

Clone the configuration from an existing Supervisor

A screenshot of a computer</p>
<p>Description automatically generated

In addition to the "Export Config" action, there is also a "Clone Config" option available.

The "Clone Config" action retrieves the Supervisor configuration from the chosen supervisor. Unlike the "Export Config" action, it doesn't involve exporting these settings into a separate file. Instead, it immediately imports them into the initiation of a new activation workflow. This avoids the need for manual exporting and importing of files. Essentially, the "Clone Config" action achieves the same outcome as "Export Config", but without the creation and retention of the settings in a JSON file.

Filter Tags

vSphere with Tanzu Supervisor Blog