Skip to content

Commit bca31ed

Browse files
committed
Update docs for client.cinder to support COW snapshots
This is to support copy on write snapshots: ``` Performing standard snapshot because direct snapshot failed: no write permission on storage pool images: nova.exception.Forbidden: no write permission on storage pool images ``` when using ceph for nova ephemeral storage. My preferrence is for a standardised configuration rather than another if you use this feature, do this.
1 parent 4026c4e commit bca31ed

File tree

8 files changed

+121
-3
lines changed

8 files changed

+121
-3
lines changed

doc/source/configuration/cephadm.rst

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ for Cinder, Cinder backup, Glance, and Nova in Kolla Ansible.
243243
- name: client.cinder
244244
caps:
245245
mon: "profile rbd"
246-
osd: "profile rbd pool=volumes, profile rbd pool=vms, profile rbd-read-only pool=images"
246+
osd: "profile rbd pool=volumes, profile rbd pool=vms, profile rbd pool=images"
247247
mgr: "profile rbd pool=volumes, profile rbd pool=vms"
248248
- name: client.cinder-backup
249249
caps:
@@ -550,3 +550,85 @@ committed to the configuration.
550550

551551
This configuration will be used during
552552
``kayobe overcloud service deploy``.
553+
554+
OpenStack integration
555+
=====================
556+
557+
Copy on write optimisations
558+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
559+
560+
Copy on write optimisations are currently disabled by default due to
561+
`security concerns <https://bugs.launchpad.net/kolla-ansible/+bug/1992153>`__.
562+
To enable them, set ``stackhpc_enable_ceph_cow_optimisations`` to ``true`` in
563+
``etc/kayobe/stackhpc.yml``. Setting this flag to ``true`` causes Kayobe to
564+
render a `glance.conf` file with the following content:
565+
566+
.. code:: ini
567+
568+
[DEFAULT]
569+
show_multiple_locations = true
570+
show_image_direct_url = true
571+
572+
[glance_store]
573+
rbd_thin_provisioning = true
574+
575+
.. warning::
576+
577+
Enabling ``show_image_direct_url`` allows Glance to return the RADOS location
578+
(pool and image name) for each image. Although this does not expose any Ceph
579+
credentials, it can be considered an information leak in some environments.
580+
There are plans in kolla-ansible to deploy a separate ``glance-api`` instance
581+
for the internal endpoint, which would allow this to be enabled for the
582+
internal endpoint only.
583+
584+
Verify that the Cinder user has read-write access to the images pool by running:
585+
586+
.. code:: console
587+
588+
ceph auth get client.cinder
589+
590+
If the output includes `profile rbd-read-only pool=images`, update the caps using:
591+
592+
.. code:: console
593+
594+
ceph auth caps client.cinder mon 'profile rbd' osd 'profile rbd pool=volumes, profile rbd pool=vms, profile rbd pool=images' mgr 'profile rbd pool=volumes, profile rbd pool=vms'
595+
596+
Be sure to keep any existing capabilities and only change the capabilities on the
597+
images pool from `profile rbd-read-only pool=images` to
598+
`profile rbd pool=images`. Then re-run the verification command to confirm the
599+
change.
600+
601+
The Ceph keyrings under the Cinder and Nova configurations should also be
602+
updated to remove the read-only flag (e.g. remove `readonly` from the caps
603+
lines in `etc/kayobe/kolla/config/cinder/ceph.client.cinder.keyring` and
604+
`etc/kayobe/kolla/config/nova/ceph.client.cinder.keyring`).
605+
606+
Example (before / after):
607+
608+
.. code:: ini
609+
610+
[client.cinder]
611+
key = redacted
612+
caps mgr = "profile rbd pool=volumes, profile rbd pool=vms"
613+
caps mon = "profile rbd"
614+
caps osd = "profile rbd pool=volumes, profile rbd pool=vms, profile rbd-read-only pool=images"
615+
616+
.. code:: ini
617+
618+
[client.cinder]
619+
key = redacted
620+
caps mgr = "profile rbd pool=volumes, profile rbd pool=vms"
621+
caps mon = "profile rbd"
622+
caps osd = "profile rbd pool=volumes, profile rbd pool=vms, profile rbd pool=images"
623+
624+
If you had to change the keyrings, you will need to reconfigure glance, nova and cinder:
625+
626+
.. code:: console
627+
628+
kayobe overcloud service deploy -kt glance,nova,cinder
629+
630+
otherwise, just reconfigure glance:
631+
632+
.. code:: console
633+
634+
kayobe overcloud service deploy -kt glance

etc/kayobe/environments/aufn-ceph/cephadm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ cephadm_keys:
4646
- name: client.cinder
4747
caps:
4848
mon: "profile rbd"
49-
osd: "profile rbd pool=volumes, profile rbd pool=vms, profile rbd-read-only pool=images"
49+
osd: "profile rbd pool=volumes, profile rbd pool=vms, profile rbd pool=images"
5050
mgr: "profile rbd pool=volumes, profile rbd pool=vms"
5151
state: present
5252
- name: client.cinder-backup

etc/kayobe/environments/aufn-ceph/stackhpc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ stackhpc_release_pulp_url: "http://pulp-server.internal.sms-cloud:8080"
1313

1414
pulp_username: admin
1515
pulp_password: 9e4bfa04-9d9d-493d-9473-ba92e4361dae
16+
17+
###############################################################################
18+
# Feature flags
19+
20+
stackhpc_enable_ceph_glance_cow_optimisations: true

etc/kayobe/environments/ci-multinode/cephadm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ cephadm_keys:
4747
- name: client.cinder
4848
caps:
4949
mon: "profile rbd"
50-
osd: "profile rbd pool=volumes, profile rbd pool=vms, profile rbd-read-only pool=images"
50+
osd: "profile rbd pool=volumes, profile rbd pool=vms, profile rbd pool=images"
5151
mgr: "profile rbd pool=volumes, profile rbd pool=vms"
5252
state: present
5353
- name: client.cinder-backup
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
---
2+
###############################################################################
3+
# Feature flags
24

35
stackhpc_enable_cis_benchmark_hardening_hook: true
6+
stackhpc_enable_ceph_glance_cow_optimisations: true
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[DEFAULT]
2+
{% if stackhpc_enable_ceph_glance_cow_optimisations | bool %}
3+
show_image_direct_url = true
4+
show_multiple_locations = true
5+
{% endif %}
6+
7+
[glance_store]
8+
{% if stackhpc_enable_ceph_glance_cow_optimisations | bool %}
9+
rbd_thin_provisioning = true
10+
{% endif %}

etc/kayobe/stackhpc.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,10 @@ stackhpc_docker_registry_password: "{{ pulp_password }}"
166166

167167
# Whether or not to run CIS benchmark hardening playbooks. Default is false.
168168
#stackhpc_enable_cis_benchmark_hardening_hook:
169+
170+
# Whether to enable copy on write optimisations for Ceph in the Glance image
171+
# store. Defaults to false as there an information disclosure vulnerability
172+
# with the current kolla-ansible setup when enabling show_direct_url in glance.
173+
# When rbd is the only backend, this is relativley safe as the the direct_url
174+
# only shows the location in ceph and does not leak any credentials.
175+
stackhpc_enable_ceph_glance_cow_optimisations: false
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
features:
3+
- |
4+
Adds a ``stackhpc_enable_ceph_cow_optimisations`` feature flag to enable
5+
copy on write optimisations when using Ceph. Please see the ``Copy on write
6+
optimisations`` section under `Configuraton Guide` > `Cephadm and Kayobe`
7+
in the documentation.
8+
9+
The feature is currently opt-in. Note the documented permissions for the
10+
images pool for the Cinder user have been adjusted to make this easier to
11+
apply for future deployments.

0 commit comments

Comments
 (0)