[queens-only] Unmount cinder NFS shares during upgrade
Unmount any cinder NFS shares on the host when upgrading cinder from running on the host to running in a kolla container. This ensures there are no active NFS mounts in cinder's service directory prior to launching the container. Kolla recusively changes the ownership of /var/lib/cinder, so removing the mounts prevents kolla from inadvertently changing the ownership of files on the NFS storage backends. Closes-Bug: #1887435 Change-Id: I5f0cedb808c6371caee6918da5b8bef743971221
This commit is contained in:
parent
944abd50d8
commit
6df5268155
|
@ -175,6 +175,17 @@ outputs:
|
||||||
- name: Stop and disable cinder_volume service
|
- name: Stop and disable cinder_volume service
|
||||||
when: cinder_volume_enabled|bool
|
when: cinder_volume_enabled|bool
|
||||||
service: name=openstack-cinder-volume state=stopped enabled=no
|
service: name=openstack-cinder-volume state=stopped enabled=no
|
||||||
|
- name: Unmount cinder NFS shares mounted on the host
|
||||||
|
mount:
|
||||||
|
path: "{{ item.mount }}"
|
||||||
|
state: unmounted
|
||||||
|
loop: "{{ ansible_mounts }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.mount }}"
|
||||||
|
index_var: cinder_mount_index
|
||||||
|
when:
|
||||||
|
- "'/var/lib/cinder/' in item.mount"
|
||||||
|
- "'nfs' in item.fstype"
|
||||||
- when: step|int == 3
|
- when: step|int == 3
|
||||||
block:
|
block:
|
||||||
- name: Set fact for removal of openstack-cinder package
|
- name: Set fact for removal of openstack-cinder package
|
||||||
|
@ -198,9 +209,24 @@ outputs:
|
||||||
when:
|
when:
|
||||||
- step|int == 0
|
- step|int == 0
|
||||||
- release == 'ocata'
|
- release == 'ocata'
|
||||||
- name: Stop openstack-cinder-volume
|
- when:
|
||||||
service: name=openstack-cinder-volume state=stopped enabled=no
|
|
||||||
when:
|
|
||||||
- step|int == 1
|
- step|int == 1
|
||||||
- release == 'ocata'
|
- release == 'ocata'
|
||||||
- cinder_volume_enabled|bool
|
- cinder_volume_enabled|bool
|
||||||
|
block:
|
||||||
|
- name: Stop openstack-cinder-volume
|
||||||
|
service:
|
||||||
|
name: openstack-cinder-volume
|
||||||
|
state: stopped
|
||||||
|
enabled: no
|
||||||
|
- name: Unmount cinder NFS shares mounted on the host
|
||||||
|
mount:
|
||||||
|
path: "{{ item.mount }}"
|
||||||
|
state: unmounted
|
||||||
|
loop: "{{ ansible_mounts }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.mount }}"
|
||||||
|
index_var: cinder_mount_index
|
||||||
|
when:
|
||||||
|
- "'/var/lib/cinder/' in item.mount"
|
||||||
|
- "'nfs' in item.fstype"
|
||||||
|
|
|
@ -321,6 +321,17 @@ outputs:
|
||||||
until: output.rc == 0
|
until: output.rc == 0
|
||||||
- name: Disable cinder_volume service from boot
|
- name: Disable cinder_volume service from boot
|
||||||
service: name=openstack-cinder-volume enabled=no
|
service: name=openstack-cinder-volume enabled=no
|
||||||
|
- name: Unmount cinder NFS shares mounted on the host
|
||||||
|
mount:
|
||||||
|
path: "{{ item.mount }}"
|
||||||
|
state: unmounted
|
||||||
|
loop: "{{ ansible_mounts }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.mount }}"
|
||||||
|
index_var: cinder_mount_index
|
||||||
|
when:
|
||||||
|
- "'/var/lib/cinder/' in item.mount"
|
||||||
|
- "'nfs' in item.fstype"
|
||||||
- name: Update cinder_volume pcs resource bundle for new container image
|
- name: Update cinder_volume pcs resource bundle for new container image
|
||||||
when:
|
when:
|
||||||
- step|int == 1
|
- step|int == 1
|
||||||
|
@ -384,3 +395,16 @@ outputs:
|
||||||
- release == 'ocata'
|
- release == 'ocata'
|
||||||
- is_bootstrap_node|bool
|
- is_bootstrap_node|bool
|
||||||
- cinder_volume_res|bool
|
- cinder_volume_res|bool
|
||||||
|
- name: Unmount cinder NFS shares mounted on the host
|
||||||
|
mount:
|
||||||
|
path: "{{ item.mount }}"
|
||||||
|
state: unmounted
|
||||||
|
loop: "{{ ansible_mounts }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.mount }}"
|
||||||
|
index_var: cinder_mount_index
|
||||||
|
when:
|
||||||
|
- step|int == 2
|
||||||
|
- release == 'ocata'
|
||||||
|
- "'/var/lib/cinder/' in item.mount"
|
||||||
|
- "'nfs' in item.fstype"
|
||||||
|
|
Loading…
Reference in New Issue