Description of problem:
Some projects/tenants are not reflecting at CFME Region database.
Version-Release number of selected component (if applicable):
Red Hat CloudForms 4.5
New tenants are visible at Cloud tenant list(Compute -> Cloud -> Tenant) but not listed in Access Control Tenants database.
It should map the tenants correctly.
If you see tenants in the Cloud Tenant list that are not showing up in the Tenant list, this seems to indicate that the link from CloudTenant to the source tenant is not being created (or updated). The post_refresh_ems method on CloudTenant re-syncs with Tenants (updating name, etc. as needed, and creating Tenants if they don't already exist). Is refresh happening successfully? It could be that refresh isn't happening, or if it is happening, that somehow the tenant refresh is erroring out.
I was unable to duplicate these conditions in my test environment. When I created a new Cloud Tenant, the next refresh created the missing Tenant. When I updated the CloudTenant name via the OpenStack CLI, the next refresh updated the name for both Cloud Tenant and Tenant. When I manually deleted the Tenant object via rails console, the next refresh re-generated the missing Tenant. Cloud Tenants are synced by ExtManagementSystem, so I'm wondering if somehow the ems_id is messed up for some of these. Could you run the following in the reproducing system so I can see the relationship between the Tenant and CloudTenant objects:
pp Tenant.pluck(:name,:id, :source_type, :source_id) ; nil
pp CloudTenant.pluck(:name,:id, :ems_id) ; nil