Skip to content

Commit

Permalink
rbd: add var for inuse and enable setting secret
Browse files Browse the repository at this point in the history
This patch refactors a variable to determine if we RBD is in
use (either directly or via cinder-volume).

It also uses this to make sure to always set rbd_user and the
rbd_secret_uuid both are set so booting from Cinder with local
storage works.

Change-Id: I052f50cd527ea222e74fdc3684613499f2b55d8e
  • Loading branch information
mnaser committed Jul 30, 2019
1 parent cb53967 commit 12a5bc7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions defaults/main.yml
Expand Up @@ -393,6 +393,9 @@ nova_ceph_client_uuid: 517a4663-3927-44bc-9ea7-4a90e1cd4c66
# ceph be deployed on the nova compute hosts to enable volume backed instances.
nova_cinder_rbd_inuse: False

# Used to determine if we need a Ceph client
nova_rbd_inuse: "(nova_libvirt_images_rbd_pool is defined) or (nova_cinder_rbd_inuse | bool)"

## General Nova configuration
# If ``nova_osapi_compute_workers`` is unset the system will use half the number of available VCPUS to
# compute the number of api workers to use.
Expand Down
5 changes: 2 additions & 3 deletions tasks/main.yml
Expand Up @@ -232,9 +232,8 @@
openstack_service_venv_bin: "{{ nova_bin }}"
when:
- nova_virt_type != 'ironic'
- "nova_services['nova-compute']['group'] in group_names"
- "(nova_libvirt_images_rbd_pool is defined) or
(nova_cinder_rbd_inuse | bool)"
- nova_services['nova-compute']['group'] in group_names
- nova_rbd_inuse | bool
tags:
- ceph

Expand Down
4 changes: 3 additions & 1 deletion templates/nova.conf.j2
Expand Up @@ -250,10 +250,12 @@ cpu_model_extra_flags = {{ nova_cpu_model_extra_flags | join(',') }}
{% endif %}
{% endif %}

{% if nova_libvirt_images_rbd_pool is defined %}
{% if nova_rbd_inuse %}
# ceph rbd support
rbd_user = {{ nova_ceph_client }}
rbd_secret_uuid = {{ nova_ceph_client_uuid }}
{% endif %}
{% if nova_libvirt_images_rbd_pool is defined %}
images_type = rbd
images_rbd_pool = {{ nova_libvirt_images_rbd_pool }}
images_rbd_ceph_conf = /etc/ceph/ceph.conf
Expand Down

0 comments on commit 12a5bc7

Please sign in to comment.