:_mod-docs-content-type: PROCEDURE
[id="adopting-image-service-with-ceph-backend_{context}"]

= Adopting the {image_service} that is deployed with a {Ceph} back end

[role="_abstract"]
Adopt the {image_service_first_ref} that you deployed with a {Ceph} back end. Use the `customServiceConfig` parameter to inject the right configuration to the `GlanceAPI` instance.

.Prerequisites

* You have completed the previous adoption steps.
* Ensure that the Ceph-related secret (`ceph-conf-files`) is created in
the `openstack` namespace and that the `extraMounts` property of the
`OpenStackControlPlane` custom resource (CR) is configured properly. For more information, see xref:configuring-a-ceph-backend_migrating-databases[Configuring a Ceph back end].
+
----
$ cat << EOF > glance_patch.yaml
spec:
  glance:
    enabled: true
    template:
      databaseInstance: openstack
      customServiceConfig: |
        [DEFAULT]
        enabled_backends=default_backend:rbd
        [glance_store]
        default_backend=default_backend
        [default_backend]
        rbd_store_ceph_conf=/etc/ceph/ceph.conf
        rbd_store_user=openstack
        rbd_store_pool=images
        store_description=Ceph glance store backend.
      storage:
        storageRequest: 10G
      glanceAPIs:
        default:
          replicas: 0
          override:
            service:
              internal:
                metadata:
                  annotations:
                    metallb.universe.tf/address-pool: internalapi
                    metallb.universe.tf/allow-shared-ip: internalapi
                    metallb.universe.tf/loadBalancerIPs: 172.17.0.80 <1>
                spec:
                  type: LoadBalancer
          networkAttachments:
          - storage
EOF
----
+
<1> If you use IPv6, change the load balancer IP to the load balancer IP in your environment, for example, `metallb.universe.tf/loadBalancerIPs: fd00:bbbb::80`.

[NOTE]
====
If you backed up your {rhos_prev_long} ({OpenStackShort}) services configuration file from the original environment, you can compare it with the confgiuration file that you adopted and ensure that the configuration is correct.
For more information, see xref:pulling-configuration-from-tripleo-deployment_adopt-control-plane[Pulling the configuration from a {OpenStackPreviousInstaller} deployment].

ifeval::["{build_variant}" == "ospdo"]
[NOTE]
Os-diff does not currently support director Operator.
endif::[]

----
os-diff diff /tmp/collect_tripleo_configs/glance/etc/glance/glance-api.conf glance_patch.yaml --crd
----

This command produces the difference between both ini configuration files.
====

.Procedure

* Patch the `OpenStackControlPlane` CR to deploy the {image_service} with a {Ceph} back end:
+
----
$ oc patch openstackcontrolplane openstack --type=merge --patch-file glance_patch.yaml
----
