Skip to content

Commit

Permalink
Fix upgrades to map existing nova instances to cell1
Browse files Browse the repository at this point in the history
When upgrading with existing instances we need to ensure that existing
instances are mapped into cell1.

Change-Id: I751ea370819379687b04f06e71afa68579bcbc69
Closes-Bug: #1682169
(cherry picked from commit 4ccf26f)
  • Loading branch information
andymcc authored and Jesse Pretorius (odyssey4me) committed May 22, 2017
1 parent f46544a commit 5223270
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tasks/nova_db_post_setup.yml
Expand Up @@ -24,6 +24,29 @@
- nova-setup
- nova-command-bin

# When upgrading we need to map existing instances to the new cell1
# To do this we need the cell UUID.
- name: Get UUID of new Nova Cell
shell: "{{ nova_bin }}/nova-manage --config-file /etc/nova/nova.conf cell_v2 list_cells | awk '/cell1/ {print $4}'"
become: yes
become_user: "{{ nova_system_user_name }}"
when: "{{ nova_cell1_create.rc == 0 }}"
register: cell1_uuid
tags:
- nova-db-setup
- nova-setup
- nova-command-bin

- name: Map instances to new Cell1
command: "{{ nova_bin }}/nova-manage --config-file /etc/nova/nova.conf cell_v2 map_instances --cell_uuid {{ cell1_uuid.stdout }}"
become: yes
become_user: "{{ nova_system_user_name }}"
when: "{{ nova_cell1_create.rc == 0 }}"
tags:
- nova-db-setup
- nova-setup
- nova-command-bin

- name: Perform Nova online data migrations
command: "{{ nova_bin }}/nova-manage --config-file /etc/nova/nova.conf db online_data_migrations"
become: yes
Expand Down

0 comments on commit 5223270

Please sign in to comment.