Use the vSphere Automation REST API to export the desired software state of a cluster or a standalone host. Then you can import the desired state to a different cluster or host in the same or a different vCenter Server instance.

Exporting a Desired State

To export a desired state, you can use one of the following methods:
  • For a cluster, use the POST https://<vcenter_ip_address_or_fqdn>/api/esx/settings/clusters/<cluster_id>/software?action=export request.
  • For a standalone host, use the POST https://<vcenter_ip_address_or_fqdn>/api/esx/settings/hosts/<host_id>/software?action=export request.
This method does not export any information about the solutions available on the cluster or the standalone host since the constraints set by these solutions might not be applicable for another cluster or host. Submit the cluster or the standalone host ID, and a Software.ExportSpec JSON object in the request body.
You can choose how to export the desired software specification.
  • Export as an ISO image. Set true to the export_iso_image property of the Software.ExportSpec JSON object that you submit in the request body. Use the exported ISO image for performing clean installs and for bootstrapping purposes. You can upload the ISO file into the Jetty Web server on the target vCenter Server instance but you cannot use ISO files to manage the life cycle of clusters or a standalone host through the vSphere Lifecycle Manager feature.
  • Export as an offline bundle in a ZIP file format. Set true to the export_offline_bundle property of the Software.ExportSpec JSON object that you submit in the request body. You can use the exported offline bundle to create a depot and add its components to the resources managed by the Depot Manager module.
  • Export as a JSON file holding the desired state specification. Set true to the export_software_spec property of the Software.ExportSpec JSON object that you submit to the request body. You can then reuse the JSON file to apply the desired state that it contains to another cluster or standalone host in the same or in a different vCenter Server instance. Note that the JSON file holds only the description of the desired state. You must check whether all components described in the JSON file are available in the depot for the target cluster. See Importing a Desired State Specification for information about how you can use a desired state specification for another cluster or standalone host.

Importing a Desired State Specification

To import a desired state of a cluster or a standalone host and assign it to another cluster or standalone host in the same or different vCenter Server instance:
  • For a cluster, use the POST https://<vcenter_ip_address_or_fqdn>/api/esx/settings/clusters/<cluster_id>/software/drafts?action=import-software-spec request.
  • For a standalone host, use the POST https://<vcenter_ip_address_or_fqdn>/api/esx/settings/hosts/<host_id>/software/drafts?action=import-software-spec request.
Submit as pat parameters the cluster or the standalone host ID, and a Drafts.ImportSpec JSON object in the request body. Use the instance of the import specification to describe the download source and the source type of the imported software specification. Depending on the location and the source type of the exported desired state, you can choose from the following import options:
  • Import a file from the vCenter Server or your local file system. Use the file_id property of the Drafts.ImportSpec data structure to set the file ID of the software specification which was previously uploaded on the Jetty Web server running on the vCenter Server at https://<vcenter_FQDN>:9087/vum-fileupload URL. You can also use this option to import a specification file that resides on your local file system. Make sure you set the source type of the import specification to PUSH through the source_type property of the Drafts.ImportSpec data structure.
  • Import a file that resides on a URI location. Use the location property of the Drafts.ImportSpec data structure to submit the URI location of the software specification file. The software specification can be pulled from a URI location with one of the following schemes: file, http, or https. You can use this import mechanism only if you set the source_type property to PULL.
  • Import a desired state as a JSON string. Use the software_spec property of the Drafts.ImportSpec data structure to set the JSON string representing the software specification you want to import. Use this method only if you set the source_type property to JSON_STRING.