From 99a199f2af8c743539585843e47cae142489b9fc Mon Sep 17 00:00:00 2001 From: Duong Ha-Quang Date: Thu, 21 Dec 2017 18:18:26 +0700 Subject: [PATCH] Apply Cinder rolling upgrade Apply Cinder database migration procedure: [1] https://docs.openstack.org/cinder/pike/upgrade.html Depends-On: I9a847b0a916a85d8f2622e93734330da5122f0d8 Change-Id: I934c38cb5366f0b3a65115b4cdd19878efec7ebc --- ansible/roles/cinder/defaults/main.yml | 3 ++ ansible/roles/cinder/tasks/upgrade.yml | 30 +++++++++++++++++++ ...mal-downtime-upgrade-3c883b015d41bf18.yaml | 4 +++ 3 files changed, 37 insertions(+) create mode 100644 releasenotes/notes/implement-cinder-minimal-downtime-upgrade-3c883b015d41bf18.yaml diff --git a/ansible/roles/cinder/defaults/main.yml b/ansible/roles/cinder/defaults/main.yml index 930beb1d7f..edc4058c7c 100644 --- a/ansible/roles/cinder/defaults/main.yml +++ b/ansible/roles/cinder/defaults/main.yml @@ -81,6 +81,9 @@ cinder_database_name: "cinder" cinder_database_user: "cinder" cinder_database_address: "{{ kolla_internal_fqdn }}:{{ database_port }}" +# Max number of object to consider +# when run online data migration +# cinder_max_number_osm: "" #################### # Docker diff --git a/ansible/roles/cinder/tasks/upgrade.yml b/ansible/roles/cinder/tasks/upgrade.yml index c38db1adf4..3b48ca2d39 100644 --- a/ansible/roles/cinder/tasks/upgrade.yml +++ b/ansible/roles/cinder/tasks/upgrade.yml @@ -1,7 +1,37 @@ --- +# NOTE (duonghq): I break pull and config into 2 phases to prevent new version +# of service start if node or process in node crash accidentally. +- include: pull.yml + when: inventory_hostname == groups["cinder-api"][0] + - include: config.yml + when: inventory_hostname == groups["cinder-api"][0] - include: bootstrap_service.yml +- include: pull.yml + +- include: config.yml + - name: Flush handlers meta: flush_handlers + +- name: Running Cinder online schema migration + vars: + cinder_api: "{{ cinder_services['cinder-api'] }}" + kolla_docker: + action: "start_container" + common_options: "{{ docker_common_options }}" + detach: False + environment: + KOLLA_OSM: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + MAX_NUMBER: "{{ cinder_max_number_osm | default(10) }}" + image: "{{ cinder_api.image }}" + labels: + BOOTSTRAP: + name: "bootstrap_cinder" + restart_policy: "never" + volumes: "{{ cinder_api.volumes }}" + run_once: True + delegate_to: "{{ groups[cinder_api.group][0] }}" diff --git a/releasenotes/notes/implement-cinder-minimal-downtime-upgrade-3c883b015d41bf18.yaml b/releasenotes/notes/implement-cinder-minimal-downtime-upgrade-3c883b015d41bf18.yaml new file mode 100644 index 0000000000..0225f0a2b1 --- /dev/null +++ b/releasenotes/notes/implement-cinder-minimal-downtime-upgrade-3c883b015d41bf18.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Implement Cinder minimal downtime upgrade procedure.