From a04b6cb15e5727a5ac34b1f7cc8213273c86d57b Mon Sep 17 00:00:00 2001 From: Domingues Luis Filipe Date: Wed, 21 Nov 2018 15:36:22 +0100 Subject: [PATCH] Add possibility to have private cinder volume types When declaring cinder_backends in user_variables.yml, it will create public volume types. We should be able to add an option to set the volume type as private. This commit add this possibility. Change-Id: I583ad08feb2293b14da8d6ccd42f8809f1f45b8d Related-Bug: 1804438 --- doc/source/configure-cinder.rst | 14 ++++++++++++++ ...inder-private-volume-type-9b2cc92c6c74c277.yaml | 5 +++++ tasks/cinder_backends.yml | 4 ++-- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/os_cinder-private-volume-type-9b2cc92c6c74c277.yaml diff --git a/doc/source/configure-cinder.rst b/doc/source/configure-cinder.rst index 3022a740..3d07c547 100644 --- a/doc/source/configure-cinder.rst +++ b/doc/source/configure-cinder.rst @@ -628,6 +628,20 @@ the desired qos spec dictionary. consumer: front-end write_iops_sec: 100 +Configure cinder to create a private volume type +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +By default, a define cinder-backend will create a public volume type. +In order to create a private volume type, add the variable ``public`` +and set it to ``false``. If it is set to ``true`` or not set at all +the volume type created will be public. + +.. code-block:: yaml + + cinder_backends: + private_type: + public: false + Shared storage and synchronized UID/GID ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/releasenotes/notes/os_cinder-private-volume-type-9b2cc92c6c74c277.yaml b/releasenotes/notes/os_cinder-private-volume-type-9b2cc92c6c74c277.yaml new file mode 100644 index 00000000..f3e10e54 --- /dev/null +++ b/releasenotes/notes/os_cinder-private-volume-type-9b2cc92c6c74c277.yaml @@ -0,0 +1,5 @@ +--- +features: + - Deployers can now define a cinder-backend volume type + explicitly private or public with option ``public`` + set to true or false. diff --git a/tasks/cinder_backends.yml b/tasks/cinder_backends.yml index d3c1d101..28466339 100644 --- a/tasks/cinder_backends.yml +++ b/tasks/cinder_backends.yml @@ -41,7 +41,7 @@ . {{ ansible_env.HOME }}/openrc CLI_OPTIONS="{{ ((keystone_service_adminuri_insecure | bool) or (cinder_service_internaluri_insecure | bool)) | ternary('--insecure','') }}" if ! {{ cinder_bin }}/openstack ${CLI_OPTIONS} volume type show "{{ item.key }}"; then - {{ cinder_bin }}/openstack ${CLI_OPTIONS} volume type create --property volume_backend_name="{{ item.value.volume_backend_name }}" "{{ item.key }}" + {{ cinder_bin }}/openstack ${CLI_OPTIONS} volume type create --property volume_backend_name="{{ item.value.volume_backend_name }}" {% if not item.value.public|default(True) %} --private {% endif %} "{{ item.key }}" fi args: executable: /bin/bash @@ -54,7 +54,7 @@ CLI_OPTIONS="{{ ((keystone_service_adminuri_insecure | bool) or (cinder_service_internaluri_insecure | bool)) | ternary('--insecure','') }}" {% for evtype in item.value.extra_volume_types %} if ! {{ cinder_bin }}/openstack ${CLI_OPTIONS} volume type show "{{ evtype }}"; then - {{ cinder_bin }}/openstack ${CLI_OPTIONS} volume type create --property volume_backend_name="{{ item.value.volume_backend_name }}" "{{ evtype }}" + {{ cinder_bin }}/openstack ${CLI_OPTIONS} volume type create --property volume_backend_name="{{ item.value.volume_backend_name }}" {% if not item.value.public|default(True) %} --private {% endif %} "{{ evtype }}" fi {% endfor %} args: