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
GlanceAPIservice 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
Cephcluster by bothcrcand 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 Copy linkLink copied!
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 Copy linkLink copied!
- You have completed the previous adoption steps.
About this task Copy linkLink copied!
..
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 Copy linkLink copied!
Adopt the Image service with a Block Storage back end Copy linkLink copied!
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 Copy linkLink copied!
- You have completed the previous adoption steps.
About this task Copy linkLink copied!
..
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 Copy linkLink copied!
Adopt the Image service deployed with an NFS back end Copy linkLink copied!
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 Copy linkLink copied!
- 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.yamlfile in the/usr/share/openstack-tripleo-heat-templates/environments/storagedirectory:GlanceBackend: file GlanceNfsEnabled: true GlanceNfsShare: 192.168.24.1:/var/nfsNote In this example, the
GlanceBackendvariable shows that an NFS back end is invisible to the Image service. The variable is using theFiledriver and, in the background, thefilesystem_store_datadir. Thefilesystem_store_datadiris mapped to the export value provided by theGlanceNfsSharevariable instead of/var/lib/glance/images/. If you do not export theGlanceNfsSharethrough a network that is propagated to the adopted Red Hat OpenStack Services on OpenShift (RHOSO) control plane, you must stop thenfs-serverand remap the export to thestoragenetwork. 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
NetworkAttachmentsDefinitioncustom 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 theNodeNetworkConfigPolicy(nncp) and theNetworkAttachmentDefinition(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 Copy linkLink copied!
- 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 Copy linkLink copied!
Results Copy linkLink copied!
- When
GlanceAPIis 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/imagesis mapped to the expectednfs server ipandnfs paththat you defined in the new defaultGlanceAPIinstance:$ 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-servernode, the sameuuidis in the exported/var/nfs:$ ls /var/nfs/ 634482ca-4002-4a6d-b1d5-64502ad02630
Adopt the Image service with a Ceph back end Copy linkLink copied!
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 Copy linkLink copied!
- You have completed the previous adoption steps.
- Ensure that the Ceph-related secret (
ceph-conf-files) is created in theopenstacknamespace and that theextraMountsproperty of theOpenStackControlPlanecustom 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 EOFwhere:
- <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.
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 Copy linkLink copied!
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 Copy linkLink copied!
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 Copy linkLink copied!
- 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
extraMountsproperty of theOpenStackControlPlaneCR 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
DistributedComputeHCIScaleOutorDistributedComputeScaleOutnodes, you have also stopped HAProxy on those nodes. For more information, see Stopping Red Hat OpenStack Platform services.
About this task Copy linkLink copied!
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 |
|
DCN1 |
|
|
|
DCN2 |
|
|
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 Copy linkLink copied!
Verify the Image service adoption to confirm service availability Copy linkLink copied!
Verify that you adopted the Image Service (glance) to the Red Hat OpenStack Services on OpenShift (RHOSO) 18.0 deployment.