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

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

[role="_abstract"]
Adopt the {image_service_first_ref} that you deployed with an {object_storage_first_ref} back end in the {rhos_prev_long} ({OpenStackShort}) environment. The control plane `glanceAPI` instance is deployed with the following configuration. You use this configuration in the patch manifest that deploys the {image_service} with the object storage back end:

----
..
spec
  glance:
   ...
      customServiceConfig: |
          [DEFAULT]
          enabled_backends = default_backend:swift
          [glance_store]
          default_backend = default_backend
          [default_backend]
          swift_store_create_container_on_put = True
          swift_store_auth_version = 3
          swift_store_auth_address = {{ .KeystoneInternalURL }}
          swift_store_endpoint_type = internalURL
          swift_store_user = service:glance
          swift_store_key = {{ .ServicePassword }}
----

.Prerequisites

* You have completed the previous adoption steps.

.Procedure

. Create a new file, for example, `glance_swift.patch`, and include the following content:
+
----
spec:
  glance:
    enabled: true
    apiOverride:
      route: {}
    template:
      secret: osp-secret
      databaseInstance: openstack
      storage:
        storageRequest: 10G
      customServiceConfig: |
        [DEFAULT]
        enabled_backends = default_backend:swift
        [glance_store]
        default_backend = default_backend
        [default_backend]
        swift_store_create_container_on_put = True
        swift_store_auth_version = 3
        swift_store_auth_address = {{ .KeystoneInternalURL }}
        swift_store_endpoint_type = internalURL
        swift_store_user = service:glance
        swift_store_key = {{ .ServicePassword }}
      glanceAPIs:
        default:
          replicas: 1
          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
----
+
<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]
The {object_storage} as a back end establishes a dependency with the {image_service}. Any deployed `GlanceAPI` instances do not work if the {image_service} is configured with the {object_storage} that is not available in the `OpenStackControlPlane` custom resource.
After the {object_storage}, and in particular `SwiftProxy`, is adopted, you can proceed with the `GlanceAPI` adoption. For more information, see xref:adopting-the-object-storage-service_adopt-control-plane[Adopting the Object Storage service].

. Verify that `SwiftProxy` is available:
+
----
$ oc get pod -l component=swift-proxy | grep Running
swift-proxy-75cb47f65-92rxq   3/3     Running   0
----

. Patch the `GlanceAPI` service that is deployed in the control plane:
+
----
$ oc patch openstackcontrolplane openstack --type=merge --patch-file=glance_swift.patch
----
