From 328e14253d82a7fca0a4351f6f82211435477e62 Mon Sep 17 00:00:00 2001
From: Jason <jasonanderson@uchicago.edu>
Date: Fri, 8 Feb 2019 15:40:07 -0600
Subject: [PATCH] Support multi-region discovery of Nova cells

In a multi-region environment, each region is being deployed separately.
Cell discovery, however, would sometimes fail due to it picking a region
different than the one being deployed. Most likely, an internal endpoint
for region A will not be visible from region B. Furthermore, it is not
very useful to discover hosts on a region you're not modifying.

This changes the check to only run against nova compute services located
in the region being deployed.

Change-Id: I21eb1164c2f67098b81edbd5cc106472663b92cb
---
 ansible/roles/nova/tasks/discover_computes.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ansible/roles/nova/tasks/discover_computes.yml b/ansible/roles/nova/tasks/discover_computes.yml
index 3035020fbc..e53822df21 100644
--- a/ansible/roles/nova/tasks/discover_computes.yml
+++ b/ansible/roles/nova/tasks/discover_computes.yml
@@ -10,6 +10,7 @@
     --os-username {{ openstack_auth.username }}
     --os-password {{ keystone_admin_password }}
     --os-user-domain-name {{ openstack_auth.domain_name }}
+    --os-region-name {{ openstack_region_name }}
     compute service list -f json --service nova-compute
   register: nova_compute_services
   changed_when: false