From aa45cb8310e939e9fb56649499584bf8053de45c Mon Sep 17 00:00:00 2001 From: Maksim Malchuk Date: Thu, 12 Sep 2019 09:16:18 +0300 Subject: [PATCH] Add cinder volume support Since I8181ed696b9ab556e7741c08839d79167aff8350 were merged we need to add support for the Cinder Volume here. By default this functionality is disabled. To enable it change the option 'octavia_cinder_enabled' to True. To override default settings use 'octavia_octavia_conf_overrides'. Change-Id: Ib9015383d36fe47272e0a27408db89df83a4b38c Signed-off-by: Maksim Malchuk --- defaults/main.yml | 3 +++ .../notes/volume-based-10a2c22c7f180cc2.yaml | 14 ++++++++++++ templates/octavia.conf.j2 | 22 +++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 releasenotes/notes/volume-based-10a2c22c7f180cc2.yaml diff --git a/defaults/main.yml b/defaults/main.yml index f7a0fdd0..ce7558f0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -63,6 +63,9 @@ octavia_clients_endpoint: internalURL octavia_auth_strategy: keystone +## Cinder Volume +octavia_cinder_enabled: False + ## Database info octavia_db_setup_host: "{{ ('galera_all' in groups) | ternary(groups['galera_all'][0], 'localhost') }}" octavia_galera_address: "{{ galera_address | default('127.0.0.1') }}" diff --git a/releasenotes/notes/volume-based-10a2c22c7f180cc2.yaml b/releasenotes/notes/volume-based-10a2c22c7f180cc2.yaml new file mode 100644 index 00000000..b719a1af --- /dev/null +++ b/releasenotes/notes/volume-based-10a2c22c7f180cc2.yaml @@ -0,0 +1,14 @@ +--- +features: + - | + Now you can use cinder-volume with Octavia. To enable the feature set + ``octavia_cinder_enabled`` to ``True``. Also you may need to override + the default settings: + + .. code-block:: yaml + + octavia_octavia_conf_overrides: + cinder: + volume_type: 'my-volume-type' + volume_size: 32 + diff --git a/templates/octavia.conf.j2 b/templates/octavia.conf.j2 index 66c8c5a4..3b09b863 100644 --- a/templates/octavia.conf.j2 +++ b/templates/octavia.conf.j2 @@ -220,6 +220,15 @@ compute_driver = {{ octavia_compute_driver }} # network_driver = {{ octavia_network_driver }} # +# Cinder Volume driver options are volume_noop_driver +# volume_cinder_driver +# +{% if octavia_cinder_enabled %} +volume_driver = volume_cinder_driver +{% else %} +volume_driver = volume_noop_driver +{% endif %} +# # Certificate Generator options are local_cert_generator # barbican_cert_generator # anchor_cert_generator @@ -354,6 +363,19 @@ enable_anti_affinity = {{ octavia_enable_anti_affinity }} {% if octavia_amp_availability_zone is defined %}availability_zone={{ octavia_amp_availability_zone }}{%endif%} +{% if octavia_cinder_enabled %} +[cinder] +service_name = {{ cinder_service_v3_name | default('cinderv3') }} +region_name = {{ keystone_service_region }} +endpoint_type = {{ octavia_clients_endpoint }} +availability_zone = nova +volume_size = 16 +volume_type = "volumes-hdd" +volume_create_retry_interval = 5 +volume_create_timeout = 50 +volume_create_max_retries = 2 +{% endif %} + [glance] # The name of the glance service in the keystone catalog # service_name =