Fix manila update, upgrade, and FFU tasks
Manila has a similar service architecture to Cinder and the latter has received several fixes for update, upgrade, and FFU tasks that are missing in Manila. Align these tasks in the Manila services with Cinder versions of the same. Closes-Bug: #1784032 Change-Id: Ifae95bae859a301e6bcf67910cd9140f51584bb3
This commit is contained in:
parent
e87fcba49d
commit
0811ccbc54
@ -157,3 +157,35 @@ outputs:
|
|||||||
- name: Stop and disable manila_api service
|
- name: Stop and disable manila_api service
|
||||||
when: manila_api_enabled|bool
|
when: manila_api_enabled|bool
|
||||||
service: name=openstack-manila-api state=stopped enabled=no
|
service: name=openstack-manila-api state=stopped enabled=no
|
||||||
|
fast_forward_upgrade_tasks:
|
||||||
|
- name: Check if manila_api is deployed
|
||||||
|
command: systemctl is-enabled --quiet openstack-manila-api
|
||||||
|
ignore_errors: True
|
||||||
|
register: manila_api_enabled_result
|
||||||
|
when:
|
||||||
|
- step|int == 0
|
||||||
|
- release == 'ocata'
|
||||||
|
- name: Set fact manila_api_enabled
|
||||||
|
set_fact:
|
||||||
|
manila_api_enabled: "{{ manila_api_enabled_result.rc == 0 }}"
|
||||||
|
when:
|
||||||
|
- step|int == 0
|
||||||
|
- release == 'ocata'
|
||||||
|
- name: Stop openstack-manila-api
|
||||||
|
service: name=openstack-manila-api state=stopped
|
||||||
|
when:
|
||||||
|
- step|int == 1
|
||||||
|
- release == 'ocata'
|
||||||
|
- manila_api_enabled|bool
|
||||||
|
- name: manila package update
|
||||||
|
package:
|
||||||
|
name: 'openstack-manila*'
|
||||||
|
state: latest
|
||||||
|
when:
|
||||||
|
- step|int == 6
|
||||||
|
- is_bootstrap_node|bool
|
||||||
|
- name: Manila db sync
|
||||||
|
command: manila-manage db sync
|
||||||
|
when:
|
||||||
|
- step|int == 8
|
||||||
|
- is_bootstrap_node|bool
|
||||||
|
@ -133,3 +133,23 @@ outputs:
|
|||||||
- name: Stop and disable manila_scheduler service
|
- name: Stop and disable manila_scheduler service
|
||||||
when: manila_scheduler_enabled|bool
|
when: manila_scheduler_enabled|bool
|
||||||
service: name=openstack-manila-scheduler state=stopped enabled=no
|
service: name=openstack-manila-scheduler state=stopped enabled=no
|
||||||
|
fast_forward_upgrade_tasks:
|
||||||
|
- name: Check if manila_scheduler is deployed
|
||||||
|
command: systemctl is-enabled --quiet openstack-manila-scheduler
|
||||||
|
ignore_errors: True
|
||||||
|
register: manila_scheduler_enabled_result
|
||||||
|
when:
|
||||||
|
- step|int == 0
|
||||||
|
- release == 'ocata'
|
||||||
|
- name: Set fact manila_scheduler_enabled
|
||||||
|
set_fact:
|
||||||
|
manila_scheduler_enabled: "{{ manila_scheduler_enabled_result.rc == 0 }}"
|
||||||
|
when:
|
||||||
|
- step|int == 0
|
||||||
|
- release == 'ocata'
|
||||||
|
- name: Stop openstack-manila-scheduler
|
||||||
|
service: name=openstack-maniila-scheduler state=stopped enabled=no
|
||||||
|
when:
|
||||||
|
- step|int == 1
|
||||||
|
- release == 'ocata'
|
||||||
|
- manila_scheduler_enabled|bool
|
||||||
|
@ -82,7 +82,7 @@ outputs:
|
|||||||
# BEGIN DOCKER SETTINGS
|
# BEGIN DOCKER SETTINGS
|
||||||
puppet_config:
|
puppet_config:
|
||||||
config_volume: manila
|
config_volume: manila
|
||||||
puppet_tags: manila_config
|
puppet_tags: manila_config,file,concat,file_line
|
||||||
step_config:
|
step_config:
|
||||||
list_join:
|
list_join:
|
||||||
- "\n"
|
- "\n"
|
||||||
@ -160,3 +160,23 @@ outputs:
|
|||||||
- name: Stop and disable manila_share service
|
- name: Stop and disable manila_share service
|
||||||
when: manila_share_enabled|bool
|
when: manila_share_enabled|bool
|
||||||
service: name=openstack-manila-share state=stopped enabled=no
|
service: name=openstack-manila-share state=stopped enabled=no
|
||||||
|
fast_forward_upgrade_tasks:
|
||||||
|
- name: Check if manila_share is deployed
|
||||||
|
command: systemctl is-enabled --quiet openstack-manila-share
|
||||||
|
ignore_errors: True
|
||||||
|
register: manila_share_enabled_result
|
||||||
|
when:
|
||||||
|
- step|int == 0
|
||||||
|
- release == 'ocata'
|
||||||
|
- name: Set fact manila_share_enabled
|
||||||
|
set_fact:
|
||||||
|
manila_share_enabled: "{{ manila_share_enabled_result.rc == 0 }}"
|
||||||
|
when:
|
||||||
|
- step|int == 0
|
||||||
|
- release == 'ocata'
|
||||||
|
- name: Stop openstack-manila-share
|
||||||
|
service: name=openstack-manila-share state=stopped enabled=no
|
||||||
|
when:
|
||||||
|
- step|int == 1
|
||||||
|
- release == 'ocata'
|
||||||
|
- manila_share_enabled|bool
|
||||||
|
@ -225,6 +225,10 @@ outputs:
|
|||||||
Log files from manila containers can be found under
|
Log files from manila containers can be found under
|
||||||
/var/log/containers/manila and /var/log/containers/httpd/manila-api.
|
/var/log/containers/manila and /var/log/containers/httpd/manila-api.
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
- name: ensure ceph configurations exist
|
||||||
|
file:
|
||||||
|
path: /etc/ceph
|
||||||
|
state: directory
|
||||||
update_tasks:
|
update_tasks:
|
||||||
- name: Manila-Share fetch and retag container image for pacemaker
|
- name: Manila-Share fetch and retag container image for pacemaker
|
||||||
when: step|int == 2
|
when: step|int == 2
|
||||||
@ -262,12 +266,13 @@ outputs:
|
|||||||
set_fact:
|
set_fact:
|
||||||
manila_share_docker_image_latest: *manila_share_image_pcmklatest
|
manila_share_docker_image_latest: *manila_share_image_pcmklatest
|
||||||
- name: Check for Manila-Share Kolla configuration
|
- name: Check for Manila-Share Kolla configuration
|
||||||
stat:
|
command: grep '^share_driver[ \t]*=' /var/lib/config-data/puppet-generated/manila/etc/manila/manila.conf
|
||||||
path: /var/lib/config-data/puppet-generated/manila
|
changed_when: no
|
||||||
|
ignore_errors: true
|
||||||
register: manila_share_kolla_config
|
register: manila_share_kolla_config
|
||||||
- name: Check if Manila-Share is already containerized
|
- name: Check if Manila-Share is already containerized
|
||||||
set_fact:
|
set_fact:
|
||||||
manila_share_containerized: "{{manila_share_kolla_config.stat.isdir | default(false)}}"
|
manila_share_containerized: "{{manila_share_kolla_config|succeeded}}"
|
||||||
- name: Prepare the switch to new Manila-Share container image name in pacemaker
|
- name: Prepare the switch to new Manila-Share container image name in pacemaker
|
||||||
when: manila_share_containerized|bool
|
when: manila_share_containerized|bool
|
||||||
block:
|
block:
|
||||||
@ -285,14 +290,47 @@ outputs:
|
|||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: manila_share_pcs_res_result
|
register: manila_share_pcs_res_result
|
||||||
- name: Set fact manila_share_pcs_res
|
- name: Set fact manila_share_pcs_res
|
||||||
set_fact: "{{manila_share_pcs_res_result|succeeded}}"
|
set_fact:
|
||||||
|
manila_share_pcs_res: "{{manila_share_pcs_res_result|succeeded}}"
|
||||||
- name: Manila-Share baremetal to container upgrade tasks
|
- name: Manila-Share baremetal to container upgrade tasks
|
||||||
when:
|
when:
|
||||||
- step|int == 1
|
- step|int == 1
|
||||||
- not manila_share_containerized|bool
|
- not manila_share_containerized|bool
|
||||||
block:
|
block:
|
||||||
- name: Stop and disable manila_share service
|
- name: get bootstrap nodeid
|
||||||
service: name=openstack-manila-share state=stopped enabled=no
|
tags: common
|
||||||
|
command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
|
||||||
|
register: bootstrap_node
|
||||||
|
- name: set is_bootstrap_node fact
|
||||||
|
tags: common
|
||||||
|
set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
|
||||||
|
- name: Check cluster resource status
|
||||||
|
pacemaker_resource:
|
||||||
|
resource: openstack-manila-share
|
||||||
|
state: show
|
||||||
|
check_mode: false
|
||||||
|
ignore_errors: true
|
||||||
|
register: manila_share_res
|
||||||
|
- when: (is_bootstrap_node) and (manila_share_res|succeeded)
|
||||||
|
block:
|
||||||
|
- name: Disable the openstack-manila-share cluster resource
|
||||||
|
pacemaker_resource:
|
||||||
|
resource: openstack-manila-share
|
||||||
|
state: disable
|
||||||
|
wait_for_resource: true
|
||||||
|
register: output
|
||||||
|
retries: 5
|
||||||
|
until: output.rc == 0
|
||||||
|
- name: Delete the stopped openstack-manila-share cluster resource.
|
||||||
|
pacemaker_resource:
|
||||||
|
resource: openstack-manila-share
|
||||||
|
state: delete
|
||||||
|
wait_for_resource: true
|
||||||
|
register: output
|
||||||
|
retries: 5
|
||||||
|
until: output.rc == 0
|
||||||
|
- name: Disable manila_share service from boot
|
||||||
|
service: name=openstack-manila-share enabled=no
|
||||||
- name: Update openstack-manila-share pcs resource bundle for new container image
|
- name: Update openstack-manila-share pcs resource bundle for new container image
|
||||||
when:
|
when:
|
||||||
- step|int == 1
|
- step|int == 1
|
||||||
@ -311,6 +349,7 @@ outputs:
|
|||||||
- name: Update the Manila-Share bundle to use the new container image name
|
- name: Update the Manila-Share bundle to use the new container image name
|
||||||
command: "pcs resource bundle update openstack-manila-share container image={{manila_share_docker_image_latest}}"
|
command: "pcs resource bundle update openstack-manila-share container image={{manila_share_docker_image_latest}}"
|
||||||
- name: Enable the Manila-Share cluster resource
|
- name: Enable the Manila-Share cluster resource
|
||||||
|
when:
|
||||||
pacemaker_resource:
|
pacemaker_resource:
|
||||||
resource: openstack-manila-share
|
resource: openstack-manila-share
|
||||||
state: enable
|
state: enable
|
||||||
@ -323,3 +362,35 @@ outputs:
|
|||||||
- step|int == 3
|
- step|int == 3
|
||||||
- manila_share_containerized|bool
|
- manila_share_containerized|bool
|
||||||
block: *manila_share_fetch_retag_container_tasks
|
block: *manila_share_fetch_retag_container_tasks
|
||||||
|
fast_forward_upgrade_tasks:
|
||||||
|
- name: Check cluster resource status
|
||||||
|
pacemaker_resource:
|
||||||
|
resource: openstack-manila-share
|
||||||
|
state: show
|
||||||
|
check_mode: false
|
||||||
|
ignore_errors: true
|
||||||
|
register: manila_share_res_result
|
||||||
|
when:
|
||||||
|
- step|int == 0
|
||||||
|
- release == 'ocata'
|
||||||
|
- is_bootstrap_node|bool
|
||||||
|
- name: Set fact manila_share_res
|
||||||
|
set_fact:
|
||||||
|
manila_share_res: "{{ manila_share_res_result.rc == 0 }}"
|
||||||
|
when:
|
||||||
|
- step|int == 0
|
||||||
|
- release == 'ocata'
|
||||||
|
- is_bootstrap_node|bool
|
||||||
|
- name: Disable the openstack-manila-share cluster resource
|
||||||
|
pacemaker_resource:
|
||||||
|
resource: openstack-manila-share
|
||||||
|
state: disable
|
||||||
|
wait_for_resource: true
|
||||||
|
register: manila_share_output
|
||||||
|
retries: 5
|
||||||
|
until: manila_share_output.rc == 0
|
||||||
|
when:
|
||||||
|
- step|int == 2
|
||||||
|
- release == 'ocata'
|
||||||
|
- is_bootstrap_node|bool
|
||||||
|
- manila_share_res|bool
|
||||||
|
Loading…
Reference in New Issue
Block a user