Adopt the Image service

To adopt the Image Service (glance) you patch an existing OpenStackControlPlane custom resource (CR) that has the Image service disabled. The patch starts the service with the configuration parameters that are provided by the Red Hat OpenStack Platform (RHOSP) environment.

The Image service adoption is complete if you see the following results:

  • The GlanceAPI service up and running.
  • The Identity service endpoints are updated, and the same back end of the source cloud is available.

To complete the Image service adoption, ensure that your environment meets the following criteria:

  • You have a running director environment (the source cloud).
  • You have a Single Node OpenShift or OpenShift Local that is running in the Red Hat OpenShift Container Platform (RHOCP) cluster.
  • Optional: You can reach an internal/external Ceph cluster by both crc and director.

If you have image quotas in RHOSP 17.1, these quotas are transferred to Red Hat OpenStack Services on OpenShift (RHOSO) 18.0 because the image quota system in 18.0 is disabled by default. If you enable image quotas in RHOSO 18.0, the new quotas replace the legacy quotas from RHOSP 17.1.

Adopt the Image service with an Object Storage back end

Adopt the Image Service (glance) with an Object Storage service (swift) back end by using the following configuration from the control plane glanceAPI instance. Use this configuration in the patch manifest that deploys the Image service with the object storage back end.

Before you begin

  • You have completed the previous adoption steps.

About this task

..
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 }}

Procedure

  1. 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>
                    spec:
                      type: LoadBalancer
              networkAttachments:
                - storage

    where:

    <172.17.0.80>

    Specifies the load balancer IP in your environment. 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 service 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 service that is not available in the OpenStackControlPlane custom resource. After the Object Storage service, and in particular SwiftProxy, is adopted, you can proceed with the GlanceAPI adoption. For more information, see Adopting the Object Storage service.
  2. Verify that SwiftProxy is available:
    $ oc get pod -l component=swift-proxy | grep Running
    swift-proxy-75cb47f65-92rxq   3/3     Running   0
  3. Patch the GlanceAPI service that is deployed in the control plane:
    $ oc patch openstackcontrolplane openstack --type=merge --patch-file=glance_swift.patch

Adopt the Image service with a Block Storage back end

Adopt the Image Service (glance) with a Block Storage service (cinder) back end by using the following configuration from the control plane glanceAPI instance. Use this configuration in the patch manifest that deploys the Image service with the block storage back end.

Before you begin

  • You have completed the previous adoption steps.

About this task

..
spec
  glance:
   ...
      customServiceConfig: |
          [DEFAULT]
          enabled_backends = default_backend:cinder
          [glance_store]
          default_backend = default_backend
          [default_backend]
          description = Default cinder backend
          cinder_store_auth_address = {{ .KeystoneInternalURL }}
          cinder_store_user_name = {{ .ServiceUser }}
          cinder_store_password = {{ .ServicePassword }}
          cinder_store_project_name = service
          cinder_catalog_info = volumev3::internalURL
          cinder_use_multipath = true
          [oslo_concurrency]
          lock_path = /var/lib/glance/tmp

Procedure

  1. Create a new file, for example glance_cinder.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:cinder
            [glance_store]
            default_backend = default_backend
            [default_backend]
            description = Default cinder backend
            cinder_store_auth_address = {{ .KeystoneInternalURL }}
            cinder_store_user_name = {{ .ServiceUser }}
            cinder_store_password = {{ .ServicePassword }}
            cinder_store_project_name = service
            cinder_catalog_info = volumev3::internalURL
            cinder_use_multipath = true
            [oslo_concurrency]
            lock_path = /var/lib/glance/tmp
          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>
                    spec:
                      type: LoadBalancer
              networkAttachments:
                - storage

    where:

    <172.17.0.80>

    Specifies the load balancer IP. 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 Block Storage service 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 Block Storage service that is not available in the OpenStackControlPlane custom resource. After the Block Storage service, and in particular CinderVolume, is adopted, you can proceed with the GlanceAPI adoption. For more information, see Adopting the Block Storage service.
  2. Verify that CinderVolume is available:
    $ oc get pod -l component=cinder-volume | grep Running
    cinder-volume-75cb47f65-92rxq   3/3     Running   0
  3. Patch the GlanceAPI service that is deployed in the control plane:
    $ oc patch openstackcontrolplane openstack --type=merge --patch-file=glance_cinder.patch

Adopt the Image service deployed with an NFS back end

Adopt the Image Service (glance) that you deployed with an NFS back end. To complete the following procedure, ensure that your environment meets the following criteria:

Before you begin

  • You have completed the previous adoption steps.
  • In the source cloud, verify the NFS parameters that the overcloud uses to configure the Image service back end. Specifically, in your director heat templates, find the following variables that override the default content that is provided by the glance-nfs.yaml file in the /usr/share/openstack-tripleo-heat-templates/environments/storage directory:
    GlanceBackend: file
    GlanceNfsEnabled: true
    GlanceNfsShare: 192.168.24.1:/var/nfs
    Note

    In this example, the GlanceBackend variable shows that an NFS back end is invisible to the Image service. The variable is using the File driver and, in the background, the filesystem_store_datadir. The filesystem_store_datadir is mapped to the export value provided by the GlanceNfsShare variable instead of /var/lib/glance/images/. If you do not export the GlanceNfsShare through a network that is propagated to the adopted Red Hat OpenStack Services on OpenShift (RHOSO) control plane, you must stop the nfs-server and remap the export to the storage network. Before doing so, ensure that the Image service is stopped in the source Controller nodes.

    In the control plane, the Image service is attached to the Storage network, then propagated through the associated NetworkAttachmentsDefinition custom resource (CR), and the resulting pods already have the right permissions to handle the Image service traffic through this network. In a deployed RHOSP control plane, you can verify that the network mapping matches with what has been deployed in the director-based environment by checking both the NodeNetworkConfigPolicy (nncp) and the NetworkAttachmentDefinition (net-attach-def). The following is an example of the output that you should check in the Red Hat OpenShift Container Platform (RHOCP) environment to make sure that there are no issues with the propagated networks:

    $ oc get nncp
    NAME                        STATUS      REASON
    enp6s0-crc-8cf2w-master-0   Available   SuccessfullyConfigured
    
    $ oc get net-attach-def
    NAME
    ctlplane
    internalapi
    storage
    tenant
    
    $ oc get ipaddresspool -n metallb-system
    NAME          AUTO ASSIGN   AVOID BUGGY IPS   ADDRESSES
    ctlplane      true          false             ["192.168.122.80-192.168.122.90"]
    internalapi   true          false             ["172.17.0.80-172.17.0.90"]
    storage       true          false             ["172.18.0.80-172.18.0.90"]
    tenant        true          false             ["172.19.0.80-172.19.0.90"]

About this task

  • The Storage network is propagated to the Red Hat OpenStack Platform (RHOSP) control plane.
  • The Image service can reach the Storage network and connect to the nfs-server through the port 2049.

Procedure

  1. Adopt the Image service and create a new defaultGlanceAPI instance that is connected with the existing NFS share:
    $ cat << EOF > glance_nfs_patch.yaml
    
    spec:
      extraMounts:
      - extraVol:
        - extraVolType: Nfs
          mounts:
          - mountPath: /var/lib/glance/images
            name: nfs
          propagation:
          - Glance
          volumes:
          - name: nfs
            nfs:
              path: <exported_path>
              server: <ip_address>
        name: r1
        region: r1
      glance:
        enabled: true
        template:
          databaseInstance: openstack
          customServiceConfig: |
            [DEFAULT]
            enabled_backends = default_backend:file
            [glance_store]
            default_backend = default_backend
            [default_backend]
            filesystem_store_datadir = /var/lib/glance/images/
          storage:
            storageRequest: 10G
          keystoneEndpoint: nfs
          glanceAPIs:
            nfs:
              replicas: 3
              type: single
              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>
                    spec:
                      type: LoadBalancer
              networkAttachments:
              - storage
    EOF

    where:

    <exported_path>
    Specifies the exported path in the nfs-server.
    <ip_address>
    Specifies the IP address that you use to communicate with the nfs-server.
    <172.17.0.80>
    Specifies the load balancer IP in your environment. 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.
  2. Patch the OpenStackControlPlane CR to deploy the Image service with an NFS back end:
    $ oc patch openstackcontrolplane openstack --type=merge --patch-file glance_nfs_patch.yaml
  3. Patch the OpenStackControlPlane CR to remove the default Image service:
    $ oc patch openstackcontrolplane openstack --type=json -p="[{'op': 'remove', 'path': '/spec/glance/template/glanceAPIs/default'}]"

Results

  • When GlanceAPI is active, confirm that you can see a single API instance:
    $ oc get pods -l service=glance
    NAME                      READY   STATUS    RESTARTS
    glance-nfs-single-0   2/2     Running   0
    glance-nfs-single-1   2/2     Running   0
    glance-nfs-single-2   2/2     Running   0
  • Ensure that the description of the pod reports the following output:
    Mounts:
    ...
      nfs:
        Type:      NFS (an NFS mount that lasts the lifetime of a pod)
        Server:    {{ server ip address }}
        Path:      {{ nfs export path }}
        ReadOnly:  false
    ...
  • Check that the mount point that points to /var/lib/glance/images is mapped to the expected nfs server ip and nfs path that you defined in the new default GlanceAPI instance:
    $ oc rsh -c glance-api glance-default-single-0
    
    sh-5.1# mount
    ...
    ...
    {{ ip address }}:/var/nfs on /var/lib/glance/images type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.18.0.5,local_lock=none,addr=172.18.0.5)
    ...
    ...
  • Confirm that the UUID is created in the exported directory on the NFS node. For example:
    $ oc rsh openstackclient
    $ openstack image list
    
    sh-5.1$  curl -L -o /tmp/cirros-0.6.3-x86_64-disk.img http://download.cirros-cloud.net/0.6.3/cirros-0.6.3-x86_64-disk.img
    ...
    ...
    
    sh-5.1$ openstack image create --container-format bare --disk-format raw --file /tmp/cirros-0.6.3-x86_64-disk.img cirros
    ...
    ...
    
    sh-5.1$ openstack image list
    +--------------------------------------+--------+--------+
    | ID                                   | Name   | Status |
    +--------------------------------------+--------+--------+
    | 634482ca-4002-4a6d-b1d5-64502ad02630 | cirros | active |
    +--------------------------------------+--------+--------+
  • On the nfs-server node, the same uuid is in the exported /var/nfs:
    $ ls /var/nfs/
    634482ca-4002-4a6d-b1d5-64502ad02630

Adopt the Image service with a Ceph back end

Adopt the Image Service (glance) that you deployed with a Red Hat Ceph Storage back end. Use the customServiceConfig parameter to inject the right configuration to the GlanceAPI instance.

Before you begin

  • 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 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: 3
              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>
                    spec:
                      type: LoadBalancer
              networkAttachments:
              - storage
    EOF

    where:

    <172.17.0.80>
    Specifies the load balancer IP. 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 Red Hat OpenStack Platform (RHOSP) services configuration file from the original environment, compare it with the customServiceConfig that you apply in the glance_patch.yamlfile and ensure that the configuration is correct.

Procedure

Patch the OpenStackControlPlane CR to deploy the Image service with a Red Hat Ceph Storage back end:
$ oc patch openstackcontrolplane openstack --type=merge --patch-file glance_patch.yaml

Adopt the Image service with multiple DCN back ends

Adopt the Image Service (glance) in a Distributed Compute Node (DCN) deployment with multiple Red Hat Ceph Storage clusters that provide storage at different sites.

Before you begin

  • You have completed the previous adoption steps.
  • The per-site Red Hat Ceph Storage secrets (ceph-conf-central, ceph-conf-dcn1, ceph-conf-dcn2) exist and contain the configuration and keyrings for each site’s Red Hat Ceph Storage cluster. For more information, see Configuring a Red Hat Ceph Storage back end.
  • The extraMounts property of the OpenStackControlPlane CR is configured to mount the Red Hat Ceph Storage configuration to all Glance instances.
  • You have stopped the Image service on all DCN nodes. If your deployment includes DistributedComputeHCIScaleOut or DistributedComputeScaleOut nodes, you have also stopped HAProxy on those nodes. For more information, see Stopping Red Hat OpenStack Platform services.

About this task

This configuration deploys multiple GlanceAPI instances: a central API with access to all Red Hat Ceph Storage clusters, and edge APIs at each DCN site with access to their local cluster and the central cluster.

During adoption, the Image service instances that ran on edge site Compute nodes are migrated to run on Red Hat OpenShift Container Platform (RHOCP) at the central site. Although the control path for API requests now traverses the WAN to reach the Image service running on Red Hat OpenShift Container Platform (RHOCP), the data path remains local. Image data continues to be stored in the Red Hat Ceph Storage cluster at each edge site. When you create a virtual machine or volume from an image, the operation occurs at the local Red Hat Ceph Storage cluster. This architecture uses Red Hat Ceph Storage shallow copies (copy-on-write clones) to enable fast boot times without transferring image data across the WAN.

The virtual IP addresses (VIPs) used by Compute service nodes to reach the Image service change during adoption. Before adoption, edge site nodes contact a local Image service VIP on the internalapi subnet. After adoption, they contact a Red Hat OpenShift Container Platform (RHOCP) service endpoint on a different internalapi subnet. The following table shows an example of this change:

Site Before adoption After adoption

Central

Identity service catalog VIP

Identity service catalog updated to http://glance-central-internal.openstack.svc:9292

DCN1

http://172.17.10.111:9293

http://glance-dcn1-internal.openstack.svc:9292

DCN2

http://172.17.20.121:9293

http://glance-dcn2-internal.openstack.svc:9292

In Red Hat OpenStack Platform, the internal Image service endpoint at edge sites used TCP port 9293, after adoption, all Image service endpoints use port 9292. The new endpoints are backed by MetalLB load balancer IPs that you assign using the metallb.universe.tf/loadBalancerIPs annotation on each GlanceAPI. When you patch the OpenStackControlPlane custom resource (CR), Red Hat OpenShift Container Platform (RHOCP) creates internal Kubernetes services (for example, glance-dcn1-internal.openstack.svc) that resolve to those MetalLB IPs. The Compute service nodes are configured to use these endpoints when you adopt the data plane. For more information, see Adopting Compute services with multiple Ceph back ends (DCN). The examples in this procedure use http:// for the Image service endpoints. If your Red Hat OpenStack Platform deployment uses TLS for internal endpoints, use https:// and ensure that you have completed the TLS migration. For more information, see Migrating TLS-e to the RHOSO deployment.

Procedure

  1. Create a patch file for the Image service with multiple Red Hat Ceph Storage back ends. Use MetalLB loadbalancer IPs for the Image service endpoints:

    Example DCN deployment with a central site and two edge sites:

    $ cat << EOF > glance_dcn_patch.yaml
    spec:
      glance:
        enabled: true
        template:
          databaseInstance: openstack
          databaseAccount: glance
          keystoneEndpoint: central
          storage:
            storageRequest: <10G>
          glanceAPIs:
            central:
              type: split
              replicas: 3
              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>
                    spec:
                      type: LoadBalancer
              networkAttachments:
              - storage
              customServiceConfig: |
                [DEFAULT]
                enabled_import_methods = [web-download,copy-image,glance-direct]
                enabled_backends = central:rbd,dcn1:rbd,dcn2:rbd
                [glance_store]
                default_backend = central
                [central]
                rbd_store_ceph_conf = /etc/ceph/central.conf
                store_description = "Central RBD backend"
                rbd_store_pool = images
                rbd_store_user = openstack
                rbd_thin_provisioning = True
                [dcn1]
                rbd_store_ceph_conf = /etc/ceph/dcn1.conf
                store_description = "DCN1 RBD backend"
                rbd_store_pool = images
                rbd_store_user = openstack
                rbd_thin_provisioning = True
                [dcn2]
                rbd_store_ceph_conf = /etc/ceph/dcn2.conf
                store_description = "DCN2 RBD backend"
                rbd_store_pool = images
                rbd_store_user = openstack
                rbd_thin_provisioning = True
            dcn1:
              type: edge
              replicas: 2
              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.81>
                    spec:
                      type: LoadBalancer
              networkAttachments:
              - storage
              customServiceConfig: |
                [DEFAULT]
                enabled_import_methods = [web-download,copy-image,glance-direct]
                enabled_backends = central:rbd,dcn1:rbd
                [glance_store]
                default_backend = dcn1
                [central]
                rbd_store_ceph_conf = /etc/ceph/central.conf
                store_description = "Central RBD backend"
                rbd_store_pool = images
                rbd_store_user = openstack
                rbd_thin_provisioning = True
                [dcn1]
                rbd_store_ceph_conf = /etc/ceph/dcn1.conf
                store_description = "DCN1 RBD backend"
                rbd_store_pool = images
                rbd_store_user = openstack
                rbd_thin_provisioning = True
            dcn2:
              type: edge
              replicas: 2
              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.82>
                    spec:
                      type: LoadBalancer
              networkAttachments:
              - storage
              customServiceConfig: |
                [DEFAULT]
                enabled_import_methods = [web-download,copy-image,glance-direct]
                enabled_backends = central:rbd,dcn2:rbd
                [glance_store]
                default_backend = dcn2
                [central]
                rbd_store_ceph_conf = /etc/ceph/central.conf
                store_description = "Central RBD backend"
                rbd_store_pool = images
                rbd_store_user = openstack
                rbd_thin_provisioning = True
                [dcn2]
                rbd_store_ceph_conf = /etc/ceph/dcn2.conf
                store_description = "DCN2 RBD backend"
                rbd_store_pool = images
                rbd_store_user = openstack
                rbd_thin_provisioning = True
    EOF

    where:

    <172.17.0.80>
    Specifies the load balancer IP for the central Image service API.
    <172.17.0.81>
    Specifies the load balancer IP for the DCN1 edge Image service API.
    <172.17.0.82>

    Specifies the load balancer IP for the DCN2 edge Image service API.

    You must configure the Compute nodes at each site to use their local Image service endpoints. For example, Compute nodes at central use 172.17.0.80, Compute nodes at dcn1 use 172.17.0.81, and Compute nodes at dcn2 use 172.17.0.82. This configuration is applied when you adopt the data plane by adding a per-site ConfigMap with the glance_api_servers setting to each OpenStackDataPlaneNodeSet. For more information, see Adopting Compute services to the data plane.

    Note
    • The central GlanceAPI uses type: split and has access to all Red Hat Ceph Storage clusters. The keystoneEndpoint: central setting registers this API as the public endpoint in the Identity service.
    • Each edge GlanceAPI uses type: edge and has access to its local Red Hat Ceph Storage cluster plus the central cluster. This enables image copying between sites.
    • Set the storageRequest PVC size based on the storage requirements of each edge site.
    • Adjust the number of edge sites and their names to match your DCN deployment.
  2. Patch the OpenStackControlPlane CR to deploy the Image service with multiple Red Hat Ceph Storage back ends:
    $ oc patch openstackcontrolplane openstack --type=merge --patch-file glance_dcn_patch.yaml
  3. Verify that the Image service stores are available for each site:
    $ glance stores-info
    +----------+----------------------------------------------------------------------------------+
    | Property | Value                                                                            |
    +----------+----------------------------------------------------------------------------------+
    | stores   | [{"id": "central", "description": "Central RBD backend", "default": "true"},     |
    |          | {"id": "dcn1", "description": "dcn1 RBD backend"}, {"id": "dcn2", "description": |
    |          | "dcn2 RBD backend"}]                                                             |
    +----------+----------------------------------------------------------------------------------+

    The output should list one store for each Red Hat Ceph Storage back end configured in the central GlanceAPI, and the central store should be marked as the default. If any stores are missing, check the customServiceConfig in the glanceAPIs section of the patch and verify that the Red Hat Ceph Storage configuration files are present in the ceph-conf-central secret.

  4. Verify that image import methods include copy-image, which is required for copying images between stores:
    $ glance import-info
    +----------------+----------------------------------------------------------------------------------+
    | Property       | Value                                                                            |
    +----------------+----------------------------------------------------------------------------------+
    | import-methods | {"description": "Import methods available.", "type": "array", "value": ["web-    |
    |                | download", "copy-image", "glance-direct"]}                                       |
    +----------------+----------------------------------------------------------------------------------+
  5. Upload a test image to the central store. Note the image ID:
    $ glance image-create --disk-format raw --container-format bare --name test-image \
        --file <image-file> --store central
  6. Verify that the image ID from the previous command is shown in the central Red Hat Ceph Storage cluster’s images pool:
    $ sudo cephadm shell --config /etc/ceph/central.conf --keyring /etc/ceph/central.client.openstack.keyring \
        -- rbd -p images --cluster central ls -l
    NAME                                       SIZE     PARENT  FMT  PROT  LOCK
    <image-id>                                  20 MiB            2
  7. Copy the image to an edge site using the copy-image import method:
    $ glance image-import <image-id> --stores dcn1 --import-method copy-image
  8. After the import completes, verify that the stores field on the image now includes both central and dcn1:
    $ glance image-show <image-id> | grep stores
    | stores                        | central,dcn1                                                                     |
  9. Verify the image was copied to the DCN1 Red Hat Ceph Storage cluster:
    $ sudo cephadm shell --config /etc/ceph/dcn1.conf --keyring /etc/ceph/dcn1.client.openstack.keyring \
        -- rbd -p images --cluster dcn1 ls -l
    NAME                                       SIZE     PARENT  FMT  PROT  LOCK
    <image-id>                                  20 MiB            2

    The image is now present on the DCN1 Red Hat Ceph Storage cluster, confirming that Image service can copy images between sites. Repeat the glance image-import command for each additional edge site to distribute the image to all DCN locations.

Verify the Image service adoption to confirm service availability

Verify that you adopted the Image Service (glance) to the Red Hat OpenStack Services on OpenShift (RHOSO) 18.0 deployment.

Procedure

  1. Test the Image service from the Red Hat OpenStack Platform CLI. You can compare and ensure that the configuration is applied to the Image service pods:
    $ os-diff diff /etc/glance/glance.conf.d/02-config.conf glance_patch.yaml --frompod -p glance-api

    If no line is displayed, then the configuration is correct.

  2. Inspect the resulting Image service pods and confirm that the configuration from the glance_patch.yaml file is applied:
    GLANCE_POD=`oc get pod |grep glance-default | cut -f 1 -d' ' | head -n 1`
    oc exec -t $GLANCE_POD -c glance-api -- cat /etc/glance/glance.conf.d/02-config.conf
    
    [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.
  3. If you use a Red Hat Ceph Storage back end, ensure that the Red Hat Ceph Storage secrets are mounted:
    $ oc exec -t $GLANCE_POD -c glance-api -- ls /etc/ceph
    ceph.client.openstack.keyring
    ceph.conf
  4. Check that the service is active, and that the endpoints are updated in the RHOSP CLI:
    $ oc rsh openstackclient
    $ openstack service list | grep image
    
    | fc52dbffef36434d906eeb99adfc6186 | glance    | image        |
    
    $ openstack endpoint list | grep image
    
    | 569ed81064f84d4a91e0d2d807e4c1f1 | regionOne | glance       | image        | True    | internal  | http://glance-internal-openstack.apps-crc.testing   |
    | 5843fae70cba4e73b29d4aff3e8b616c | regionOne | glance       | image        | True    | public    | http://glance-public-openstack.apps-crc.testing     |
  5. Check that the images that you previously listed in the source cloud are available in the adopted service:
    $ openstack image list
    +--------------------------------------+--------+--------+
    | ID                                   | Name   | Status |
    +--------------------------------------+--------+--------+
    | c3158cad-d50b-452f-bec1-f250562f5c1f | cirros | active |
    +--------------------------------------+--------+--------+