Manage Base Images and Add-Ons with ESXCLI

You can use ESXCLI to retrieve information about base images and add-ons in a depot. You can also apply a complete image by using a JSON software specification that specifies the base image, add-on, and components to install on the
ESXi
host.
The following example illustrates how to list all base images and add-ons in a depot, retrieve details about a specific base image or add-on, and apply a complete image to a host. You can also verify the signatures of installed components after applying the complete image. Specify one of the connection options listed in Connection Options for ESXCLI Host Management Commands in place of
<conn_options>
.
  1. List all base images in the depot by specifying the full remote URL to the
    index.xml
    file of the online depot or the local absolute datastore path to an offline bundle
    .zip
    file.
    esxcli <conn_options> software sources baseimage list -d <
    depot_url_or_offline_bundle_path
    >
    The list contains information about the release ID, version, vendor, release date, and acceptance level of each base image.
  2. Retrieve detailed information about a specific base image in the depot by specifying the base image version.
    esxcli <conn_options> software sources baseimage get -b <
    base_image_version
    > -d <
    depot_url_or_offline_bundle_path
    >
  3. List all add-ons in the depot by specifying the full remote URL to the
    index.xml
    file of the online depot or the local absolute datastore path to an offline bundle
    .zip
    file.
    esxcli <conn_options> software sources addon list -d <
    depot_url_or_offline_bundle_path
    >
    The list contains information about the release ID, version, vendor, release date, and acceptance level of each add-on.
  4. Retrieve detailed information about a specific add-on in the depot by specifying the add-on name.
    The add-on name can be either in the
    <
    add-on_name
    >
    or
    <
    add-on_name
    >:<
    version
    >
    format. If there are multiple add-ons with the same name, you must specify the version. Add-on names are case-sensitive.
    esxcli <conn_options> software sources addon get -a <
    add-on_name
    > -d <
    depot_url_or_offline_bundle_path
    >
  5. Prepare a JSON software specification.
    • Obtain a JSON software specification exported from a
      vSphere Lifecycle Manager
      managed cluster.
    • Create a custom JSON software specification.
      You can use the following JSON software specification syntax to apply a base image only.
      { "add_on": null, "base_image": { "version": "<
      base_image_version
      >" }, "components": {} }
      You can use the following JSON software specification syntax to apply a base image, an add-on, and one or more components.
      { "base_image": { "version": "<
      base_image_version
      >" }, "add_on": { "name": "<
      add-on_name
      >", "version": "<
      add-on_version
      >" }, "components": { "<
      component_name
      >": "<
      component_version
      >" } }
  6. Apply a complete image to the
    ESXi
    host by specifying the location of the JSON software specification and the location of the depot.
    The location of the JSON software specification can be either a remote URL or a local file path. You can use a software specification exported from a
    vSphere Lifecycle Manager
    managed cluster. You can specify multiple depots.
    esxcli <conn_options> software apply -s <
    location_of_software_spec
    >.json -d <
    depot_url_or_offline_bundle_path
    >
  7. Verify the signatures of components installed on the host.
    If you have not rebooted the
    ESXi
    host after applying the complete image, you can verify the newly applied image by using the
    --rebooting-image
    option.
    esxcli <conn_options> software component signature verify
    A list of all installed components appears. The list contains the name, version, vendor, acceptance level, and signature verification result of each component.