// Module included in the following assemblies:
//
// * installing/disconnected_install/installing-mirroring-disconnected-v2.adoc

:_mod-docs-content-type: PROCEDURE
[id="oc-mirror-building-image-set-config-v2_{context}"]
= Creating the image set configuration

Before you can use the oc-mirror plugin v2 to mirror images, you must create an image set configuration file.
This image set configuration file defines which {product-title} releases, Operators, and other images to mirror, along with other configuration settings for the oc-mirror plugin v2.

.Prerequisites

* You have created a container image registry credentials file.
For instructions, see _Configuring credentials that allow images to be mirrored_.

.Procedure

* Create an `ImageSetConfiguration` YAML file and modify it to include your required images.
+
.Example `ImageSetConfiguration` YAML file
[source,yaml]
----
kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v2alpha1
mirror:
  platform:
    channels:
    - name: stable-4.21 <1>
      minVersion: 4.21.2
      maxVersion: 4.21.2
    graph: true <2>
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.21 <3>
      packages: <4>
       - name: aws-load-balancer-operator
       - name: 3scale-operator
       - name: node-observability-operator
  additionalImages: <5>
   - name: registry.redhat.io/ubi8/ubi:latest
   - name: registry.redhat.io/ubi9/ubi@sha256:20f695d2a91352d4eaa25107535126727b5945bff38ed36a3e59590f495046f0
----
<1> Set the channel to retrieve {product-title} images from.
<2> Add `graph: true` to build and push the graph-data image to the mirror registry.
The graph-data image is required to create OpenShift Update Service (OSUS).
The `graph: true` field also generates the `UpdateService` custom resource manifest.
The `oc` command-line interface (CLI) can use the `UpdateService` custom resource manifest to create OSUS.
For more information, see _About the OpenShift Update Service_.
<3> Set the Operator catalog to retrieve the {product-title} images from.
<4> Specify only certain Operator packages to include in the image set. Remove this field to retrieve all packages in the catalog.
<5> Specify any additional images to include in image set.
+
[NOTE]
====
In oc-mirror plugin v2, you must use explicit registry hostnames for all images listed under `additionalImages`. Otherwise, images are mirrored to incorrect target paths.
====

// Are there more relevant example version numbers we can use in the example above?
// Also, are there any other callouts that would be helpful for users here?
