diff --git a/ansible/roles/cinder/defaults/main.yml b/ansible/roles/cinder/defaults/main.yml index c750672876..62dac7c7cc 100644 --- a/ansible/roles/cinder/defaults/main.yml +++ b/ansible/roles/cinder/defaults/main.yml @@ -203,6 +203,15 @@ cinder_logging_debug: "{{ openstack_logging_debug }}" openstack_cinder_auth: "{{ openstack_auth }}" +# After upgrading cinder, services will have an RPC version cap in place. We +# need to restart all services in order to allow them to use the latest RPC +# version. Ideally, there would be a way to check whether all cinder services +# are using the latest version, but currently there is not. Instead, wait a +# short time for all cinder services to update the version of their service in +# the database. This seems to take around 10 seconds, but the default is 30 to +# allow room for slowness. +cinder_rpc_version_startup_delay: 30 + #################### # Cinder diff --git a/ansible/roles/cinder/handlers/main.yml b/ansible/roles/cinder/handlers/main.yml index ecd3b8f069..59a08ca8d0 100644 --- a/ansible/roles/cinder/handlers/main.yml +++ b/ansible/roles/cinder/handlers/main.yml @@ -66,3 +66,23 @@ healthcheck: "{{ service.healthcheck | default(omit) }}" when: - kolla_action != "config" + +# NOTE(mgoddard): After upgrading cinder, services will have an RPC version cap +# in place. We need to restart all services in order to allow them to use the +# latest RPC version. Ideally, there would be a way to check whether all cinder +# services are using the latest version, but currently there is not. Instead, +# wait a short time for all cinder services to update the version of their +# service in the database. This seems to take around 10 seconds, but the +# default is 30 to allow room for slowness. + +- name: Wait for cinder services to update service versions + pause: + seconds: "{{ cinder_rpc_version_startup_delay }}" + run_once: true + when: + - kolla_action == 'upgrade' + listen: + - Restart cinder-api container + - Restart cinder-scheduler container + - Restart cinder-volume container + - Restart cinder-backup container diff --git a/ansible/roles/cinder/tasks/reload.yml b/ansible/roles/cinder/tasks/reload.yml new file mode 100644 index 0000000000..a8d6dd3289 --- /dev/null +++ b/ansible/roles/cinder/tasks/reload.yml @@ -0,0 +1,10 @@ +--- +- name: Reload cinder services to remove RPC version pin + vars: + service: "{{ item.value }}" + become: true + kolla_docker: + action: "restart_container" + common_options: "{{ docker_common_options }}" + name: "{{ service.container_name }}" + with_dict: "{{ cinder_services | select_services_enabled_and_mapped_to_host }}" diff --git a/ansible/roles/cinder/tasks/upgrade.yml b/ansible/roles/cinder/tasks/upgrade.yml index 17bbdae0cf..a30a1c726b 100644 --- a/ansible/roles/cinder/tasks/upgrade.yml +++ b/ansible/roles/cinder/tasks/upgrade.yml @@ -13,6 +13,8 @@ - name: Flush handlers meta: flush_handlers +- import_tasks: reload.yml + - name: Running Cinder online schema migration vars: cinder_api: "{{ cinder_services['cinder-api'] }}" diff --git a/releasenotes/notes/unpin-cinder-rpcs-8eb7e0858a91b9b8.yaml b/releasenotes/notes/unpin-cinder-rpcs-8eb7e0858a91b9b8.yaml new file mode 100644 index 0000000000..acb8f66bf1 --- /dev/null +++ b/releasenotes/notes/unpin-cinder-rpcs-8eb7e0858a91b9b8.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes an issue with Cinder upgrade where Cinder services would remain + pinned to the previous release's RPC & object versions. `LP#1954932 + `__