From 7e0d6b5477d6218467dc2692c74e4df8ea07fca6 Mon Sep 17 00:00:00 2001 From: Marc Gariepy Date: Wed, 18 Jul 2018 09:56:47 -0400 Subject: [PATCH] Map instances to cell_v2 only once. If nova-manage cell_v2 create_cell returns 2, it's because the cell already exists and all instances are correctly mapped to the cell. The cell_v2 map_instances doesn't need to run. Change-Id: I38002a18dff4dbd44bd3df9e1969c9d50ab12705 Related-Bug: 1729661 (cherry picked from commit 0f24bb8bd45e6c3c4f1dc0fed1418c6be79525ee) --- tasks/nova_db_setup.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/nova_db_setup.yml b/tasks/nova_db_setup.yml index defa0cf3..b0c21a3a 100644 --- a/tasks/nova_db_setup.yml +++ b/tasks/nova_db_setup.yml @@ -82,9 +82,11 @@ become_user: "{{ nova_system_user_name }}" register: cell1_uuid changed_when: false + when: "nova_cell1_create.rc == 0" - name: Map instances to new Cell1 command: "{{ nova_bin }}/nova-manage cell_v2 map_instances --cell_uuid {{ cell1_uuid['stdout'].split()[3] }}" become: yes become_user: "{{ nova_system_user_name }}" changed_when: false + when: "nova_cell1_create.rc == 0"