Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the old Ceph section from cinder.conf #115

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 88 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,62 @@ make undeploy

### Configure Cinder with Ceph backend

The Cinder spec API can be used to configure and customize the Ceph backend. In
particular, the `customServiceConfig` parameter should be used, for each
defined volume, to override the `enabled_backends` parameter, which must exist
in `cinder.conf` to make the `cinderVolume` pod run. The global `cephBackend`
parameter is used to specify the Ceph client-related "key/value" pairs required
to connect the service with an external Ceph cluster. Multiple external Ceph
clusters are not supported at the moment. The following represents an example
of the Cinder object that can be used to trigger the Cinder service deployment,
and enable the Cinder backend that points to an external Ceph cluster.
The Cinder services can be configured to interact with an external Ceph cluster.
In particular, the `customServiceConfig` parameter must be used, for each defined
`cinder-volume` and `cinder-backup` instance, to override the `enabled_backends`
parameter and inject the Ceph related parameters.
The `ceph.conf` and the `client keyring` must exist as secrets, and can be
mounted by the cinder pods using the `extraMounts` feature.

Create a secret by generating the following file and then apply it using the `oc`
cli.

---
apiVersion: v1
kind: Secret
metadata:
name: ceph-client-conf
namespace: openstack
stringData:
ceph.client.openstack.keyring: |
[client.openstack]
key = <secret key>
caps mgr = "allow *"
caps mon = "profile rbd"
caps osd = "profile rbd pool=images"
ceph.conf: |
[global]
fsid = 7a1719e8-9c59-49e2-ae2b-d7eb08c695d4
mon_host = 10.1.1.2,10.1.1.3,10.1.1.4


Add the following to the spec of the Cinder CR and then apply it using the `oc`
cli.

```
extraMounts:
- name: v1
region: r1
extraVol:
- propagation:
- CinderVolume
- CinderBackup
volumes:
- name: ceph
projected:
sources:
- secret:
name: ceph-client-conf
mounts:
- name: ceph
mountPath: "/etc/ceph"
readOnly: true
```

The following represents an example of the entire Cinder object that can be used
to trigger the Cinder service deployment, and enable the Cinder backend that
points to an external Ceph cluster.


```
apiVersion: cinder.openstack.org/v1beta1
Expand All @@ -73,6 +120,11 @@ spec:
cinderBackup:
replicas: 1
containerImage: quay.io/tripleowallabycentos9/openstack-cinder-backup:current-tripleo
customServiceConfig: |
[DEFAULT]
backup_driver = cinder.backup.drivers.ceph.CephBackupDriver
backup_ceph_pool = backups
backup_ceph_user = admin
secret: cinder-secret
cinderVolumes:
volume1:
Expand All @@ -81,29 +133,35 @@ spec:
customServiceConfig: |
[DEFAULT]
enabled_backends=ceph
cephBackend:
cephFsid: <CephClusterFSID>
cephMons: <CephMons>
cephClientKey: <cephClientKey>
cephUser: openstack
cephPools:
cinder:
name: volumes
nova:
name: vms
glance:
name: images
cinder_backup:
name: backup
extra_pool1:
name: ceph_ssd_tier
extra_pool2:
name: ceph_nvme_tier
extra_pool3:
name: ceph_hdd_tier
[ceph]
volume_backend_name=ceph
volume_driver=cinder.volume.drivers.rbd.RBDDriver
rbd_ceph_conf=/etc/ceph/ceph.conf
rbd_user=admin
rbd_pool=volumes
rbd_flatten_volume_from_snapshot=False
rbd_secret_uuid=<Ceph_FSID>
extraMounts:
- name: cephfiles
region: r1
extraVol:
- propagation:
- CinderVolume
- CinderBackup
extraVolType: Ceph
volumes:
- name: ceph
projected:
sources:
- secret:
name: ceph-client-files
mounts:
- name: ceph
mountPath: "/etc/ceph"
readOnly: true
```

When the service is up and running, it's possible to interact with the cinder
When the service is up and running, it's possible to interact with the Cinder
API and create the Ceph `cinder type` backend which is associated with the Ceph
tier specified in the config file.

Expand Down
9 changes: 0 additions & 9 deletions templates/cinder/config/cinder.conf
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,3 @@ lock_path = /var/locks/openstack/os-brick
#volume_backend_name=nfs
#volume_driver=cinder.volume.drivers.nfs.NfsDriver
#nfs_shares_config=/etc/cinder/nfs_shares

[ceph]
volume_backend_name=ceph
volume_driver=cinder.volume.drivers.rbd.RBDDriver
rbd_ceph_conf=/etc/ceph/ceph.conf
rbd_user={{ .User }}
rbd_pool={{ .Pool }}
rbd_flatten_volume_from_snapshot=False
rbd_secret_uuid={{ .ClusterFSID }}