diff --git a/docker/services/README.rst b/docker/services/README.rst index e8a666ac85..a326e0830d 100644 --- a/docker/services/README.rst +++ b/docker/services/README.rst @@ -116,7 +116,7 @@ Steps correlate to the following: a) step 4 baremetal b) step 4 containers c) Keystone containers post initialization (tenant,service,endpoint creation) - 5) Service activation (Pacemaker) + 5) Service activation (Pacemaker), online data migration a) step 5 baremetal b) step 5 containers diff --git a/docker/services/cinder-api.yaml b/docker/services/cinder-api.yaml index f76bd671b8..88e42e3a22 100644 --- a/docker/services/cinder-api.yaml +++ b/docker/services/cinder-api.yaml @@ -168,6 +168,26 @@ outputs: - '' environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS + step_5: + cinder_api_online_migrations: + start_order: 2 + image: *cinder_api_image + net: host + privileged: false + detach: false + user: root + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/config-data/cinder/etc/my.cnf.d/tripleo.cnf:/etc/my.cnf.d/tripleo.cnf:ro + - /var/lib/config-data/cinder/etc/cinder/:/etc/cinder/:ro + - /var/log/containers/cinder:/var/log/cinder + - /var/log/containers/httpd/cinder-api:/var/log/httpd + command: + - '/usr/bin/bootstrap_host_exec' + - 'cinder_api' + - "su cinder -s /bin/bash -c 'cinder-manage db online_data_migrations'" cinder_api_cron: image: *cinder_api_image net: host @@ -206,6 +226,11 @@ outputs: - when: step|int == 0 tags: common block: + - name: get bootstrap nodeid + command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid + register: bootstrap_node + - name: set is_bootstrap_node fact + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Check is cinder_api is deployed command: systemctl is-enabled openstack-cinder-api ignore_errors: True @@ -217,6 +242,18 @@ outputs: shell: systemctl is-active --quiet openstack-cinder-api when: cinder_api_enabled|bool tags: validation + # NOTE: In puppet service variant, we ran release N online + # migrations before upgrade to release N+1. In docker + # service variant, we run release N online migrations + # after upgrade to release N. This means that during + # switch from non-containerized to containerized, we need + # to run both of these. + - name: Online data migration for Cinder before switching to containers + tags: pre-upgrade + when: + - is_bootstrap_node|bool + - cinder_api_enabled|bool + command: cinder-manage db online_data_migrations - when: step|int == 2 block: - name: Stop and disable cinder_api service (pre-upgrade not under httpd) diff --git a/docker/services/ironic-api.yaml b/docker/services/ironic-api.yaml index caf1e1e6f9..dadae805e9 100644 --- a/docker/services/ironic-api.yaml +++ b/docker/services/ironic-api.yaml @@ -135,6 +135,22 @@ outputs: - /var/log/containers/httpd/ironic-api:/var/log/httpd environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS + step_5: + ironic_online_migrations: + start_order: 2 + image: *ironic_api_image + net: host + privileged: false + detach: false + user: root + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /var/lib/config-data/ironic_api/etc/ironic:/etc/ironic:ro + - /var/log/containers/ironic:/var/log/ironic + - /var/log/containers/httpd/ironic-api:/var/log/httpd + command: "/usr/bin/bootstrap_host_exec ironic_api su ironic -s /bin/bash -c 'ironic-dbsync --config-file /etc/ironic/ironic.conf online_data_migrations'" host_prep_tasks: - name: create persistent logs directory file: @@ -154,6 +170,11 @@ outputs: - when: step|int == 0 tags: common block: + - name: get bootstrap nodeid + command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid + register: bootstrap_node + - name: set is_bootstrap_node fact + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Check if ironic_api is deployed command: systemctl is-enabled --quiet openstack-ironic-api ignore_errors: True @@ -188,6 +209,18 @@ outputs: when: - ironic_httpd_enabled|bool - httpd_running|bool + # NOTE: In puppet service variant, we ran release N online + # migrations before upgrade to release N+1. In docker + # service variant, we run release N online migrations + # after upgrade to release N. This means that during + # switch from non-containerized to containerized, we need + # to run both of these. + - name: Online data migration for Ironic before switching to containers + tags: pre-upgrade + when: + - is_bootstrap_node|bool + - (ironic_httpd_enabled|bool and httpd_running|bool) or ironic_api_enabled|bool + command: ironic-dbsync --config-file /etc/ironic/ironic.conf online_data_migrations - when: step|int == 2 block: - name: Stop and disable ironic_api service diff --git a/docker/services/nova-api.yaml b/docker/services/nova-api.yaml index 82fbe14cbd..13b3ab0d2f 100644 --- a/docker/services/nova-api.yaml +++ b/docker/services/nova-api.yaml @@ -311,6 +311,14 @@ outputs: - '' - - 'TRIPLEO_DEPLOY_IDENTIFIER=' - {get_param: DeployIdentifier} + nova_online_migrations: + start_order: 2 + image: *nova_api_image + net: host + detach: false + volumes: *nova_api_bootstrap_volumes + user: root + command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage db online_data_migrations'" metadata_settings: get_attr: [NovaApiBase, role_data, metadata_settings] host_prep_tasks: {get_attr: [NovaApiLogging, host_prep_tasks]} @@ -318,6 +326,11 @@ outputs: - when: step|int == 0 tags: common block: + - name: get bootstrap nodeid + command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid + register: bootstrap_node + - name: set is_bootstrap_node fact + set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}} - name: Check if nova_api is deployed command: systemctl is-enabled --quiet openstack-nova-api ignore_errors: True @@ -349,6 +362,18 @@ outputs: when: - nova_api_httpd_enabled|bool - httpd_running|bool + # NOTE: In puppet service variant, we ran release N online + # migrations before upgrade to release N+1. In docker + # service variant, we run release N online migrations + # after upgrade to release N. This means that during + # switch from non-containerized to containerized, we need + # to run both of these. + - name: Online data migration for Nova before switching to containers + tags: pre-upgrade + when: + - is_bootstrap_node|bool + - (nova_api_httpd_enabled|bool and httpd_running|bool) or nova_api_enabled|bool + command: nova-manage db online_data_migrations - when: step|int == 2 block: - name: Stop and disable nova_api service